All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Patil, Kiran" <kiran.patil@intel.com>
To: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nhorman@redhat.com" <nhorman@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"Bowers, AndrewX" <andrewx.bowers@intel.com>
Subject: RE: [net-next 05/15] ice: return correct error code from ice_aq_sw_rules
Date: Wed, 29 Jul 2020 16:26:33 +0000	[thread overview]
Message-ID: <SN6PR11MB2847EA0F57447F0CF6650B52FE700@SN6PR11MB2847.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200729162405.1596435-6-anthony.l.nguyen@intel.com>

ACK

-----Original Message-----
From: Nguyen, Anthony L <anthony.l.nguyen@intel.com> 
Sent: Wednesday, July 29, 2020 9:24 AM
To: davem@davemloft.net
Cc: Patil, Kiran <kiran.patil@intel.com>; netdev@vger.kernel.org; nhorman@redhat.com; sassmann@redhat.com; Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Bowers, AndrewX <andrewx.bowers@intel.com>
Subject: [net-next 05/15] ice: return correct error code from ice_aq_sw_rules

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>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@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 ccbe1cc64295..c3a6c41385ee 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -495,6 +495,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 && @@ -506,7 +507,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.26.2


  reply	other threads:[~2020-07-29 16:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:23 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 Tony Nguyen
2020-07-29 16:23 ` [net-next 01/15] ice: Implement LFC workaround Tony Nguyen
2020-07-29 16:23 ` [net-next 02/15] ice: Fix link broken after GLOBR reset Tony Nguyen
2020-07-29 16:23 ` [net-next 03/15] ice: fix link event handling timing Tony Nguyen
2020-07-29 16:23 ` [net-next 04/15] ice: restore VF MSI-X state during PCI reset Tony Nguyen
2020-07-29 16:23 ` [net-next 05/15] ice: return correct error code from ice_aq_sw_rules Tony Nguyen
2020-07-29 16:26   ` Patil, Kiran [this message]
2020-07-29 16:23 ` [net-next 06/15] ice: fix overwriting TX/RX descriptor values when rebuilding VSI Tony Nguyen
2020-07-29 16:23 ` [net-next 07/15] ice: Add RL profile bit mask check Tony Nguyen
2020-07-29 16:23 ` [net-next 08/15] ice: Adjust scheduler default BW weight Tony Nguyen
2020-07-29 16:23 ` [net-next 09/15] ice: distribute Tx queues evenly Tony Nguyen
2020-07-29 16:24 ` [net-next 10/15] ice: need_wakeup flag might not be set for Tx Tony Nguyen
2020-07-29 16:24 ` [net-next 11/15] ice: Allow all VLANs in safe mode Tony Nguyen
2020-07-29 16:31   ` Creeley, Brett
2020-07-29 16:24 ` [net-next 12/15] ice: cleanup VSI on probe fail Tony Nguyen
2020-07-29 16:24 ` [net-next 13/15] ice: reduce scope of variable Tony Nguyen
2020-07-29 16:24 ` [net-next 14/15] ice: disable no longer needed workaround for FW logging Tony Nguyen
2020-07-29 16:24 ` [net-next 15/15] ice: fix unused parameter warning Tony Nguyen
2020-07-29 20:15 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 David Miller

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=SN6PR11MB2847EA0F57447F0CF6650B52FE700@SN6PR11MB2847.namprd11.prod.outlook.com \
    --to=kiran.patil@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /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.