|WARNING| pw133771-133778 [PATCH] [v9, 9/9] app/testpmd: add RSS hash algorithms display

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Nov 2 15:54:18 CET 2023


Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/133771

_apply patch failure_

Submitter: Jie Hai <haijie1 at huawei.com>
Date: Thursday, November 02 2023 08:20:20 
Applied on: CommitID:71f9da6691c49d0dfcf088dce5e99c488af0eb7e
Apply patch set 133771-133778 failed:

Checking patch doc/guides/rel_notes/release_23_11.rst...
Hunk #1 succeeded at 361 (offset 16 lines).
Checking patch lib/ethdev/rte_ethdev.c...
Hunk #1 succeeded at 1533 (offset 33 lines).
error: while searching for:
		return -ENOTSUP;
	}

	if (*dev->dev_ops->rss_hash_update == NULL)
		return -ENOTSUP;
	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,

error: patch failed: lib/ethdev/rte_ethdev.c:4698
error: while searching for:
rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
			      struct rte_eth_rss_conf *rss_conf)
{
	struct rte_eth_dev *dev;
	int ret;


error: patch failed: lib/ethdev/rte_ethdev.c:4712
error: while searching for:
		return -EINVAL;
	}

	if (*dev->dev_ops->rss_hash_conf_get == NULL)
		return -ENOTSUP;
	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,

error: patch failed: lib/ethdev/rte_ethdev.c:4725
Checking patch lib/ethdev/rte_ethdev.h...
error: while searching for:
/**
 * A structure used to configure the Receive Side Scaling (RSS) feature
 * of an Ethernet port.
 * If not NULL, the *rss_key* pointer of the *rss_conf* structure points
 * to an array holding the RSS key to use for hashing specific header
 * fields of received packets. The length of this array should be indicated
 * by *rss_key_len* below. Otherwise, a default random hash key is used by
 * the device driver.
 *
 * The *rss_key_len* field of the *rss_conf* structure indicates the length
 * in bytes of the array pointed by *rss_key*. To be compatible, this length
 * will be checked in i40e only. Others assume 40 bytes to be used as before.
 *
 * The *rss_hf* field of the *rss_conf* structure indicates the different
 * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
 * Supplying an *rss_hf* equal to zero disables the RSS feature.
 */
struct rte_eth_rss_conf {
	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
	uint8_t rss_key_len; /**< hash key length in bytes. */
	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
};

/*

error: patch failed: lib/ethdev/rte_ethdev.h:448
Checking patch lib/ethdev/rte_flow.h...
error: while searching for:
 * Hash function types.
 */
