From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
kuba@kernel.org, lorenzo.bianconi@redhat.com,
ilias.apalodimas@linaro.org, brouer@redhat.com
Subject: Re: [RFC 1/2] net: xdp: introduce bulking for xdp tx return path
Date: Tue, 20 Oct 2020 11:46:13 +0200 [thread overview]
Message-ID: <20201020114613.752a979c@carbon> (raw)
In-Reply-To: <62165fcacf47521edae67ae739827aa5f751fb8b.1603185591.git.lorenzo@kernel.org>
On Tue, 20 Oct 2020 11:33:37 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 54b0bf574c05..af33cc62ed4c 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -663,6 +663,8 @@ struct mvneta_tx_queue {
>
> /* Affinity mask for CPUs*/
> cpumask_t affinity_mask;
> +
> + struct xdp_frame_bulk bq;
> };
>
> struct mvneta_rx_queue {
> @@ -1854,12 +1856,10 @@ static void mvneta_txq_bufs_free(struct mvneta_port *pp,
> dev_kfree_skb_any(buf->skb);
> } else if (buf->type == MVNETA_TYPE_XDP_TX ||
> buf->type == MVNETA_TYPE_XDP_NDO) {
> - if (napi && buf->type == MVNETA_TYPE_XDP_TX)
> - xdp_return_frame_rx_napi(buf->xdpf);
> - else
> - xdp_return_frame(buf->xdpf);
> + xdp_return_frame_bulk(buf->xdpf, &txq->bq, napi);
Hmm, I don't think you can use 'napi' directly here.
You are circumventing check (buf->type == MVNETA_TYPE_XDP_TX), and will
now also allow XDP_NDO (XDP_REDIRECT) to basically use xdp_return_frame_rx_napi().
> }
> }
> + xdp_flush_frame_bulk(&txq->bq, napi);
>
> netdev_tx_completed_queue(nq, pkts_compl, bytes_compl);
> }
--
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:[~2020-10-20 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-20 9:33 [RFC 0/2] xdp: introduce bulking for page_pool tx return path Lorenzo Bianconi
2020-10-20 9:33 ` [RFC 1/2] net: xdp: introduce bulking for xdp " Lorenzo Bianconi
2020-10-20 9:46 ` Jesper Dangaard Brouer [this message]
2020-10-20 10:34 ` Lorenzo Bianconi
2020-10-20 9:33 ` [RFC 2/2] net: page_pool: add bulk support for ptr_ring Lorenzo Bianconi
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=20201020114613.752a979c@carbon \
--to=brouer@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
/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).