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 8673842661; Thu, 28 Sep 2023 15:15:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5ACE840273; Thu, 28 Sep 2023 15:15:53 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by mails.dpdk.org (Postfix) with ESMTP id 4232B4021D for ; Thu, 28 Sep 2023 15:15:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ianYFIQkAHM2eSJ2KDt32OSIKknq2wVeHVBnRYiA3vJqH67sdRIW7yx2COG9tq+qU/Xmsqz3c2ofNUlWZwPgf2TXl+oSxQ6YuZ35LgHx5SrYTjm0GSvo2Ao5WUHCmxoZ6GsLS437LXipmTAhCjDVTguhkXj9RTCQPoT6eboRxGBuIOQf/RTHHPhew5QZms3R7kw8riS6sSktGYQtCcZiYmM5hGiJNzMOGPAmzB0WG8skLPM5fWNMIT6fmXwTi+TgTIe9P/ewKb4xtw8M3FMvr82Z2f2X9pvNdj5Y+EI8MEFLlDuUdcweoRuxJLFwxrPYjosFYryr3VbfnIRwyiOUlA== 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=wUqblnKhNFG3Wwt4NR75QBLrBDvOzC6UMc49DpWJ6yE=; b=T0YDP7dSSoHaUldV96selhcyo9itFqYak+TSkaKPkr69G3Hrwh/2SEpRanFBilrXuTEI/izvfTNs8i/4t5Fs94DkZAW9TZ+AJ7Box08rUtiAMiXAVl/fqdqvxwlVVPT+8sogTz/oGSjLw2tysqunM0TJ5mHztPv70b4y68ty33gR3NOu0JBtYAkWmKh/hWkrNWona8p7U2lz2Cla2YVo2vDq1neiC1jGACTxjNOO8uZlvK5ViRroeS4A2GB2dNIS2GcoNPRGikxuN+8/S5liQk/jKByR6N2ipd75OlwqVhLmYzy/QPwv7CdOB2vlwrqeoEwjm3wM4EBQfNrnK+6BhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wUqblnKhNFG3Wwt4NR75QBLrBDvOzC6UMc49DpWJ6yE=; b=BbyMfFsYdmmt3Tg24NUOLrTFzuOIVWr2i7eV86UHLMO5mn8Wso/VDS/+rXzgPBwXe1DWIArRYyVjSTHX2eTrc6K7sKrg/DweaQRHmL3opgUX/mq8cCKhptQtJ0CsatsQV5ct2yb/yIclH5H4QhZfmTto0F5bGT6346WWsEWDVXs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM6PR12MB4545.namprd12.prod.outlook.com (2603:10b6:5:2a3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.24; Thu, 28 Sep 2023 13:15:50 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8%4]) with mapi id 15.20.6838.024; Thu, 28 Sep 2023 13:15:50 +0000 Message-ID: Date: Thu, 28 Sep 2023 14:15:44 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/8] lib/ethdev: update Rx and Tx queue status Content-Language: en-US To: Jie Hai , dev@dpdk.org, Thomas Monjalon , Andrew Rybchenko Cc: lihuisong@huawei.com, David Marchand References: <20230908112901.1169869-1-haijie1@huawei.com> <20230928074305.2991100-1-haijie1@huawei.com> <20230928074305.2991100-2-haijie1@huawei.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKK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w/tXmA17nx+c2uR5jx8wb4j68umG2X++0dSta5eHAVhmtXvrqPW6Ku 3FQ= In-Reply-To: <20230928074305.2991100-2-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P302CA0026.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM6PR12MB4545:EE_ X-MS-Office365-Filtering-Correlation-Id: 28b7eed6-5602-4ea8-80b8-08dbc02508ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GhrFDvxJafvgp6EhLgy791lSmFbKNyyL3mnmrOk6MECPPdrhKgWgiqF8wjJUpvNnbxXhvpiX757p64CEkwxDbiTAtXE7Few3ESNPG3pNSvAqQ3etut0nD4mznl6UIkgD65NhjZXfLiM4zfAg5CTJk9lueYDLVNrg+q3sS1cUW5np0F6OTJC9b9jeKk5WQCk4tvxwo/1jQGo1QEBIPUL60hKW4zIg0QFmLx/+AFAnSucyXw09TAg75MPEk641meBJzVG3uLbBNFKLUhGdVLSyo7QdcvrEiwgnIspB7QaePFAzSuTM9Mrp2rmLtIbSacxC71OGFWDzzkp02IJTnTMu29DrvJdTnRGrcDgL4+FVMRE1n992d4cBmrGXI5oB3V5J8C5f6bDR0hD7hfk88okWVro0Y6QoQ/gRGXIbcIjg0Bj8mk1CTvhTf3bAoPdlvzHz7pL5fbCVNShct7uCZlX+buAFB4lnyaWELHYI7VpDhMi1RdBekufQ71HzkSQ0dLJMsQ76UTUSPpl1mO4KA1fhOBzRd2d7sjqiynhwyUOpchj9OTPp3v1kSFSUEU6wuBpWNo3MPcbatSdDkGLJGB+p4W6xBCDol8q37b49rUqwTq4a2wDhHqmTButpNJM329I1AC+jpWl8yiCoeuBPV8wofg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(346002)(39860400002)(366004)(396003)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(2616005)(6506007)(6666004)(53546011)(6486002)(478600001)(83380400001)(26005)(6512007)(15650500001)(2906002)(41300700001)(316002)(5660300002)(66946007)(66476007)(66556008)(44832011)(8676002)(8936002)(4326008)(110136005)(36756003)(38100700002)(86362001)(31696002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dE9nWGJkMUtMSzlWRG5zb0JpRWpZWWZiUUt2UG40QzJuYnhFdjB6ZlU2QnNI?= =?utf-8?B?RnRXUGQyQWM2S3FRVzNBU1QwQVRMZ1lSRTA0SjBJaTM0WkgrZmJnQ1grdHl3?= =?utf-8?B?RUhEdCtYTU45cmE3cHNkUXJheHJ6L2ovdk5PNFhHTDVUL2ZCU2o5ZnZiSkVL?= =?utf-8?B?d21MWm5HMlNKN2xqemlLYlpISlpKU0czUTNuK291cjg4WXI5QlFRRmZ6MGlR?= =?utf-8?B?bi95SWNOcXY5dDN0RUx5MjVwTjNNMUMxTnhvUStoNHRoRENpRU5NZkNjTVJn?= =?utf-8?B?MmVYcWhqRkVIWU9sc1RVNVVOTldQZnZvaks3RUREcStDUjMzNzdkOWxKMzlM?= =?utf-8?B?UHRHR0hDZ0drcXVjNXY3WitSV1EyZ0xsNjdHd3gzbnZ2bHBwTHkxeElhT3Bz?= =?utf-8?B?MGw1TnM4VXZrc1BXODBkdmNQSWZUNVo2OFZnTW5VY3RuQVIvTnBCWEhKbDZz?= =?utf-8?B?QXJ4SGZhT3N1L3ZGMTg2dzZMbkMwcVdsVHg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JwcGE5MTE5RDhnR2grRFZMVkducEgyaGFNMXJs?= =?utf-8?B?a0lrcVFra2t2eG1nU1ZCaWduaE9XWkdMSmdUcGJMdE01c3ZqdG1zZGI0TzND?= =?utf-8?B?TVhzMmZ2Y0pOaVhpVGFReVN0V0VSVXJNMEcyako1RmRnK1ZWMzR3SGVNNXhy?= =?utf-8?B?Ykx2WW0zZzdGQXpMSVBTZFJUV0FWREJtQjNST0tlOGNDbUNsMjdBUVFpY21t?= =?utf-8?B?Mm53b0Y3TFdZRWZBd0plOTZEWjRtQk8zTGFFYnB6VFBIcDN2blBiakVTcXFS?= =?utf-8?B?Ny9mOVJrZFdldEc1eE9OYVlEWmdQQmc0RU9TbGNRemNKWnRLTEdkYVkzK3FO?= =?utf-8?B?ZVJ1LzJSOFo0Uk5hTytvbTQ0WG1MdTFXM1BzSjFGQk1KVTQ0djZ3Q2xzYWp1?= =?utf-8?B?ZWxySEQwSlZPODZlZnNiTEVhUWdqOGo3Wk9IWEU0OGR3QmMwY1FtVGNhd2Ez?= =?utf-8?B?clJjcnZqSUFJRFdJNzJpRkt4R0tSUS9Qa1BLNXZ6UkNQajZQT1Rub1B1cGcz?= =?utf-8?B?OThRMmhyR1VscW0vQnZ1bXd3NWJ1TEJSbmlkU1BUVW1BeU9EdUgwdkJlK0VC?= =?utf-8?B?OHVGSEhwTjNQenpBa3VWODdNYk9rcHJ2bTRYZGEwNmdVMnM0czBZeGl4aFZu?= =?utf-8?B?T082bWRJWm9DZkh4UFZxQjNyM0xCUTFmalJrcjZhVHorSFVwUk9qcVV2MjJV?= =?utf-8?Q?eR0JBkzy7kZsWIsScceIBhlY0?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28b7eed6-5602-4ea8-80b8-08dbc02508ef X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 13:15:50.1630 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rHgEiLVYUfX27yVSzbt/XalWs1zDuO38Und4psZ14gmj5pSYenofwV41MjKEeGnM X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4545 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 On 9/28/2023 8:42 AM, Jie Hai wrote: > The DPDK framework reports the queue status, which is stored in > 'dev->data->tx_queue_state' and 'dev->data->rx_queue_state'.The > state is currently maintained by the drivers. Users may determine > whether a queue participates in packet forwarding based on the > state. However, not all drivers correctly report the queue status. > This may cause forwarding problems. > > Since it is difficult to modify the queue status of all drivers, > we consider updating the queue status at the framework level. > Some drivers support queues for hairpin, leaving status updating > for such queues to the drivers. Some drivers support > 'deferred_start'. Assume that all drivers that support > 'deferred_start' can obtain the configuration through > 'rte_eth_tx_queue_info_get' and 'rte_eth_rx_queue_info_get'. So > we can directly update the queue status in 'rte_eth_dev_start' > and 'rte_eth_dev_stop'. > > Signed-off-by: Jie Hai > --- > lib/ethdev/rte_ethdev.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 0840d2b5942a..e3aaa71eba9e 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -1641,6 +1641,9 @@ rte_eth_dev_start(uint16_t port_id) > struct rte_eth_dev_info dev_info; > int diag; > int ret, ret_stop; > + uint16_t i; > + struct rte_eth_rxq_info rxq_info; > + struct rte_eth_txq_info txq_info; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -1697,6 +1700,30 @@ rte_eth_dev_start(uint16_t port_id) > (*dev->dev_ops->link_update)(dev, 0); > } > > + for (i = 0; i < dev->data->nb_rx_queues; i++) { > + if (rte_eth_dev_is_rx_hairpin_queue(dev, i)) > + continue; > + > + memset(&rxq_info, 0, sizeof(rxq_info)); > + ret = rte_eth_rx_queue_info_get(port_id, i, &rxq_info); > + if (ret == 0 && rxq_info.conf.rx_deferred_start != 0) > + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + else > + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; > + } > + > + for (i = 0; i < dev->data->nb_tx_queues; i++) { > + if (rte_eth_dev_is_tx_hairpin_queue(dev, i)) > + continue; > + > + memset(&txq_info, 0, sizeof(txq_info)); > + ret = rte_eth_tx_queue_info_get(port_id, i, &txq_info); > + if (ret == 0 && txq_info.conf.tx_deferred_start != 0) > + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + else > + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; > + } > + Hi Jie, I am not sure about adding queue_info_get() calls a dependency to start(), since start() is a mandatory API, I am concerned about possible side affects. Like if rte_eth_rx_queue_info_get() fails, Or event though deferred_start is set, can application first call rx_queue_start(), later start(), like: start() rx_queue_start() stop() rx_queue_start() start() Or even applications sets deferred_start, PMD be ignoring without reflecting that to conf.rx_deferred_start, etc... Anyway, intention was to move common task, setting queue state, to the ethdev layer, but because of the deferred_start, in rte_eth_dev_start() we don't really know the queue state. We can try to move deferred state information to the ethdev, but that is similar to setting queue state in the driver, that is why perhaps better to leave setting state to drivers, as done in the first version of the set. @Jie, @David, what do you think? And, @Jie, can you also check the rx_queue_start() & tx_queue_start() dev_ops of the drivers sets the queue state? If missing on some drivers, that needs to be added too. > /* expose selection of PMD fast-path functions */ > eth_dev_fp_ops_setup(rte_eth_fp_ops + port_id, dev); > > @@ -1708,6 +1735,7 @@ int > rte_eth_dev_stop(uint16_t port_id) > { > struct rte_eth_dev *dev; > + uint16_t i; > int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > @@ -1731,6 +1759,18 @@ rte_eth_dev_stop(uint16_t port_id) > dev->data->dev_started = 0; > rte_ethdev_trace_stop(port_id, ret); > > + for (i = 0; i < dev->data->nb_rx_queues; i++) { > + if (rte_eth_dev_is_rx_hairpin_queue(dev, i)) > + continue; > + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + } > + > + for (i = 0; i < dev->data->nb_tx_queues; i++) { > + if (rte_eth_dev_is_tx_hairpin_queue(dev, i)) > + continue; > + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + } > + > return ret; > } >