enum rte_eth_hash_function {
	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */

error: patch failed: lib/ethdev/rte_flow.h:3226
Applied patch doc/guides/rel_notes/release_23_11.rst cleanly.
Applying patch lib/ethdev/rte_ethdev.c with 3 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Applying patch lib/ethdev/rte_ethdev.h with 1 reject...
Rejected hunk #1.
Applying patch lib/ethdev/rte_flow.h with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c	(rejected hunks)
@@ -4698,6 +4708,14 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->rss_key != NULL &&
+	    rss_conf->rss_key_len != dev_info.hash_key_size) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n",
+			port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4712,6 +4730,7 @@ int
 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 			      struct rte_eth_rss_conf *rss_conf)
 {
+	struct rte_eth_dev_info dev_info = { 0 };
 	struct rte_eth_dev *dev;
 	int ret;
 
@@ -4725,6 +4744,18 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
+	if (rss_conf->rss_key != NULL &&
+	    rss_conf->rss_key_len < dev_info.hash_key_size) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS key len: %u, should not be less than: %u\n",
+			port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h	(rejected hunks)
@@ -448,24 +448,27 @@ struct rte_vlan_filter_conf {
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
- * If not NULL, the *rss_key* pointer of the *rss_conf* structure points
- * to an array holding the RSS key to use for hashing specific header
- * fields of received packets. The length of this array should be indicated
- * by *rss_key_len* below. Otherwise, a default random hash key is used by
- * the device driver.
- *
- * The *rss_key_len* field of the *rss_conf* structure indicates the length
- * in bytes of the array pointed by *rss_key*. To be compatible, this length
- * will be checked in i40e only. Others assume 40 bytes to be used as before.
- *
- * The *rss_hf* field of the *rss_conf* structure indicates the different
- * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
- * Supplying an *rss_hf* equal to zero disables the RSS feature.
  */
 struct rte_eth_rss_conf {
-	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
+	/**
+	 * In rte_eth_dev_rss_hash_conf_get(), the *rss_key_len* should be
+	 * greater than or equal to the *hash_key_size* which get from
+	 * rte_eth_dev_info_get() API. And the *rss_key* should contain at least
+	 * *hash_key_size* bytes. If not meet these requirements, the query
+	 * result is unreliable even if the operation returns success.
+	 *
+	 * In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), if
+	 * *rss_key* is not NULL, the *rss_key_len* indicates the length of the
+	 * *rss_key* in bytes and it should be equal to *hash_key_size*.
+	 * If *rss_key* is NULL, drivers are free to use a random or a default key.
+	 */
+	uint8_t *rss_key;
 	uint8_t rss_key_len; /**< hash key length in bytes. */
-	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
+	/**
+	 * Indicates the type of packets or the specific part of packets to
+	 * which RSS hashing is to be applied.
+	 */
+	uint64_t rss_hf;
 };
 
 /*
diff a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h	(rejected hunks)
@@ -3226,6 +3226,7 @@ struct rte_flow_query_count {
  * Hash function types.
  */
 enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
 	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
 	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
 	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
Checking patch doc/guides/rel_notes/release_23_11.rst...
error: doc/guides/rel_notes/release_23_11.rst: does not match index
Checking patch lib/ethdev/rte_ethdev.c...
error: lib/ethdev/rte_ethdev.c: does not match index
Checking patch lib/ethdev/rte_ethdev.h...
error: while searching for:
	uint64_t ids[64];
};

/**
 * A structure used to configure the Receive Side Scaling (RSS) feature
 * of an Ethernet port.

error: patch failed: lib/ethdev/rte_ethdev.h:445
error: while searching for:
	 * which RSS hashing is to be applied.
	 */
	uint64_t rss_hf;
};

/*

error: patch failed: lib/ethdev/rte_ethdev.h:469
error: while searching for:
	/** Device redirection table size, the total number of entries. */
	uint16_t reta_size;
	uint8_t hash_key_size; /**< Hash key size in bytes */
	/** Bit mask of RSS offloads, the bit offset also means flow type */
	uint64_t flow_type_rss_offloads;
	struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */

error: patch failed: lib/ethdev/rte_ethdev.h:1749
Checking patch lib/ethdev/rte_flow.c...
error: while searching for:
#include <rte_branch_prediction.h>
#include <rte_string_fns.h>
#include <rte_mbuf_dyn.h>
#include "rte_ethdev.h"
#include "rte_flow_driver.h"
#include "rte_flow.h"


error: patch failed: lib/ethdev/rte_flow.c:13
Checking patch lib/ethdev/rte_flow.h...
error: while searching for:
#include <rte_macsec.h>
#include <rte_ib.h>

#ifdef __cplusplus
extern "C" {
#endif

error: patch failed: lib/ethdev/rte_flow.h:40
error: while searching for:
	uint64_t bytes; /**< Number of bytes through this rule [out]. */
};

/**
 * Hash function types.
 */
enum rte_eth_hash_function {
	/** DEFAULT means driver decides which hash algorithm to pick. */
	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
	/**
	 * Symmetric Toeplitz: src, dst will be replaced by
	 * xor(src, dst). For the case with src/dst only,
	 * src or dst address will xor with zero pair.
	 */
	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
	/**
	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
	 * the hash function.
	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
	 *  If src_port > dst_port, swap src_port and dst_port.
	 */
	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
	RTE_ETH_HASH_FUNCTION_MAX,
};

