All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	anthony.l.nguyen@intel.com, magnus.karlsson@intel.com,
	tirthendu.sarkar@intel.com, alexandr.lobakin@intel.com,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Subject: [PATCH bpf-next 00/13] ice: add XDP mbuf support
Date: Tue, 31 Jan 2023 21:44:53 +0100	[thread overview]
Message-ID: <20230131204506.219292-1-maciej.fijalkowski@intel.com> (raw)

Hi there,

although this work started as an effort to add multi-buffer XDP support
to ice driver, as usual it turned out that some other side stuff needed
to be addressed, so let me give you an overview.

First patch adjusts legacy-rx in a way that it will be possible to refer
to skb_shared_info being at the end of the buffer when gathering up
frame fragments within xdp_buff.

Then, patches 2-9 prepare ice driver in a way that actual multi-buffer
patches will be easier to swallow.

10 and 11 are the meat. What is worth mentioning is that this set
actually *fixes* things as patch 11 removes the logic based on
next_dd/rs and we previously stepped away from this for ice_xmit_zc().
Currently, AF_XDP ZC XDP_TX workload is off as there are two cleaning
sides that can be triggered and two of them work on different internal
logic. This set unifies that and allows us to improve the performance by
2x with a trick on the last (13) patch.

12th is a simple cleanup of no longer fields from Tx ring.

I might be wrong but I have not seen anyone reporting performance impact
among patches that add XDP multi-buffer support to a particular driver.
Numbers below were gathered via xdp_rxq_info and xdp_redirect_map on
1500 MTU:

XDP_DROP      +1%
XDP_PASS      -1,2%
XDP_TX        -0,5%
XDP_REDIRECT  -3,3%

Cherry on top, which is not directly related to mbuf support (last
patch):
XDP_TX ZC +126%

Target the we agreed on was to not degrade performance for any action by
anything that would be over 5%, so our goal was met. Basically this set
keeps the performance where it was. Redirect is slower due to more
frequent tail bumps.

Thanks!


Maciej Fijalkowski (13):
  ice: prepare legacy-rx for upcoming XDP multi-buffer support
  ice: add xdp_buff to ice_rx_ring struct
  ice: store page count inside ice_rx_buf
  ice: pull out next_to_clean bump out of ice_put_rx_buf()
  ice: inline eop check
  ice: centrallize Rx buffer recycling
  ice: use ice_max_xdp_frame_size() in ice_xdp_setup_prog()
  ice: do not call ice_finalize_xdp_rx() unnecessarily
  ice: use xdp->frame_sz instead of recalculating truesize
  ice: add support for XDP multi-buffer on Rx side
  ice: add support for XDP multi-buffer on Tx side
  ice: remove next_{dd,rs} fields from ice_tx_ring
  ice: xsk: do not convert to buff to frame for XDP_TX

 drivers/net/ethernet/intel/ice/ice_base.c     |  21 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |   4 +-
 drivers/net/ethernet/intel/ice/ice_lib.c      |   8 +-
 drivers/net/ethernet/intel/ice/ice_main.c     |  47 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c     | 408 ++++++++++--------
 drivers/net/ethernet/intel/ice/ice_txrx.h     |  54 ++-
 drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 236 ++++++----
 drivers/net/ethernet/intel/ice/ice_txrx_lib.h |  75 +++-
 drivers/net/ethernet/intel/ice/ice_xsk.c      | 192 +++++----
 9 files changed, 629 insertions(+), 416 deletions(-)

-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: tirthendu.sarkar@intel.com, netdev@vger.kernel.org,
	anthony.l.nguyen@intel.com, bpf@vger.kernel.org,
	magnus.karlsson@intel.com
Subject: [Intel-wired-lan] [PATCH bpf-next 00/13] ice: add XDP mbuf support
Date: Tue, 31 Jan 2023 21:44:53 +0100	[thread overview]
Message-ID: <20230131204506.219292-1-maciej.fijalkowski@intel.com> (raw)

Hi there,

although this work started as an effort to add multi-buffer XDP support
to ice driver, as usual it turned out that some other side stuff needed
to be addressed, so let me give you an overview.

First patch adjusts legacy-rx in a way that it will be possible to refer
to skb_shared_info being at the end of the buffer when gathering up
frame fragments within xdp_buff.

Then, patches 2-9 prepare ice driver in a way that actual multi-buffer
patches will be easier to swallow.

10 and 11 are the meat. What is worth mentioning is that this set
actually *fixes* things as patch 11 removes the logic based on
next_dd/rs and we previously stepped away from this for ice_xmit_zc().
Currently, AF_XDP ZC XDP_TX workload is off as there are two cleaning
sides that can be triggered and two of them work on different internal
logic. This set unifies that and allows us to improve the performance by
2x with a trick on the last (13) patch.

12th is a simple cleanup of no longer fields from Tx ring.

I might be wrong but I have not seen anyone reporting performance impact
among patches that add XDP multi-buffer support to a particular driver.
Numbers below were gathered via xdp_rxq_info and xdp_redirect_map on
1500 MTU:

