All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH S50 05/15] ice: return correct error code from ice_aq_sw_rules
Date: Mon, 13 Jul 2020 13:53:08 -0700	[thread overview]
Message-ID: <20200713205318.32425-5-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200713205318.32425-1-anthony.l.nguyen@intel.com>

From: Kiran Patil <kiran.patil@intel.com>

Return ICE_ERR_DOES_NOT_EXIST return code if admin command error code is
ICE_AQ_RC_ENOENT (not exist). ice_aq_sw_rules is used when switch
rule is getting added/deleted/updated. In case of delete/update
switch rule, admin command can return ICE_AQ_RC_ENOENT error code
if such rule does not exist, hence return ICE_ERR_DOES_NOT_EXIST error
code from ice_aq_sw_rule, so that caller of this function can decide
how to handle ICE_ERR_DOES_NOT_EXIST.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index ee434b8d794d..cd23c15d6579 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -481,6 +481,7 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
 		u8 num_rules, enum ice_adminq_opc opc, struct ice_sq_cd *cd)
 {
 	struct ice_aq_desc desc;
+	enum ice_status status;
 
 	if (opc != ice_aqc_opc_add_sw_rules &&
 	    opc != ice_aqc_opc_update_sw_rules &&
@@ -492,7 +493,12 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
 	desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
 	desc.params.sw_rules.num_rules_fltr_entry_index =
 		cpu_to_le16(num_rules);
-	return ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+	status = ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+	if (opc != ice_aqc_opc_add_sw_rules &&
+	    hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT)
+		status = ICE_ERR_DOES_NOT_EXIST;
+
+	return status;
 }
 
 /* ice_init_port_info - Initialize port_info with switch configuration data
-- 
2.20.1


  parent reply	other threads:[~2020-07-13 20:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 20:53 [Intel-wired-lan] [PATCH S50 01/15] ice: Implement LFC workaround Tony Nguyen
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 02/15] ice: Fix link broken after GLOBR reset Tony Nguyen
2020-07-16 17:48   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 03/15] ice: fix link event handling timing Tony Nguyen
2020-07-16 17:46   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 04/15] ice: restore VF MSI-X state during PCI reset Tony Nguyen
2020-07-16 17:46   ` Bowers, AndrewX
2020-07-13 20:53 ` Tony Nguyen [this message]
2020-07-16 17:45   ` [Intel-wired-lan] [PATCH S50 05/15] ice: return correct error code from ice_aq_sw_rules Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 06/15] ice: fix overwriting TX/RX descriptor values when rebuilding VSI Tony Nguyen
2020-07-16 17:49   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 07/15] ice: Add RL profile bit mask check Tony Nguyen
2020-07-16 17:47   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 08/15] ice: Adjust scheduler default BW weight Tony Nguyen
2020-07-16 17:47   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 09/15] ice: distribute Tx queues evenly Tony Nguyen
2020-07-16 17:50   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 10/15] ice: need_wakeup flag might not be set for Tx Tony Nguyen
2020-07-16 17:49   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 11/15] ice: Allow all VLANs in safe mode Tony Nguyen
2020-07-16 17:46   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 12/15] ice: cleanup VSI on probe fail Tony Nguyen
2020-07-16 17:48   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 13/15] ice: reduce scope of variable Tony Nguyen
2020-07-16 17:49   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 14/15] ice: disable no longer needed workaround for FW logging Tony Nguyen
2020-07-16 17:48   ` Bowers, AndrewX
2020-07-13 20:53 ` [Intel-wired-lan] [PATCH S50 15/15] ice: fix unused parameter warning Tony Nguyen
2020-07-16 17:48   ` Bowers, AndrewX
2020-07-16 17:47 ` [Intel-wired-lan] [PATCH S50 01/15] ice: Implement LFC workaround Bowers, AndrewX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713205318.32425-5-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.