/**
 * RTE_FLOW_ACTION_TYPE_RSS
 *

error: patch failed: lib/ethdev/rte_flow.h:3222
Applying patch lib/ethdev/rte_ethdev.h with 3 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
Applying patch lib/ethdev/rte_flow.c with 1 reject...
Rejected hunk #1.
Applying patch lib/ethdev/rte_flow.h with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h	(rejected hunks)
@@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
 	 * which RSS hashing is to be applied.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
@@ -1749,6 +1777,7 @@ struct rte_eth_dev_info {
 	/** Device redirection table size, the total number of entries. */
 	uint16_t reta_size;
 	uint8_t hash_key_size; /**< Hash key size in bytes */
+	uint32_t rss_algo_capa; /** RSS hash algorithms capabilities */
 	/** Bit mask of RSS offloads, the bit offset also means flow type */
 	uint64_t flow_type_rss_offloads;
 	struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */
diff a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c	(rejected hunks)
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h	(rejected hunks)
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/** DEFAULT means driver decides which hash algorithm to pick. */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
Checking patch drivers/net/hns3/hns3_common.c...
error: while searching for:
	info->reta_size = hw->rss_ind_tbl_size;
	info->hash_key_size = hw->rss_key_size;
	info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT;

	info->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
	info->default_txportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;

error: patch failed: drivers/net/hns3/hns3_common.c:133
Applying patch drivers/net/hns3/hns3_common.c with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c	(rejected hunks)
@@ -133,6 +133,10 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->reta_size = hw->rss_ind_tbl_size;
 	info->hash_key_size = hw->rss_key_size;
 	info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT;
+	info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) |
+			      RTE_ETH_HASH_ALGO_CAPA_MASK(TOEPLITZ) |
+			      RTE_ETH_HASH_ALGO_CAPA_MASK(SIMPLE_XOR) |
+			      RTE_ETH_HASH_ALGO_CAPA_MASK(SYMMETRIC_TOEPLITZ);
 
 	info->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
 	info->default_txportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
Checking patch drivers/net/hns3/hns3_rss.c...
error: while searching for:
	if (ret)
		goto set_tuple_fail;

	if (key) {
		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
					    key, hw->rss_key_size);
		if (ret)
			goto set_algo_key_fail;
		/* Update the shadow RSS key with user specified */
		memcpy(hw->rss_info.key, key, hw->rss_key_size);
	}
	hw->rss_info.rss_hf = rss_hf;
	rte_spinlock_unlock(&hw->lock);


error: patch failed: drivers/net/hns3/hns3_rss.c:646
error: while searching for:
hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
			   struct rte_eth_rss_conf *rss_conf)
{
	struct hns3_adapter *hns = dev->data->dev_private;
	struct hns3_hw *hw = &hns->hw;
	uint8_t hash_algo = 0;
	int ret;

error: patch failed: drivers/net/hns3/hns3_rss.c:769
error: while searching for:
	rte_spinlock_lock(&hw->lock);
	ret = hns3_rss_hash_get_rss_hf(hw, &rss_conf->rss_hf);
	if (ret != 0) {
		hns3_err(hw, "obtain hash tuples failed, ret = %d", ret);
		goto out;
	}

	/* Get the RSS Key required by the user */
	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
					    hw->rss_key_size);
		if (ret != 0) {
			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
				 ret);
			goto out;
		}
		rss_conf->rss_key_len = hw->rss_key_size;
	}

out:
	rte_spinlock_unlock(&hw->lock);

	return ret;
}

