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 71F834611A; Fri, 24 Jan 2025 09:39:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B00640E11; Fri, 24 Jan 2025 09:39:31 +0100 (CET) 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 7A8E4402E9 for ; Fri, 24 Jan 2025 09:39:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737707969; 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=PQf02has+7WEcWj9WQbtib7aO7mErwZB8qQb/HpmL5U=; b=ZUY7xegYqEPv+s8CL+Z8Bio39zh0Ja5N4+DmwAJFt2iK+jdj0HIn3jHeO8OmMzgSSx/Xl3 BgAXXyUP2wB4hEwB9mulxYkXIhh5lC+il8W8Pd6q6x/EOxykmrH/qMDjnhITHfdIyN2Baq 2Fe5WsvSdS+x/Az99QAtvRj2Fqnp9fg= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-Fkc5_4j5MTiJttX4iEX2qw-1; Fri, 24 Jan 2025 03:39:27 -0500 X-MC-Unique: Fkc5_4j5MTiJttX4iEX2qw-1 X-Mimecast-MFC-AGG-ID: Fkc5_4j5MTiJttX4iEX2qw Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-30627346ce8so6970031fa.0 for ; Fri, 24 Jan 2025 00:39:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737707966; x=1738312766; 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=PQf02has+7WEcWj9WQbtib7aO7mErwZB8qQb/HpmL5U=; b=eKDjQYMr7su4UTtNJO7H25FxY1/NrEdAB1/iB9GsTaEO1ZlwVZID68v6UktWEuRSoe fstjzA5Inh5d07+qvu1kNhLMlo1+fRYzK9lDs6JDyDyOpU/BfQoh+7JlEuWkUflSwNSW +CQJsaKFc0mXs+ubmo/3NxITZ26DmGhTZxoKvL3xolv+JWwPyHVAlURB+ZSEdE33XKlB GHG1752urQIll04K+lgczqvptqKZdY3OjeEZ/ftWZo/ZWmGJ1vqA6eFkIjHv3obhiHYW 2KkDaHWpUyTphYUNNH8NducZeDW/0XGFUhhqsJneWh5EozgO998iGuekj0i9K3sVgiw3 M+qQ== X-Gm-Message-State: AOJu0YyUVnF2y5GoXe9c19y6K9SjtZvn2WNaAjw3f6IO/W3gz3FBGuTd 7ioYA8GS60gHPW43VNrDjg3JH4UvmrQIHnin0Cz62YR8pUuGaN6t+nE9Ov/OO4rAcI5QS3sOSKN ruyI8juByayt/Jjnee+sn4PDaCT7CLgf7mOffslcKwYZHelsnlaZJ+Ivqpld006WSSTIGIuZYVA ht9ciQrOgVNA+4JFs= X-Gm-Gg: ASbGnctEymPf6jUZwg0mnzRRPlH0Zh0fdhkWXUb7dgBzehziBvQRAFqwiV0f7tXRkfB pqAp7RTeI4JOMDnf4XDANgkii+V0+DSAVfrx2F2XZ1H/C36AQF581+w== X-Received: by 2002:a05:6512:3405:b0:542:232c:d3eb with SMTP id 2adb3069b0e04-5439c241275mr11048846e87.19.1737707965995; Fri, 24 Jan 2025 00:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrvRH4tmG/JQMSLCbiSxEaNqM7V+Kx22N0xjCygkj8A0HXn8yGwbdVs5tiRMsWS33Z5Mf38QqIswpbl/sBhzE= X-Received: by 2002:a05:6512:3405:b0:542:232c:d3eb with SMTP id 2adb3069b0e04-5439c241275mr11048831e87.19.1737707965564; Fri, 24 Jan 2025 00:39:25 -0800 (PST) MIME-Version: 1.0 References: <20241122125418.2857301-1-bruce.richardson@intel.com> <20250120120016.1530274-1-bruce.richardson@intel.com> <20250120120016.1530274-8-bruce.richardson@intel.com> In-Reply-To: <20250120120016.1530274-8-bruce.richardson@intel.com> From: David Marchand Date: Fri, 24 Jan 2025 09:39:13 +0100 X-Gm-Features: AWEUYZn9ezxDNq-e6wGALlbmk-I1X2TDNcP5LtMKPKnFrMuiWZkCdfvTUp_xeqc Message-ID: Subject: Re: [PATCH v5 07/25] net/intel/common: merge ice and i40e Tx queue struct To: Bruce Richardson Cc: dev@dpdk.org, Ian Stokes , Anatoly Burakov X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QIrRKrJLj6RDgGl6omCFnAWx8udLQPjk2U7U-Wrw9tk_1737707966 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 On Mon, Jan 20, 2025 at 1:00=E2=80=AFPM Bruce Richardson wrote: > > The queue structures of i40e and ice drivers are virtually identical, so > merge them into a common struct. This should allow easier function > merging in future using that common struct. > > Signed-off-by: Bruce Richardson > --- > drivers/net/intel/common/tx.h | 55 +++++++++++++++++ > drivers/net/intel/i40e/i40e_ethdev.c | 4 +- > drivers/net/intel/i40e/i40e_ethdev.h | 4 +- > drivers/net/intel/i40e/i40e_fdir.c | 4 +- > .../i40e/i40e_recycle_mbufs_vec_common.c | 2 +- > drivers/net/intel/i40e/i40e_rxtx.c | 58 +++++++++--------- > drivers/net/intel/i40e/i40e_rxtx.h | 50 ++-------------- > .../net/intel/i40e/i40e_rxtx_vec_altivec.c | 4 +- > drivers/net/intel/i40e/i40e_rxtx_vec_avx2.c | 4 +- > drivers/net/intel/i40e/i40e_rxtx_vec_avx512.c | 6 +- > drivers/net/intel/i40e/i40e_rxtx_vec_common.h | 2 +- > drivers/net/intel/i40e/i40e_rxtx_vec_neon.c | 4 +- > drivers/net/intel/i40e/i40e_rxtx_vec_sse.c | 4 +- > drivers/net/intel/ice/ice_dcf.c | 4 +- > drivers/net/intel/ice/ice_dcf_ethdev.c | 10 ++-- > drivers/net/intel/ice/ice_diagnose.c | 2 +- > drivers/net/intel/ice/ice_ethdev.c | 2 +- > drivers/net/intel/ice/ice_ethdev.h | 4 +- > drivers/net/intel/ice/ice_rxtx.c | 60 +++++++++---------- > drivers/net/intel/ice/ice_rxtx.h | 41 +------------ > drivers/net/intel/ice/ice_rxtx_vec_avx2.c | 4 +- > drivers/net/intel/ice/ice_rxtx_vec_avx512.c | 8 +-- > drivers/net/intel/ice/ice_rxtx_vec_common.h | 8 +-- > drivers/net/intel/ice/ice_rxtx_vec_sse.c | 6 +- > 24 files changed, 165 insertions(+), 185 deletions(-) > > diff --git a/drivers/net/intel/common/tx.h b/drivers/net/intel/common/tx.= h > index 5397007411..c965f5ee6c 100644 > --- a/drivers/net/intel/common/tx.h > +++ b/drivers/net/intel/common/tx.h > @@ -8,6 +8,9 @@ > #include > #include > > +/* forward declaration of the common intel (ci) queue structure */ > +struct ci_tx_queue; > + > /** > * Structure associated with each descriptor of the TX ring of a TX queu= e. > */ > @@ -24,6 +27,58 @@ struct ci_tx_entry_vec { > struct rte_mbuf *mbuf; /* mbuf associated with TX desc, if any. *= / > }; > > +typedef void (*ice_tx_release_mbufs_t)(struct ci_tx_queue *txq); > + > +struct ci_tx_queue { > + union { /* TX ring virtual address */ > + volatile struct ice_tx_desc *ice_tx_ring; > + volatile struct i40e_tx_desc *i40e_tx_ring; > + }; Minor nit.. this gets alphabetically sorted in a later patch. > + volatile uint8_t *qtx_tail; /* register address of = tail */ > + struct ci_tx_entry *sw_ring; /* virtual address of SW ring */ > + rte_iova_t tx_ring_dma; /* TX ring DMA address */ > + uint16_t nb_tx_desc; /* number of TX descriptors */ > + uint16_t tx_tail; /* current value of tail register */ > + uint16_t nb_tx_used; /* number of TX desc used since RS bit set *= / > + /* index to last TX descriptor to have been cleaned */ > + uint16_t last_desc_cleaned; > + /* Total number of TX descriptors ready to be allocated. */ > + uint16_t nb_tx_free; > + /* Start freeing TX buffers if there are less free descriptors th= an > + * this value. > + */ > + uint16_t tx_free_thresh; > + /* Number of TX descriptors to use before RS bit is set. */ > + uint16_t tx_rs_thresh; > + uint8_t pthresh; /**< Prefetch threshold register. */ > + uint8_t hthresh; /**< Host threshold register. */ > + uint8_t wthresh; /**< Write-back threshold reg. */ > + uint16_t port_id; /* Device port identifier. */ > + uint16_t queue_id; /* TX queue index. */ > + uint16_t reg_idx; > + uint64_t offloads; > + uint16_t tx_next_dd; > + uint16_t tx_next_rs; > + uint64_t mbuf_errors; > + bool tx_deferred_start; /* don't start this queue in dev start */ > + bool q_set; /* indicate if tx queue has been configur= ed */ > + union { /* the VSI this queue belongs to */ > + struct ice_vsi *ice_vsi; > + struct i40e_vsi *i40e_vsi; > + }; Idem. > + const struct rte_memzone *mz; > + > + union { > + struct { /* ICE driver specific values */ > + ice_tx_release_mbufs_t tx_rel_mbufs; > + uint32_t q_teid; /* TX schedule node id. */ > + }; > + struct { /* I40E driver specific values */ > + uint8_t dcb_tc; > + }; > + }; > +}; > + > static __rte_always_inline void > ci_tx_backlog_entry(struct ci_tx_entry *txep, struct rte_mbuf **tx_pkts,= uint16_t nb_pkts) > { --=20 David Marchand