All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@mellanox.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>, sameehj@amazon.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Daniel Borkmann" <borkmann@iogearbox.net>,
	"Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Alexander Duyck" <alexander.duyck@gmail.com>,
	"Jeff Kirsher" <jeffrey.t.kirsher@intel.com>,
	"David Ahern" <dsahern@gmail.com>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Saeed Mahameed" <saeedm@mellanox.com>
Subject: Re: [PATCH net-next v3 28/33] mlx5: rx queue setup time determine frame_sz for XDP
Date: Sun, 10 May 2020 09:31:41 +0300	[thread overview]
Message-ID: <b6d91551-76c9-7fe1-2bd7-a80a519cb4dd@mellanox.com> (raw)
In-Reply-To: <158893626831.2321140.8243471055668639661.stgit@firesoul>



On 5/8/2020 2:11 PM, Jesper Dangaard Brouer wrote:
> The mlx5 driver have multiple memory models, which are also changed
> according to whether a XDP bpf_prog is attached.
> 
> The 'rx_striding_rq' setting is adjusted via ethtool priv-flags e.g.:
>   # ethtool --set-priv-flags mlx5p2 rx_striding_rq off
> 
> On the general case with 4K page_size and regular MTU packet, then
> the frame_sz is 2048 and 4096 when XDP is enabled, in both modes.
> 
> The info on the given frame size is stored differently depending on the
> RQ-mode and encoded in a union in struct mlx5e_rq union wqe/mpwqe.
> In rx striding mode rq->mpwqe.log_stride_sz is either 11 or 12, which
> corresponds to 2048 or 4096 (MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ).
> In non-striding mode (MLX5_WQ_TYPE_CYCLIC) the frag_stride is stored
> in rq->wqe.info.arr[0].frag_stride, for the first fragment, which is
> what the XDP case cares about.
> 
> To reduce effect on fast-path, this patch determine the frame_sz at
> setup time, to avoid determining the memory model runtime. Variable
> is named first_frame_sz to make it clear that this is only the frame
> size of the first fragment.
> 
> This mlx5 driver does a DMA-sync on XDP_TX action, but grow is safe
> as it have done a DMA-map on the entire PAGE_SIZE. The driver also
> already does a XDP length check against sq->hw_mtu on the possible
> XDP xmit paths mlx5e_xmit_xdp_frame() + mlx5e_xmit_xdp_frame_mpwqe().
> 
> V2: Fix that frag_size need to be recalc before creating SKB.
> 
> Cc: Tariq Toukan <tariqt@mellanox.com>
> Cc: Saeed Mahameed <saeedm@mellanox.com>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---

Thanks Jesper.
Acked-by: Tariq Toukan <tariqt@mellanox.com>

  reply	other threads:[~2020-05-10  6:31 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 11:08 [PATCH net-next v3 00/33] XDP extend with knowledge of frame size Jesper Dangaard Brouer
2020-05-08 11:08 ` [PATCH net-next v3 01/33] xdp: add frame size to xdp_buff Jesper Dangaard Brouer
2020-05-08 11:08 ` [PATCH net-next v3 02/33] bnxt: add XDP frame size to driver Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 03/33] sfc: add XDP frame size Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 04/33] mvneta: add XDP frame size to driver Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 05/33] net: netsec: Add support for XDP frame size Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 06/33] net: XDP-generic determining " Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 07/33] xdp: xdp_frame add member frame_sz and handle in convert_to_xdp_frame Jesper Dangaard Brouer
2020-05-08 16:00   ` Jakub Kicinski
2020-05-08 11:09 ` [PATCH net-next v3 08/33] xdp: cpumap redirect use frame_sz and increase skb_tailroom Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 09/33] veth: adjust hard_start offset on redirect XDP frames Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 10/33] veth: xdp using frame_sz in veth driver Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 11/33] dpaa2-eth: add XDP frame size Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 12/33] hv_netvsc: add XDP frame size to driver Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 13/33] qlogic/qede: " Jesper Dangaard Brouer
2020-05-08 11:09 ` [PATCH net-next v3 14/33] net: ethernet: ti: add XDP frame size to driver cpsw Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 15/33] ena: add XDP frame size to amazon NIC driver Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 16/33] mlx4: add XDP frame size and adjust max XDP MTU Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 17/33] net: thunderx: add XDP frame size Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 18/33] nfp: add XDP frame size to netronome driver Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 19/33] tun: add XDP frame size Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 20/33] vhost_net: also populate " Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 21/33] virtio_net: add XDP frame size in two code paths Jesper Dangaard Brouer
2020-05-09  2:15   ` Jason Wang
2020-05-08 11:10 ` [PATCH net-next v3 22/33] ixgbe: fix XDP redirect on archs with PAGE_SIZE above 4K Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 23/33] ixgbe: add XDP frame size to driver Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 24/33] ixgbevf: add XDP frame size to VF driver Jesper Dangaard Brouer
2020-05-08 16:01   ` Jakub Kicinski
2020-05-08 11:10 ` [PATCH net-next v3 25/33] i40e: add XDP frame size to driver Jesper Dangaard Brouer
2020-05-08 11:10 ` [PATCH net-next v3 26/33] ice: " Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 27/33] xdp: for Intel AF_XDP drivers add XDP frame_sz Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 28/33] mlx5: rx queue setup time determine frame_sz for XDP Jesper Dangaard Brouer
2020-05-10  6:31   ` Tariq Toukan [this message]
2020-05-08 11:11 ` [PATCH net-next v3 29/33] xdp: allow bpf_xdp_adjust_tail() to grow packet size Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 30/33] xdp: clear grow memory in bpf_xdp_adjust_tail() Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 31/33] bpf: add xdp.frame_sz in bpf_prog_test_run_xdp() Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 32/33] selftests/bpf: adjust BPF selftest for xdp_adjust_tail Jesper Dangaard Brouer
2020-05-08 11:11 ` [PATCH net-next v3 33/33] selftests/bpf: xdp_adjust_tail add grow tail tests Jesper Dangaard Brouer

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=b6d91551-76c9-7fe1-2bd7-a80a519cb4dd@mellanox.com \
    --to=tariqt@mellanox.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=borkmann@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=sameehj@amazon.com \
    --cc=toke@redhat.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.