[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240902190425.6eef2ee6@kernel.org>
Date: Mon, 2 Sep 2024 19:04:25 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Justin Lai <justinlai0215@...ltek.com>
Cc: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>, <andrew@...n.ch>,
<jiri@...nulli.us>, <horms@...nel.org>, <rkannoth@...vell.com>,
<jdamato@...tly.com>, <pkshih@...ltek.com>, <larry.chiu@...ltek.com>
Subject: Re: [PATCH net-next v29 07/13] rtase: Implement a function to
receive packets
On Thu, 29 Aug 2024 11:48:26 +0800 Justin Lai wrote:
> + skb->dev = dev;
no need to assign skb->dev = dev; eth_type_trans() will do it for you
> + skb_put(skb, pkt_size);
> + skb_mark_for_recycle(skb);
> + skb->protocol = eth_type_trans(skb, dev);
> +
> + if (skb->pkt_type == PACKET_MULTICAST)
> + tp->stats.multicast++;
> +
> + rtase_rx_vlan_skb(desc, skb);
> + rtase_rx_skb(ring, skb);
> +
> + dev_sw_netstats_rx_add(dev, pkt_size);
> +
> +skip_process_pkt:
> + workdone++;
> + cur_rx++;
> + entry = cur_rx % RTASE_NUM_DESC;
> + desc = ring->desc + sizeof(union rtase_rx_desc) * entry;
> + } while (workdone != budget);
The check needs to be at the start of the function.
NAPI can be called with budget of 0 to limit the processing
to just Tx cleanup. In that case no packet should be received.
Powered by blists - more mailing lists