Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416894 > unrolled thread

[PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets

Started byShrikrishna Khare <skhare@vmware.com>
First post2016-06-08 08:20 +0200
Last post2016-06-10 09:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets Shrikrishna Khare <skhare@vmware.com> - 2016-06-08 08:20 +0200
    Re: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO  packets Thomas Hellstrom <thellstrom@vmware.com> - 2016-06-08 12:20 +0200
      Re: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO  packets Shrikrishna Khare <skhare@vmware.com> - 2016-06-08 16:50 +0200
    Re: [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets David Miller <davem@davemloft.net> - 2016-06-10 09:20 +0200

#1416894 — [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets

FromShrikrishna Khare <skhare@vmware.com>
Date2016-06-08 08:20 +0200
Subject[PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets
Message-ID<rHF0l-4MH-3@gated-at.bofh.it>
The device emulation may send segCnt of 1 for LRO packets.

Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: Jin Heo <heoj@vmware.com>

---
v2: fix subject line
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
 drivers/net/vmxnet3/vmxnet3_int.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index db8022a..6f399b2 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1369,7 +1369,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
 				rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd;
 
 				segCnt = rcdlro->segCnt;
-				BUG_ON(segCnt <= 1);
+				BUG_ON(segCnt == 0);
 				mss = rcdlro->mss;
 				if (unlikely(segCnt <= 1))
 					segCnt = 0;
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index c482539..3d2b64e 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -69,10 +69,10 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.7.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.4.8.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01040700
+#define VMXNET3_DRIVER_VERSION_NUM      0x01040800
 
 #if defined(CONFIG_PCI_MSI)
 	/* RSS only makes sense if MSI-X is supported. */
-- 
2.8.2

[toc] | [next] | [standalone]


#1417248 — Re: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets

FromThomas Hellstrom <thellstrom@vmware.com>
Date2016-06-08 12:20 +0200
SubjectRe: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets
Message-ID<rHIKC-7iL-13@gated-at.bofh.it>
In reply to#1416894
On 06/08/2016 08:13 AM, Shrikrishna Khare wrote:
> The device emulation may send segCnt of 1 for LRO packets.
>
> Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
> Signed-off-by: Jin Heo <heoj@vmware.com>
>
> ---
> v2: fix subject line
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
>  drivers/net/vmxnet3/vmxnet3_int.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index db8022a..6f399b2 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -1369,7 +1369,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
>  				rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd;
>  
>  				segCnt = rcdlro->segCnt;
> -				BUG_ON(segCnt <= 1);
> +				BUG_ON(segCnt == 0);

What will the vmxnet3 driver do otherwise if segCnt == 0? Please see below.


>  				mss = rcdlro->mss;
>  				if (unlikely(segCnt <= 1))
>  					segCnt = 0;

Based on this code, it looks like it can handle the case without taking
down the kernel completely, so instead of a
"BUG_ON", would it make sense with a WARN_ON_ONCE() or WARN_ON()?

Thanks,
Thomas

[toc] | [prev] | [next] | [standalone]


#1417542 — Re: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets

FromShrikrishna Khare <skhare@vmware.com>
Date2016-06-08 16:50 +0200
SubjectRe: [Pv-drivers] [PATCH net v2] vmxnet3: segCnt can be 1 for LRO packets
Message-ID<rHMXT-1pV-5@gated-at.bofh.it>
In reply to#1417248

On Wed, 8 Jun 2016, Thomas Hellstrom wrote:

> >  				mss = rcdlro->mss;
> >  				if (unlikely(segCnt <= 1))
> >  					segCnt = 0;
> 
> Based on this code, it looks like it can handle the case without taking
> down the kernel completely, so instead of a
> "BUG_ON", would it make sense with a WARN_ON_ONCE() or WARN_ON()?

Thanks for the review Thomas. I fixed the code to use WARN_ON_ONCE. Sent 
out revised patch.

[toc] | [prev] | [next] | [standalone]


#1419086

FromDavid Miller <davem@davemloft.net>
Date2016-06-10 09:20 +0200
Message-ID<rIoTw-1zi-11@gated-at.bofh.it>
In reply to#1416894
From: Shrikrishna Khare <skhare@vmware.com>
Date: Tue,  7 Jun 2016 23:13:35 -0700

> The device emulation may send segCnt of 1 for LRO packets.
> 
> Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
> Signed-off-by: Jin Heo <heoj@vmware.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web