From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: "Björn Töpel" <bjorn.topel@gmail.com>
Cc: intel-wired-lan@lists.osuosl.org,
"Björn Töpel" <bjorn.topel@intel.com>,
magnus.karlsson@intel.com, netdev@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH net-next] ice, xsk: Move Rx alloction out of while-loop
Date: Thu, 10 Dec 2020 17:11:05 +0100 [thread overview]
Message-ID: <20201210161105.GD45760@ranger.igk.intel.com> (raw)
In-Reply-To: <20201210121915.14412-1-bjorn.topel@gmail.com>
On Thu, Dec 10, 2020 at 01:19:15PM +0100, Björn Töpel wrote:
> From: Björn Töpel <bjorn.topel@intel.com>
>
> Instead of trying to allocate for each packet, move it outside the
> while loop and try to allocate once every NAPI loop.
To rectify above, it wasn't for each packet but per ICE_RX_BUF_WRITE
cleaned frames (16).
You also have a typo in subject (alloction).
Is spinning a v2 worth it?
>
> This change boosts the xdpsock rxdrop scenario with 15% more
> packets-per-second.
>
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_xsk.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
> index 797886524054..39757b4cf8f4 100644
> --- a/drivers/net/ethernet/intel/ice/ice_xsk.c
> +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
> @@ -570,12 +570,6 @@ int ice_clean_rx_irq_zc(struct ice_ring *rx_ring, int budget)
> u16 vlan_tag = 0;
> u8 rx_ptype;
>
> - if (cleaned_count >= ICE_RX_BUF_WRITE) {
> - failure |= ice_alloc_rx_bufs_zc(rx_ring,
> - cleaned_count);
> - cleaned_count = 0;
> - }
> -
> rx_desc = ICE_RX_DESC(rx_ring, rx_ring->next_to_clean);
>
> stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S);
> @@ -642,6 +636,9 @@ int ice_clean_rx_irq_zc(struct ice_ring *rx_ring, int budget)
> ice_receive_skb(rx_ring, skb, vlan_tag);
> }
>
> + if (cleaned_count >= ICE_RX_BUF_WRITE)
> + failure = !ice_alloc_rx_bufs_zc(rx_ring, cleaned_count);
> +
> ice_finalize_xdp_rx(rx_ring, xdp_xmit);
> ice_update_rx_ring_stats(rx_ring, total_rx_packets, total_rx_bytes);
>
>
> base-commit: a7105e3472bf6bb3099d1293ea7d70e7783aa582
> --
> 2.27.0
>
next prev parent reply other threads:[~2020-12-10 16:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 12:19 [PATCH net-next] ice, xsk: Move Rx alloction out of while-loop Björn Töpel
2020-12-10 16:11 ` Maciej Fijalkowski [this message]
2020-12-10 17:10 ` Björn Töpel
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=20201210161105.GD45760@ranger.igk.intel.com \
--to=maciej.fijalkowski@intel.com \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=magnus.karlsson@intel.com \
--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).