/*

error: patch failed: drivers/net/hns3/hns3_rss.c:777
Applying patch drivers/net/hns3/hns3_rss.c with 3 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c	(rejected hunks)
@@ -646,14 +646,14 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	if (ret)
 		goto set_tuple_fail;
 
-	if (key) {
-		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
-					    key, hw->rss_key_size);
-		if (ret)
-			goto set_algo_key_fail;
-		/* Update the shadow RSS key with user specified */
+	ret = hns3_update_rss_algo_key(hw, rss_conf->algorithm, key, key_len);
+	if (ret != 0)
+		goto set_algo_key_fail;
+
+	if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+		hw->rss_info.hash_algo = hns3_hash_func_map[rss_conf->algorithm];
+	if (key != NULL)
 		memcpy(hw->rss_info.key, key, hw->rss_key_size);
-	}
 	hw->rss_info.rss_hf = rss_hf;
 	rte_spinlock_unlock(&hw->lock);
 
@@ -769,7 +769,13 @@ int
 hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 			   struct rte_eth_rss_conf *rss_conf)
 {
+	const uint8_t hash_func_map[] = {
+		[HNS3_RSS_HASH_ALGO_TOEPLITZ] = RTE_ETH_HASH_FUNCTION_TOEPLITZ,
+		[HNS3_RSS_HASH_ALGO_SIMPLE] = RTE_ETH_HASH_FUNCTION_SIMPLE_XOR,
+		[HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP] = RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	};
 	struct hns3_adapter *hns = dev->data->dev_private;
+	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	struct hns3_hw *hw = &hns->hw;
 	uint8_t hash_algo = 0;
 	int ret;
@@ -777,26 +783,27 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	rte_spinlock_lock(&hw->lock);
 	ret = hns3_rss_hash_get_rss_hf(hw, &rss_conf->rss_hf);
 	if (ret != 0) {
+		rte_spinlock_unlock(&hw->lock);
 		hns3_err(hw, "obtain hash tuples failed, ret = %d", ret);
-		goto out;
+		return ret;
+	}
+
+	ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_key, hw->rss_key_size);
+	if (ret != 0) {
+		rte_spinlock_unlock(&hw->lock);
+		hns3_err(hw, "obtain hash algo and key failed, ret = %d", ret);
+		return ret;
 	}
+	rte_spinlock_unlock(&hw->lock);
 
-	/* Get the RSS Key required by the user */
+	/* Get the RSS Key if user required. */
 	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
-		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
-					    hw->rss_key_size);
-		if (ret != 0) {
-			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
-				 ret);
-			goto out;
-		}
+		memcpy(rss_conf->rss_key, rss_key, hw->rss_key_size);
 		rss_conf->rss_key_len = hw->rss_key_size;
 	}
+	rss_conf->algorithm = hash_func_map[hash_algo];
 
-out:
-	rte_spinlock_unlock(&hw->lock);
-
-	return ret;
+	return 0;
 }
 
 /*
Checking patch app/proc-info/main.c...
error: while searching for:
static struct desc_param rx_desc_param;
static struct desc_param tx_desc_param;

/* display usage */
static void
proc_info_usage(const char *prgname)

error: patch failed: app/proc-info/main.c:151
error: while searching for:
		struct rte_eth_fc_conf fc_conf;
		struct rte_ether_addr mac;
		struct rte_eth_dev_owner owner;

		/* Skip if port is not in mask */
		if ((enabled_port_mask & (1ul << i)) == 0)

error: patch failed: app/proc-info/main.c:1011
error: while searching for:
			printf("\n");
		}

		ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
		if (ret == 0) {
			if (rss_conf.rss_key) {
				printf("  - RSS\n");
				printf("\t  -- RSS len %u key (hex):",
						rss_conf.rss_key_len);
				for (k = 0; k < rss_conf.rss_key_len; k++)
					printf(" %x", rss_conf.rss_key[k]);
				printf("\t  -- hf 0x%"PRIx64"\n",
						rss_conf.rss_hf);
			}
		}

#ifdef RTE_LIB_SECURITY

