From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; spf=pass (mailfrom) smtp.mailfrom=rts-flowmailer.siemens.com (client-ip=185.136.65.226; helo=mta-65-226.siemens.flowmailer.net; envelope-from=fm-68982-202304180931197d9a9372056bd3c61d-gkqj_u@rts-flowmailer.siemens.com; receiver=) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; secure) header.d=siemens.com header.i=florian.bezdeka@siemens.com header.a=rsa-sha256 header.s=fm1 header.b=qgSvw768 Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by mail.toke.dk (Postfix) with ESMTPS id F14D09FEF16 for ; Tue, 18 Apr 2023 11:31:21 +0200 (CEST) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 202304180931197d9a9372056bd3c61d for ; Tue, 18 Apr 2023 11:31:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=florian.bezdeka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=CqK3hsqP4ZsT3ZUY+isIcg9eKHACr0lAiNG1+JRla6g=; b=qgSvw768XrHXL9zjoF5Fi+WBoNdMdWHl324bLBiS9wq1u4tQkr2ulODt4ZPNSvEiHuxy2w RKE2yu8Sb8Bi5ojr66/Z5zlRmyQQ9lRmWdbz4qoWuBo9sjNznGinj7y4/74qtLGJqMnle6KC e1VTaI9CzcGE4fniV7kl20klcOhV8=; Message-ID: <98a4831de6c2ae4a3eb8d29dcd114a6e96c34f94.camel@siemens.com> From: Florian Bezdeka To: Jesper Dangaard Brouer , Song Yoong Siang , Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Maciej Fijalkowski , Vedang Patel , Jithu Joseph , Andre Guedes , Stanislav Fomichev , Jacob Keller , David Laight Date: Tue, 18 Apr 2023 11:31:16 +0200 In-Reply-To: References: <20230414154902.2950535-1-yoong.siang.song@intel.com> <934a4204-1920-f5e1-bcde-89429554d0d6@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-68982:519-21489:flowmailer Message-ID-Hash: N65ZIZC2QIFR6Q53YUATKYOLTU4IGCFA X-Message-ID-Hash: N65ZIZC2QIFR6Q53YUATKYOLTU4IGCFA X-MailFrom: fm-68982-202304180931197d9a9372056bd3c61d-GKQj_u@rts-flowmailer.siemens.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: brouer@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, xdp-hints@xdp-project.net, stable@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH net v3 1/1] igc: read before write to SRRCTL register List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 2023-04-17 at 16:24 +0200, Jesper Dangaard Brouer wrote: > On 14/04/2023 22.05, Jesper Dangaard Brouer wrote: > > =20 > > On 14/04/2023 17.49, Song Yoong Siang wrote: > > > igc_configure_rx_ring() function will be called as part of XDP progra= m > > > setup. If Rx hardware timestamp is enabled prio to XDP program setup, > > > this timestamp enablement will be overwritten when buffer size is > > > written into SRRCTL register. > > >=20 > > > Thus, this commit read the register value before write to SRRCTL > > > register. This commit is tested by using xdp_hw_metadata bpf selftest > > > tool. The tool enables Rx hardware timestamp and then attach XDP prog= ram > > > to igc driver. It will display hardware timestamp of UDP packet with > > > port number 9092. Below are detail of test steps and results. > > >=20 > [...] > > >=20 > > > Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") > > > Cc: # 5.14+ > > > Signed-off-by: Song Yoong Siang > > > Reviewed-by: Jacob Keller > > > Reviewed-by: Jesper Dangaard Brouer > > > --- > >=20 > > LGTM, thank for the adjustments :-) > >=20 > > Acked-by: Jesper Dangaard Brouer > >=20 >=20 > Tested-by: Jesper Dangaard Brouer >=20 > I can confirm that this patch fix the issue I experienced with igc. >=20 > This patch clearly fixes a bug in igc when writing the SRRCTL register. > (as bit 30 in register is "Timestamp Received Packet" which got cleared= =20 > before). >=20 > Florian might have found another bug around RX timestamps, but this > patch should be safe and sane to apply as is. After a closer look I'm quite sure now that this patch should fix my issue as well. The register will be overwritten when setting up a XSK_POOL as well: igc_bpf igc_xdp_setup_pool igc_enable_rx_ring igc_configure_rx_ring wr32(IGC_SRRCTL) I already removed the BPF loading (which is the use case that the patch description mentions) from my setup to limit the search scope. If you like you could extend the patch description, but I'm fine with it. Thanks a lot for all the support / ideas! Highly appreciated! Florian >=20 > > > v2 -> v3: Refactor SRRCTL definitions to more human readable definiti= ons > > > v1 -> v2: Fix indention > > > --- > > > =C2=A0 drivers/net/ethernet/intel/igc/igc_base.h | 11 ++++++++--- > > > =C2=A0 drivers/net/ethernet/intel/igc/igc_main.c |=C2=A0 7 +++++-- > > > =C2=A0 2 files changed, 13 insertions(+), 5 deletions(-) >=20