[dpdk-stable] patch 'net/ice/base: calculate logical PF ID' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:16 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang at intel.com>
Date: Thu, 16 Sep 2021 17:52:53 +0800
Subject: [PATCH] net/ice/base: calculate logical PF ID
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 ]

In some devices, the function numbers used are non-contiguous. For
example, some two port devices will report as functions 0 and 2.

When distributing RSS and FDIR masks, which are global resources across
the active devices, it is required to have a contiguous PF id, which can
be described as a logical PF id. In the case above, function 0 would
have a logical PF id of 0, and function 2 would have a logical PF id of
1.

Using logical PF id can properly describe which slice of resources can
be used by a particular PF.

Signed-off-by: Dan Nowlin <dan.nowlin at intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
Acked-by: Junfeng Guo <junfeng.guo at intel.com>
---
 drivers/net/ice/base/ice_common.c    | 19 +++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.c |  2 +-
 drivers/net/ice/base/ice_type.h      |  1 +
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index be33ee252d..2b53f78512 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -2017,6 +2017,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
 	ice_recalc_port_limited_caps(hw, &func_p->common_cap);
 }
 
+/**
+ * ice_func_id_to_logical_id - map from function id to logical pf id
+ * @active_function_bitmap: active function bitmap
+ * @pf_id: function number of device
+ */
+static int ice_func_id_to_logical_id(u32 active_function_bitmap, u8 pf_id)
+{
+	u8 logical_id = 0;
+	u8 i;
+
+	for (i = 0; i < pf_id; i++)
+		if (active_function_bitmap & BIT(i))
+			logical_id++;
+
+	return logical_id;
+}
+
 /**
  * ice_parse_valid_functions_cap - Parse ICE_AQC_CAPS_VALID_FUNCTIONS caps
  * @hw: pointer to the HW struct
@@ -2034,6 +2051,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
 	dev_p->num_funcs = ice_hweight32(number);
 	ice_debug(hw, ICE_DBG_INIT, "dev caps: num_funcs = %d\n",
 		  dev_p->num_funcs);
+
+	hw->logical_pf_id = ice_func_id_to_logical_id(number, hw->pf_id);
 }
 
 /**
diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index d74fecbf5b..42eda0b4b4 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -3125,7 +3125,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
 	per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs;
 
 	hw->blk[blk].masks.count = per_pf;
-	hw->blk[blk].masks.first = hw->pf_id * per_pf;
+	hw->blk[blk].masks.first = hw->logical_pf_id * per_pf;
 
 	ice_memset(hw->blk[blk].masks.masks, 0,
 		   sizeof(hw->blk[blk].masks.masks), ICE_NONDMA_MEM);
diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h
index 6b8d44f0b4..1aae9fe721 100644
--- a/drivers/net/ice/base/ice_type.h
+++ b/drivers/net/ice/base/ice_type.h
@@ -864,6 +864,7 @@ struct ice_hw {
 	u8 revision_id;
 
 	u8 pf_id;		/* device profile info */
+	u8 logical_pf_id;
 
 	u16 max_burst_size;	/* driver sets this value */
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:05.270966334 +0800
+++ 0072-net-ice-base-calculate-logical-PF-ID.patch	2021-11-10 14:17:01.834079724 +0800
@@ -1 +1 @@
-From 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 Mon Sep 17 00:00:00 2001
+From 60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 ]
@@ -18,2 +20,0 @@
-Cc: stable at dpdk.org
-
@@ -30 +31 @@
-index 641859f752..6004c95625 100644
+index be33ee252d..2b53f78512 100644
@@ -33 +34 @@
-@@ -2535,6 +2535,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
+@@ -2017,6 +2017,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
@@ -57 +58 @@
-@@ -2552,6 +2569,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
+@@ -2034,6 +2051,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
@@ -67 +68 @@
-index fd98b3837d..8a6fc8a9a5 100644
+index d74fecbf5b..42eda0b4b4 100644
@@ -70 +71 @@
-@@ -3432,7 +3432,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
+@@ -3125,7 +3125,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
@@ -80 +81 @@
-index 56ee628f10..b1e03b10ff 100644
+index 6b8d44f0b4..1aae9fe721 100644
@@ -83 +84 @@
-@@ -1132,6 +1132,7 @@ struct ice_hw {
+@@ -864,6 +864,7 @@ struct ice_hw {


More information about the stable mailing list