error: patch failed: app/proc-info/main.c:1169
Applying patch app/proc-info/main.c with 3 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/app/proc-info/main.c b/app/proc-info/main.c	(rejected hunks)
@@ -151,6 +151,8 @@ struct desc_param {
 static struct desc_param rx_desc_param;
 static struct desc_param tx_desc_param;
 
+#define RSS_HASH_KEY_SIZE 64
+
 /* display usage */
 static void
 proc_info_usage(const char *prgname)
@@ -1011,6 +1013,7 @@ show_port(void)
 		struct rte_eth_fc_conf fc_conf;
 		struct rte_ether_addr mac;
 		struct rte_eth_dev_owner owner;
+		uint8_t rss_key[RSS_HASH_KEY_SIZE];
 
 		/* Skip if port is not in mask */
 		if ((enabled_port_mask & (1ul << i)) == 0)
@@ -1169,17 +1172,17 @@ show_port(void)
 			printf("\n");
 		}
 
+		rss_conf.rss_key = rss_key;
+		rss_conf.rss_key_len = dev_info.hash_key_size;
 		ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
 		if (ret == 0) {
-			if (rss_conf.rss_key) {
-				printf("  - RSS\n");
-				printf("\t  -- RSS len %u key (hex):",
-						rss_conf.rss_key_len);
-				for (k = 0; k < rss_conf.rss_key_len; k++)
-					printf(" %x", rss_conf.rss_key[k]);
-				printf("\t  -- hf 0x%"PRIx64"\n",
-						rss_conf.rss_hf);
-			}
+			printf("  - RSS\n");
+			printf("\t  -- RSS len %u key (hex):",
+					rss_conf.rss_key_len);
+			for (k = 0; k < rss_conf.rss_key_len; k++)
+				printf(" %x", rss_conf.rss_key[k]);
+			printf("\t  -- hf 0x%"PRIx64"\n",
+					rss_conf.rss_hf);
 		}
 
 #ifdef RTE_LIB_SECURITY
Checking patch app/proc-info/main.c...
error: while searching for:
		rss_conf.rss_key_len = dev_info.hash_key_size;
		ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
		if (ret == 0) {
			printf("  - RSS\n");
			printf("\t  -- RSS len %u key (hex):",
					rss_conf.rss_key_len);
			for (k = 0; k < rss_conf.rss_key_len; k++)
				printf(" %x", rss_conf.rss_key[k]);
			printf("\t  -- hf 0x%"PRIx64"\n",
					rss_conf.rss_hf);
		}


