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

Commit 7dbea3e8 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'napi_page_frags'



Alexander Duyck says:

====================
net: Alloc NAPI page frags from their own pool

This patch series implements a means of allocating page fragments without
the need for the local_irq_save/restore in __netdev_alloc_frag.  By doing
this I am able to decrease packet processing time by 11ns per packet in my
test environment.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6e5f59aa 45abfb10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -836,7 +836,7 @@ static int b44_rx(struct b44 *bp, int budget)
			struct sk_buff *copy_skb;

			b44_recycle_rx(bp, cons, bp->rx_prod);
			copy_skb = netdev_alloc_skb_ip_align(bp->dev, len);
			copy_skb = napi_alloc_skb(&bp->napi, len);
			if (copy_skb == NULL)
				goto drop_it_no_recycle;

+1 −1
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
		if (len < copybreak) {
			struct sk_buff *nskb;

			nskb = netdev_alloc_skb_ip_align(dev, len);
			nskb = napi_alloc_skb(&priv->napi, len);
			if (!nskb) {
				/* forget packet, just rearm desc */
				dev->stats.rx_dropped++;
+1 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
		 */
		if ((bp->dev->mtu > ETH_MAX_PACKET_SIZE) &&
		    (len <= RX_COPY_THRESH)) {
			skb = netdev_alloc_skb_ip_align(bp->dev, len);
			skb = napi_alloc_skb(&fp->napi, len);
			if (skb == NULL) {
				DP(NETIF_MSG_RX_ERR | NETIF_MSG_RX_STATUS,
				   "ERROR  packet dropped because of alloc failure\n");
+6 −5
Original line number Diff line number Diff line
@@ -1025,7 +1025,7 @@ MODULE_PARM_DESC(copybreak, "Receive copy threshold");

/**
 *	get_packet - return the next ingress packet buffer
 *	@pdev: the PCI device that received the packet
 *	@adapter: the adapter that received the packet
 *	@fl: the SGE free list holding the packet
 *	@len: the actual packet length, excluding any SGE padding
 *
@@ -1037,14 +1037,15 @@ MODULE_PARM_DESC(copybreak, "Receive copy threshold");
 *	threshold and the packet is too big to copy, or (b) the packet should
 *	be copied but there is no memory for the copy.
 */
static inline struct sk_buff *get_packet(struct pci_dev *pdev,
static inline struct sk_buff *get_packet(struct adapter *adapter,
					 struct freelQ *fl, unsigned int len)
{
	struct sk_buff *skb;
	const struct freelQ_ce *ce = &fl->centries[fl->cidx];
	struct pci_dev *pdev = adapter->pdev;
	struct sk_buff *skb;

	if (len < copybreak) {
		skb = netdev_alloc_skb_ip_align(NULL, len);
		skb = napi_alloc_skb(&adapter->napi, len);
		if (!skb)
			goto use_orig_buf;

@@ -1357,7 +1358,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
	struct sge_port_stats *st;
	struct net_device *dev;

	skb = get_packet(adapter->pdev, fl, len - sge->rx_pkt_pad);
	skb = get_packet(adapter, fl, len - sge->rx_pkt_pad);
	if (unlikely(!skb)) {
		sge->stats.rx_drops++;
		return;
+1 −1
Original line number Diff line number Diff line
@@ -4100,7 +4100,7 @@ static bool e1000_tbi_should_accept(struct e1000_adapter *adapter,
static struct sk_buff *e1000_alloc_rx_skb(struct e1000_adapter *adapter,
					  unsigned int bufsz)
{
	struct sk_buff *skb = netdev_alloc_skb_ip_align(adapter->netdev, bufsz);
	struct sk_buff *skb = napi_alloc_skb(&adapter->napi, bufsz);

	if (unlikely(!skb))
		adapter->alloc_rx_buff_failed++;
Loading