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 5776741DFA; Tue, 7 Mar 2023 04:28:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C27A40E03; Tue, 7 Mar 2023 04:28:09 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 6F3564067E; Tue, 7 Mar 2023 04:28:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678159686; x=1709695686; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XFvGwbyaCw8UWp0whwSDgwLyBNBAgqYdVXHr8sp+0S4=; b=YAdEHjJ5bWS3e5XGu9Re00Ho+JOTQ7r3+5XgYPDSSipxn9bsMrmzkES8 7+7Fuk+40vXoOze6UlKsF53nYF0j7PnWWArEHu8Iq9XjXl2KJ3dD7Z3Hm PDoO8My+MXBi+0d3qLlYrgT7jTi+hCEUgralxHxU4gQU2/GLfE7lQtibX pz/zqRIe2+oihOze6NqCFTTrL/Bx8OOMkrLB2dD/7e9IkYJOI6s3pYIWt IaW2/ix0UGF9G1DTSlP4vV5XaoTs7b0ojrpgEsupFE6NPXbRWWc4RHYZ1 0s/fLVbkJMmgT4sjJ/bUEugOk/0gw4ha6ryU8f1lL3JToCrNQ23vWJY0J g==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="338076451" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="338076451" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 19:28:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="678765920" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="678765920" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 06 Mar 2023 19:28:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 6 Mar 2023 19:28:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 6 Mar 2023 19:28:03 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 6 Mar 2023 19:28:03 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) 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.2507.21; Mon, 6 Mar 2023 19:28:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIeqE2ALsnEdhsRfjG4XQbuJZzdXpVuvrTsRGyt5UAHxVBVxphaTwvaFqFBp0eMWk7BCU3xbaOHEM7a2KD+Udu8b++BZoh/ONbo7hS2f3/i1EI/osIpQsSVfA5ao2/6wbfK/79vaC4wsvtr9cgfXfpiIPjAqs+xge16IM6TgiFzuNfXiTyVYDKDED2LtlirRoSIL61Kyr8GQC/tTwsJTJ9Jwi6+9q7IAf7N5e5gL6/YjTNyTVe+gtOevd0gYdvD/diHkexAL/REh/xoLWCBUdjrQDOjhUQGX4OprXWpGEiVYRjbFW+5YESIDR+eLIcnilvEsZMG3ZSxwXMrnXarOgg== 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=iDCEJa16xeMqtvapuqcJQtSNXsdhL+ZnvX4fkvGmj38=; b=NI++z2Xhfbx+d38KoxmWKOhLb15yzgyZSh9aEe/GxGituGQx6eKz9RCYe0hWk9TDxWeXD3lzKmDqb5J24LlOLYBu7igY1sokzCPl8+J9CR/gmoBuxqjALukLuxLZXtJiL41HjN0NWCYXV+rADLzxmS0C2AxcOIoji9OCyfVD9OIiTK3jp+58sP6FF6kKwEEjGik9unCqk5jeE4Twgvf7kB1k09HrpDsRSiJwsthCWiGwRvYIDI3+7xEWs60XQ9dL+H/KIRU3BPWCnaSLuyLPp46L7veHZoQVRC98ABuQbTBQ3sshqubab0wOPKixzraJ1cgPLIQaGLy/Oy2IEgvFLQ== 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 BYAPR11MB2903.namprd11.prod.outlook.com (2603:10b6:a03:89::31) by MN6PR11MB8241.namprd11.prod.outlook.com (2603:10b6:208:473::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Tue, 7 Mar 2023 03:28:01 +0000 Received: from BYAPR11MB2903.namprd11.prod.outlook.com ([fe80::18be:e6a:f443:f8ce]) by BYAPR11MB2903.namprd11.prod.outlook.com ([fe80::18be:e6a:f443:f8ce%7]) with mapi id 15.20.6156.029; Tue, 7 Mar 2023 03:28:00 +0000 From: "Deng, KaiwenX" To: "Zhang, Qi Z" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Yang, Qiming" , "Zhou, YidingX" , "Wu, Jingjing" , "Xing, Beilei" Subject: RE: [PATCH] net/iavf: fix iavf query stats in intr thread Thread-Topic: [PATCH] net/iavf: fix iavf query stats in intr thread Thread-Index: AQHZRnwPXF0A6biPeEOgBAjGk8jAU67h/6CAgAy7otA= Date: Tue, 7 Mar 2023 03:27:59 +0000 Message-ID: References: <20230222044001.1241845-1-kaiwenx.deng@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR11MB2903:EE_|MN6PR11MB8241:EE_ x-ms-office365-filtering-correlation-id: a613adc6-bbb4-4656-c552-08db1ebbf36d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2Ul1BPzLRrFs6SHQxDyVTwt8U1zsbH06jgapM5kejMNTSZQUyMKKX6n7yhKRO4hzxQl8ZgapQG8594AoZBVBgwnNsras72H9Vu8n072v7oSLNG1WXIF6uVb+feiHipnaaKcCVxLOElOlxwdLfdGEA/kpI4fiMlskR1f9eKbBXqf8ZrH5Is5qFUTTzbw83xWOlq+jtp/I1NPbk5ScWvEdkyRK83hy5qhf2DDeF6cbqC3hVi3eREPt69mIN/UK22aaFH9WWNdlQ7pFmhWIYer+F3Hld7V2t4GR4C2EO3hXYXayT3G016d8nh60cKqV06YH0OqtmHGhbdH2EFvcBvanYuuEriXzKoK69o9HfYI5bJ5MPqz5MsslQvmSzrDBRa8AKVSgvZg5PLWNEfNAkGD7OUSeZqrVMjEAdBTeH+UI55EF1RLEqKu+3AICgyPombmjMdulaT15G54HPx3YNnmezWcrODQNqgiYfUYht9rqtiSflb98gv1c1m4NONzVA3yrDK+cwQiaJeQXOaIqWaHDGLZ1cmush3jRehHZ39QqvzG+jKHuU/HatlvmwyQrjtdZFmC37u0Oiq27pm9rGHqe3dytZ8aTv0xhvwuWKeXuisq3Rjez78c9TYG3TYEre4FkZUKsSWp29Ymb2IYawlB/Kh41zxomUutxR9Fxq8rAHAA5Pb5MPHnAgYweChIKWSiNZ29ITEMyPASQoVqJq59WVg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2903.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(366004)(376002)(136003)(396003)(39860400002)(451199018)(8936002)(5660300002)(52536014)(66446008)(66476007)(450100002)(66946007)(2906002)(76116006)(4326008)(64756008)(8676002)(66556008)(54906003)(110136005)(316002)(478600001)(7696005)(71200400001)(107886003)(6506007)(53546011)(26005)(41300700001)(122000001)(86362001)(33656002)(83380400001)(38070700005)(55016003)(38100700002)(186003)(82960400001)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?N1g2T2VyelNhTWtuUytVVW85a3QxK2NSTUkrd1hJNHgxbDFleWZUNWZQ?= =?iso-2022-jp?B?WjdQSm5KNk1Pb2s1c1ZYbm1jQUZCNEQwaFkvU3JlUlBrdnVyVHVJeWxm?= =?iso-2022-jp?B?OTM1MUtTYkJ1SHFVSlhQUFEyakJoOVUxYjlhWk1aZUx3elI2ME5qOWZv?= =?iso-2022-jp?B?QmQwV2Z4QzUwYnpJRW9YcndKdlZ1d2g2KzFGVnVIWVB5NFdiMlJtb1NJ?= =?iso-2022-jp?B?UG00QThuSnRrT2FPVHhTTmZlN2tTdWNXRWIvNjhoYkdidjNOTlRwQ0Mx?= =?iso-2022-jp?B?U0xJMHc0cHhCQkpjQmJsTUZmcjBUZVlnMWhmb25sT25XRllyS3NvTXR0?= =?iso-2022-jp?B?RkNiYlI3RW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1NqMDBNdi8z?= =?iso-2022-jp?B?RjI5U2wwVm5nclpDT2FCVThMRE1vUGdiV3FNS1poak9KYWtyNlgreGN5?= =?iso-2022-jp?B?UHFERnpiZ2tkZ08vS2tvMWJjZFhJZU9nVk5LcnJMTTB1dlVsdG4wZEcz?= =?iso-2022-jp?B?OFBRSA==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2903.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a613adc6-bbb4-4656-c552-08db1ebbf36d X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2023 03:27:59.4363 (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: SAS+87FzqwY4gu8dc//zNPpIunxKyvgxA6YmDL90NN7xWk1mZhuyd4FmmqkTDMJHSXiqdl8BQQ61nkLMNFHPbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR11MB8241 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: Zhang, Qi Z > Sent: Monday, February 27, 2023 8:56 AM > To: Deng, KaiwenX ; dev@dpdk.org > Cc: stable@dpdk.org; Yang, Qiming ; Zhou, YidingX > ; Wu, Jingjing ; Xing, > Beilei > Subject: RE: [PATCH] net/iavf: fix iavf query stats in intr thread >=20 >=20 >=20 > > -----Original Message----- > > From: Deng, KaiwenX > > Sent: Wednesday, February 22, 2023 12:40 PM > > To: dev@dpdk.org > > Cc: stable@dpdk.org; Yang, Qiming ; Zhou, > > YidingX ; Deng, KaiwenX > > ; Wu, Jingjing ; Xing, > > Beilei ; Zhang, Qi Z > > Subject: [PATCH] net/iavf: fix iavf query stats in intr thread > > > > When iavf send query-stats command in eal-intr-thread through virtual > > channel, there will be no response received from > > iavf_dev_virtchnl_handler for this command during block and wait. > > Because iavf_dev_virtchnl_handler is also registered in eal-intr-thread= . > > > > When vf device is bonded as BONDING_MODE_TLB mode, the slave > update > > callback will registered in alarm and called by eal-intr-thread, it > > would also raise the above issue. > > > > This commit add local stats return to iavf_dev_stats_get immediately > > when it is called by eal-intr-thread. And update local stats in iavf-vi= rtchnl- > thread. > > > > Fixes: cb5c1b91f76f ("net/iavf: add thread for event callbacks") > > Fixes: 22b123a36d07 ("net/avf: initialize PMD") > > Cc: stable@dpdk.org > > > > Signed-off-by: Kaiwen Deng > > --- > > drivers/net/iavf/iavf.h | 9 ++- > > drivers/net/iavf/iavf_ethdev.c | 24 ++++++-- > > drivers/net/iavf/iavf_vchnl.c | > > 107 ++++++++++++++++++++++++--------- > > 3 files changed, 104 insertions(+), 36 deletions(-) > > > > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > > 1edebab8dc..3a249b90a3 100644 > > --- a/drivers/net/iavf/iavf.h > > +++ b/drivers/net/iavf/iavf.h > > @@ -128,6 +128,7 @@ struct iavf_vsi { > > uint16_t base_vector; > > uint16_t msix_intr; /* The MSIX interrupt binds to VSI */ > > struct iavf_eth_xstats eth_stats_offset; > > + struct virtchnl_eth_stats eth_stats; > > }; > > > > struct rte_flow; > > @@ -325,6 +326,8 @@ struct iavf_adapter { > > struct iavf_devargs devargs; > > }; > > > > +typedef void (*virtchnl_callback)(struct rte_eth_dev *dev, void > > +*args); > > + > > /* IAVF_DEV_PRIVATE_TO */ > > #define IAVF_DEV_PRIVATE_TO_ADAPTER(adapter) \ > > ((struct iavf_adapter *)adapter) > > @@ -424,8 +427,10 @@ _atomic_set_async_response_cmd(struct > iavf_info > > *vf, enum virtchnl_ops ops) } int iavf_check_api_version(struct > > iavf_adapter *adapter); int iavf_get_vf_resource(struct iavf_adapter > > *adapter); -void iavf_dev_event_handler_fini(void); > > -int iavf_dev_event_handler_init(void); > > +void iavf_dev_virtchnl_handler_fini(void); > > +void iavf_dev_virtchnl_callback_post(struct rte_eth_dev *dev, > > + virtchnl_callback cb, void *args); int > > +iavf_dev_virtchnl_handler_init(void); > > void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev); int > > iavf_enable_vlan_strip(struct iavf_adapter *adapter); int > > iavf_disable_vlan_strip(struct iavf_adapter *adapter); diff --git > > a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c > > index 3196210f2c..fcbab5b26a 100644 > > --- a/drivers/net/iavf/iavf_ethdev.c > > +++ b/drivers/net/iavf/iavf_ethdev.c > > @@ -1729,6 +1729,17 @@ iavf_update_stats(struct iavf_vsi *vsi, struct > > virtchnl_eth_stats *nes) > > iavf_stat_update_32(&oes->tx_discards, &nes->tx_discards); } > > > > +static void iavf_dev_stats_get_callback(struct rte_eth_dev *dev, void > > +*args) { > > + struct virtchnl_eth_stats *eth_stats =3D (struct virtchnl_eth_stats > *)args; > > + struct virtchnl_eth_stats *pstats =3D NULL; > > + struct iavf_adapter *adapter =3D > > + IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > > + int ret =3D iavf_query_stats(adapter, &pstats); > > + if (ret =3D=3D 0) > > + rte_memcpy(eth_stats, pstats, sizeof(struct > > virtchnl_eth_stats)); } > > + > > static int > > iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats > > *stats) { @@ -1738,8 +1749,13 @@ iavf_dev_stats_get(struct rte_eth_dev > > *dev, struct rte_eth_stats *stats) > > struct iavf_vsi *vsi =3D &vf->vsi; > > struct virtchnl_eth_stats *pstats =3D NULL; > > int ret; > > - > > - ret =3D iavf_query_stats(adapter, &pstats); > > + if (rte_thread_is_intr()) { > > + pstats =3D &vsi->eth_stats; > > + iavf_dev_virtchnl_callback_post(dev, > > iavf_dev_stats_get_callback, (void *)pstats); > > + ret =3D 0; >=20 >=20 > I assume this is going to return a copy of outdated stats, then the stats= will be > updated it in future and this happens in another thread, is it correct? > If true, then will be 2 issues. > 1. How the caller know when the updated data will be ready? > 2. even caller will consume the outdated stats directly, is that will be = a race > condition if the virtchnl thread update the stats at the same time? >> Hi=1B$B!$=1B(BQi >>1.The caller cannot know when the updated data will be ready in interrupt= thread. if caller block for stats update in interrupt thread, >> the stats will not be updated, because interrupt thread is blocked. = The caller can only get local stats which is updated last time. >> I can't find any other better solution. If you have any suggestions, = please let me know. >>2.I submit patch v2 to avoid race condition. >>Thanks >=20 > > + } else { > > + ret =3D iavf_query_stats(adapter, &pstats); > > + } > > if (ret =3D=3D 0) { > > uint8_t crc_stats_len =3D (dev->data- > > >dev_conf.rxmode.offloads & > > RTE_ETH_RX_OFFLOAD_KEEP_CRC) ? > > 0 :