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 877C042614; Fri, 22 Sep 2023 08:42:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3342740265; Fri, 22 Sep 2023 08:42:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E653C40151 for ; Fri, 22 Sep 2023 08:42:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695364929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0jsjxGaZEXSbG1k8vUZZ1BN/dnR/mvtDNmey1MkPaZs=; b=Uky4DEoLB4VtNo01s0N3GtJQ0orpSlnbLExntRYGGn9m1jzwSazmfL2bolnF46VZANbthY Y8Oip9b+vl8qgCnHwTJVmBuvjCPnfNjuiBu93MUHaCm/GHKtShqBWhAkaTAoRQlvxCmv9V zZ5UqGD3ZFlEJRFmYtGAQJVF6e8AByE= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-216-f-BNxQSgPHGa2s1vJjfeYw-1; Fri, 22 Sep 2023 02:42:07 -0400 X-MC-Unique: f-BNxQSgPHGa2s1vJjfeYw-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2c0165b5c5cso22556491fa.1 for ; Thu, 21 Sep 2023 23:42:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695364926; x=1695969726; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0jsjxGaZEXSbG1k8vUZZ1BN/dnR/mvtDNmey1MkPaZs=; b=hawnAh2/lSBux4V21HxinNS90qHvZ8O+4TE5c7pWUgliOd4oIUFOMw1JeoIQrfkioc 9NsKmjhqE1dsPOInPfPUeK0tkvD8FTjBUbNpS4yuMu/FVaISE//pb/6+ybXFxMUgrM1d Ete4YMiAabstHZ5bh0aNRtFTjUcyt+NpJWA66Aatvgddj9aQZ5aaC/H70wpxnAVdTA2A fW9rS0ZWv/Cr9ldhunrMEgYxzQhy3Fidux90MV/OsXQpocrNxq86WHSKABwRfu+EKbcf kCDEQxtLUEtkUtGQpCNddWtm38qOqq7BACUPBTamiB8bCZhXOafcx8+tzsJ0vcnnhExI /zew== X-Gm-Message-State: AOJu0YxJttt2pHhtExS4QLSjA/DPgXE7MvVNrzy8Cda37KSi6Cf/0CWE RZUuF8RGTYcLkzmBaSp479m0DXAP4XGbj19bfPUJayzGvtOT5msvoRY0yTs0tXo2Vz2LVOlmqTl razqlp0gYMvzeNHBe91c= X-Received: by 2002:a2e:6a09:0:b0:2b9:f13b:613c with SMTP id f9-20020a2e6a09000000b002b9f13b613cmr7225432ljc.2.1695364926391; Thu, 21 Sep 2023 23:42:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpxyNLr8lsFWENZrivX8GgwCN1KLe9P7JiS5Z69a8gJgZUSF6MV+nK2gWiwOJ/qNhPXhsmpAEbgjP/xKOZiTQ= X-Received: by 2002:a2e:6a09:0:b0:2b9:f13b:613c with SMTP id f9-20020a2e6a09000000b002b9f13b613cmr7225422ljc.2.1695364926066; Thu, 21 Sep 2023 23:42:06 -0700 (PDT) MIME-Version: 1.0 References: <20230908112901.1169869-1-haijie1@huawei.com> <6c030892-5e27-4537-9262-c733914d95df@amd.com> In-Reply-To: From: David Marchand Date: Fri, 22 Sep 2023 08:41:54 +0200 Message-ID: Subject: Re: [PATCH 00/36] fix Rx and Tx queue state To: Jie Hai Cc: Ferruh Yigit , dev@dpdk.org, lihuisong@huawei.com, Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hello, On Fri, Sep 22, 2023 at 4:41=E2=80=AFAM Jie Hai wrote: > On 2023/9/19 0:54, Ferruh Yigit wrote: > > On 9/8/2023 12:50 PM, David Marchand wrote: > >> On Fri, Sep 8, 2023 at 1:32=E2=80=AFPM Jie Hai wr= ote: > >>> > >>> 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, > >>> for example, > >> > >> The driver is maintaining this state in dev_start / dev_stop and per > >> queue start/stop handlers. > >> > >>> > >>> [1] 5028f207a4fa ("app/testpmd: fix secondary process packet forwardi= ng" > >>> [2] 141a520b35f7 ("app/testpmd: fix primary process not polling all q= ueues") > >>> > >>> Therefore, the drivers need to modify the queue state in time > >>> according to the actual situation, especially when dev_start > >>> and dev_stop are called. see [3] for more information. > >>> > >>> [3] https://inbox.dpdk.org/dev/20230721160422.3848154-1-ferruh.yigit@= amd.com/ > >>> > >>> This patchset also resubmit the patch [2] and makes some fixes on the= patch. > >> > >> I just had a quick look at some patches and I wonder if a better fix > >> would be at the ethdev level, rather than fixing all drivers. > >> > >> > > > > I came here to make the same comment, > > > > Jie, I forgot if we discuss this already but, > > > > does it work if we update queue state in 'rte_eth_dev_start()' & > > 'rte_eth_dev_stop()' when 'dev_start' & 'dev_stop' dev_ops succeeds? > > > > This solves the case driver forgets to update the queue state. > > > > > Hi, Furrh and David, > > It's OK for dev_stop, but not enough for dev_start. > Some drivers also support deferred_start. > Therefore, not all queues are in the start state after dev_start. > > If we want to get that correct queue state at the framework level, I > offer the following options: > > step 1. A capability(e.g. RTE_ETH_DEV_CAPA_DEFERRED_START) is added to > the framework, indicating whether the driver supports deferred_start. > The capability should be reported by the driver and user can get it by > rte_eth_dev_info_get(). > step 2. All drivers that support deferred_start should report configurati= on > information about deferred_start through > rte_eth_rx_queue_info_get |rte_eth_tx_queue_info_get. > step 3.The framework updates the queue status based on the support and > configuration of deferred_start. rte_eth_dev_start must only update the queue state if rx_deferred_start is unset (see struct rte_eth_rxconf::rx_deferred_start). And the queue state needs to be updated in ethdev rte_eth_dev_rx_queue_start/stop. So I don't see where we need a new capability. --=20 David Marchand