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 169A642545; Mon, 11 Sep 2023 03:45:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F38040291; Mon, 11 Sep 2023 03:45:45 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2133.outbound.protection.outlook.com [40.107.101.133]) by mails.dpdk.org (Postfix) with ESMTP id B060C4021D for ; Mon, 11 Sep 2023 03:45:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8+6GoIz72nM8fE0JdPc48O3FP32f52S/ITaAjor8rsVdRS3xqjsgAvaJR9ylyikvff7gODcr1pzG6mqzcaQbx1qZpLpXbumfJz9NWrovfULZNSc7MToPpXQGjhi/X/sV9sYTc4Dv3T8o6GgP4iUbOoDffHMo28dW7sKwVw/hRrx7itIftmxc9Kpa5QrpvKPDW27C7aM2MxM+QUFW9fcYyesjkyq2I/99duus5OVQV6xHy0p2wLogf5shRKGqst3ipzN0mdezO1ZZkpobeXiQY6ORBg/k4QPjGuDm3p5wxZZCkRnEFmNIUxypOSsPX7ZzCoXQ/Pjv475tNdArz2ZEw== 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=yQZIctpUx0iYnMTAUvEzh2xrYeBpU6FGuTBAFEjunWw=; b=Mecu5uZAMjbphubEZL5QQ+oYiLLHvsiwJjAuk+mKikmL7Aljip2oyDKhnPIFNVt8bPw9smoFNOtvH5KIoLBfZJxY2XVBsS72FPArycKfFCMUm3p6N4U1AJlYeD8vyhs+OWPLFXKGrYzNz+/yhd7CNEOaMnwKxU/tCCnIroU0KMomHTX6APWZMSWLkpgoGRUngApsPmNZARPjSJZnNYcjDA3mqN9NXTs4ylxPoKP5M4qLzgRBDrg6nX8Kk7C87yzZN6ezdM86ySaEh+iA0xJSipziAH4EU0gSfpjwveWjlK/LXu8Ixh9Yo58wTe6Xp2p8VSdIEvYX3+qaSLkJMs+Ivw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yQZIctpUx0iYnMTAUvEzh2xrYeBpU6FGuTBAFEjunWw=; b=JCDcCxM1LbSn5URVWHAEhX6F+hHC5+/3KTUfgH5BbPzzCAqCv1ZxKFqhiCYiBtMW2y+c3ngmxTDpI9lMmssw3RR0HFNfaaMgd2iE0EJ2a5kF1NavN7rCyCDZ1+OHaEKYSR7H72FwPIb/QJZWwH8fANgxpJ5PrPGI4FjfoDHefJM= Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SJ2PR13MB6523.namprd13.prod.outlook.com (2603:10b6:a03:55e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.34; Mon, 11 Sep 2023 01:45:41 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c05c:6915:1628:70c4]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c05c:6915:1628:70c4%7]) with mapi id 15.20.6768.029; Mon, 11 Sep 2023 01:45:41 +0000 From: Chaoyong He To: "dev@dpdk.org" CC: Jie Hai Subject: RE: [PATCH 23/36] net/nfp: fix Rx and Tx queue state Thread-Topic: [PATCH 23/36] net/nfp: fix Rx and Tx queue state Thread-Index: AQHZ4kgoBSMJqbjqf06r5VL+5EBCVbAU3cSg Date: Mon, 11 Sep 2023 01:45:40 +0000 Message-ID: References: <20230908112901.1169869-1-haijie1@huawei.com> <20230908112901.1169869-24-haijie1@huawei.com> In-Reply-To: <20230908112901.1169869-24-haijie1@huawei.com> 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=corigine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR13MB5545:EE_|SJ2PR13MB6523:EE_ x-ms-office365-filtering-correlation-id: c9d4e35b-46af-4212-2cef-08dbb268ce47 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: slbok1OYc6yOP4YzvLJhiPvj8wfhMqgbcVpuUP0azT/bV0VLvkxrXv0TadnPN/TLS4lkqiwNMUP74lfy77jRGX3vi7ZlR1BOeuwuUKiXgYLXYb4Ifmoh8BBqipx3HNPUMQnOVRTUreWn5+kBWcPX2vC9G/dO/xGh9nHB29KtOtZIJbKbmcPxQfNmHAYsE6lcbn4Ry5lruJyG+OPvEuC4DBaqkelHys68L2ugXTsvlulQl5vxlgggcTZWfBVp+kFcVRmyKgdA5VfuxRQUA/V9H4rcRvuQ6ma4JKlIPvXuU4ogni0sp8I5/fajIpgYpL9VHgiE0nR4p19+2p6EzfAUJONKs50jFF6nswBoQv2mt2EQaYTNMW0hVEtuBrxl0Qba2NB2uCSOpqWiXArW+Z7hFR8jClP19l3r5Vb0/0yi1WfeQtuj6jkWZ4NbdLgKvh6zZ56+qniyQEW70++3uOviqWWPJaBaMQdn2UCsO8HvUtCo6IJpnlsGSoxPAoiOSj/5AKnHINVpd/h14rQFo0TRFmA2uOAK5fLnXlTMXzmil6SZY3Xcfp13l0dq87o7L5TBDUSvoNZuYUxIkAOSEI2Hku9l5z/zi3MQj5ZicGXRgpAF+NM1cqsJY3bP+otWBaHVMG49wnixCKW8pFpTzf+gRtBKUMeUp/bdfQh/DF95Q9Y= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(39830400003)(396003)(376002)(136003)(451199024)(186009)(1800799009)(2906002)(44832011)(52536014)(55016003)(26005)(6916009)(316002)(41300700001)(66556008)(66446008)(64756008)(66476007)(66946007)(76116006)(478600001)(966005)(4326008)(8676002)(8936002)(5660300002)(53546011)(6506007)(7696005)(9686003)(71200400001)(83380400001)(38100700002)(33656002)(38070700005)(86362001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dD37Pbs9hWsEiFHvTTYKYktax1IKTTJjWR9Ujf1ERHy0Wy1aE57zFrqRSyEh?= =?us-ascii?Q?Kk3Mf2sgpc7VOCk3caTS2lDXJ5gGGiFa2SBACycm4WtEy4mWz5VTd7woynEC?= =?us-ascii?Q?XbvjA9S28ALxNW7MJ8p62R2Fwm90m2Pt4EfbNexz8vpF8n2rPSiIosucFSI8?= =?us-ascii?Q?7wl4jZ9yz0GomZYP6tG89xIGS4v1f79/t2N0ScOOIJ4Sp7L4iPCQoX4JEdOt?= =?us-ascii?Q?qdDlVcnkQvMQ0iQC+9XVoPNgDAN+vVeTCby6iYPyPGGdppHNpuKE0xsYcwqT?= =?us-ascii?Q?qNmh3dQUmDStL4Ex5L39wgys5k+Ra3bHc2IIpo5jbhqsy+Bi399XlWcOJ4PO?= =?us-ascii?Q?ArfooSTs77SIGWjGuTOwnNE1HcFrR9SUhPokBTG0KmtIuWvo+6XUV8apIwqC?= =?us-ascii?Q?tUVAcHRkz8hJco9bEgnc1CSrygxejlofLrjhb3krB6OnP048Tdyks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UxVCIGcK6z+emTFoNctzbFNhaD?= =?us-ascii?Q?f6bFz5+NrD7FpZkhAdcguBq3LRxTtUPxiFGmYBzYwgNhPIlD/FYwoXTYXRAD?= =?us-ascii?Q?zLhGU3sx0dKhp2O2bQO2CRTOdOBsr/ZUC+y2Vvz8a8WBW78B5NClNtbYipjN?= =?us-ascii?Q?on61KZaP/4B85auzKq7JlE45+EIPga2QPNHgQpZvue5Fx1A3lNHVF+bTMz7U?= =?us-ascii?Q?amqNE5zPiC7nLL9EnMpatXGwOGke1EewqaBynJ+7?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9d4e35b-46af-4212-2cef-08dbb268ce47 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2023 01:45:40.9916 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XI52e9gpYSevTIPoqPZjYJbMSbuH5sHrSw+pPhzkmQeht8LkzF6X1V7dEC1QflCEVE8dtlpcT0cmm/lx+ovhsEiz9+GiNJqGZgfxez8Jorc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR13MB6523 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 Thanks, it looks good to me. Acked-by: Chaoyong He > -----Original Message----- > From: Jie Hai > Sent: Friday, September 8, 2023 7:29 PM > To: dev@dpdk.org; Chaoyong He ; Niklas > Soderlund ; Chengwen Feng > ; Lijun Ou ; Konstantin > Ananyev > <"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com>; > Thomas Monjalon ; Ferruh Yigit > > Cc: haijie1@huawei.com; lihuisong@huawei.com > Subject: [PATCH 23/36] net/nfp: fix Rx and Tx queue state >=20 > [Some people who received this message don't often get email from > haijie1@huawei.com. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] >=20 > The DPDK framework reports the queue state, which is stored in > dev->data->tx_queue_state and dev->data->rx_queue_state. The > state is maintained by the driver. Users may determine whether a queue > participates in packet forwarding based on the state. > Therefore, the driver needs to modify the queue state in time according t= o the > actual situation. >=20 > Fixes: 9ad9ff476cac ("ethdev: add queue state in queried queue informatio= n") > Cc: stable@dpdk.org >=20 > Signed-off-by: Jie Hai > --- > drivers/net/nfp/flower/nfp_flower.c | 8 ++++++++ > drivers/net/nfp/flower/nfp_flower_representor.c | 12 ++++++++++++ > drivers/net/nfp/nfp_common.c | 2 ++ > drivers/net/nfp/nfp_ethdev.c | 6 ++++++ > drivers/net/nfp/nfp_ethdev_vf.c | 6 ++++++ > 5 files changed, 34 insertions(+) >=20 > diff --git a/drivers/net/nfp/flower/nfp_flower.c > b/drivers/net/nfp/flower/nfp_flower.c > index 77dab864f319..eb7b40a6eb25 100644 > --- a/drivers/net/nfp/flower/nfp_flower.c > +++ b/drivers/net/nfp/flower/nfp_flower.c > @@ -85,6 +85,7 @@ int > nfp_flower_pf_start(struct rte_eth_dev *dev) { > int ret; > + uint16_t i; > uint32_t new_ctrl; > uint32_t update =3D 0; > struct nfp_net_hw *hw; > @@ -137,6 +138,11 @@ nfp_flower_pf_start(struct rte_eth_dev *dev) > return -EIO; > } >=20 > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] =3D RTE_ETH_QUEUE_STATE_STAR= TED; > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STARTED; > + > return 0; > } >=20 > @@ -159,11 +165,13 @@ nfp_flower_pf_stop(struct rte_eth_dev *dev) > for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > this_tx_q =3D dev->data->tx_queues[i]; > nfp_net_reset_tx_queue(this_tx_q); > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STOPPED; > } >=20 > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > this_rx_q =3D dev->data->rx_queues[i]; > nfp_net_reset_rx_queue(this_rx_q); > + dev->data->rx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STOPPED; > } >=20 > if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) diff --git > a/drivers/net/nfp/flower/nfp_flower_representor.c > b/drivers/net/nfp/flower/nfp_flower_representor.c > index 5f94d20f1b0c..3f97bc9f8a39 100644 > --- a/drivers/net/nfp/flower/nfp_flower_representor.c > +++ b/drivers/net/nfp/flower/nfp_flower_representor.c > @@ -303,6 +303,7 @@ nfp_flower_repr_dev_start(struct rte_eth_dev *dev) > { > struct nfp_flower_representor *repr; > struct nfp_app_fw_flower *app_fw_flower; > + uint16_t i; >=20 > repr =3D dev->data->dev_private; > app_fw_flower =3D repr->app_fw_flower; @@ -314,6 +315,11 @@ > nfp_flower_repr_dev_start(struct rte_eth_dev *dev) >=20 > nfp_flower_cmsg_port_mod(app_fw_flower, repr->port_id, true); >=20 > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] =3D RTE_ETH_QUEUE_STATE_STAR= TED; > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STARTED; > + > return 0; > } >=20 > @@ -322,6 +328,7 @@ nfp_flower_repr_dev_stop(struct rte_eth_dev *dev) > { > struct nfp_flower_representor *repr; > struct nfp_app_fw_flower *app_fw_flower; > + uint16_t i; >=20 > repr =3D dev->data->dev_private; > app_fw_flower =3D repr->app_fw_flower; @@ -333,6 +340,11 @@ > nfp_flower_repr_dev_stop(struct rte_eth_dev *dev) > repr->nfp_idx, 0); > } >=20 > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] =3D RTE_ETH_QUEUE_STATE_STOP= PED; > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STOPPED; > + > return 0; > } >=20 > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index 5092e5869de4..c0d4708f2b3e 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -1927,6 +1927,7 @@ nfp_net_stop_rx_queue(struct rte_eth_dev *dev) > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > this_rx_q =3D dev->data->rx_queues[i]; > nfp_net_reset_rx_queue(this_rx_q); > + dev->data->rx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STOPPED; > } > } >=20 > @@ -1952,6 +1953,7 @@ nfp_net_stop_tx_queue(struct rte_eth_dev *dev) > for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > this_tx_q =3D dev->data->tx_queues[i]; > nfp_net_reset_tx_queue(this_tx_q); > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STOPPED; > } > } >=20 > diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c > index e3ff3d80873d..bdfd5530c55f 100644 > --- a/drivers/net/nfp/nfp_ethdev.c > +++ b/drivers/net/nfp/nfp_ethdev.c > @@ -65,6 +65,7 @@ nfp_net_start(struct rte_eth_dev *dev) > struct rte_eth_conf *dev_conf; > struct rte_eth_rxmode *rxmode; > uint32_t intr_vector; > + uint16_t i; > int ret; >=20 > hw =3D NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -176,6 +177,11 @@ nfp_net_start(struct rte_eth_dev *dev) >=20 > hw->ctrl =3D new_ctrl; >=20 > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] =3D RTE_ETH_QUEUE_STATE_STAR= TED; > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STARTED; > + > return 0; >=20 > error: > diff --git a/drivers/net/nfp/nfp_ethdev_vf.c > b/drivers/net/nfp/nfp_ethdev_vf.c index eaf815d06da5..3e8aeef51ab4 > 100644 > --- a/drivers/net/nfp/nfp_ethdev_vf.c > +++ b/drivers/net/nfp/nfp_ethdev_vf.c > @@ -39,6 +39,7 @@ nfp_netvf_start(struct rte_eth_dev *dev) > struct rte_eth_conf *dev_conf; > struct rte_eth_rxmode *rxmode; > uint32_t intr_vector; > + uint16_t i; > int ret; >=20 > hw =3D NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -115,6 +116,11 @@ nfp_netvf_start(struct rte_eth_dev *dev) >=20 > hw->ctrl =3D new_ctrl; >=20 > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] =3D RTE_ETH_QUEUE_STATE_STAR= TED; > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] =3D > + RTE_ETH_QUEUE_STATE_STARTED; > + > return 0; >=20 > error: > -- > 2.30.0