Skip to contentSkip to conversation

pcnet32: fix non-napi packet reception

PATCH Applied Don Fry 2 participants 3 messages Oct 17, 2007 – Oct 18, 2007

Subsystems (2)
lore
Share & tools
lore

Don Fry

author
#0 lore raw

PATCH 1/1 pcnet32: fix non-napi packet reception

Recent changes to the driver for the new napi API broke the reception of packets when in non-napi mode. The initialization of napi.weight was removed for the non-napi case leaving the value zero.

Tested NAPI and non-NAPI on x86_64.

---

drivers/net/pcnet32.c renamed from drivers/net/orig.pcnet32.c +3 -0
@@ -1849,6 +1849,9 @@ pcnet32_probe1(unsigned long ioaddr, int
 	lp->mii_if.mdio_read = mdio_read;
 	lp->mii_if.mdio_write = mdio_write;
 
+	/* napi.weight is used in both the napi and non-napi cases */
+	lp->napi.weight = lp->rx_ring_size / 2;
+
 #ifdef CONFIG_PCNET32_NAPI
 	netif_napi_add(dev, &lp->napi, pcnet32_poll, lp->rx_ring_size / 2);
 #endif
#1 lore raw
Quoted 11 lines · Don Fry

Recent changes to the driver for the new napi API broke the reception of packets when in non-napi mode. The initialization of napi.weight was removed for the non-napi case leaving the value zero.

Tested NAPI and non-NAPI on x86_64.

---

drivers/net/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int · line 1857

Quoted 9 lines
drivers/net/pcnet32.c renamed from drivers/net/orig.pcnet32.c +3 -0
@@ -1849,6 +1849,9 @@ pcnet32_probe1(unsigned long ioaddr, int
 	lp->mii_if.mdio_read = mdio_read;
 	lp->mii_if.mdio_write = mdio_write;
 
+	/* napi.weight is used in both the napi and non-napi cases */
+	lp->napi.weight = lp->rx_ring_size / 2;
+
 #ifdef CONFIG_PCNET32_NAPI
 	netif_napi_add(dev, &lp->napi, pcnet32_poll, lp->rx_ring_size / 2);
 #endif

In general, we're hoping to remove as many CONFIG_FOO_NAPI as possible, pushing everybody towards using NAPI.

Any objection to heading in this direction with pcnet32?

Jeff

Applied
#2 lore raw
In reply to Don Fry
Quoted 11 lines · Don Fry

Recent changes to the driver for the new napi API broke the reception of packets when in non-napi mode. The initialization of napi.weight was removed for the non-napi case leaving the value zero.

Tested NAPI and non-NAPI on x86_64.

---

drivers/net/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int · line 1857

Quoted 9 lines
drivers/net/pcnet32.c renamed from drivers/net/orig.pcnet32.c +3 -0
@@ -1849,6 +1849,9 @@ pcnet32_probe1(unsigned long ioaddr, int
 	lp->mii_if.mdio_read = mdio_read;
 	lp->mii_if.mdio_write = mdio_write;
 
+	/* napi.weight is used in both the napi and non-napi cases */
+	lp->napi.weight = lp->rx_ring_size / 2;
+
 #ifdef CONFIG_PCNET32_NAPI
 	netif_napi_add(dev, &lp->napi, pcnet32_poll, lp->rx_ring_size / 2);
 #endif

applied