From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D382A00C4; Thu, 4 Jun 2020 20:40:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 89A7A1D5F2; Thu, 4 Jun 2020 20:40:49 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B57AE1C19E for ; Wed, 3 Jun 2020 04:47:56 +0200 (CEST) IronPort-SDR: oeq9XwKKdhl1I682ldvTqT7wjgpfEbJNNWEDHZ31RG0Sw3TpTKFbXAyryOJSjSF41L98kgLt41 YRqvFgrut3CQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 19:47:55 -0700 IronPort-SDR: JLZjSCAQ/rk7ntAzFWwfYwRSo5Ztp5gVLQ80ltHYgdwD7ygNyDCIMDU1xdkZ6wBKUoGntlcZX3 RdeIDWgaIj6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,466,1583222400"; d="scan'208";a="304451085" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 02 Jun 2020 19:47:55 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:54 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:55 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.52) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGqAygYFcC67gyNbeaK/qiDyM1632pLnIU3g7hzhE9WOHE4adoo0PsFjrBjO6LV3lNJDGjGTdPxIUWzw/t+HA8UQumar+lh9psr6yMqUqyW7Qc77rNN67JIzyi9QgvqiQpL3ytGTYe3025Pj8lle8jYAIPp9qovTPnYZcKJWTmCiIG9mnUlJ7+FCO28nWsyCMUSXzfvkWI4Fwedn0rpgfp3lPnTE26wQWT5qR2MlNsqzAoWcBE3LoPfOZq5y5gkW7pLRPYas/P3aNxQQbEeNOSSO2a7WiwGtTsyRXWpAGlAR/2BlZsCFH4i+U+j1XjxHRDeD+no8X66e9BNaeXp4GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sLQ0GuLaJNJHSRlEdr2tN02/3VeuUWLW46S775VtDpY=; b=lpw4Kd5cwUdjJNSuHfsT51uf6SCbo7G5ldkktyKYVUpwc6wWQ6MDQKDIZyyMehiwbV+4WlQJk2kRQiOo1CSFWRDtwUWXns4c7w5kJu164+UtGpvu2JKT+IIlZ1gpzal5r0nisZt8jdRMaM/6UN5L1OLfHPGVTcs/MCvvTCgIvsdRZ1v1E9wnvEEH7I8FiaTZW7teRr8gWr1BqGNW7jySKuwNpNhe5Ld7MZZ2I8CX72cSsD23to0pXDfP5jXaSvu/FMCntb5YtM12fmUELlxf2rDjaYDgbAZeRJBZjUsDJ2Tu4AtHuVY6HGqKnhjMuw/KAMqExOqLmh85t5LQ0oY4PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sLQ0GuLaJNJHSRlEdr2tN02/3VeuUWLW46S775VtDpY=; b=Fn92dqvw7ESJa+B/QuTShNkIGakx8e6iMh/4hwMW3FtY1iFVC3fbvMETlwx2NWfejst9mFgUmOa8TD7wQwXvtNcYjxKnMNmd186QxOkT9UYsI0ogieFhkHo3ZqI3etHP5/nmuPsidmbP1uqlawCjXk6QzJ+TLd5TT3giHRvYebQ= Received: from SN6PR11MB2847.namprd11.prod.outlook.com (2603:10b6:805:55::31) by SN6PR11MB2862.namprd11.prod.outlook.com (2603:10b6:805:5b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Wed, 3 Jun 2020 02:47:53 +0000 Received: from SN6PR11MB2847.namprd11.prod.outlook.com ([fe80::d89d:a96a:98c8:5acb]) by SN6PR11MB2847.namprd11.prod.outlook.com ([fe80::d89d:a96a:98c8:5acb%3]) with mapi id 15.20.3045.022; Wed, 3 Jun 2020 02:47:53 +0000 From: "Patil, Kiran" To: "Zhang, Qi Z" , "Yang, Qiming" CC: "dev@dpdk.org" , "Ye, Xiaolong" , "Stillwell Jr, Paul M" Thread-Topic: [PATCH 28/52] net/ice/base: return correct error code Thread-Index: AQHWOU/4thjDAWR240qM+wUr3cqNBqjGMBYw Date: Wed, 3 Jun 2020 02:47:53 +0000 Message-ID: References: <20200603024016.30636-1-qi.z.zhang@intel.com> <20200603024016.30636-29-qi.z.zhang@intel.com> In-Reply-To: <20200603024016.30636-29-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [134.134.136.222] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3c2191d-54ad-4cc6-5b3e-08d807688348 x-ms-traffictypediagnostic: SN6PR11MB2862: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:217; x-forefront-prvs: 04238CD941 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FLRBuLY53br4KjST4eM0XwdWSzKb+/uJJMqv0N11cRTJ7hNNAW49mo08GH0val8AC+lKa4e7RBK9DqVKthrckPBze262YdKrL1vHKfGgEXP+UJDv4NaRZEtHcHUqDsvJRj1STK8uVgO01C5ZoRyr4yQ7/rEM3GWnwAtHOjj48n3ZIKXkZz0E76Vc8V956jV6tOGFGQUlQsXcSvPywTw80WhnLJfLhyZWOZ0P5CZkh6qg9g3bp4ShflCvfJP5A7RY15WLOZ6yU5jcWDqef1IETcAWUUggu38x+iUuB2QeYTD852ZzEsEpzmCAey5QTh0pgeAlQW1XFI9NBoZwjlN+iw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2847.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(136003)(376002)(39860400002)(346002)(396003)(33656002)(9686003)(83380400001)(55016002)(52536014)(6636002)(8936002)(86362001)(478600001)(4326008)(107886003)(26005)(110136005)(2906002)(66556008)(53546011)(66946007)(66476007)(186003)(64756008)(6506007)(7696005)(316002)(8676002)(5660300002)(71200400001)(66446008)(54906003)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: OFEwHU9phg1DLzP/Qu41kNkR80p4VG79YlE8a4K6qtQuP3UWJ5htpirg40hoKAunwtb1BozNEve9iplPshB+d3TTK2hPpBRZN+DmS8zSNLrnGESJ2WyaBPLElHzUY5XYhJYr1ZOtXrBdQqdWGpkmGtTBgwJ251g9oczj3kpLoASZTUyd5ZIIeuKqLP2OUoaQWBVfN6kp2pK53qlhYrVrPnM+cWIaMPs3Lv228PXTHRJPtyhq5gWGN5fFxQQmSWnXdlOUOIfC4GBIPNiAWfIeKoAuxg6fCVm0nnLPSlZ3b9EqPh3OSUS8H7DlYSIyWh5nYJnjQrTZ4TfpZZq1KCvOObs6AY4sxdYniG2xjdW8I9fyBW3S/coH40C4B887HSpoKcnvy65UpPh7YpDMTa7XyJRqdinlCZ0HdeHblGWcrd4398QYOLcqA6O+eGmPAPd2R2tBY9YM2zbLTXQrtjya1qo3ZbHYET6K/R6rMeqRqZiRINVLMF7FxkC7lBxsc4Hs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a3c2191d-54ad-4cc6-5b3e-08d807688348 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2020 02:47:53.2536 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wz5IV19BcykISDddodSixx5GTl5UwZpAmYs4yMQFaBFEdUTANPp1TJoEldNd91AMfZK0IOZx5dw4wnNtKfj2Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2862 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Thu, 04 Jun 2020 20:40:47 +0200 Subject: Re: [dpdk-dev] [PATCH 28/52] net/ice/base: return correct error code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ACK -----Original Message----- From: Zhang, Qi Z =20 Sent: Tuesday, June 2, 2020 7:40 PM To: Yang, Qiming Cc: dev@dpdk.org; Ye, Xiaolong ; Zhang, Qi Z ; Patil, Kiran ; Stillwell Jr, Paul M= Subject: [PATCH 28/52] net/ice/base: return correct error code Return ICE_ERR_DOES_NOT_EXIST return code if admin command error code is IC= E_AQ_RC_ENOENT (not exist). ice_aq_sw_rules is used when switch rule is get= ting added/deleted/updated. In case of delete/update switch rule, admin com= mand can return ICE_AQ_RC_ENOENT error code if such rule does not exist, he= nce return ICE_ERR_DOES_NOT_EXIST error code from ice_aq_sw_rule, so that c= aller of this fucnction can decide how to handle ICE_ERR_DOES_NOT_EXIST. Allow proper cleanup of internal data structures from ice_rem_adv_rule func= tion if ice_aq_sw_rules return error code ICE_ERR_DOES_NOT_EXIST otherwise = per recipe:rule list will never become empty. Signed-off-by: Kiran Patil Signed-off-by: Paul M. Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_s= witch.c index 6387f9b84..fa3a59e51 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -1868,6 +1868,7 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u= 16 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; =20 ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); =20 @@ -1881,7 +1882,12 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, = u16 rule_list_sz, desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); desc.params.sw_rules.num_rules_fltr_entry_index =3D CPU_TO_LE16(num_rules); - return ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd); + status =3D ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd); + if (opc !=3D ice_aqc_opc_add_sw_rules && + hw->adminq.sq_last_status =3D=3D ICE_AQ_RC_ENOENT) + status =3D ICE_ERR_DOES_NOT_EXIST; + + return status; } =20 /** @@ -7354,7 +7360,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lk= up_elem *lkups, status =3D ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule, rule_buf_sz, 1, ice_aqc_opc_remove_sw_rules, NULL); - if (status =3D=3D ICE_SUCCESS) { + if (status =3D=3D ICE_SUCCESS || status =3D=3D ICE_ERR_DOES_NOT_EXIST) { ice_acquire_lock(rule_lock); LIST_DEL(&list_elem->list_entry); ice_free(hw, list_elem->lkups); -- 2.13.6