patch 'net/ice/base: fix return type of bitmap hamming weight' has been queued to stable release 22.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 15 17:26:27 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/17/24. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e31db1b871f0cc94a1120e560580c562d8089a23

Thanks.

Luca Boccassi

---
>From e31db1b871f0cc94a1120e560580c562d8089a23 Mon Sep 17 00:00:00 2001
From: Chinh Cao <chinh.t.cao at intel.com>
Date: Wed, 26 Jun 2024 12:41:11 +0100
Subject: [PATCH] net/ice/base: fix return type of bitmap hamming weight

[ upstream commit 509c55f699d1e13f38abaaf85df7bd9b585f5b87 ]

"count" is the returned value, and in this function, value of "count"
and "bit" are the same, so there is no reason why these values should be
declared as different types, and for returned value data type to be
different.

Fixes: 6d288fa5f72b ("net/ice/base: introduce and use bitmap hamming weight API")

Signed-off-by: Chinh Cao <chinh.t.cao at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ice/base/ice_bitops.h | 4 ++--
 drivers/net/ice/base/ice_switch.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/base/ice_bitops.h b/drivers/net/ice/base/ice_bitops.h
index c4ae2b9c8e..81f9dadc07 100644
--- a/drivers/net/ice/base/ice_bitops.h
+++ b/drivers/net/ice/base/ice_bitops.h
@@ -411,10 +411,10 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits)
  * Note that this function assumes it is operating on a bitmap declared using
  * ice_declare_bitmap.
  */
-static inline int
+static inline u16
 ice_bitmap_hweight(ice_bitmap_t *bm, u16 size)
 {
-	int count = 0;
+	u16 count = 0;
 	u16 bit = 0;
 
 	while (size > (bit = ice_find_next_bit(bm, size, bit))) {
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index a2581f404d..697b45ccf4 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -7124,7 +7124,7 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
 	ice_xor_bitmap(free_idx, used_idx, possible_idx, ICE_MAX_FV_WORDS);
 
 	/* return number of free indexes */
-	return (u16)ice_bitmap_hweight(free_idx, ICE_MAX_FV_WORDS);
+	return ice_bitmap_hweight(free_idx, ICE_MAX_FV_WORDS);
 }
 
 /**
@@ -7822,6 +7822,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	enum ice_status status = ICE_SUCCESS;
 	struct ice_sw_recipe *rm;
 	u8 i;
+	u16 cnt;
 
 	if (!ice_is_prof_rule(rinfo->tun_type) && !lkups_cnt)
 		return ICE_ERR_PARAM;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:37.113619586 +0100
+++ 0049-net-ice-base-fix-return-type-of-bitmap-hamming-weigh.patch	2024-07-15 16:19:34.600207147 +0100
@@ -1 +1 @@
-From 509c55f699d1e13f38abaaf85df7bd9b585f5b87 Mon Sep 17 00:00:00 2001
+From e31db1b871f0cc94a1120e560580c562d8089a23 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 509c55f699d1e13f38abaaf85df7bd9b585f5b87 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 3b71c1b7f5..5c17bcb674 100644
+index c4ae2b9c8e..81f9dadc07 100644
@@ -26 +27 @@
-@@ -418,10 +418,10 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits)
+@@ -411,10 +411,10 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits)
@@ -40 +41 @@
-index 711a6cfbbe..fa5bd94c58 100644
+index a2581f404d..697b45ccf4 100644
@@ -43 +44 @@
-@@ -7467,7 +7467,7 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
+@@ -7124,7 +7124,7 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
@@ -51,2 +52,3 @@
- static void ice_set_recipe_index(unsigned long idx, u8 *bitmap)
-@@ -8178,6 +8178,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+ /**
+@@ -7822,6 +7822,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+ 	enum ice_status status = ICE_SUCCESS;
@@ -55 +56,0 @@
- 	int status = ICE_SUCCESS;


More information about the stable mailing list