lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+5GBFpx5M8rCpVq@boxer>
Date:   Thu, 16 Feb 2023 16:04:36 +0100
From:   Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To:     Saeed Mahameed <saeed@...nel.org>
CC:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        "Saeed Mahameed" <saeedm@...dia.com>, <netdev@...r.kernel.org>,
        Tariq Toukan <tariqt@...dia.com>,
        Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [net-next 2/9] net/mlx5e: Remove redundant page argument in
 mlx5e_xmit_xdp_buff()

On Wed, Feb 15, 2023 at 04:09:11PM -0800, Saeed Mahameed wrote:
> From: Tariq Toukan <tariqt@...dia.com>
> 
> Remove the page parameter, it can be derived from the xdp_buff.
> 
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
> Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> index f7d52b1d293b..4b9cd8ef8d28 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> @@ -57,8 +57,9 @@ int mlx5e_xdp_max_mtu(struct mlx5e_params *params, struct mlx5e_xsk_param *xsk)
>  
>  static inline bool
>  mlx5e_xmit_xdp_buff(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq,
> -		    struct page *page, struct xdp_buff *xdp)
> +		    struct xdp_buff *xdp)
>  {
> +	struct page *page = virt_to_page(xdp->data);
>  	struct skb_shared_info *sinfo = NULL;
>  	struct mlx5e_xmit_data xdptxd;
>  	struct mlx5e_xdp_info xdpi;
> @@ -197,7 +198,7 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct page *page,
>  	case XDP_PASS:
>  		return false;
>  	case XDP_TX:
> -		if (unlikely(!mlx5e_xmit_xdp_buff(rq->xdpsq, rq, page, xdp)))
> +		if (unlikely(!mlx5e_xmit_xdp_buff(rq->xdpsq, rq, xdp)))

is there any value behind this patch? you're not super excessive in terms
of count of args that  mlx5e_xmit_xdp_buff() takes.

Maybe don't initialize this right on the start but rather just before
getting dma_addr? This way XSK XDP_TX won't be doing this.

>  			goto xdp_abort;
>  		__set_bit(MLX5E_RQ_FLAG_XDP_XMIT, rq->flags); /* non-atomic */
>  		return true;
> -- 
> 2.39.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