[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230622195757.kmxqagulvu4mwhp6@macbook-pro-8.dhcp.thefacebook.com>
Date: Thu, 22 Jun 2023 12:57:57 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Stanislav Fomichev <sdf@...gle.com>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
yhs@...com, john.fastabend@...il.com, kpsingh@...nel.org,
haoluo@...gle.com, jolsa@...nel.org, netdev@...r.kernel.org
Subject: Re: [RFC bpf-next v2 11/11] net/mlx5e: Support TX timestamp metadata
On Wed, Jun 21, 2023 at 10:02:44AM -0700, Stanislav Fomichev wrote:
> WIP, not tested, only to show the overall idea.
> Non-AF_XDP paths are marked with 'false' for now.
>
> Cc: netdev@...r.kernel.org
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
> ---
> .../net/ethernet/mellanox/mlx5/core/en/txrx.h | 11 +++
> .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 96 ++++++++++++++++++-
> .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 9 +-
> .../ethernet/mellanox/mlx5/core/en/xsk/tx.c | 3 +
> .../net/ethernet/mellanox/mlx5/core/en_tx.c | 16 ++++
> .../net/ethernet/mellanox/mlx5/core/main.c | 26 ++++-
> 6 files changed, 156 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> index 879d698b6119..e4509464e0b1 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> @@ -6,6 +6,7 @@
>
> #include "en.h"
> #include <linux/indirect_call_wrapper.h>
> +#include <net/devtx.h>
>
> #define MLX5E_TX_WQE_EMPTY_DS_COUNT (sizeof(struct mlx5e_tx_wqe) / MLX5_SEND_WQE_DS)
>
> @@ -506,4 +507,14 @@ static inline struct mlx5e_mpw_info *mlx5e_get_mpw_info(struct mlx5e_rq *rq, int
>
> return (struct mlx5e_mpw_info *)((char *)rq->mpwqe.info + array_size(i, isz));
> }
> +
> +struct mlx5e_devtx_frame {
> + struct devtx_frame frame;
> + struct mlx5_cqe64 *cqe; /* tx completion */
cqe is only valid at completion.
> + struct mlx5e_tx_wqe *wqe; /* tx */
wqe is only valid at submission.
imo that's a very clear sign that this is not a generic datastructure.
The code is trying hard to make 'frame' part of it look common,
but it won't help bpf prog to be 'generic'.
It is still going to precisely coded for completion vs submission.
Similarly a bpf prog for completion in veth will be different than bpf prog for completion in mlx5.
As I stated earlier this 'generalization' and 'common' datastructure only adds code complexity.
Powered by blists - more mailing lists