lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 02 Feb 2009 14:01:15 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	ron.mercer@...gic.com
CC:	netdev@...r.kernel.org
Subject: qlge packet receive


I wanted to mention a bug that I noticed in the qlge driver
while perusing NAPI capable drivers last week.

Although qlge uses NAPI polling, it passes packets into the
stack using netif_rx() and vlan_hwaccel_rx().

That's wrong and incredibly inefficient, because these routines
are for the cases where the driver receives packets in hardware
interrupt context, so they schedule a new software interrupt to
process the frames.

NAPI ->poll() executes in software interrupt context so you can
pass the packets directly into the stack using netif_receive_skb()
and vlan_hwaccel_receive_skb().

It should even be fine to do this via the delayed workqueue that calls
ql_rx_clean().

Something like this:

qlge: Use netif_receive_skb() and vlan_hwaccel_receive_skb().

Since we receive packets either in software interrupt context
(via NAPI ->poll()) or process context (via delayed workqueues)
we should pass packets directly into the stack instead of
deferring them via another level of software interrupt processing.

Signed-off-by: David S. Miller <davem@...emloft.net>

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 3d1d7b6..79363b8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -1449,12 +1449,12 @@ static void ql_process_mac_rx_intr(struct ql_adapter *qdev,
 	if (qdev->vlgrp && (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V)) {
 		QPRINTK(qdev, RX_STATUS, DEBUG,
 			"Passing a VLAN packet upstream.\n");
-		vlan_hwaccel_rx(skb, qdev->vlgrp,
-				le16_to_cpu(ib_mac_rsp->vlan_id));
+		vlan_hwaccel_receive_skb(skb, qdev->vlgrp,
+					 le16_to_cpu(ib_mac_rsp->vlan_id));
 	} else {
 		QPRINTK(qdev, RX_STATUS, DEBUG,
 			"Passing a normal packet upstream.\n");
-		netif_rx(skb);
+		netif_receive_skb(skb);
 	}
 }
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