From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mail.toke.dk (Postfix) with ESMTPS id C4012A02295 for ; Sun, 30 Apr 2023 07:06:09 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Gtx2ID7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682831169; x=1714367169; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=wUIy27kaA7x1m/LYtCGQz0bQD3AE4rfsj1cxLUC2Tzk=; b=Gtx2ID7BxlxDj8kf2qwgbNGMLghSpCkst/xJFuKwHcs0aLRWzOF/B/Za g3nVhpXt+h8VZ79pg6zxDjslIKM6ASxgxR5oFGg9qFcoHGRKGGwQ7plNp WIQotZWtwtngfiuoOQsfGxFJCatROOIJgiLkrUNpRdBNIrx34urBDAh25 Zf+WiHLfk1VRUmNViKBQSR4PXgIzJBpuJAVhusdTq6OceQnexSHctzDaN hf4FdMCI9XiPxfcS1WYPhJAhaQBl/TNbMxp3+xZliQfSXMhmz2umpzPNn pdc7jnnaWHgSRVaKwFNz/p3ha8746WJGPeA6fk0urw1BsISXiP5CfPDhI A==; X-IronPort-AV: E=McAfee;i="6600,9927,10695"; a="348029655" X-IronPort-AV: E=Sophos;i="5.99,238,1677571200"; d="scan'208";a="348029655" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2023 22:06:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10695"; a="728115425" X-IronPort-AV: E=Sophos;i="5.99,238,1677571200"; d="scan'208";a="728115425" Received: from naamamex-mobl.ger.corp.intel.com (HELO [10.13.12.36]) ([10.13.12.36]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2023 22:05:58 -0700 Message-ID: <499598fd-05fc-e3bc-be85-d74b47a0b46c@linux.intel.com> Date: Sun, 30 Apr 2023 08:05:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: 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 , Jesper Dangaard Brouer , Stanislav Fomichev , Jacob Keller , David Laight References: <20230414154902.2950535-1-yoong.siang.song@intel.com> From: "naamax.meir" In-Reply-To: <20230414154902.2950535-1-yoong.siang.song@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: L7O4DLQ73ZXG5KWMDG3EMSQEIGS3POG6 X-Message-ID-Hash: L7O4DLQ73ZXG5KWMDG3EMSQEIGS3POG6 X-MailFrom: naamax.meir@linux.intel.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: xdp-hints@xdp-project.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [Intel-wired-lan] [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 4/14/2023 18:49, Song Yoong Siang wrote: > igc_configure_rx_ring() function will be called as part of XDP program > 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. > > 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 program > to igc driver. It will display hardware timestamp of UDP packet with > port number 9092. Below are detail of test steps and results. > > Command on DUT: > sudo ./xdp_hw_metadata > > Command on Link Partner: > echo -n skb | nc -u -q1 9092 > > Result before this patch: > skb hwtstamp is not found! > > Result after this patch: > found skb hwtstamp = 1677800973.642836757 > > Optionally, read PHC to confirm the values obtained are almost the same: > Command: > sudo ./testptp -d /dev/ptp0 -g > Result: > clock time: 1677800973.913598978 or Fri Mar 3 07:49:33 2023 > > 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 > --- > v2 -> v3: Refactor SRRCTL definitions to more human readable definitions > v1 -> v2: Fix indention > --- > drivers/net/ethernet/intel/igc/igc_base.h | 11 ++++++++--- > drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++-- > 2 files changed, 13 insertions(+), 5 deletions(-) Tested-by: Naama Meir