Skip to contentSkip to conversation

vmxnet3: segCnt can be 1 for LRO packets

PATCH Applied Shrikrishna Khare 3 participants 4 messages Jun 8, 2016 – Jun 10, 2016

Subsystems (3)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 vmxnet3: segCnt can be 1 for LRO packets

The device emulation may send segCnt of 1 for LRO packets.

---
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(-)
drivers/net/vmxnet3/vmxnet3_drv.c +1 -1
index db8022a..6f399b2 100644
@@ -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;
drivers/net/vmxnet3/vmxnet3_int.h +2 -2
index c482539..3d2b64e 100644
@@ -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. */
Signature · 1 line
2.8.2
#1 lore raw
Quoted 17 lines · Shrikrishna Khare

The device emulation may send segCnt of 1 for LRO packets.

---
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(-)
drivers/net/vmxnet3/vmxnet3_drv.c +0 -0
index db8022a..6f399b2 100644

drivers/net/vmxnet3/vmxnet3_drv.c vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, · line 1372

Quoted 5 lines
drivers/net/vmxnet3/vmxnet3_drv.c +1 -1
@@ -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.

drivers/net/vmxnet3/vmxnet3_drv.c vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, · line 1375

Quoted 3 lines
drivers/net/vmxnet3/vmxnet3_drv.c +0 -0
 				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

#2 lore raw
Quoted 7 lines · Thomas Hellstrom

drivers/net/vmxnet3/vmxnet3_drv.c vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, · line 1375

Quoted 3 lines
drivers/net/vmxnet3/vmxnet3_drv.c +0 -0
 				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.