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 20FF745EAA; Sun, 15 Dec 2024 09:57:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8CC14026F; Sun, 15 Dec 2024 09:56:59 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CD54340269 for ; Sun, 15 Dec 2024 09:56:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 8431044 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1734253015; bh=7kwi78pKopejS/Cf7mo6gcusyRiQvwqz4A+MlgP0Ccg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=qAlFobeCbqLP4pntrJLXBma71XbEifQMpMQoMWfuAnTowm1ro88zzJxIpIcTgEcDo mwAxF7tqFdZCZkcIHMJ+ZVrvX3CNZFrgDF8ThGvIzCrKMDn9Pplvl6gMXLUGolU7ht 3oYYco6JYQyYKcz0jJzFUxdiRSXIc+jnn3X8VRy4= 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 8431044; Sun, 15 Dec 2024 11:56:55 +0300 (MSK) Message-ID: <9c5a3e1e-a1b7-4f3f-96f5-674031de6e15@oktetlabs.ru> Date: Sun, 15 Dec 2024 11:56:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] ethdev: check that device supports deferred start To: Stephen Hemminger , dev@dpdk.org Cc: Thomas Monjalon , Ferruh Yigit References: <20241213214929.817688-1-stephen@networkplumber.org> <20241214180843.6662-1-stephen@networkplumber.org> <20241214180843.6662-2-stephen@networkplumber.org> Content-Language: en-US From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20241214180843.6662-2-stephen@networkplumber.org> 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 12/14/24 21:07, Stephen Hemminger wrote: > The check for supporting deferred start should be handled at > the ethdev level for all devices. It is a good idea to check it on ethdev level. Strictly speaking presence of queue start/stop callback does not mean support for deferred start right now. It is possible to use stop/start without deferred start feature. However, such check is much better than nothing since deferred start definitely requires queue start callback. It would be good to clarify it in the documentation. doc/guides/nics/features.rst does not mention deferred start at all. In fact, I don't mind to couple deferred start to queue start/stop features. One nit below. Anyway: Acked-by: Andrew Rybchenko > > Signed-off-by: Stephen Hemminger > --- > lib/ethdev/rte_ethdev.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 6413c54e3b..7768058f6d 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -2264,6 +2264,11 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, > if (rx_conf != NULL) > rx_offloads |= rx_conf->offloads; > > + /* Deferred start requires that device supports queue start */ > + if (rx_conf != NULL && rx_conf->rx_deferred_start && > + *dev->dev_ops->rx_queue_start == NULL) > + return -ENOTSUP; Wouldn't it be useful to add some kind of logging to simplify debugging in this case. > + > /* Ensure that we have one and only one source of Rx buffers */ > if ((mp != NULL) + > (rx_conf != NULL && rx_conf->rx_nseg > 0) + > @@ -2575,6 +2580,11 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, > return -EINVAL; > } > > + /* Deferred start requires that device supports queue start */ > + if (tx_conf != NULL && tx_conf->tx_deferred_start && > + *dev->dev_ops->tx_queue_start == NULL) > + return -ENOTSUP; > + > ret = rte_eth_dev_info_get(port_id, &dev_info); > if (ret != 0) > return ret;