Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp47943lqm; Tue, 30 Apr 2024 12:17:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWho7CpI431Y7sODpDpKlsyD2YmtqeXSaJEQKQw6uSmmrjktQp2Kd2HddXZLDAP2lf7YNsIUNmmmFWWJHr/v3w5gs2MjuP2prSnhFS1HQ== X-Google-Smtp-Source: AGHT+IFLYQXTq6gEVU+A64JJLzUHc08kAU9ar/1dJKPv6BtnCvz5wxrnNzmvKDDMCKX0pdBLc3lo X-Received: by 2002:a05:6a20:7fa4:b0:1a7:a3ee:5e4a with SMTP id d36-20020a056a207fa400b001a7a3ee5e4amr348959pzj.33.1714504632947; Tue, 30 Apr 2024 12:17:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714504632; cv=pass; d=google.com; s=arc-20160816; b=UDOYw0jA5/MJf1Q6zlrcbqy36+IsdOhrtggR9rT+BGBVOJiICOGVjsNFKB8ilB+nHj Lyj3BSTQdvg95ELJQy4KDj3zGSIoX93r83EHFkivRF+L1oICivCcpLvZ5d29iFilLYrg TcbBCoF3NFOh/WGPv7B8dD+ZZwlSV35U4c6JquSErmD8P2mBgpEo8UDHv28N4tSOsfLQ WGYMax4kCDN5t8ydvR6Jg9LSLbsx07qtYgmre6ek62mT30o4VpBCxYDXySc7IMY4MIRi awGkvnoqWP5F7kzgVw4/gVFDcSz65fBSqAdvwpT5FdhYXG9WZKqOkRs14IQ1cANwpN/Y eCIA== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=h1aRhctW+hflPZhe4iXejsBdSGqN0UtQR9Cwo3lKjq0=; fh=fQhBeWXZk570+lHmILivSW9D+REo72S0eMDJQtrxrvM=; b=jZoKaOFIYLDoivsz9peoMGTbJboNfhUEJVYaLZIVtW2eYFGUXlr9bBIez9SxwzaUiR OubDwwy/JMiwY7c3FnE3dZeXxCOvkBg2Z744TD0ajVFw84qwZZ84hTOBElQfDu3dKzA9 DvU6tj36cYYZlx6J+8EB1dI8lLsdNCw1yiJsP0lub9t5zjZ/XbDxlUAjS96AiWChIuGs E1dRTAWWjp4Fft1WcZcaojCqs/wvLGEgNF04R8z0CEdVD7xsBBgMI5HxNKdCIA6Trf9V ZTBk6TEi8tMcAAoaY8uGQh/cv5Im4p/rei06MxPFgNn/2mRXwhjycl/VDvC45iaOMNdC s+JQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="NZu4yp0/"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-164630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n4-20020a170902d2c400b001eb0daf403csi8497239plc.237.2024.04.30.12.17.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 12:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="NZu4yp0/"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-164630-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8CAB72830F3 for ; Tue, 30 Apr 2024 19:17:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EDDE199E88; Tue, 30 Apr 2024 19:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NZu4yp0/" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 56B647710B; Tue, 30 Apr 2024 19:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714504622; cv=none; b=pD2L4yENHxQeAnMYFV54fTqsbejT1KJPHnzELi7lsYNHWwlYXcc8bMtTpLbf9MeR1rAPb2dGzRFmWb6tvbkzkPNvXeH3pFqtrFTI3d2dU7l2AnX5dDjSDu6QXMGXrk52//Mx+Z3rt2HkNmRtNzU2qjqoJ/mayGg963yPOZ7tfpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714504622; c=relaxed/simple; bh=RdFfCjNbgzIvSlpEj8Die0XDDORC4D/jlYBq+Mn5u/M=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=gqDMHTa1WBihETz7GZDJOeinQHv4UNkPmHIM2CNLdZJYeHSR3GlbKXSSBA8bt5ACxAGwg1WiLsIICu52e07RAspbuFQEtbM0DnCpynLqPqO8ax4W6kFDpjdFw88h1HdSH4UsKejqAgWwIosdh9KlReAoAb2IY81MZQm+Ms/tkYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=NZu4yp0/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43UFlrGY029101; Tue, 30 Apr 2024 19:16:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=h1aRhctW+hflPZhe4iXejsBdSGqN0UtQR9Cwo3lKjq0=; b=NZ u4yp0/wDWTElzpCautSiDsDUz4whkBxjpPa2caB+n03jig6kJPGcQXrjj6TcCDWa oWpOeRlgZcMkTHFxH871v42UbdG/AQXExC30HQP+OPAVOv0fqlIfLaAiQ12ubCsc nRumVMOffsJGJbmdj+zVFmNZi/IWndLev83iv9Eh49JmjeCu0SLz3xc4RguEjZ9k RiOQPjvSw7Jey0AhXwvcmXJdyQL9Ai1To0qq64ONJ+KGy2c0rABoxtHt3ozE4d5o EWozTG3/1vstI0R+x5JX5mcK9qqUVrRyJMa6L3coghZJhK6Oha6BoNMm7tzkW9iE 68sbReJe6NsTOyokzkVQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xthgvv00r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Apr 2024 19:16:40 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43UJGdhi017136 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Apr 2024 19:16:39 GMT Received: from [10.110.24.18] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Apr 2024 12:16:35 -0700 Message-ID: <6eb5b283-a9bd-4081-8bce-a60d72af430c@quicinc.com> Date: Tue, 30 Apr 2024 12:16:35 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH bpf-next v5 2/2] net: Add additional bit to support clockid_t timestamp type Content-Language: en-US To: Martin KaFai Lau , Willem de Bruijn CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , , Andrew Halaney , "Martin KaFai Lau" , Daniel Borkmann , bpf , References: <20240424222028.1080134-1-quic_abchauha@quicinc.com> <20240424222028.1080134-3-quic_abchauha@quicinc.com> <2b2c3eb1-df87-40fe-b871-b52812c8ecd0@linux.dev> <379558fe-a6e2-444b-a6a7-ef233efa8311@linux.dev> From: "Abhishek Chauhan (ABC)" In-Reply-To: <379558fe-a6e2-444b-a6a7-ef233efa8311@linux.dev> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: pCjJTonkyvEVCMMeRHtr9PNDpOvoV3h1 X-Proofpoint-GUID: pCjJTonkyvEVCMMeRHtr9PNDpOvoV3h1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-30_12,2024-04-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=982 priorityscore=1501 phishscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404300138 On 4/26/2024 4:50 PM, Martin KaFai Lau wrote: > 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(). Sounds good. I will wait for Willem to comment here.