error: patch failed: app/proc-info/main.c:1176
Applying patch app/proc-info/main.c with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/app/proc-info/main.c b/app/proc-info/main.c	(rejected hunks)
@@ -1176,12 +1176,13 @@ show_port(void)
 		rss_conf.rss_key_len = dev_info.hash_key_size;
 		ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
 		if (ret == 0) {
-			printf("  - RSS\n");
-			printf("\t  -- RSS len %u key (hex):",
+			printf("  - RSS info\n");
+			printf("\t  -- key len : %u\n",
 					rss_conf.rss_key_len);
+			printf("\t  -- key (hex) : ");
 			for (k = 0; k < rss_conf.rss_key_len; k++)
-				printf(" %x", rss_conf.rss_key[k]);
-			printf("\t  -- hf 0x%"PRIx64"\n",
+				printf("%02x", rss_conf.rss_key[k]);
+			printf("\n\t  -- hash function : 0x%"PRIx64"\n",
 					rss_conf.rss_hf);
 		}
 
Checking patch app/test-pmd/config.c...
error: while searching for:
		printf(" %d", rss_conf->queue[i]);
	printf("\n");

	printf(" function: ");
	switch (rss_conf->func) {
	case RTE_ETH_HASH_FUNCTION_DEFAULT:
		printf("default\n");
		break;
	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
		printf("toeplitz\n");
		break;
	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
		printf("simple_xor\n");
		break;
	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
		printf("symmetric_toeplitz\n");
		break;
	default:
		printf("Unknown function\n");
		return;
	}

	printf(" RSS key:\n");
	if (rss_conf->key_len == 0) {

error: patch failed: app/test-pmd/config.c:1504
Checking patch doc/guides/rel_notes/release_23_11.rst...
error: doc/guides/rel_notes/release_23_11.rst: does not match index
Checking patch lib/ethdev/rte_ethdev.c...
error: lib/ethdev/rte_ethdev.c: does not match index
Checking patch lib/ethdev/rte_ethdev.h...
error: while searching for:
rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
			      struct rte_eth_rss_conf *rss_conf);

/**
 * Add UDP tunneling port for a type of tunnel.
 *

error: patch failed: lib/ethdev/rte_ethdev.h:4643
Checking patch lib/ethdev/version.map...
error: while searching for:
	rte_flow_restore_info_dynflag;

	# added in 23.11
	rte_eth_recycle_rx_queue_info_get;
	rte_flow_group_set_miss_actions;
	rte_flow_calc_table_hash;

error: patch failed: lib/ethdev/version.map:314
Applying patch app/test-pmd/config.c with 1 reject...
Rejected hunk #1.
Applying patch lib/ethdev/rte_ethdev.h with 1 reject...
Rejected hunk #1.
Applying patch lib/ethdev/version.map with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/app/test-pmd/config.c b/app/test-pmd/config.c	(rejected hunks)
@@ -1504,24 +1504,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)
 		printf(" %d", rss_conf->queue[i]);
 	printf("\n");
 
-	printf(" function: ");
-	switch (rss_conf->func) {
-	case RTE_ETH_HASH_FUNCTION_DEFAULT:
-		printf("default\n");
-		break;
-	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
-		printf("toeplitz\n");
-		break;
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		printf("simple_xor\n");
-		break;
-	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
-		printf("symmetric_toeplitz\n");
-		break;
-	default:
-		printf("Unknown function\n");
-		return;
-	}
+	printf(" function: %s\n", rte_eth_dev_rss_algo_name(rss_conf->func));
 
 	printf(" RSS key:\n");
 	if (rss_conf->key_len == 0) {
diff a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h	(rejected hunks)
@@ -4643,6 +4643,22 @@ int
 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 			      struct rte_eth_rss_conf *rss_conf);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ *  Get the name of RSS hash algorithm.
+ *
+ * @param rss_algo
+ *   Hash algorithm.
+ *
+ * @return
+ *   Hash algorithm name or 'UNKNOWN' if the rss_algo cannot be recognized.
+ */
+__rte_experimental
+const char *
+rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo);
+
 /**
  * Add UDP tunneling port for a type of tunnel.
  *
diff a/lib/ethdev/version.map b/lib/ethdev/version.map	(rejected hunks)
@@ -314,6 +314,7 @@ EXPERIMENTAL {
 	rte_flow_restore_info_dynflag;
 
 	# added in 23.11
+	rte_eth_dev_rss_algo_name;
 	rte_eth_recycle_rx_queue_info_get;
 	rte_flow_group_set_miss_actions;
 	rte_flow_calc_table_hash;
Checking patch app/proc-info/main.c...
error: while searching for:
				printf("%02x", rss_conf.rss_key[k]);
			printf("\n\t  -- hash function : 0x%"PRIx64"\n",
					rss_conf.rss_hf);
		}

#ifdef RTE_LIB_SECURITY

error: patch failed: app/proc-info/main.c:1184
Applying patch app/proc-info/main.c with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/app/proc-info/main.c b/app/proc-info/main.c	(rejected hunks)
@@ -1184,6 +1184,8 @@ show_port(void)
 				printf("%02x", rss_conf.rss_key[k]);
 			printf("\n\t  -- hash function : 0x%"PRIx64"\n",
 					rss_conf.rss_hf);
+			printf("\t  -- hash algorithm : %s\n",
+				rte_eth_dev_rss_algo_name(rss_conf.algorithm));
 		}
 
 #ifdef RTE_LIB_SECURITY
Checking patch app/test-pmd/cmdline.c...
error: while searching for:
			" by masks on port X. size is used to indicate the"
			" hardware supported reta size\n\n"

			"show port (port_id) rss-hash [key]\n"
			"    Display the RSS hash functions and RSS hash key of port\n\n"

			"clear port (info|stats|xstats|fdir) (port_id|all)\n"
			"    Clear information for port_id, or all.\n\n"

error: patch failed: app/test-pmd/cmdline.c:174
error: while searching for:
	cmdline_fixed_string_t rss_hash;
	cmdline_fixed_string_t rss_type;
	cmdline_fixed_string_t key; /* optional argument */
};

