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 96FC9A0C45; Fri, 24 Sep 2021 07:44:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F11B412B8; Fri, 24 Sep 2021 07:44:17 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id CF73D40142; Fri, 24 Sep 2021 07:44:15 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="222119056" X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="222119056" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 22:44:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="653907889" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP; 23 Sep 2021 22:44:14 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 23 Sep 2021 22:44:14 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 23 Sep 2021 22:44:14 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 23 Sep 2021 22:44:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OhO0XhMxbXijZo7iVKFvWa1MOFV7u7bN15gRbYCiKaYDdqxvDdF0+CDH3cgCagJmLyBsoYxksJM6D/XcyRsTNwTXpr5hZStFoZqhg/NK0/XrUBCD32LkDj35DMU1CiKC/qWuRZ4Z9xBlOEN3kYo1OFh7wI/5Y+mkZ+HErDVdNjiVSuMFMCjdaUPItZTjFbgCQ+A7bVdT4VKJKeydJ/GY8doIKEkESBHbd3zuRhD+npmgbGiUQvxS94f1mDYd4LR2hd27tMGGjVsVQ4IzLbwV4UsDkN865t1y8G4rIs7C8G4la2+7iitzzJ77K50sk65dmMOFldvgjmqvXHwcDAsBIQ== 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; bh=Ci4CiHnzhtYiZNvzG3RW1dq3CMxOQtSKtJoPeGZnxBM=; b=Lxh6bW5/Q6A7ywMM6t4dmUbdUMnY25fMid0BfFogT7/foPdvhETExVbEe8O5jS6U1yz0elFIivSUmlAsnAIOmwYCqjKivSVD0dXjiO0kNeIuW8L/W0mgEkThZ8JHCW9gqH9gerF3MVGhHjBksFi1GL79WEE6HJWpA4tI93YFzKMTpZFdsXnBIQTvCyf81arpPgqeA0KQQj9ZXK3dbG8wJIFolYo66en45g46buNo4kLGY+QHyTvdGTeSnOcysBaA/2S8drKsZwtOLRzMOwKbhMU1kqbHLrkvSMUgLSNAjXK9foLm0sKqoJ8aLNDHGIAkH6XqC4T7/9fGj+gwYYfemw== 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=Ci4CiHnzhtYiZNvzG3RW1dq3CMxOQtSKtJoPeGZnxBM=; b=xu42ficySRSlmAJFDKOSsQOWztzDb7dAZneFADViRuADRKwg96cFpQIzCxWTSwwlKnKtUVJVAo5OmYiSqnUj1cHfStiTJ312RYhyRnXJpe17hWjHs93hKXHlSWzIdFgyV9NPQfVikuOTeNNicRblqgUP8KtzAmRYo9KSQt3J36g= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN7PR11MB2802.namprd11.prod.outlook.com (2603:10b6:406:b7::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Fri, 24 Sep 2021 05:43:59 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7%3]) with mapi id 15.20.4544.014; Fri, 24 Sep 2021 05:43:59 +0000 From: "Wang, Haiyue" To: "Yu, DapengX" , "Yang, Qiming" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ice: retry getting VF VSI map after it fails Thread-Index: AQHXqRXpE6BcZsyrCkGnBWhIBaZAiquyuk1w Date: Fri, 24 Sep 2021 05:43:59 +0000 Message-ID: References: <20210914030858.202578-1-dapengx.yu@intel.com> In-Reply-To: <20210914030858.202578-1-dapengx.yu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f573ba8e-e237-420f-743a-08d97f1e4ead x-ms-traffictypediagnostic: BN7PR11MB2802: 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:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dOJj/zZ2N1l5yZhlqoU+QgieCPxylMpDZLR0FdGy5PHJbvgNUn6MU88zsWF6Ny81wbV8hi74oigKbdR+SiXeV4l3HjUeCE2FFQz4+Lf+GCfyoVx22vFuhNQBMQHrctyNvq607+KEYXXQArBXoFzRNqtjjdVZk2wjJ0HcotADNfSA+HnG9/GrZONUqy1MFhk2m/TP8L48EGWNkWAMOy12WznqSyP9iumrM2ZuXdcilJ0EJPxS1Ia4bqTl7PlNMqkv/o81agW6g3CjCWz7+4c8vmBcymrmZFQ5PNCx5fCGEZYO0F+86uRNoprxLF0NcnoApTtJ2vu1lzJkVES0yv1mWH+PEDXdNH6rcWgpWLi7xlBen8GSA/ZwB1F6nQInxjsF3lTHDeyaKuTV3CQKIDSD4/tw+PzYN/GSiox72mkgXaPG0IvmX3DAfqYwzfGSJMesLNYQMYtIL3wL6GDdE8K24Rvm4aiGe30W+Py6jXSjj3EyWErFY/SvxFt24TXRpa2b8rN4x3coUVKULeRickn8IM37Hpo8mE3cAxz4qLtDeAtWbYJ9bUaq4ac/AXDgoufRtj+w0jO+fmqeBTQiqc4v5jmFbJYsLqcGCg+jtLaU06KV9gkyHcH+BpF7859INwLwhXsKxB4v0KFwtBwpf2HwKv2r26h9XCpX4btauc+AzVtBiwAkC9GnT4BUx08Y4KdtesVQZd9jq13AaS9GycJykQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6636002)(2906002)(33656002)(54906003)(8676002)(4326008)(122000001)(53546011)(9686003)(7696005)(52536014)(55016002)(71200400001)(508600001)(83380400001)(5660300002)(76116006)(110136005)(8936002)(66476007)(64756008)(66556008)(66946007)(38070700005)(186003)(66446008)(38100700002)(26005)(316002)(86362001)(450100002)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/+XqoodCxUvmznjv/rrHfhFq/d58ZJoF8rvp3RrRpOuS6YSQk/3WRO4s/DNW?= =?us-ascii?Q?zuN+Y57GiuNY3kbwCWiOd+QQqefGjIf44hmXpjEWBMVDm6T2yRK/eKPWu1TG?= =?us-ascii?Q?SNEkGWIGwDmQ+/MU3Gv69tB54WUy0NNJLzSRe8FoUk1/U7jHzpMjxNeBSx9w?= =?us-ascii?Q?3IPDIbEAViIF/DlRbM30l/4BAmfW2tzdzDIq4xbHuRG4zlFXUDH8sZ0Do3u3?= =?us-ascii?Q?vEKOVDpUf/5UTXMuvV7RlUjxgipn9TKKXbvNhUavgsnINHr4LgMkAQlGxlUJ?= =?us-ascii?Q?PQ0SPa9t8pKRnSw69ubs9Nv4qDGo9zFgzHniDdvzHqf76IPVuEUdzCIoIB/X?= =?us-ascii?Q?txe1Co0iJXRKUk162kj7/ZrdKhOJnPc5anpyqkZMAfjPXjF1sXIFpQUwrGgC?= =?us-ascii?Q?AKZ54IgqhqoTJeMC/nCQ4C4cUr6fdFlWfW39KFesz9Hdse4PF4Oba0rac0YI?= =?us-ascii?Q?YygNHWpNx8eHqAppmsM0FZSVb6q7wiL2dT8o+M6zwSM4lcZLQ2h3wZ2EdVjZ?= =?us-ascii?Q?9tMgD9RAtAuOxW8eGGoPSlhd82jN2cxVrjTJC7XlHYMPrOioU1s+xTSHSsnp?= =?us-ascii?Q?XcM47eDgd7jzHxrnO7GHsxI+aSr6FvosKKjpBhC1JJImZaO9McDrJF9lyDmn?= =?us-ascii?Q?r4TX/lTxgUF3csmQLPeQfW3t+GZCVjAV2olkzkQ1Plnuspf4j5xS7OZS0ezw?= =?us-ascii?Q?aej9tXsr9uMpxri5uEedgYbdng+TwjbBWHR5ACdRIx/2LKjJBcAgzPupRUBB?= =?us-ascii?Q?SrS8Jd+ZmDTldZcXAEJTyH9ZtkqEFvNMImvGPY8xb85+rfxkF7JTs6BziTqG?= =?us-ascii?Q?bMTzOFtHYBCz/wuon3E7vRV2dtiopXNMCa+kg0PvHGOkCLlAMZGgb1b40k4o?= =?us-ascii?Q?PLdwUnC4yU2+0YUduoOxyhsl88XR+RvnQo1lhRfHbYe5vuPQ4Abdgyqb7ofK?= =?us-ascii?Q?WgqvIJ2NT5O1gmjKcO2RgDmawEOfl1CWRh9V5upXB2pBQsqkurvuc2NslXh/?= =?us-ascii?Q?aJyXJujGxDtur08/QbaqFuRY6rwfG/aYkkWkObGWKoe4vaBgDuxBpXWoZr+5?= =?us-ascii?Q?/qjxaBqy7/cQYvPunACaPLFpQvAzd4HT4a7kHjRIzfNSgvamQDIkhNnvATjF?= =?us-ascii?Q?4vEjgitxyJyDtnGrqu7TpDdnVSmzKJ1DZf+M6A89ZkZb1pIq1319bhv2r4rL?= =?us-ascii?Q?eviHtKIhdof6GBajTaIqyX2gQ2vYTxfZcCITqJPsZJgAXtVnXP782cQ0xnVa?= =?us-ascii?Q?cFTSxCeKKvb2knp16Gt1CJIzhybMN/BLM4OUsS/b2jVNsMa7vgSvp3cZQqhi?= =?us-ascii?Q?OQJ9RvECoDozRcsUc8kMDb+s?= 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: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f573ba8e-e237-420f-743a-08d97f1e4ead X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2021 05:43:59.3693 (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: RK0pL/K8idTmOjPEuUMYli6bu+Tr6jyBmRgylY8h+0pSNiwqeAhhO+UBnxmGLmy0A0LYqB0OK8yIp2znjxWSKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2802 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ice: retry getting VF VSI map after it fails 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 Sender: "dev" > -----Original Message----- > From: Yu, DapengX > Sent: Tuesday, September 14, 2021 11:09 > To: Yang, Qiming ; Zhang, Qi Z > Cc: dev@dpdk.org; Wang, Haiyue ; Yu, DapengX ; > stable@dpdk.org > Subject: [PATCH] net/ice: retry getting VF VSI map after it fails >=20 > From: Dapeng Yu >=20 > The request of getting VF VSI map request may fail when DCF is busy, > this patch adds retry mechanism to make it able to succeed. >=20 > Fixes: b09d34ac8584 ("net/ice: fix flow redirector") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dapeng Yu > --- > drivers/net/ice/ice_dcf.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c > index 38e9a84698..043bd48192 100644 > --- a/drivers/net/ice/ice_dcf.c > +++ b/drivers/net/ice/ice_dcf.c > @@ -534,6 +534,7 @@ int > ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw) > { > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(hw->eth_dev); > + int i =3D 0; > int err =3D 0; >=20 > rte_spinlock_lock(&hw->vc_cmd_send_lock); > @@ -541,8 +542,18 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *h= w) > rte_intr_disable(&pci_dev->intr_handle); > ice_dcf_disable_irq0(hw); >=20 > - if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0) > - err =3D -1; > + do { > + if (ice_dcf_get_vf_resource(hw) || > + ice_dcf_get_vf_vsi_map(hw) < 0) { > + err =3D -1; > + goto again; > + } else { > + err =3D 0; > + break; > + } > +again: > + rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME); > + } while (i++ < ICE_DCF_ARQ_MAX_RETRIES); >=20 I think we can remove the 'goto', and sleep if we can (like < MAX_RERRIES), like: int err =3D -1; int i =3D 0; for (;;) { if (ice_dcf_get_vf_resource(hw) =3D=3D 0 && ice_dcf_get_vf_vsi_map(hw) >=3D 0) { err =3D 0; break; } if (++i < ICE_DCF_ARQ_MAX_RETRIES) break; rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME); } > rte_intr_enable(&pci_dev->intr_handle); > ice_dcf_enable_irq0(hw); > -- > 2.27.0