From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CEDDEA00C3; Fri, 13 May 2022 11:56:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E1614282E; Fri, 13 May 2022 11:56:56 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 80A4A40DDE for ; Fri, 13 May 2022 11:56:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652435814; x=1683971814; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PZbeXq+z7nvhvcJ0shb4vbZDaIRLuuKflsj/i367lzk=; b=JHaC/Uzb9XQudLasjRcVeik58jFIknZTYvk9j/JvKpnyMaSK8lDll+r1 xn7Uv9kNLUoGyAadRxbRLCfY1/+Qu4qgtmLT2Kgacg6zN1q3yQWZJ8DmI wixBGgZCZA0p1vqN+aAVRhvvdkb5ZeLuYTkeA0ImGBoscTq+WR5e0B0PI 7xx7H3b5Jsd1qW47scAF+lgfNaXNA1do95c8MmU4tHkv1xzHpWki0WCDz icCruTPJxPKgwq8yTRp1pqx5TrPE0Wy/SoP5CU13kW3jjNX3tMymjDRmn jkgVnGy+LmzIoYO+TzvhcEqlczfl8m2uTI1GkN2Cab58c0R0XsnHylwkt w==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="270202771" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="270202771" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 02:56:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="896173468" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 13 May 2022 02:56:53 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 02:56:52 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 02:56:52 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 13 May 2022 02:56:52 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 13 May 2022 02:56:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=il1r2t8QoDxECPum4tS82UbNpIK/6S1w+7Nt6bIJr+ajVxCCpBuhckIzt8dTBA/mkvvJmeiDUAdhSMorKunpGeknNrM9DaDGQ1wu1iqM2PjdDxFB8PiVa6HULoXS3BCMmOZ1ibF/LN9y19XRONpNEHsNS5ddvPKscOQ/WdFgcGC2nrRl2vpcIWo88qZichjPHkWUF6SSUMmnucZzBwCFV02SeMeyZzmeaOFEReSjIJRSchqsI9W3HDmkoqbFJTdfZOB4ILVzymOBUczN6/sm2x3UKgqWIzcFQgO2AW2rHeFdsKccovRs3J9kH1M11XP5mpcztUdH1FTMOg3jGMh7jA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WFzj/SvgikhuWVk+BB3ePL9SD1ljdrPuWer3fz6fisc=; b=AJqI4u4gSSKqA/2ki4D6nDoF882lfQJTzO5WdChEx2nRXgAOqibz6Z4+tM3SdqlpuSypipJQIrDbfY7/NDIy52ZaEKDF7iokGDh8jXJIi4qoud71KQGcHB1h4if/HFHYg5A3OWSOK7/y7x3jP22vBdtW9nhn5nZwjJZqNN81Da9J7M/xkOAxmU1l341WDlQFdD9HcSBIPl8VYRA9E6YWnY3EB1lkjxzTxzrul4Rih0RDVeeVrTJ89/47+8aNlSZg9M8oPOTKMV3X4lhOn/ZlFP8jWgSX1QRywIdF2BfnKMcdsWBL5kNGv9AN18Ug7oDMQ+xrpKm2lAN6nKAwKMhPKA== 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 Received: from DS7PR11MB6015.namprd11.prod.outlook.com (2603:10b6:8:74::17) by DM5PR11MB1467.namprd11.prod.outlook.com (2603:10b6:4:a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Fri, 13 May 2022 09:56:42 +0000 Received: from DS7PR11MB6015.namprd11.prod.outlook.com ([fe80::f943:ae81:e5d8:d8ef]) by DS7PR11MB6015.namprd11.prod.outlook.com ([fe80::f943:ae81:e5d8:d8ef%8]) with mapi id 15.20.5250.013; Fri, 13 May 2022 09:56:42 +0000 From: "Connolly, Padraig J" To: "Zhang, Peng1X" , "Yang, Qiming" , "Zhang, Qi Z" , "dev@dpdk.org" CC: "Zhang, Peng1X" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/ice: fix DCF state checking mechanism Thread-Topic: [PATCH v2] net/ice: fix DCF state checking mechanism Thread-Index: AQHYZQydhFIdo6jFvEq0+T05JcxeMK0clMvA Date: Fri, 13 May 2022 09:56:42 +0000 Message-ID: References: <20220511154930.509436-1-peng1x.zhang@intel.com> In-Reply-To: <20220511154930.509436-1-peng1x.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.401.20 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 05314073-3212-4818-9521-08da34c6e1dd x-ms-traffictypediagnostic: DM5PR11MB1467:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WiXarsAibzB4llrtYkZEalyJF1XgKGFSsEcjqlSTyIzFI0cPVCBmQlzhlW3mASaLKLEVnejkQ4IzBsBl783eGrE817kGpnbhcKoM50UGD761/fhSiEdhUcWJ1g8tJ/8phj8ZWL1s84ONaQAcB5YEUzSLQbA7Vzp2zuqwwBDiucZPUfFYhmdEauIBiaznTMmr92rgbS0TRhLUMLPKNlOodMU+lho+skyGFtSNEuNBndI6ZbG0EoH3z9GEvFm489QIrJxW4GB1gUlYpbrj51C+HHKES+RsUKcBheaYTzojPLIR3/kl2NNZu8PisHD5SAO2zu/1NWeCHmdpzzlIHJxVscv7yG6hODGdXsrfeA5supV/LYDkzbBkr+AygzV7ljefhM18mFp7FKIiS/B+X5+lKVEE2JZF74A2wkmClfo/gNmReOfkFAH7VJb+5X2UAv5h1Sjpb8UDRqulJeg2k3drIXqTuGz1wZhxjA651pL1MvYsKcX4vK5R6P1S1cgHfjVUO9h4JHUfFIHc25D6sqJ7+tyS51+Qz+zYPoLuKpSYmj1IzuiGV8Pd6CpCDSlm18LntRWhK8Ud1CdN4bRjmS6EcKgMntL95yzCZ7WJxgasZUTFRYdXyyKI7h0Girdm7AxRSEYV0eFnUl7M8wHpGzYymsmBKp/ViWt3LzDxJO0NKpAgTDd7sfsOhEtpKm7D+ZgxhMaUCrKNDfFVA209xvd/5Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR11MB6015.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6506007)(86362001)(53546011)(71200400001)(7696005)(508600001)(38070700005)(8936002)(83380400001)(186003)(26005)(122000001)(9686003)(55016003)(5660300002)(52536014)(33656002)(2906002)(110136005)(54906003)(316002)(66476007)(4326008)(64756008)(66556008)(66446008)(66946007)(8676002)(450100002)(76116006)(82960400001)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DvJWCrAIHl6JjXFl6Vp7ZXrtgE8HYV8LLgq7cFOi2zEXnbw+6/klRK23icUH?= =?us-ascii?Q?LOv0+yRH1rmyQggKZnz6mfGTL3D+tELJ0wVU78aUWBTv359ABoW7TwuaJ96T?= =?us-ascii?Q?jGBvYXIrRqIJVUH2yXrayPagIuO3Yu3DKg7OYeNUlXHpn0l8LjZDvBAmdH9E?= =?us-ascii?Q?Ny1r8+kF1Ba0qjGlbEGjacgOb7kR7II0meH9VTMR9J6S230tc0TwVp9rm/Wm?= =?us-ascii?Q?nsU1mFD7h+3sM/zc5ZA5dRlF7iyRM8TOv8l9JOWXk07IsQiGs1NIg2KTbhzm?= =?us-ascii?Q?9p7i1B8ebGkcoZjItT1dJOSX+KX7dMmb7OmTyGH9Wia/+9cvysG5TXedo1XJ?= =?us-ascii?Q?OTwPnAsWziadPzr6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YjX?= =?us-ascii?Q?vgm86IpYIOcGkszYzT8RyWEdKpuqXbJSUJpQE6Y7Q0lEokzAo59YMdz1d7bk?= =?us-ascii?Q?FSdnpeUtGGB/ySHz0xH/qwvkN8g16S79xGyDD2RcofZa9j8CIisrZH0rHLTZ?= =?us-ascii?Q?iiKoVW5BVjDFaKHwNIDaS+TGMH8QKIQdOro/d/A6LPeCjV6b1AZ5LmGOPWhU?= =?us-ascii?Q?UA12iKbYib5f9/ey8+pMXDp4a16YQwZPdXM6LORF4vVMF7G8Dn8Q6vVrw6XA?= =?us-ascii?Q?ZZ0VSPrRhTc78OMbL3+KNpYqB6PIFrtpa/6klEy0P8XDLXHbtg4rIwg8zlIi?= =?us-ascii?Q?VFWYUxffLYTJJqqz4AYEDX8JPtFAKEqJW/GUXQfI8v7o3vnaqaPAA7AYXaHs?= =?us-ascii?Q?CxqGj0jV8JGOUSpEronZBVjOyXBTcJpxmEwCnXpru6KYjSUEcTzgyoCrcR3k?= =?us-ascii?Q?zvO6f7CKu9xrT83kS0OxjYa45thO0tYZQ7NghRK7gdurOFcpMjLPmGergwX/?= =?us-ascii?Q?p0LV6zucxhWSNo7yMaXXAVppgpI9BpA=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB6015.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05314073-3212-4818-9521-08da34c6e1dd X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 09:56:42.3754 (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: Pzmqg0ltg3C6o35NbVlBa7UzdtHZiMTuut6OFr5x3HB7Qo/mnj14O4PfN+hyPctTG64+2Vz5MMxSHvt9pl1Kmqxd95xoyd0iF/IIs0QG7q0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1467 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: peng1x.zhang@intel.com > Sent: Wednesday, May 11, 2022 4:50 PM > To: Yang, Qiming ; Zhang, Qi Z > ; dev@dpdk.org > Cc: Zhang, Peng1X ; stable@dpdk.org > Subject: [PATCH v2] net/ice: fix DCF state checking mechanism >=20 > From: Peng Zhang >=20 > DCF state previous checking mechanism can not fully detect DCF state > whether is on or not,so PMD will report uncorrect error code in some case= s > and mislead user.Fix DCF state checking mechanism which will mention user > resource temporarily unavailable when DCF state is not on. >=20 > Fixes: 285f63fc6bb7 ("net/ice: track DCF state of PF") > Cc: stable@dpdk.org >=20 > Signed-off-by: Peng Zhang > --- > drivers/net/ice/ice_dcf_parent.c | 3 --- > drivers/net/ice/ice_switch_filter.c | 20 ++++++-------------- > 2 files changed, 6 insertions(+), 17 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_parent.c > b/drivers/net/ice/ice_dcf_parent.c > index 2f96dedcce..5b02e0197f 100644 > --- a/drivers/net/ice/ice_dcf_parent.c > +++ b/drivers/net/ice/ice_dcf_parent.c > @@ -121,7 +121,6 @@ ice_dcf_vsi_update_service_handler(void *param) > struct ice_dcf_hw *hw =3D reset_param->dcf_hw; > struct ice_dcf_adapter *adapter =3D > container_of(hw, struct ice_dcf_adapter, real_hw); > - struct ice_adapter *parent_adapter =3D &adapter->parent; >=20 > pthread_detach(pthread_self()); >=20 > @@ -130,8 +129,6 @@ ice_dcf_vsi_update_service_handler(void *param) > rte_spinlock_lock(&vsi_update_lock); >=20 > if (!ice_dcf_handle_vsi_update_event(hw)) { > - __atomic_store_n(&parent_adapter->dcf_state_on, true, > - __ATOMIC_RELAXED); > ice_dcf_update_vf_vsi_map(&adapter->parent.hw, > hw->num_vfs, hw->vf_vsi_map); > } > diff --git a/drivers/net/ice/ice_switch_filter.c > b/drivers/net/ice/ice_switch_filter.c > index 36c9bffb73..3d36c63e97 100644 > --- a/drivers/net/ice/ice_switch_filter.c > +++ b/drivers/net/ice/ice_switch_filter.c > @@ -403,13 +403,6 @@ ice_switch_create(struct ice_adapter *ad, > goto error; > } >=20 > - if (ice_dcf_adminq_need_retry(ad)) { > - rte_flow_error_set(error, EAGAIN, > - RTE_FLOW_ERROR_TYPE_ITEM, NULL, > - "DCF is not on"); > - goto error; > - } > - > ret =3D ice_add_adv_rule(hw, list, lkups_cnt, rule_info, &rule_added); > if (!ret) { > filter_conf_ptr =3D rte_zmalloc("ice_switch_filter", @@ -432,6 > +425,9 @@ ice_switch_create(struct ice_adapter *ad, > filter_conf_ptr->fltr_status =3D ICE_SW_FLTR_ADDED; >=20 > flow->rule =3D filter_conf_ptr; > + > + if (ad->hw.dcf_enabled) > + __atomic_store_n(&ad->dcf_state_on, true, > __ATOMIC_RELAXED); > } else { > if (ice_dcf_adminq_need_retry(ad)) > ret =3D -EAGAIN; > @@ -490,13 +486,6 @@ ice_switch_destroy(struct ice_adapter *ad, > return -rte_errno; > } >=20 > - if (ice_dcf_adminq_need_retry(ad)) { > - rte_flow_error_set(error, EAGAIN, > - RTE_FLOW_ERROR_TYPE_ITEM, NULL, > - "DCF is not on"); > - return -rte_errno; > - } > - > ret =3D ice_rem_adv_rule_by_id(hw, &filter_conf_ptr- > >sw_query_data); > if (ret) { > if (ice_dcf_adminq_need_retry(ad)) > @@ -508,6 +497,9 @@ ice_switch_destroy(struct ice_adapter *ad, > RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > "fail to destroy switch filter rule"); > return -rte_errno; > + } else { > + if (ad->hw.dcf_enabled) > + __atomic_store_n(&ad->dcf_state_on, true, > __ATOMIC_RELAXED); > } >=20 > ice_switch_filter_rule_free(flow); > -- > 2.25.1 Tested-by: Padraig Connolly