From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D7CD1537C6; Thu, 30 Jan 2025 23:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738280565; cv=none; b=Z+qiGuLARqZHt8OAlL0yRv339yMcz/ySJXPpzfjrsp013IAwXvc13WliwOKafT1tL/1X5ngV3ytviBOYkFQXhM99rzX3/YNkTodIFM+yU0LmD8PYJJEmF+Ckcv1ypekJD1lmVl1DGjFDtBGVrfj+glq0hQwFSuJBCmEONcgbpf4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738280565; c=relaxed/simple; bh=SNgWdW0+w8g7zWzmvBJ6hqxTIrMFupouLSnDTRPedqs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=J0Cf9nrwbfYy1nk/OPvNKgmUxvVCpf1YGyn6cb2AZiHbMd7YNcxJHdu8ePWpuObn6tDGsA590kB/e3gqJf18T1JVX/oeB7+ggUpJPutMGJ5+BwO+viR+3O9Q7J5/RAlSqPu6mWalSOZfunnJLukeAIVZBfYEhhrew1Rze2UvkN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=njBD4Cqe; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="njBD4Cqe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738280564; x=1769816564; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=SNgWdW0+w8g7zWzmvBJ6hqxTIrMFupouLSnDTRPedqs=; b=njBD4CqeB5D6xy51Tc8bVyUbpf5GhYjisE/+RIUI25Dnsi7knQt37i8z //ijX4l6nYKHHS0knmhUaRKBvco9pV0iarSJuxZiyu+5SezGAvDMIM5Wp ZebOAruyR7yqYNWyBgB+8QvxPNhS3svWXqCR+52c2YqLUYR74D8l2Q84/ pCmMfO0mKFOpQ4vocePBpmNlezhf/mtWNCM/Q5G0aJVj2IkyYocXzXbar 06Z5WWdawqfu5mnVYRxKJXPqZqq7Ygu8v0fokcd9mA1JmlvYZoLDXEzUk r+kX2xXFiXUlnvL0BF162Gw11lvWf2qEnJ6vCpVf8UpKOR8sRFWDMd6QT w==; X-CSE-ConnectionGUID: MFZdPN7BRiOJxwDUgsSmuA== X-CSE-MsgGUID: osTrCAaoTqugUPDE/80O4A== X-IronPort-AV: E=McAfee;i="6700,10204,11331"; a="56392369" X-IronPort-AV: E=Sophos;i="6.13,246,1732608000"; d="scan'208";a="56392369" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2025 15:42:43 -0800 X-CSE-ConnectionGUID: AX6mNGHhQwWBZd3qMSmH6A== X-CSE-MsgGUID: tg0EZPT9SgeNGo2EEfp3cg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="114081720" Received: from johunt-mobl9.ger.corp.intel.com (HELO vcostago-mobl3) ([10.124.222.4]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2025 15:42:41 -0800 From: Vinicius Costa Gomes To: Zdenek Bouska , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Florian Bezdeka , Jan Kiszka , Song Yoong Siang Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Zdenek Bouska Subject: Re: [PATCH] igc: Fix HW RX timestamp when passed by ZC XDP In-Reply-To: <20250128-igc-fix-hw-rx-timestamp-when-passed-by-zc-xdp-v1-1-b765d3e972de@siemens.com> References: <20250128-igc-fix-hw-rx-timestamp-when-passed-by-zc-xdp-v1-1-b765d3e972de@siemens.com> Date: Thu, 30 Jan 2025 15:42:41 -0800 Message-ID: <87r04jc1hq.fsf@intel.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Zdenek Bouska writes: > Fixes HW RX timestamp in the following scenario: > - AF_PACKET socket with enabled HW RX timestamps is created > - AF_XDP socket with enabled zero copy is created > - frame is forwarded to the BPF program, where the timestamp should > still be readable (extracted by igc_xdp_rx_timestamp(), kfunc > behind bpf_xdp_metadata_rx_timestamp()) > - the frame got XDP_PASS from BPF program, redirecting to the stack > - AF_PACKET socket receives the frame with HW RX timestamp > > Moves the skb timestamp setting from igc_dispatch_skb_zc() to > igc_construct_skb_zc() so that igc_construct_skb_zc() is similar to > igc_construct_skb(). > > This issue can also be reproduced by running: > # tools/testing/selftests/bpf/xdp_hw_metadata enp1s0 > When a frame with the wrong port 9092 (instead of 9091) is used: > # echo -n xdp | nc -u -q1 192.168.10.9 9092 > then the RX timestamp is missing and xdp_hw_metadata prints: > skb hwtstamp is not found! > > With this fix or when copy mode is used: > # tools/testing/selftests/bpf/xdp_hw_metadata -c enp1s0 > then RX timestamp is found and xdp_hw_metadata prints: > found skb hwtstamp = 1736509937.852786132 > > Fixes: 069b142f5819 ("igc: Add support for PTP .getcyclesx64()") > Signed-off-by: Zdenek Bouska Acked-by: Vinicius Costa Gomes Cheers, -- Vinicius From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CD75C0218A for ; Thu, 30 Jan 2025 23:42:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F2A98416B5; Thu, 30 Jan 2025 23:42:45 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id B1pIVkQf1lLD; Thu, 30 Jan 2025 23:42:45 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4C7474155B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1738280565; bh=QLdGJ3oUC4191pyblaj+XY7Mrb33AqpXrBaKEN3nK6I=; h=From:To:Cc:In-Reply-To:References:Date:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W1wUV4QDDl7RmlvLHrOePqJmMm10ZYQ7mxwk1PloXzr0+L6Q/DNqVXoHl/C+BbkeR 7gawJLIRTyKnLUzeVniBMFuBTkkRqRiIOyfMm7hrK8NfUjL/xW3cqIrD87bzNpd2nC a1xZfFGlEJIpaCi76FiU3AAP/jQkWMmj5diYctawNnEf6+fSo6IMi13UoKfKO0BIPG cyKqa0AMl0rRvVGd8SLl5yku52y5L3oLm/mPxwZZzefvvXMrgNcYVmT+sku0upCynY +u5f1METXSVStegU6InUTzWuXQrLxECMJQldmxLwtHVusrAiUCy053h9aQg8RFEQ7s Tc2XvN1h0mPmg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 4C7474155B; Thu, 30 Jan 2025 23:42:45 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 9730712C for ; Thu, 30 Jan 2025 23:42:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7BF5F80A95 for ; Thu, 30 Jan 2025 23:42:44 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id V-XqrMBi9Pa0 for ; Thu, 30 Jan 2025 23:42:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.8; helo=mgamail.intel.com; envelope-from=vinicius.gomes@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 7F4BD80A7F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7F4BD80A7F Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7F4BD80A7F for ; Thu, 30 Jan 2025 23:42:43 +0000 (UTC) X-CSE-ConnectionGUID: 1fGe/e9oQ9uRUjhf/pNGOg== X-CSE-MsgGUID: kwOGQWDdQj+FcdljfT47FA== X-IronPort-AV: E=McAfee;i="6700,10204,11331"; a="56392374" X-IronPort-AV: E=Sophos;i="6.13,246,1732608000"; d="scan'208";a="56392374" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2025 15:42:43 -0800 X-CSE-ConnectionGUID: AX6mNGHhQwWBZd3qMSmH6A== X-CSE-MsgGUID: tg0EZPT9SgeNGo2EEfp3cg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="114081720" Received: from johunt-mobl9.ger.corp.intel.com (HELO vcostago-mobl3) ([10.124.222.4]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2025 15:42:41 -0800 From: Vinicius Costa Gomes To: Zdenek Bouska , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Florian Bezdeka , Jan Kiszka , Song Yoong Siang Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Zdenek Bouska In-Reply-To: <20250128-igc-fix-hw-rx-timestamp-when-passed-by-zc-xdp-v1-1-b765d3e972de@siemens.com> References: <20250128-igc-fix-hw-rx-timestamp-when-passed-by-zc-xdp-v1-1-b765d3e972de@siemens.com> Date: Thu, 30 Jan 2025 15:42:41 -0800 Message-ID: <87r04jc1hq.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738280564; x=1769816564; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=SNgWdW0+w8g7zWzmvBJ6hqxTIrMFupouLSnDTRPedqs=; b=njBD4CqeB5D6xy51Tc8bVyUbpf5GhYjisE/+RIUI25Dnsi7knQt37i8z //ijX4l6nYKHHS0knmhUaRKBvco9pV0iarSJuxZiyu+5SezGAvDMIM5Wp ZebOAruyR7yqYNWyBgB+8QvxPNhS3svWXqCR+52c2YqLUYR74D8l2Q84/ pCmMfO0mKFOpQ4vocePBpmNlezhf/mtWNCM/Q5G0aJVj2IkyYocXzXbar 06Z5WWdawqfu5mnVYRxKJXPqZqq7Ygu8v0fokcd9mA1JmlvYZoLDXEzUk r+kX2xXFiXUlnvL0BF162Gw11lvWf2qEnJ6vCpVf8UpKOR8sRFWDMd6QT w==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=njBD4Cqe Subject: Re: [Intel-wired-lan] [PATCH] igc: Fix HW RX timestamp when passed by ZC XDP X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Zdenek Bouska writes: > Fixes HW RX timestamp in the following scenario: > - AF_PACKET socket with enabled HW RX timestamps is created > - AF_XDP socket with enabled zero copy is created > - frame is forwarded to the BPF program, where the timestamp should > still be readable (extracted by igc_xdp_rx_timestamp(), kfunc > behind bpf_xdp_metadata_rx_timestamp()) > - the frame got XDP_PASS from BPF program, redirecting to the stack > - AF_PACKET socket receives the frame with HW RX timestamp > > Moves the skb timestamp setting from igc_dispatch_skb_zc() to > igc_construct_skb_zc() so that igc_construct_skb_zc() is similar to > igc_construct_skb(). > > This issue can also be reproduced by running: > # tools/testing/selftests/bpf/xdp_hw_metadata enp1s0 > When a frame with the wrong port 9092 (instead of 9091) is used: > # echo -n xdp | nc -u -q1 192.168.10.9 9092 > then the RX timestamp is missing and xdp_hw_metadata prints: > skb hwtstamp is not found! > > With this fix or when copy mode is used: > # tools/testing/selftests/bpf/xdp_hw_metadata -c enp1s0 > then RX timestamp is found and xdp_hw_metadata prints: > found skb hwtstamp = 1736509937.852786132 > > Fixes: 069b142f5819 ("igc: Add support for PTP .getcyclesx64()") > Signed-off-by: Zdenek Bouska Acked-by: Vinicius Costa Gomes Cheers, -- Vinicius