From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: brouer@redhat.com, "davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>,
Florian Westphal <fw@strlen.de>,
Edward Cree <ecree@solarflare.com>
Subject: Re: [PATCH net-next] dpaa2-eth: use netif_receive_skb_list
Date: Tue, 26 Mar 2019 15:43:15 +0100 [thread overview]
Message-ID: <20190326154315.7476de9d@carbon> (raw)
In-Reply-To: <1553521344-31094-1-git-send-email-ioana.ciornei@nxp.com>
On Mon, 25 Mar 2019 13:42:39 +0000
Ioana Ciornei <ioana.ciornei@nxp.com> wrote:
> Take advantage of the software Rx batching by using
> netif_receive_skb_list instead of napi_gro_receive.
>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---
Nice to see more people/drivers using: netif_receive_skb_list()
We should likely add a similar napi_gro_receive_list() function.
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 8 +++++++-
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | 1 +
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index 2ba49e9..e923e5c 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -435,7 +435,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
> percpu_stats->rx_packets++;
> percpu_stats->rx_bytes += dpaa2_fd_get_len(fd);
>
> - napi_gro_receive(&ch->napi, skb);
> + list_add_tail(&skb->list, ch->rx_list);
>
> return;
>
> @@ -1108,12 +1108,16 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)
> struct dpaa2_eth_fq *fq, *txc_fq = NULL;
> struct netdev_queue *nq;
> int store_cleaned, work_done;
> + struct list_head rx_list;
> int err;
>
> ch = container_of(napi, struct dpaa2_eth_channel, napi);
> ch->xdp.res = 0;
> priv = ch->priv;
>
> + INIT_LIST_HEAD(&rx_list);
> + ch->rx_list = &rx_list;
> +
> do {
> err = pull_channel(ch);
> if (unlikely(err))
> @@ -1157,6 +1161,8 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)
> work_done = max(rx_cleaned, 1);
>
> out:
> + netif_receive_skb_list(ch->rx_list);
> +
> if (txc_fq && txc_fq->dq_frames) {
> nq = netdev_get_tx_queue(priv->net_dev, txc_fq->flowid);
> netdev_tx_completed_queue(nq, txc_fq->dq_frames,
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> index 7879622..a11ebfd 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> @@ -334,6 +334,7 @@ struct dpaa2_eth_channel {
> struct dpaa2_eth_ch_stats stats;
> struct dpaa2_eth_ch_xdp xdp;
> struct xdp_rxq_info xdp_rxq;
> + struct list_head *rx_list;
> };
>
> struct dpaa2_eth_dist_fields {
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2019-03-26 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 13:42 [PATCH net-next] dpaa2-eth: use netif_receive_skb_list Ioana Ciornei
2019-03-26 14:43 ` Jesper Dangaard Brouer [this message]
2019-03-26 14:54 ` Eric Dumazet
2019-03-27 12:02 ` Edward Cree
2019-03-27 14:20 ` Jesper Dangaard Brouer
2019-03-26 18:47 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190326154315.7476de9d@carbon \
--to=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=fw@strlen.de \
--cc=ioana.ciornei@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=ruxandra.radulescu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).