[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e615366cb2b260bf1b77fdaa0692957ab750a9a4.camel@nvidia.com>
Date: Tue, 15 Sep 2020 05:09:55 +0000
From: Saeed Mahameed <saeedm@...dia.com>
To: "tanhuazhong@...wei.com" <tanhuazhong@...wei.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "yisen.zhuang@...wei.com" <yisen.zhuang@...wei.com>,
"salil.mehta@...wei.com" <salil.mehta@...wei.com>,
"linuxarm@...wei.com" <linuxarm@...wei.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linyunsheng@...wei.com" <linyunsheng@...wei.com>,
"kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH net-next 6/6] net: hns3: use napi_consume_skb() when
cleaning tx desc
On Mon, 2020-09-14 at 20:06 +0800, Huazhong Tan wrote:
> From: Yunsheng Lin <linyunsheng@...wei.com>
>
> Use napi_consume_skb() to batch consuming skb when cleaning
> tx desc in NAPI polling.
>
> Signed-off-by: Yunsheng Lin <linyunsheng@...wei.com>
> Signed-off-by: Huazhong Tan <tanhuazhong@...wei.com>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 27 +++++++++++-
> ----------
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +-
> drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 ++--
> 3 files changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 4a49a76..feeaf75 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -2333,10 +2333,10 @@ static int hns3_alloc_buffer(struct
> hns3_enet_ring *ring,
> }
>
> static void hns3_free_buffer(struct hns3_enet_ring *ring,
> - struct hns3_desc_cb *cb)
> + struct hns3_desc_cb *cb, int budget)
> {
> if (cb->type == DESC_TYPE_SKB)
> - dev_kfree_skb_any((struct sk_buff *)cb->priv);
> + napi_consume_skb(cb->priv, budget);
This code can be reached from hns3_lb_clear_tx_ring() below which is
your loopback test and called with non-zero budget, I am not sure you
are allowed to call napi_consume_skb() with non-zero budget outside
napi context, perhaps the cb->type for loopback test is different in lb
test case ? Idk.. , please double check other code paths.
[...]
> static void hns3_lb_clear_tx_ring(struct hns3_nic_priv *priv, u32
> start_ringid,
> - u32 end_ringid, u32 budget)
> + u32 end_ringid, int budget)
> {
> u32 i;
>
> for (i = start_ringid; i <= end_ringid; i++) {
> struct hns3_enet_ring *ring = &priv->ring[i];
>
> - hns3_clean_tx_ring(ring);
> + hns3_clean_tx_ring(ring, budget);
> }
> }
>
Powered by blists - more mailing lists