On Mon, 9 Jan 2017 14:16:01 -0800
Alexander Loktionov [off-list ref] wrote:
++self->stats.rx_packets;
+ ++ndev->stats.rx_packets;
+ ndev->stats.rx_bytes += buff->len;
Why keep two sets of statistics (self->stats and ndev->stats); seems redundant.
Could also use per-cpu network stats pcpu_sw_netstats
You could also optimize by doing only one addition of ndev->stats after processing
several packets.
+ skb = netdev_alloc_skb(ndev, ETH_HLEN);
+ skb_put(skb, ETH_HLEN);
+ memcpy(skb->data, page_address(buff->page), ETH_HLEN);
Why not use build_skb() here?