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 AF01245D41; Tue, 19 Nov 2024 10:17:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52A5B427A8; Tue, 19 Nov 2024 10:17:37 +0100 (CET) Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) by mails.dpdk.org (Postfix) with ESMTP id C8C5B40268 for ; Tue, 19 Nov 2024 10:17:35 +0100 (CET) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id CF73D11401B1; Tue, 19 Nov 2024 04:17:34 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 19 Nov 2024 04:17:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732007854; x=1732094254; bh=Pge/krwJ7lOC512+C28BKiFHdcVwCtWVI170fu9xWww=; b= hxDgo+vBUbS0wD4kCK1mJhq9aFCpgW4b1IV+RnEKDX95R0x+AJjoUDwHsAJr02TX /1h8tj5vHQpnOBsqx/0IkxhytLP89wnEA8/FNRBEbNUwRAYji55aFRs+axxjqL3o n2yt4qgKFXnKQcf9F8Bk/fpdoRnF4mnKq0UpdTCcJZwRoiGPYaeFAdqRB9pipi5y n5GEE8ELZTJVnjVoGVwZO1uVk4t8t8D2whbOdDJUpJLme4Skb8n4rwCDnjUCRijP JLOuL/NIycv2QwDOWwTfQeEti+/IqLv6t8Dq57GytRB+JHrh+K5M4pTtAfua0gcn sdm5ZxO8swDh+vuKsZz86Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1732007854; x= 1732094254; bh=Pge/krwJ7lOC512+C28BKiFHdcVwCtWVI170fu9xWww=; b=M kEXy2sAFqcH1FBdgbBqrEZBw61oRXPi1YkBoteh6ICadE9j4ZnXe/wx/aaGTIbhP JE0FSzQprSe+zPqrH4PeSeQweD8T+a1Pejc63jCpdnH6HnipWmm57W59u9NHcMpY y9PyAJCR4GQwvzrx39Ec6LqrT+YmSZT2Yv8wtpxwg/D1wiAwAciANs5LofoXLB7o WoA17/SKVVB4JnXh+/nXcqqcU2slHzQDdyYFNqZ6KzAy5KgXJR/aWDoYW//JpB1l S3+VlCIxkjyvofECoQdHCixa5P2a9D7DkK7CWU2q3i5C/PYA3U4JSbeUOPEn+Y4i 939kkvt/pXWccOKbiel3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfedvgddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdejnecu hfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlh honhdrnhgvtheqnecuggftrfgrthhtvghrnhepgedttdeljeejgeffkeekkedtjeevtdeh vedtkeeivdeuuedvieduvdelveejueejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthdpnhgs pghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphhrohgpnh hitggpughpughksehrvggrlhhtvghkrdgtohhmpdhrtghpthhtohephhhofigrrhgupgif rghnghesrhgvrghlshhilhdrtghomhdrtghnpdhrtghpthhtohepuggvvhesughpughkrd horhhgpdhrtghpthhtohepfhgvrhhruhhhrdihihhgihhtsegrmhgurdgtohhm X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Nov 2024 04:17:32 -0500 (EST) From: Thomas Monjalon To: "pro_nic_dpdk@realtek.com" , =?UTF-8?B?546L6aKi?= Cc: "dev@dpdk.org" , Ferruh Yigit Subject: Re: =?UTF-8?B?562U5aSNOiDnrZTlpI06?= [PATCH v8 12/17] net/r8169: implement Tx path Date: Tue, 19 Nov 2024 10:17:30 +0100 Message-ID: <2257300.72vocr9iq0@thomas> In-Reply-To: <119104a4d3e048349ffe2d4643f119fa@realsil.com.cn> References: <20241113092854.91445-1-howard_wang@realsil.com.cn> <1768763.QkHrqEjB74@thomas> <119104a4d3e048349ffe2d4643f119fa@realsil.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Yes atomic load is perfect. rte_rmb is worst :) 19/11/2024 09:52, =E7=8E=8B=E9=A2=A2: > Dear Thomas, >=20 > How about the following modification? Or could I just change rte_smp_rmb = to rte_rmb instead? >=20 > struct rtl_tx_desc { > RTE_ATOMIC(u32) opts1; > u32 opts2; > u64 addr; > u32 reserved0; > u32 reserved1; > u32 reserved2; > u32 reserved3; > }; >=20 > static u32 > rtl_get_opts1(struct rtl_tx_desc *txd) > { > u32 opts1 =3D rte_atomic_load_explicit (&txd->opts1, rte_memory_order= _acquire); >=20 > return rte_le_to_cpu_32(opts1); > } >=20 >=20 > Best Wishes, > Howard Wang >=20 > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Thomas Monjalon =20 > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2024=E5=B9=B411=E6=9C=8819=E6=97=A5= 15:16 > =E6=94=B6=E4=BB=B6=E4=BA=BA: pro_nic_dpdk@realtek.com; =E7=8E=8B=E9=A2=A2= > =E6=8A=84=E9=80=81: dev@dpdk.org; Ferruh Yigit > =E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: [PATCH v8 12/17] net/r8169: i= mplement Tx path >=20 >=20 > External mail. >=20 >=20 >=20 > The change below is replacing 1 rte_smp_rmb with 2 calls, so no it is not= what I am asking for. > Please could you check how to not calling this function at all? >=20 > This series is already merged in the main branch, so any new change shoul= d be submitted as a new patch. >=20 > Thank you >=20 >=20 > 19/11/2024 07:29, =E7=8E=8B=E9=A2=A2: > > Dear Thomas, > > > > After our discussion, we concluded that we can make the following chang= es. What do you think? Additionally, I may not have been very clear in my l= ast email. Should I submit the entire series of changes as PATCH v9, or sho= uld I respond with [PATCH v9 12/17] net/r8169: implement Tx path? > > > > static u32 > > rtl_get_opts1(struct rtl_tx_desc *txd) { > > - rte_smp_rmb(); > > > > return rte_le_to_cpu_32(txd->opts1); } > > > > static void > > rtl_tx_clean(struct rtl_hw *hw, struct rtl_tx_queue *txq) { > > ... > > tx_left =3D (rte_atomic_load_explicit(&txq->tx_tail, > > rte_memory_order_rela= xed) % nb_tx_desc) - head; > > } > > > > + rte_smp_rmb(); > > > > while (tx_left > 0) { > > txd =3D &txq->hw_ring[head]; > > > > if (!enable_tx_no_close && (rtl_get_opts1(txd) & DescOwn)) > > break; > > ... > > } > > > > > > int > > rtl_tx_done_cleanup(void *tx_queue, uint32_t free_cnt) { > > ... > > tx_left =3D (rte_atomic_load_explicit(&txq->tx_tail, > > rte_memory_order_rela= xed) % nb_tx_desc) - head; > > } > > > > + rte_smp_rmb(); > > > > while (tx_left > 0) { > > txd =3D &txq->hw_ring[head]; > > > > status =3D rtl_get_opts1(txd); > > > > if (!enable_tx_no_close && (status & DescOwn)) > > break; > > > > ... > > } > > > > Best Regards, > > Howard Wang > > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Thomas Monjalon > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2024=E5=B9=B411=E6=9C=8818=E6=97= =A5 22:59 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: pro_nic_dpdk@realtek.com; =E7=8E=8B=E9=A2= =A2 > > =E6=8A=84=E9=80=81: dev@dpdk.org; Ferruh Yigit > > =E4=B8=BB=E9=A2=98: Re: [PATCH v8 12/17] net/r8169: implement Tx path > > > > > > External mail. > > > > > > > > Hello, > > > > 13/11/2024 10:28, Howard Wang: > > > +static u32 > > > +rtl_get_opts1(struct rtl_tx_desc *txd) { > > > + rte_smp_rmb(); > > > + > > > + return rte_le_to_cpu_32(txd->opts1); } > > > > We should avoid using such heavy memory barrier. > > Is it possible to use a lighter fence or atomic API? > > > > > > >=20 >=20 >=20 >=20 >=20 >=20