Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 17:24:21 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r347815 - stable/11/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161724.x4GHOLIj004828@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 17:24:21 2019
New Revision: 347815
URL: https://svnweb.freebsd.org/changeset/base/347815

Log:
  MFC r347264:
  Configure firmware to use RX hash format in mini CQE in mlx5en(4).
  
  When using CQE zipping, one can choose between RX hash and Checksum.
  This will indicate the parameter on which a zipping session should be
  stopped.
  
  While porting the Linux code, Checksum was chosen. However, the value
  of Checksum is not being used anywhere.
  For the FreeBSD driver, we prefer to use the RX hash format which will
  guarantee the RX hash value for all the mini CQEs.
  While at it, make sure to initialize the Checksum value in the
  decompressed CQE.
  
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 17:24:11 2019	(r347814)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 17:24:21 2019	(r347815)
@@ -1850,13 +1850,15 @@ mlx5e_build_rx_cq_param(struct mlx5e_priv *priv,
 	struct net_dim_cq_moder curr;
 	void *cqc = param->cqc;
 
-
 	/*
-	 * TODO The sysctl to control on/off is a bool value for now, which means
-	 * we only support CSUM, once HASH is implemnted we'll need to address that.
+	 * We use MLX5_CQE_FORMAT_HASH because the RX hash mini CQE
+	 * format is more beneficial for FreeBSD use case.
+	 *
+	 * Adding support for MLX5_CQE_FORMAT_CSUM will require changes
+	 * in mlx5e_decompress_cqe.
 	 */
 	if (priv->params.cqe_zipping_en) {
-		MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_CSUM);
+		MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_HASH);
 		MLX5_SET(cqc, cqc, cqe_compression_en, 1);
 	}
 

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Thu May 16 17:24:11 2019	(r347814)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Thu May 16 17:24:21 2019	(r347815)
@@ -340,7 +340,12 @@ mlx5e_decompress_cqe(struct mlx5e_cq *cq, struct mlx5_
 	 */
 	title->byte_cnt = mini->byte_cnt;
 	title->wqe_counter = cpu_to_be16((wqe_counter + i) & cq->wq.sz_m1);
-	title->check_sum = mini->checksum;
+	title->rss_hash_result = mini->rx_hash_result;
+	/*
+	 * Since we use MLX5_CQE_FORMAT_HASH when creating the RX CQ,
+	 * the value of the checksum should be ignored.
+	 */
+	title->check_sum = 0;
 	title->op_own = (title->op_own & 0xf0) |
 	    (((cq->wq.cc + i) >> cq->wq.log_sz) & 1);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161724.x4GHOLIj004828>