vmxnet3: use correct tcp hdr length when packet is encapsulated
Subsystems (3)
PATCH 1/1 vmxnet3: use correct tcp hdr length when packet is encapsulated
'Commit dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support")' added support for encapsulation offload. However, while calculating tcp hdr length, it does not take into account if the packet is encapsulated or not.
This patch fixes this issue by using correct reference for inner tcp header.
support")
--- drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++- drivers/net/vmxnet3/vmxnet3_int.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +2 -1
@@ -886,7 +886,8 @@ vmxnet3_parse_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,switch (protocol) {case IPPROTO_TCP : - ctx->l4_hdr_size =tcp_hdrlen (skb); + ctx->l4_hdr_size = skb->encapsulation ?inner_tcp_hdrlen (skb) : +tcp_hdrlen (skb);break ;case IPPROTO_UDP : ctx->l4_hdr_size =sizeof (struct udphdr );
drivers/net/vmxnet3/vmxnet3_int.h +2 -2
@@ -69,12 +69,12 @@/* * Version numbers */ -#define VMXNET3_DRIVER_VERSION_STRING "1.5.0.0-k" +#define VMXNET3_DRIVER_VERSION_STRING "1.5.1.0-k"/* Each byte of this 32-bit integer encodes a version number in * VMXNET3_DRIVER_VERSION_STRING. */ -#define VMXNET3_DRIVER_VERSION_NUM 0x01050000 +#define VMXNET3_DRIVER_VERSION_NUM 0x01050100#if defined(CONFIG_PCI_MSI )/* RSS only makes sense if MSI-X is supported. */
Signature · 1 line
2.11.0
Jakub Kicinski
maintainerQuoted 2 lines · On Thu, 6 Aug 2020 23:43:45 -0700 Ronak Doshi wrote:
'Commit
dacce2be3312("vmxnet3: add geneve and vxlan tunnel offload support")' added support for encapsulation offload. However, while
nit: no need for the quotes around commit xzy ("")
Quoted 8 lines
calculating tcp hdr length, it does not take into account if the packet is encapsulated or not.
This patch fixes this issue by using correct reference for inner tcp header.
Fixes dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offloadsupport")
Please don't wrap Fixes tags, let it overflow the line.
Quoted 26 lines
Signed-off-by Ronak Doshi <[email protected]>Acked-by Guolin Yang <[email protected]>--- drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++- drivers/net/vmxnet3/vmxnet3_int.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)drivers/net/vmxnet3/vmxnet3_drv.c +2
-1@@ -886,7 +886,8 @@ vmxnet3_parse_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,switch (protocol) {case IPPROTO_TCP : - ctx->l4_hdr_size =tcp_hdrlen (skb); + ctx->l4_hdr_size = skb->encapsulation ?inner_tcp_hdrlen (skb) : +tcp_hdrlen (skb);break ;case IPPROTO_UDP : ctx->l4_hdr_size =sizeof (struct udphdr );drivers/net/vmxnet3/vmxnet3_int.h +0
-0
drivers/net/vmxnet3/vmxnet3_int.h line 72
Quoted 5 lines
drivers/net/vmxnet3/vmxnet3_int.h +1
-1@@ -69,12 +69,12 @@/* * Version numbers */ -#define VMXNET3_DRIVER_VERSION_STRING "1.5.0.0-k" +#define VMXNET3_DRIVER_VERSION_STRING "1.5.1.0-k"
Please don't do this.
We are working on removing all the driver version strings from the kernel because upstream they are strictly inferior to the kernel version alone.
For a fix like this it's especially bad to bump the version, as it could cause a conflict during backporting. I'm not saying it will in this case, but as a general rule fixes should be minimal in size.
Quoted 8 lines
drivers/net/vmxnet3/vmxnet3_int.h +1
-1/* Each byte of this 32-bit integer encodes a version number in * VMXNET3_DRIVER_VERSION_STRING. */ -#define VMXNET3_DRIVER_VERSION_NUM 0x01050000 +#define VMXNET3_DRIVER_VERSION_NUM 0x01050100#if defined(CONFIG_PCI_MSI )/* RSS only makes sense if MSI-X is supported. */