All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next v2] ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS
@ 2022-04-20 10:55 Wojciech Drewek
  2022-04-25 10:40 ` Penigalapati, Sandeep
  0 siblings, 1 reply; 2+ messages in thread
From: Wojciech Drewek @ 2022-04-20 10:55 UTC (permalink / raw)
  To: intel-wired-lan

When number of words exceeds ICE_MAX_CHAIN_WORDS, -ENOSPC
should be returned not -EINVAL. Do not overwrite this
error code in ice_add_tc_flower_adv_fltr.

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Suggested-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

---
v2: change title as Paul suggested
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 5 ++++-
 drivers/net/ethernet/intel/ice/ice_tc_lib.c | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 968b96a6e0ac..79ab2128857f 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -6265,9 +6265,12 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 				word_cnt++;
 	}
 
-	if (!word_cnt || word_cnt > ICE_MAX_CHAIN_WORDS)
+	if (!word_cnt)
 		return -EINVAL;
 
+	if (word_cnt > ICE_MAX_CHAIN_WORDS)
+		return -ENOSPC;
+
 	/* locate a dummy packet */
 	profile = ice_find_dummy_packet(lkups, lkups_cnt, rinfo->tun_type);
 
diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
index 5b300c8cb009..ce6b5f31a1c8 100644
--- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
@@ -781,7 +781,6 @@ ice_add_tc_flower_adv_fltr(struct ice_vsi *vsi,
 	} else if (ret) {
 		NL_SET_ERR_MSG_MOD(tc_fltr->extack,
 				   "Unable to add filter due to error");
-		ret = -EIO;
 		goto exit;
 	}
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS
  2022-04-20 10:55 [Intel-wired-lan] [PATCH net-next v2] ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS Wojciech Drewek
@ 2022-04-25 10:40 ` Penigalapati, Sandeep
  0 siblings, 0 replies; 2+ messages in thread
From: Penigalapati, Sandeep @ 2022-04-25 10:40 UTC (permalink / raw)
  To: intel-wired-lan

>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
>Wojciech Drewek
>Sent: Wednesday, April 20, 2022 4:26 PM
To: intel-wired-lan@lists.osuosl.org
>Subject: [Intel-wired-lan] [PATCH net-next v2] ice: return ENOSPC when
>exceeding ICE_MAX_CHAIN_WORDS
>
>When number of words exceeds ICE_MAX_CHAIN_WORDS, -ENOSPC should
>be returned not -EINVAL. Do not overwrite this error code in
>ice_add_tc_flower_adv_fltr.
>
>Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
>Suggested-by: Marcin Szycik <marcin.szycik@linux.intel.com>
>Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>
>---
>v2: change title as Paul suggested
>---
> drivers/net/ethernet/intel/ice/ice_switch.c | 5 ++++-
>drivers/net/ethernet/intel/ice/ice_tc_lib.c | 1 -
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-25 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 10:55 [Intel-wired-lan] [PATCH net-next v2] ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS Wojciech Drewek
2022-04-25 10:40 ` Penigalapati, Sandeep

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.