XDP_DROP      +1%
XDP_PASS      -1,2%
XDP_TX        -0,5%
XDP_REDIRECT  -3,3%

Cherry on top, which is not directly related to mbuf support (last
patch):
XDP_TX ZC +126%

Target the we agreed on was to not degrade performance for any action by
anything that would be over 5%, so our goal was met. Basically this set
keeps the performance where it was. Redirect is slower due to more
frequent tail bumps.

Thanks!


Maciej Fijalkowski (13):
  ice: prepare legacy-rx for upcoming XDP multi-buffer support
  ice: add xdp_buff to ice_rx_ring struct
  ice: store page count inside ice_rx_buf
  ice: pull out next_to_clean bump out of ice_put_rx_buf()
  ice: inline eop check
  ice: centrallize Rx buffer recycling
  ice: use ice_max_xdp_frame_size() in ice_xdp_setup_prog()
  ice: do not call ice_finalize_xdp_rx() unnecessarily
  ice: use xdp->frame_sz instead of recalculating truesize
  ice: add support for XDP multi-buffer on Rx side
  ice: add support for XDP multi-buffer on Tx side
  ice: remove next_{dd,rs} fields from ice_tx_ring
  ice: xsk: do not convert to buff to frame for XDP_TX

 drivers/net/ethernet/intel/ice/ice_base.c     |  21 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |   4 +-
 drivers/net/ethernet/intel/ice/ice_lib.c      |   8 +-
 drivers/net/ethernet/intel/ice/ice_main.c     |  47 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c     | 408 ++++++++++--------
 drivers/net/ethernet/intel/ice/ice_txrx.h     |  54 ++-
 drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 236 ++++++----
 drivers/net/ethernet/intel/ice/ice_txrx_lib.h |  75 +++-
 drivers/net/ethernet/intel/ice/ice_xsk.c      | 192 +++++----
 9 files changed, 629 insertions(+), 416 deletions(-)

-- 
2.34.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

             reply	other threads:[~2023-01-31 20:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 20:44 Maciej Fijalkowski [this message]
2023-01-31 20:44 ` [Intel-wired-lan] [PATCH bpf-next 00/13] ice: add XDP mbuf support Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 01/13] ice: prepare legacy-rx for upcoming XDP multi-buffer support Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 02/13] ice: add xdp_buff to ice_rx_ring struct Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 03/13] ice: store page count inside ice_rx_buf Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 04/13] ice: pull out next_to_clean bump out of ice_put_rx_buf() Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 05/13] ice: inline eop check Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:44 ` [PATCH bpf-next 06/13] ice: centrallize Rx buffer recycling Maciej Fijalkowski
2023-01-31 20:44   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:45 ` [PATCH bpf-next 07/13] ice: use ice_max_xdp_frame_size() in ice_xdp_setup_prog() Maciej Fijalkowski
2023-01-31 20:45   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:45 ` [Intel-wired-lan] [PATCH bpf-next 08/13] ice: do not call ice_finalize_xdp_rx() unnecessarily Maciej Fijalkowski
2023-01-31 20:45   ` Maciej Fijalkowski
2023-01-31 20:45 ` [Intel-wired-lan] [PATCH bpf-next 09/13] ice: use xdp->frame_sz instead of recalculating truesize Maciej Fijalkowski
2023-01-31 20:45   ` Maciej Fijalkowski
2023-01-31 20:45 ` [PATCH bpf-next 10/13] ice: add support for XDP multi-buffer on Rx side Maciej Fijalkowski
2023-01-31 20:45   ` [Intel-wired-lan] " Maciej Fijalkowski
2023-01-31 20:45 ` [Intel-wired-lan] [PATCH bpf-next 11/13] ice: add support for XDP multi-buffer on Tx side Maciej Fijalkowski
2023-01-31 20:45   ` Maciej Fijalkowski
2023-01-31 20:45 ` [Intel-wired-lan] [PATCH bpf-next 12/13] ice: remove next_{dd, rs} fields from ice_tx_ring Maciej Fijalkowski
2023-01-31 20:45   ` [PATCH bpf-next 12/13] ice: remove next_{dd,rs} " Maciej Fijalkowski
2023-01-31 20:45 ` [Intel-wired-lan] [PATCH bpf-next 13/13] ice: xsk: do not convert to buff to frame for XDP_TX Maciej Fijalkowski
2023-01-31 20:45   ` Maciej Fijalkowski
2023-02-01 11:05 ` [PATCH bpf-next 00/13] ice: add XDP mbuf support Alexander Lobakin
2023-02-01 11:05   ` [Intel-wired-lan] " Alexander Lobakin
2023-02-01 22:40 ` patchwork-bot+netdevbpf
2023-02-01 22:40   ` [Intel-wired-lan] " patchwork-bot+netdevbpf

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=20230131204506.219292-1-maciej.fijalkowski@intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tirthendu.sarkar@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.