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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <761fa4422e5576b087c8e6d26a9046126f5dff2f.camel@mellanox.com>
Date:   Fri, 17 Apr 2020 03:55:22 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "edumazet@...gle.com" <edumazet@...gle.com>,
        "davem@...emloft.net" <davem@...emloft.net>
CC:     "willemb@...gle.com" <willemb@...gle.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "eric.dumazet@...il.com" <eric.dumazet@...il.com>,
        Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [PATCH net-next] net/mlx4_en: avoid indirect call in TX
 completion

On Wed, 2020-04-15 at 09:46 -0700, Eric Dumazet wrote:
> Commit 9ecc2d86171a ("net/mlx4_en: add xdp forwarding and data write
> support")
> brought another indirect call in fast path.
> 
> Use INDIRECT_CALL_2() helper to avoid the cost of the indirect call
> when/if CONFIG_RETPOLINE=y
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Tariq Toukan <tariqt@...lanox.com>
> Cc: Willem de Bruijn <willemb@...gle.com>
> ---

Hi Eric, I believe net-next is still closed.

But FWIW, 

Reviewed-by: Saeed Mahameed <saeedm@...lanox.com>


>  drivers/net/ethernet/mellanox/mlx4/en_tx.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index
> 4d5ca302c067126b8627cb4809485b45c10e2460..a30edb436f4af11526e04c09623
> 840288ebe4a29 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -43,6 +43,7 @@
>  #include <linux/ip.h>
>  #include <linux/ipv6.h>
>  #include <linux/moduleparam.h>
> +#include <linux/indirect_call_wrapper.h>
>  
>  #include "mlx4_en.h"
>  
> @@ -261,6 +262,10 @@ static void mlx4_en_stamp_wqe(struct
> mlx4_en_priv *priv,
>  	}
>  }
>  
> +INDIRECT_CALLABLE_DECLARE(u32 mlx4_en_free_tx_desc(struct
> mlx4_en_priv *priv,
> +						   struct
> mlx4_en_tx_ring *ring,
> +						   int index, u64
> timestamp,
> +						   int napi_mode));
>  
>  u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
>  			 struct mlx4_en_tx_ring *ring,
> @@ -329,6 +334,11 @@ u32 mlx4_en_free_tx_desc(struct mlx4_en_priv
> *priv,
>  	return tx_info->nr_txbb;
>  }
>  
> +INDIRECT_CALLABLE_DECLARE(u32 mlx4_en_recycle_tx_desc(struct
> mlx4_en_priv *priv,
> +						      struct
> mlx4_en_tx_ring *ring,
> +						      int index, u64
> timestamp,
> +						      int napi_mode));
> +
>  u32 mlx4_en_recycle_tx_desc(struct mlx4_en_priv *priv,
>  			    struct mlx4_en_tx_ring *ring,
>  			    int index, u64 timestamp,
> @@ -449,7 +459,9 @@ bool mlx4_en_process_tx_cq(struct net_device
> *dev,
>  				timestamp = mlx4_en_get_cqe_ts(cqe);
>  
>  			/* free next descriptor */
> -			last_nr_txbb = ring->free_tx_desc(
> +			last_nr_txbb = INDIRECT_CALL_2(ring-
> >free_tx_desc,
> +						       mlx4_en_free_tx_
> desc,
> +						       mlx4_en_recycle_
> tx_desc,
>  					priv, ring, ring_index,
>  					timestamp, napi_budget);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