static void cmd_showport_rss_hash_parsed(void *parsed_result,
				__rte_unused struct cmdline *cl,
				void *show_rss_key)
{
	struct cmd_showport_rss_hash *res = parsed_result;

	port_rss_hash_conf_show(res->port_id, show_rss_key != NULL);
}

static cmdline_parse_token_string_t cmd_showport_rss_hash_show =

error: patch failed: app/test-pmd/cmdline.c:3026
error: while searching for:
				 "rss-hash");
static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =
	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, "key");

static cmdline_parse_inst_t cmd_showport_rss_hash = {
	.f = cmd_showport_rss_hash_parsed,

error: patch failed: app/test-pmd/cmdline.c:3049
error: while searching for:

static cmdline_parse_inst_t cmd_showport_rss_hash_key = {
	.f = cmd_showport_rss_hash_parsed,
	.data = (void *)1,
	.help_str = "show port <port_id> rss-hash key",
	.tokens = {
		(void *)&cmd_showport_rss_hash_show,

error: patch failed: app/test-pmd/cmdline.c:3065
Hunk #5 succeeded at 3095 (offset 14 lines).
error: while searching for:
	(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
	(cmdline_parse_inst_t *)&cmd_showport_rss_hash,
	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
	(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
	(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
	(cmdline_parse_inst_t *)&cmd_dump,

error: patch failed: app/test-pmd/cmdline.c:12969
Checking patch app/test-pmd/config.c...
error: while searching for:
 * key of the port.
 */
void
port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
{
	struct rte_eth_rss_conf rss_conf = {0};
	uint8_t rss_key[RSS_HASH_KEY_LENGTH];

error: patch failed: app/test-pmd/config.c:4469
error: while searching for:
		printf("RSS disabled\n");
		return;
	}
	printf("RSS functions:\n");
	rss_types_display(rss_hf, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
	if (!show_rss_key)
		return;
	printf("RSS key:\n");

error: patch failed: app/test-pmd/config.c:4519
Checking patch app/test-pmd/testpmd.h...
error: while searching for:
int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,
			 uint8_t avail_thresh);

void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
void port_rss_hash_key_update(portid_t port_id, char rss_type[],
			      uint8_t *hash_key, uint8_t hash_key_len);
int rx_queue_id_is_invalid(queueid_t rxq_id);

error: patch failed: app/test-pmd/testpmd.h:1153
Checking patch doc/guides/testpmd_app_ug/testpmd_funcs.rst...
error: while searching for:
show port rss-hash
~~~~~~~~~~~~~~~~~~

Display the RSS hash functions and RSS hash key of a port::

   testpmd> show port (port_id) rss-hash [key]

clear port
~~~~~~~~~~

error: patch failed: doc/guides/testpmd_app_ug/testpmd_funcs.rst:235
Applying patch app/test-pmd/cmdline.c with 5 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Hunk #5 applied cleanly.
Rejected hunk #6.
Applying patch app/test-pmd/config.c with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applying patch app/test-pmd/testpmd.h with 1 reject...
Rejected hunk #1.
Applying patch doc/guides/testpmd_app_ug/testpmd_funcs.rst with 1 reject...
Rejected hunk #1.
hint: Use 'git am --show-current-patch' to see the failed patch
diff a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c	(rejected hunks)
@@ -174,8 +174,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" by masks on port X. size is used to indicate the"
 			" hardware supported reta size\n\n"
 
-			"show port (port_id) rss-hash [key]\n"
-			"    Display the RSS hash functions and RSS hash key of port\n\n"
+			"show port (port_id) rss-hash [key | algorithm]\n"
+			"    Display the RSS hash functions, RSS hash key and RSS hash algorithms of port\n\n"
 
 			"clear port (info|stats|xstats|fdir) (port_id|all)\n"
 			"    Clear information for port_id, or all.\n\n"
@@ -3026,15 +3026,17 @@ struct cmd_showport_rss_hash {
 	cmdline_fixed_string_t rss_hash;
 	cmdline_fixed_string_t rss_type;
 	cmdline_fixed_string_t key; /* optional argument */
+	cmdline_fixed_string_t algorithm; /* optional argument */
 };
 
 static void cmd_showport_rss_hash_parsed(void *parsed_result,
 				__rte_unused struct cmdline *cl,
-				void *show_rss_key)
+				__rte_unused void *data)
 {
 	struct cmd_showport_rss_hash *res = parsed_result;
 
-	port_rss_hash_conf_show(res->port_id, show_rss_key != NULL);
+	port_rss_hash_conf_show(res->port_id,
+		!strcmp(res->key, "key"), !strcmp(res->algorithm, "algorithm"));
 }
 
 static cmdline_parse_token_string_t cmd_showport_rss_hash_show =
@@ -3049,6 +3051,8 @@ static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =
 				 "rss-hash");
 static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, "key");
+static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, algorithm, "algorithm");
 
 static cmdline_parse_inst_t cmd_showport_rss_hash = {
 	.f = cmd_showport_rss_hash_parsed,
@@ -3065,7 +3069,7 @@ static cmdline_parse_inst_t cmd_showport_rss_hash = {
 
 static cmdline_parse_inst_t cmd_showport_rss_hash_key = {
 	.f = cmd_showport_rss_hash_parsed,
-	.data = (void *)1,
+	.data = NULL,
 	.help_str = "show port <port_id> rss-hash key",
 	.tokens = {
 		(void *)&cmd_showport_rss_hash_show,
@@ -12969,6 +12987,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash,
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
+	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
 	(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
 	(cmdline_parse_inst_t *)&cmd_dump,
diff a/app/test-pmd/config.c b/app/test-pmd/config.c	(rejected hunks)
@@ -4469,7 +4469,7 @@ port_rss_reta_info(portid_t port_id,
  * key of the port.
  */
 void
-port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
+port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_algo)
 {
 	struct rte_eth_rss_conf rss_conf = {0};
 	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
@@ -4519,8 +4519,16 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 		printf("RSS disabled\n");
 		return;
 	}
+
+	if (show_rss_algo) {
+		printf("RSS algorithm:\n  %s\n",
+			rte_eth_dev_rss_algo_name(rss_conf.algorithm));
+		return;
+	}
+
 	printf("RSS functions:\n");
 	rss_types_display(rss_hf, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
+
 	if (!show_rss_key)
 		return;
 	printf("RSS key:\n");
diff a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h	(rejected hunks)
@@ -1153,7 +1153,7 @@ int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate,
 int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,
 			 uint8_t avail_thresh);
 
-void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
+void port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_algo);
 void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 			      uint8_t *hash_key, uint8_t hash_key_len);
 int rx_queue_id_is_invalid(queueid_t rxq_id);
diff a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst	(rejected hunks)
@@ -235,9 +235,9 @@ size is used to indicate the hardware supported reta size
 show port rss-hash
 ~~~~~~~~~~~~~~~~~~
 
-Display the RSS hash functions and RSS hash key of a port::
+Display the RSS hash functions and RSS hash key or RSS hash algorithm of a port::
 
-   testpmd> show port (port_id) rss-hash [key]
+   testpmd> show port (port_id) rss-hash [key | algorithm]
 
 clear port
 ~~~~~~~~~~

https://lab.dpdk.org/results/dashboard/patchsets/28198/

UNH-IOL DPDK Community Lab


More information about the test-report mailing list