Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp116735lqa; Fri, 26 Apr 2024 16:57:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYSDnfjUFFrO401w5rV9bSCySRnLQwuAmE3QqttJZfeZRZRVqED4x241U0Yw0fpDt5lihtmtjLLd+D7f8Pq8PmVZaUbKMhsbjZ+RkVsQ== X-Google-Smtp-Source: AGHT+IGYHl2o8CDn+p+r3yE7BHDRH1JO4Ebc/1snjQFQbVTUjiqyiuisbRVWHncX/djUle2DH0yf X-Received: by 2002:a50:ab0e:0:b0:56e:603:9fc9 with SMTP id s14-20020a50ab0e000000b0056e06039fc9mr721830edc.3.1714175823908; Fri, 26 Apr 2024 16:57:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714175823; cv=pass; d=google.com; s=arc-20160816; b=r0vJOuWlFI8eg9Po+LYx9DZpLMf4AkcjUW7nG5oj+XYax2rS64V3winQWBdWnkUSfp Vf17KNG3kCp4IjwEkxJyPWVWDE8DmIUbDw+arDC7YtfF/cRPqSkORTOgCZWj64JwKK0m AGMPvLYLzTwdt02loM3Q9CXeZ7cxCjcbzEd3+/FK8yCX70I87s5Z2kzUWEPdbptp5P/M 2JGi1yp1W0TIDJmcoqRgy4ZktX9qLUmWfbbGKRfaZ1xR461HZziU7xoDrOCXJkEN0WJW we6noJXznhDn8PCt0w9kvOTzN2zsFX+LzazF96zF8vOg2MZyp6wNsIjEm1X9fy0OGGs3 onoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=/GHDmjtDOSTgx3MzgQxrNQiEz0qPRdRT76sy97OELOM=; fh=dWy2TC+kdzjb7ePn/XHS2d3jYZP2x0qcbZbIUQ7kTvU=; b=iMCUnrqetWIkMff8ADWTlliBV6yAsgqHCrUuUgpyzqPSKwOXu9Uu8ZWWWnR/y47lI4 3ndAg/GsSqjnBFM0s3ZpYdApSTpWMjrWDwqUVo8B+CqsLdnZzWIx+uwEcsvTUi3+xHoI zCVq82tLtwS+UYTrg3gfMgdXDxtXRxFHqaTE9Ui8th2X5RQ7pC0g5ND2jERX4Jg7HO2X qRzeXd/+fxoVOrL32nMvFhRj7ZfwgWvshF54jWNl6NfOK3Izi0b28Za+kPWmyug1IEeC V7mfryMj4sM37BB5cWFwXzL9kw+VidLN2aD3IzHgYd0htAjSMo2x/RvcGSfaqiSFOJy3 NbYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CVb3ShiT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v23-20020a50d597000000b00572242f02casi5033556edi.122.2024.04.26.16.57.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 16:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CVb3ShiT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4A5081F23FB9 for ; Fri, 26 Apr 2024 23:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65E1C3D575; Fri, 26 Apr 2024 23:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CVb3ShiT" Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 859593BBCE for ; Fri, 26 Apr 2024 23:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714175473; cv=none; b=qreMHlmrfCEhGrqDZ/gucCl92oqrfTiw1+evPKN7w+Pjb8gtHRGfNFmN83VxGz1KSwmvS7qDkRWuaj5G+nhxKcjOLf1bTWP/iy0ha0EA5+bVpqq95199+aIskb0Ol+zY2nLitMidnSdwAwcnbe7KjesleOrBYgH+8UqTAPx8fJA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714175473; c=relaxed/simple; bh=UOv2aSPHtSJ211fWROncfK9M6zsTUFl405ydVst3K9M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=a/Mep6YF7urGSud8TZrz7fTSILZc+zAc51oA1gdrKUmThyzat8p8WpUsdZ3oRXV3qkorY7ttKR6hXrlWGPswzA0K/v0G41rbP6yv69e7irxVjVOWIHGxwvGGUgpM0nIff+D77FFK62P3yt0n6hrLsutqI/zrTSMl7m9p62/zGJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=CVb3ShiT; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <379558fe-a6e2-444b-a6a7-ef233efa8311@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714175467; 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=/GHDmjtDOSTgx3MzgQxrNQiEz0qPRdRT76sy97OELOM=; b=CVb3ShiTUn0xa4PG6OX8EmBXIc9zY36L10ebOPcSSWRWAE7ynY8/gPavHseNIiU3OkYG8v E6WqKEfo2oqkeRd1ShabxM6aKsSO5SMJ8j1ZAIlXDfHVM6e79WE8T/nGiC7don6w97B1rs GF92K151T07PZqqMpb5RpU4vCXP1b1w= Date: Fri, 26 Apr 2024 16:50:59 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH bpf-next v5 2/2] net: Add additional bit to support clockid_t timestamp type To: "Abhishek Chauhan (ABC)" , Willem de Bruijn Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney , Martin KaFai Lau , Daniel Borkmann , bpf , kernel@quicinc.com References: <20240424222028.1080134-1-quic_abchauha@quicinc.com> <20240424222028.1080134-3-quic_abchauha@quicinc.com> <2b2c3eb1-df87-40fe-b871-b52812c8ecd0@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 4/26/24 11:46 AM, Abhishek Chauhan (ABC) wrote: >>> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c >>> index 591226dcde26..f195b31d6e75 100644 >>> --- a/net/ipv4/ip_output.c >>> +++ b/net/ipv4/ip_output.c >>> @@ -1457,7 +1457,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk, >>>         skb->priority = (cork->tos != -1) ? cork->priority: READ_ONCE(sk->sk_priority); >>>       skb->mark = cork->mark; >>> -    skb->tstamp = cork->transmit_time; >>> +    skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid); >> hmm... I think this will break for tcp. This sequence in particular: >> >> tcp_v4_timewait_ack() >>   tcp_v4_send_ack() >>     ip_send_unicast_reply() >>       ip_push_pending_frames() >>         ip_finish_skb() >>           __ip_make_skb() >>             /* sk_clockid is REAL but cork->transmit_time should be in mono */ >>             skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid);; >> >> I think I hit it from time to time when running the test in this patch set. >> > do you think i need to check for protocol type here . since tcp uses Mono and the rest according to the new design is based on > sk->sk_clockid > if (iph->protocol == IPPROTO_TCP) > skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, CLOCK_MONOTONIC); > else > skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid); Looks ok. iph->protocol is from sk->sk_protocol. I would defer to Willem input here. There is at least one more place that needs this protocol check, __ip6_make_skb().