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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FC9E56C.4000707@computer.org>
Date:	Sat, 02 Jun 2012 12:05:32 +0200
From:	Jan Ceuleers <jan.ceuleers@...puter.org>
To:	"Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@...esas.com>
CC:	netdev <netdev@...r.kernel.org>,
	SH-Linux <linux-sh@...r.kernel.org>
Subject: Re: [PATCH v5 6/6 resend] net: sh_eth: use NAPI

On 05/29/2012 10:15 AM, Shimoda, Yoshihiro wrote:
> @@ -1087,13 +1088,17 @@ static int sh_eth_rx(struct net_device *ndev)
>  				skb_reserve(skb, NET_IP_ALIGN);
>  			skb_put(skb, pkt_len);
>  			skb->protocol = eth_type_trans(skb, ndev);
> -			netif_rx(skb);
> -			ndev->stats.rx_packets++;
> -			ndev->stats.rx_bytes += pkt_len;
> +			if (netif_receive_skb(skb) == NET_RX_DROP) {
> +				ndev->stats.rx_dropped++;
> +			} else {
> +				ndev->stats.rx_packets++;
> +				ndev->stats.rx_bytes += pkt_len;
> +			}
>  		}
>  		rxdesc->status |= cpu_to_edmac(mdp, RD_RACT);
>  		entry = (++mdp->cur_rx) % mdp->num_rx_ring;
>  		rxdesc = &mdp->rx_ring[entry];
> +		(*work)++;
>  	}
> 
>  	/* Refill the Rx ring buffers. */

Please forgive a newbie's question/comment; feel free to ignore if I'm
wasting your time. Particularly because it's about an aspect of the
driver that you're not changing in this patch. (And yes, I know that
you've been asked to sit on this patch series until net-next opens up
again).

I see that most users of netif_receive_skb() ignore its return value.
Some drivers (including this-one) do check it and use it to determine
whether counters should be updated. But looking at netif_receive_skb()
itself I see that there's counter infrastructure there already.

So why this in-driver set of counters, I wonder?

Thanks, Jan
--
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