Skip to content

Commit 3865dc9

Browse files
author
Izabela Bakollari
committed
vmxnet3: correctly report csum_level for encapsulated packet
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2158807 Commit dacce2b ("vmxnet3: add geneve and vxlan tunnel offload support") added support for encapsulation offload. However, the pathc did not report correctly the csum_level for encapsulated packet. This patch fixes this issue by reporting correct csum level for the encapsulated packet. Fixes: dacce2b ("vmxnet3: add geneve and vxlan tunnel offload support") Signed-off-by: Ronak Doshi <doshir@vmware.com> Acked-by: Peng Li <lpeng@vmware.com> Link: https://lore.kernel.org/r/20221220202556.24421-1-doshir@vmware.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 3d8f2c4) Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
1 parent e0197de commit 3865dc9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,10 @@ vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
12881288
(le32_to_cpu(gdesc->dword[3]) &
12891289
VMXNET3_RCD_CSUM_OK) == VMXNET3_RCD_CSUM_OK) {
12901290
skb->ip_summed = CHECKSUM_UNNECESSARY;
1291+
if ((le32_to_cpu(gdesc->dword[0]) &
1292+
(1UL << VMXNET3_RCD_HDR_INNER_SHIFT))) {
1293+
skb->csum_level = 1;
1294+
}
12911295
WARN_ON_ONCE(!(gdesc->rcd.tcp || gdesc->rcd.udp) &&
12921296
!(le32_to_cpu(gdesc->dword[0]) &
12931297
(1UL << VMXNET3_RCD_HDR_INNER_SHIFT)));
@@ -1297,6 +1301,10 @@ vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
12971301
} else if (gdesc->rcd.v6 && (le32_to_cpu(gdesc->dword[3]) &
12981302
(1 << VMXNET3_RCD_TUC_SHIFT))) {
12991303
skb->ip_summed = CHECKSUM_UNNECESSARY;
1304+
if ((le32_to_cpu(gdesc->dword[0]) &
1305+
(1UL << VMXNET3_RCD_HDR_INNER_SHIFT))) {
1306+
skb->csum_level = 1;
1307+
}
13001308
WARN_ON_ONCE(!(gdesc->rcd.tcp || gdesc->rcd.udp) &&
13011309
!(le32_to_cpu(gdesc->dword[0]) &
13021310
(1UL << VMXNET3_RCD_HDR_INNER_SHIFT)));

0 commit comments

Comments
 (0)