Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ec24119 authored by David S. Miller's avatar David S. Miller
Browse files

[NET]: Do not check netif_running() and carrier state in ->poll()



Drivers do this to try to break out of the ->poll()'ing loop
when the device is being brought administratively down.

Now that we have a napi_disable() "pending" state we are going
to solve that problem generically.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0a46196
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1997,7 +1997,7 @@ static int e100_poll(struct napi_struct *napi, int budget)
	tx_cleaned = e100_tx_clean(nic);

	/* If no Rx and Tx cleanup work was done, exit polling mode. */
	if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
	if((!tx_cleaned && (work_done == 0))) {
		netif_rx_complete(netdev, napi);
		e100_enable_irq(nic);
	}
+1 −7
Original line number Diff line number Diff line
@@ -3924,10 +3924,6 @@ e1000_clean(struct napi_struct *napi, int budget)
	/* Must NOT use netdev_priv macro here. */
	adapter = poll_dev->priv;

	/* Keep link state information with original netdev */
	if (!netif_carrier_ok(poll_dev))
		goto quit_polling;

	/* e1000_clean is called per-cpu.  This lock protects
	 * tx_ring[0] from being cleaned by multiple cpus
	 * simultaneously.  A failure obtaining the lock means
@@ -3942,9 +3938,7 @@ e1000_clean(struct napi_struct *napi, int budget)
	                  &work_done, budget);

	/* If no Tx and not enough Rx work done, exit the polling mode */
	if ((!tx_cleaned && (work_done == 0)) ||
	   !netif_running(poll_dev)) {
quit_polling:
	if ((!tx_cleaned && (work_done == 0))) {
		if (likely(adapter->itr_setting & 3))
			e1000_set_itr(adapter);
		netif_rx_complete(poll_dev, napi);
+1 −7
Original line number Diff line number Diff line
@@ -1389,10 +1389,6 @@ static int e1000_clean(struct napi_struct *napi, int budget)
	/* Must NOT use netdev_priv macro here. */
	adapter = poll_dev->priv;

	/* Keep link state information with original netdev */
	if (!netif_carrier_ok(poll_dev))
		goto quit_polling;

	/* e1000_clean is called per-cpu.  This lock protects
	 * tx_ring from being cleaned by multiple cpus
	 * simultaneously.  A failure obtaining the lock means
@@ -1405,9 +1401,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
	adapter->clean_rx(adapter, &work_done, budget);

	/* If no Tx and not enough Rx work done, exit the polling mode */
	if ((!tx_cleaned && (work_done < budget)) ||
	   !netif_running(poll_dev)) {
quit_polling:
	if ((!tx_cleaned && (work_done < budget))) {
		if (adapter->itr_setting & 3)
			e1000_set_itr(adapter);
		netif_rx_complete(poll_dev, napi);
+1 −1
Original line number Diff line number Diff line
@@ -1273,7 +1273,7 @@ static int epic_poll(struct napi_struct *napi, int budget)

	epic_rx_err(dev, ep);

	if (netif_running(dev) && (work_done < budget)) {
	if (work_done < budget) {
		unsigned long flags;
		int more;

+0 −5
Original line number Diff line number Diff line
@@ -476,11 +476,6 @@ static int fec_enet_rx_common(struct fec_enet_private *ep,
	__u16 pkt_len, sc;
	int curidx;

	if (fpi->use_napi) {
		if (!netif_running(dev))
			return 0;
	}

	/*
	 * First, grab all of the stats for the incoming packet.
	 * These get messed up if we get called due to a busy condition.
Loading