net/mlx5e: FPGA, fix Innova IPsec TX offload data path performance [Linux 5.0]

This Linux kernel change "net/mlx5e: FPGA, fix Innova IPsec TX offload data path performance" is included in the Linux 5.0 release. This change is authored by Raed Salem <raeds [at]> on Mon Dec 17 11:40:06 2018 +0200. The commit for this change in Linux stable tree is 82eaa1f (patch).

net/mlx5e: FPGA, fix Innova IPsec TX offload data path performance

At Innova IPsec TX offload data path a special software parser metadata
is used to pass some packet attributes to the hardware, this metadata
is passed using the Ethernet control segment of a WQE (a HW descriptor)

The cited commit might nullify this header, hence the metadata is lost,
this caused a significant performance drop during hw offloading

Fix by restoring the metadata at the Ethernet control segment in case
it was nullified.

Fixes: 37fdffb217a4 ("net/mlx5: WQ, fixes for fragmented WQ buffers API")
Signed-off-by: Raed Salem <[email protected]>
Reviewed-by: Tariq Toukan <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>

There are 6 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 598ad7e..0e55cd1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -387,8 +387,14 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
    num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS);
    contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
    if (unlikely(contig_wqebbs_room < num_wqebbs)) {
+       struct mlx5_wqe_eth_seg cur_eth = wqe->eth;
        mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
        mlx5e_sq_fetch_wqe(sq, &wqe, &pi);
+       wqe->eth = cur_eth;

    /* fill wqe */

Leave a Reply

Your email address will not be published. Required fields are marked *