Re: [PATCH net-next 2/3] net/usb/r8152: enable tx checksum

From: Sergei Shtylyov
Date: Tue Aug 13 2013 - 10:40:13 EST


Hello.

On 08/13/2013 11:28 AM, Hayes Wang wrote:

Enable tx checksum.

Signed-off-by: Hayes Wang <hayeswang@xxxxxxxxxxx>
---
drivers/net/usb/r8152.c | 63 +++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 58 insertions(+), 5 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index c6c5aa2..5d9d949 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
[...]
@@ -964,6 +971,51 @@ err1:
return -ENOMEM;
}

+static void
+r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, struct sk_buff *skb)
+{
[...]
+ if (ip_protocol == IPPROTO_TCP) {
+ opts2 |= TCP_CS;
+ opts2 |= (skb_transport_offset(skb) & 0x7fff) << 17;
+ } else if (ip_protocol == IPPROTO_UDP) {
+ opts2 |= UDP_CS;
+ } else
+ WARN_ON_ONCE(1);

Stange, why *else if* branch has {} and *else* don't. It should, according to Documentation/CodingStyle.

+
+ desc->opts2 = cpu_to_le32(opts2);
+ }
+}
+

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/