From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 849F33BBC1 for ; Fri, 26 Apr 2024 23:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714175472; cv=none; b=YOq0A2+8TrrM6pH/fjXWgBJOjn7CPpFZwbo0/LYE1M9Qqd0jU0bjCArwpVay5sOObhMty3anZXQvNvd/L+gIqUF3oV+/YioIlumUqPqZJ4/4YljODb+5kmsQxD16VOH3wDcT870E2aDD8iqHTXfT3FKWl+/zhFWJWSpaqRoI6rk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714175472; c=relaxed/simple; bh=UOv2aSPHtSJ211fWROncfK9M6zsTUFl405ydVst3K9M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ueieWqEj5M46L1euryQEPGPrTsXVRRlJy2gShsE7t5ur2MdopfIlGuwbOMWkiyRgfCSpounk+GKFkzurd+PELcpyx+57y6LjTG/ETFrRcbEDob7YtkDK1sQnHc1/w7LgEAUeTUnuAnhNQ1J0gCjDTNDFoFnSdPeD0GqdXq0MCmA= 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.172 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CVb3ShiT" 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: netdev@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().