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 95F03A0546; Tue, 6 Apr 2021 16:02:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19DDA140FA5; Tue, 6 Apr 2021 16:02:22 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 2E82A140F94 for ; Tue, 6 Apr 2021 16:02:20 +0200 (CEST) IronPort-SDR: NjysidaAs+wBC9bUDkuXLsLLnoQfzql/PZ04i8Srxr9bMuvZU1GBg7lyw9Jqb7HfLDUHpknvj9 vzaxjEPNkRpg== X-IronPort-AV: E=McAfee;i="6000,8403,9946"; a="190903900" X-IronPort-AV: E=Sophos;i="5.81,309,1610438400"; d="scan'208";a="190903900" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 07:02:19 -0700 IronPort-SDR: 39GDYi6GiHZUYH//fylLMUh552nhG9Dk7EbQG62eO8kMaxI6VWX66ZT4X0QMaSI979K31ER+tu 4f3krSPG8N2A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,309,1610438400"; d="scan'208";a="447845512" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by FMSMGA003.fm.intel.com with ESMTP; 06 Apr 2021 07:02:19 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 6 Apr 2021 07:02:18 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 6 Apr 2021 07:02:18 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.59) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 6 Apr 2021 07:02:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9pOorm9bn0C28d+Ze501F50gteL8ywneUQWWxSZs4JM+jNxsDUHMacFeGTNUhkuUSvVnsRpUhxHOejIo44HCiL0O6dgMYaHxHhof1XSOR1ARnnViGaEhv0ncf2QDBmj9jHN/Psdj1sdZY9YrQr753yhi5za2BOp+g4HYP7wKLHiBTRPK4UfZyyaULQbs4ELdDez23MbaOWsy1p2GrseLZNrT26DcgbwvH8z+rA6KwoO/BPScvAzeaZhwzab6HbTemiTiR7TMxViGpBtLrtbJ6WUeJQub9xbietDKeWtwJZKWRWDHoBMAcp1Bu+Agd1mLvdDlNqRKgzrY/3u40K4RA== 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=SvwdJncdsj7O/0zR3gYjHM9m8J5mf5U4p53t8HBRSJA=; b=gnrGcjkuKS2N0QEz3m++XrQDBf+ltXDFyPz4p4HMJIJOGqWNjJNue3rk5WXwzdpbDEBLGs8tIigDOuaIz+0YYCQ/egz0EJoKmZ+Aqg6lfWoQMk/23GQzM2Gra1Wr6vWFW7QdkAVajvZ1hTTTZ0KbK9NTBPZ4neRQJK1CHxQ6GVMW1CM0ZOgVz4BIFnKY4lqIGZjg+JRQGjo9mU2z55CQunpZkHrpZznFxe8G2lY/4h+VGv0jbF4E0gKp34H4eGFfXbFtmO1pv5ql8zhEaX0AmnxdmYBcf7OPUQwRMqmFIUUrIsrsTQtOVm81l/4VmjwINBewScB9NDbeuSD9iJEI7Q== 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=SvwdJncdsj7O/0zR3gYjHM9m8J5mf5U4p53t8HBRSJA=; b=S8SzhArcb4cX5CGkwzJ40fyqTXDiFRWTdw/D1SbvH+5CoicRmGJLNsBvY3vCXMUguICb/VXfNZNWVNWIMEv/F+fGegYiQOn53vbcoTAQaTU682yGKRXUgZY7CWR9kYuqww4m1Ob74RRAWzeaPnRb9v+2i+wl6Yxik0MyApwhnh4= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3467.namprd11.prod.outlook.com (2603:10b6:5:8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32; Tue, 6 Apr 2021 14:02:02 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a%3]) with mapi id 15.20.3999.032; Tue, 6 Apr 2021 14:02:02 +0000 From: "Ananyev, Konstantin" To: Lijun Ou , "thomas@monjalon.net" , "Yigit, Ferruh" CC: "dev@dpdk.org" , "linuxarm@openeuler.org" Thread-Topic: [dpdk-dev] [PATCH V2] ethdev: add queue state when retrieve queue information Thread-Index: AQHXIWdRqdPqyulizEGNn720bkCeC6qnlptg Date: Tue, 6 Apr 2021 14:02:02 +0000 Message-ID: References: <1616070332-63414-1-git-send-email-oulijun@huawei.com> <1616670560-62333-1-git-send-email-oulijun@huawei.com> In-Reply-To: <1616670560-62333-1-git-send-email-oulijun@huawei.com> Accept-Language: en-GB, 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.5.1.3 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.255.184.192] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ff644f13-593d-4fa8-1bba-08d8f9048daf x-ms-traffictypediagnostic: DM6PR11MB3467: 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:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j7pyU4PnjCXX7JHZDQ6UM0kljNIApH66xG3UMTKWX2Iz1TEo53omFSVBencugKTaFebm5/C54i49ScTDT3dF925HLlg0pxpu0/CI7MOpXQ5wad2W6V2bVBXAlWImOJq30XQCGdJYELhEfvigxa0uToHiRpNGTNJWtY+uuUL2etgwbQTI/YjFWQ173xOLcwDPAPVcFt2DjjvvQb9WmLcU5LHb4FIpX2Rsu0Vu5Fb9CyrxdZjAQfPx21CFTekRNqXyWfGnp9XdiVYnFBlJU09/RQZ+4r9hDKPA+O5gtNGdPuEfUoMRn8fUpMyW2vc0ob34zxa6q6fj6sX6lt2vvnEhRg9ea7SsJ/+Ski3wkAj4LHZ++p399KET7zUGSs60Cy6OJHMipx72hfVRs/+PY/xekhoaBqA/nytTDRhtVeUtGs07i4zJljSEl7mk0L1BPN5gXyrzFQsgTt8Wvak44j//eZmvddp6uaoL+6sXKX78x2TmUESNdRnTb1Ce3M+JY66Ov/WvjtigEAKHkw7gy8FbuSgCiM2o4YLBaODETnxywiD+OrX0TW04LwPbFjCeYP5CSfm3WUZcQpfKsA9WOinUvKTJR/5GWUzWCRHH8uQsv4pSoR/UWtOBwHgbK8+xmok9G7MFL/UmCFbvNIUuShHp4cxatb+KqG1DoDWRYOstbHA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(136003)(39860400002)(366004)(396003)(6506007)(33656002)(55236004)(4326008)(66446008)(76116006)(66476007)(66946007)(66556008)(64756008)(5660300002)(478600001)(9686003)(55016002)(8936002)(8676002)(6636002)(7696005)(38100700001)(316002)(71200400001)(54906003)(2906002)(86362001)(186003)(26005)(52536014)(83380400001)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?lr4GAR6BrzlQ114C1qPbQa3xlhRAklPowDof+NXBhBSbLWV+fHANE0PWkGbE?= =?us-ascii?Q?qVtpDWjtlidxzItfSHDQsT60dxpkXGH1m1ctCa5pSFBP3A5dvuG2ChXotoaa?= =?us-ascii?Q?BOnOPpzpJ2Y/bYBUDaaHtNuKRyICBp54JqPPXZlyQEWZjIoZEOb5HlO/mcpR?= =?us-ascii?Q?OHcIgzYYW/FprNheJv86CcXGrxf1tr2Rjydy/eC2M7svamFZ05iHM/agdz0U?= =?us-ascii?Q?yO73wVZ5ubuTXJfu8GoNB/htzMI66qCusV4fQ1hzckj5+GVPkRQiQFFsvp1A?= =?us-ascii?Q?7NuSajPSsp80lbgY2BXKFeFT0hixcUMfHpYhFcMWG6XoPt1VDqrFy60m7kaU?= =?us-ascii?Q?ak65bR79Rbv4IGNPc4PMFSmquzLybCsWpSNfX9yC2iCJCtMj2z+kLIMIDREy?= =?us-ascii?Q?Eeq33uXyWuFL5IknaPG8EoCmXILSjsNhK0cWaDIHJQuNvQQGKWi1x/G6Jw8N?= =?us-ascii?Q?EPuvI+kzy/iBxp7EK9q0Asc4wjR/riZ3fnSoBnUKD9T5kZGY8UmQWtIg7QCb?= =?us-ascii?Q?r6VPiLeruq6OPt239bwDPahWTbZPJ/8pd5H2EVd9A1XHX4wcznn/r5c+/LG2?= =?us-ascii?Q?PGdzqKFhnxdGOkgTXg7u4/LtGkEoXuuujoEwW4PAb6GSEHb91gOqyTk+Db1e?= =?us-ascii?Q?rK8Q3vBnVk9XICM6kcOi0hh9AclwAzU/C0M7jrkNnRGtfbnCs0+zQ3d4ZtYa?= =?us-ascii?Q?Zx5DwC3DMW0qUopbdeDyEktqqG2j1Oq4KEaten40IbaGJplAPjyELtVOf/uf?= =?us-ascii?Q?Vvntd3jddJH6pbGsbRPjVnxc09/zTz/fKkxOh0OFv6IGW1QTzmbuCPjmxy/Q?= =?us-ascii?Q?P7KPJig34n+ERtSGPQ2kokNew1J5yVygpwi40ubgkJArhASN0bz5CM40aX81?= =?us-ascii?Q?bx0lrr46EBUiq4gsZMPHaqlRc8dN6O34FE6NnulHk7i+KoMZgVO0HqHuroiS?= =?us-ascii?Q?0F1/Alqlc7VcnjO4QqxaV5Xww/mgGt6yDdwNGOdKCKE8tPcSvc/Q+n4cpFjq?= =?us-ascii?Q?SjYmkPaCSO4h0IHF/PDR8/Aa14MDQePNdZEhXuVT28ffdtm2BVT+GBTJX2G1?= =?us-ascii?Q?GGXoVwIbF2Xah1EmP+s8mDRDhfi3LTwk5vn44QNui2zvS79P54y44wbCaWM+?= =?us-ascii?Q?JagSGhPSZvnzEdey/U9/ZH/l8Yl9yrsPf2kyhkNz3IszxfzvOTkotEsuG5xJ?= =?us-ascii?Q?hO0D6sJBqskKrkzED7m8xCHRyo80RlawS1D8kkAY4D+NFVKmMaIvTqzqY+co?= =?us-ascii?Q?lNXNjpox+VN+U49octMQBB7r0FYw0yk5um/EunB0PIYMzXvM+scDyfhyWzlP?= =?us-ascii?Q?JAVipw2oNWsLK9kTDLPqo/Zh?= 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff644f13-593d-4fa8-1bba-08d8f9048daf X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2021 14:02:02.4434 (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: E6f4YFZ9W+WODf8NCKdNORi80Fb47MDOzgybPvcugE10ng+fWW+JL3whxFmLUBOwvhPJ+tYKgYrn/mba55PFtgzLgoQ/ujpTccu072PwRxw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3467 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH V2] ethdev: add queue state when retrieve queue information 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" Hi, > Currently, upper-layer application could get queue state only > through pointers such as dev->data->tx_queue_state[queue_id], > this is not the recommended way to access it. So this patch > add get queue state when call rte_eth_rx_queue_info_get and > rte_eth_tx_queue_info_get API. >=20 > Note: The hairpin queue is not supported with above > rte_eth_*x_queue_info_get, so the queue state could be > RTE_ETH_QUEUE_STATE_STARTED or RTE_ETH_QUEUE_STATE_STOPPED. I wonder why RTE_ETH_QUEUE_STATE_HAIRPIN Is not supported? Obviously what we do - copy internal queue state to the user provided buffe= r. > Note: After add queue_state field, the 'struct rte_eth_rxq_info' size > remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so > it could be ABI compatible. >=20 > Signed-off-by: Chengwen Feng > Signed-off-by: Lijun Ou > --- > V1->V2: > - move queue state defines to public file > --- > doc/guides/rel_notes/release_21_05.rst | 6 ++++++ > lib/librte_ethdev/ethdev_driver.h | 7 ------- > lib/librte_ethdev/rte_ethdev.c | 3 +++ > lib/librte_ethdev/rte_ethdev.h | 11 +++++++++++ > 4 files changed, 20 insertions(+), 7 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_note= s/release_21_05.rst > index 22aa80a..503daf9 100644 > --- a/doc/guides/rel_notes/release_21_05.rst > +++ b/doc/guides/rel_notes/release_21_05.rst > @@ -164,6 +164,12 @@ ABI Changes >=20 > * No ABI change that would break compatibility with 20.11. >=20 > +* Added new field ``queue_state`` to ``rte_eth_rxq_info`` structure > + to provide indicated rxq queue state. > + > +* Added new field ``queue_state`` to ``rte_eth_txq_info`` structure > + to provide indicated txq queue state. > + >=20 > Known Issues > ------------ > diff --git a/lib/librte_ethdev/ethdev_driver.h b/lib/librte_ethdev/ethdev= _driver.h > index cdd4b43..ec5a17d 100644 > --- a/lib/librte_ethdev/ethdev_driver.h > +++ b/lib/librte_ethdev/ethdev_driver.h > @@ -970,13 +970,6 @@ struct eth_dev_ops { > }; >=20 > /** > - * RX/TX queue states > - */ > -#define RTE_ETH_QUEUE_STATE_STOPPED 0 > -#define RTE_ETH_QUEUE_STATE_STARTED 1 > -#define RTE_ETH_QUEUE_STATE_HAIRPIN 2 > - > -/** > * @internal > * Check if the selected Rx queue is hairpin queue. > * > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 3059aa5..fbd10b2 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -5042,6 +5042,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_= t queue_id, >=20 > memset(qinfo, 0, sizeof(*qinfo)); > dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); > + qinfo->queue_state =3D dev->data->rx_queue_state[queue_id]; > + > return 0; > } >=20 > @@ -5082,6 +5084,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_= t queue_id, >=20 > memset(qinfo, 0, sizeof(*qinfo)); > dev->dev_ops->txq_info_get(dev, queue_id, qinfo); > + qinfo->queue_state =3D dev->data->tx_queue_state[queue_id]; >=20 > return 0; > } > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethde= v.h > index efda313..4f0b1b2 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -1582,6 +1582,13 @@ struct rte_eth_dev_info { > }; >=20 > /** > + * RX/TX queue states > + */ > +#define RTE_ETH_QUEUE_STATE_STOPPED 0 > +#define RTE_ETH_QUEUE_STATE_STARTED 1 > +#define RTE_ETH_QUEUE_STATE_HAIRPIN 2 > + > +/** > * Ethernet device RX queue information structure. > * Used to retrieve information about configured queue. > */ > @@ -1591,6 +1598,8 @@ struct rte_eth_rxq_info { > uint8_t scattered_rx; /**< scattered packets RX supported. */ > uint16_t nb_desc; /**< configured number of RXDs. */ > uint16_t rx_buf_size; /**< hardware receive buffer size. */ > + /**< Queues state: STARTED(1) / STOPPED(0). */ I think comment has to state that possible values are one of RTE_ETH_QUEUE_STATE_*. About previous discussion about new field in this struct vs new API functio= n, I still think new function will be a bit cleaner, but could live with both. > + uint8_t queue_state; If we'll go with new 1B field, then as Stephen pointed, it is probably worth to fill the hole between scattered_rx and nb_desc with this new filed. > } __rte_cache_min_aligned; >=20 > /** > @@ -1600,6 +1609,8 @@ struct rte_eth_rxq_info { > struct rte_eth_txq_info { > struct rte_eth_txconf conf; /**< queue config parameters. */ > uint16_t nb_desc; /**< configured number of TXDs. */ > + /**< Queues state: STARTED(1) / STOPPED(0). */ Same about comment here. > + uint8_t queue_state; > } __rte_cache_min_aligned; >=20 > /* Generic Burst mode flag definition, values can be ORed. */ > -- > 2.7.4