[PATCH Trusty SRU] Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
Tim Gardner
tim.gardner at canonical.com
Fri Mar 10 12:38:28 UTC 2017
From: Shrikrishna Khare <skhare at vmware.com>
BugLink: http://bugs.launchpad.net/bugs/1605494
For IPv6, if the device indicates that the checksum is correct, set
CHECKSUM_UNNECESSARY.
Reported-by: Subbarao Narahari <snarahari at vmware.com>
Signed-off-by: Shrikrishna Khare <skhare at vmware.com>
Signed-off-by: Jin Heo <heoj at vmware.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(back ported from commit f0d437809d23999cb25207cfbe80c61e5703fdc1)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
Conflicts:
drivers/net/vmxnet3/vmxnet3_int.h
---
I dropped the part of the patch that updates the version number and string
because this driver is obviously not up to the same revision level as this
back ported commit.
git describe --contains f0d437809d23999cb25207cfbe80c61e5703fdc1
v4.6-rc5~19^2~1
drivers/net/vmxnet3/vmxnet3_drv.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 55d8939..fafa450 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1101,12 +1101,16 @@ vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
union Vmxnet3_GenericDesc *gdesc)
{
if (!gdesc->rcd.cnc && adapter->netdev->features & NETIF_F_RXCSUM) {
- /* typical case: TCP/UDP over IP and both csums are correct */
- if ((le32_to_cpu(gdesc->dword[3]) & VMXNET3_RCD_CSUM_OK) ==
- VMXNET3_RCD_CSUM_OK) {
+ if (gdesc->rcd.v4 &&
+ (le32_to_cpu(gdesc->dword[3]) &
+ VMXNET3_RCD_CSUM_OK) == VMXNET3_RCD_CSUM_OK) {
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ BUG_ON(!(gdesc->rcd.tcp || gdesc->rcd.udp));
+ BUG_ON(gdesc->rcd.frg);
+ } else if (gdesc->rcd.v6 && (le32_to_cpu(gdesc->dword[3]) &
+ (1 << VMXNET3_RCD_TUC_SHIFT))) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
BUG_ON(!(gdesc->rcd.tcp || gdesc->rcd.udp));
- BUG_ON(!(gdesc->rcd.v4 || gdesc->rcd.v6));
BUG_ON(gdesc->rcd.frg);
} else {
if (gdesc->rcd.csum) {
--
2.7.4
More information about the kernel-team
mailing list