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 8035F42548; Fri, 8 Sep 2023 14:01:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 751C7402D0; Fri, 8 Sep 2023 14:01:18 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CA53D40285 for ; Fri, 8 Sep 2023 14:01:16 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id A08485A; Fri, 8 Sep 2023 15:01:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru A08485A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1694174475; bh=7/YGjl99GMZ0pVDFQMYnCVPgSTrAKD6XOHBFtfn9O7g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Uz9ix+F0jX7KqrNgIr7gvwZBMwU37Tdjj0E1c5gD8dx5Jzqhp11DwW3l2nIXNyRK+ I+7xx2AGw5etU0DYr8xau+vxtUNaWkVOi1hPFV62hoEKmXRGqJlEGu8lovKaOm59lf ktJGl8ATGioTFWJUFl0EKGSHM3lS7IPBb1hq9WKU= Message-ID: <7cf9adb7-4fdb-7d02-4634-0201ed54b50c@oktetlabs.ru> Date: Fri, 8 Sep 2023 15:01:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 30/36] net/sfc: fix Rx and Tx queue state Content-Language: en-US To: Jie Hai , dev@dpdk.org, Thomas Monjalon , Lijun Ou , Chengwen Feng , Konstantin Ananyev Cc: lihuisong@huawei.com, Ferruh Yigit References: <20230908112901.1169869-1-haijie1@huawei.com> <20230908112901.1169869-31-haijie1@huawei.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20230908112901.1169869-31-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/8/23 14:28, Jie Hai wrote: > 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 to the actual situation. > > Fixes: 9ad9ff476cac ("ethdev: add queue state in queried queue information") > Cc: stable@dpdk.org > > Signed-off-by: Jie Hai > --- > drivers/net/sfc/sfc_repr.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c > index 6c7727d56980..278e37477530 100644 > --- a/drivers/net/sfc/sfc_repr.c > +++ b/drivers/net/sfc/sfc_repr.c > @@ -263,6 +263,7 @@ static int > sfc_repr_dev_start(struct rte_eth_dev *dev) > { > struct sfc_repr *sr = sfc_repr_by_eth_dev(dev); > + uint16_t i; > int ret; > > sfcr_info(sr, "entry"); > @@ -274,6 +275,11 @@ sfc_repr_dev_start(struct rte_eth_dev *dev) > if (ret != 0) > goto fail_start; > > + for (i = 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; > + for (i = 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; May be I miss something, but the driver does when queue is really started in sfc_rx_qstart() and sfc_tx_qstart(). Also the patch is wrong in general in the case of deferred start queues. Same for stop. > + > sfcr_info(sr, "done"); > > return 0; > @@ -338,6 +344,7 @@ static int > sfc_repr_dev_stop(struct rte_eth_dev *dev) > { > struct sfc_repr *sr = sfc_repr_by_eth_dev(dev); > + uint16_t i; > int ret; > > sfcr_info(sr, "entry"); > @@ -352,6 +359,11 @@ sfc_repr_dev_stop(struct rte_eth_dev *dev) > > sfc_repr_unlock(sr); > > + for (i = 0; i < dev->data->nb_rx_queues; i++) > + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + for (i = 0; i < dev->data->nb_tx_queues; i++) > + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; > + > sfcr_info(sr, "done"); > > return 0;