Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp107745rbe; Wed, 28 Feb 2024 13:54:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUr/RJoBEReOPNbvq8CUUp+YaA9jsfBpJWMoxQ/W96V0g9kpDHgjYljqE4PSmnnt7LA/2d2T8fiWwyfqvf2PsEwwq743pHC74FCzZY6YA== X-Google-Smtp-Source: AGHT+IHiLx/UZ+PhC0FHZVNW6aeiqqBz9PkWJ3Hm2llAAGHjjkGQ3dsjyevoUHqbP7ZHurvf/0Zo X-Received: by 2002:a17:903:503:b0:1dc:418f:890b with SMTP id jn3-20020a170903050300b001dc418f890bmr198808plb.40.1709157255248; Wed, 28 Feb 2024 13:54:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709157255; cv=pass; d=google.com; s=arc-20160816; b=wE/q3Iaq1dSVhlbB9fCMsPf+Yrl99METkAT7SZpsze8sCbIYbgwWTAh0MgMpy56Qif MTssL0YK7l+sP3uvrUd+uXZSi/nXUAR9cTrey2kSph+xgmKYSLl4gEaJV65ApBCe+tDJ AcnxQ0pox9+Rqkvl7239lreFI+cy+YwlWPSHIVAEKBYfVQXJlzzO+EjlORLgr2M5QMmV ENjtr89AmvpAklVVyCQg00KcF2jNzwHI8T93lc7+cImVRi2TCFfaEFH3/gu7VOTv2NFT 5oCEGfHITv02XoSWrdr3pm/HG+QdfwoTwABGQApIo4Sko8Xuiuaa/Ln+S31lERn7Zb1H CPLQ== 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=JSVKryuam2bUhRANM9hEqbHjM26jbCrdVMAbYCzj5zk=; fh=ckD2j613TETb23GQJAj/YVHPtMBxnDJ2IfTN1y1U8mY=; b=fcsZHcbWekEhqloKf6MTO0Ghxxj55+GjxYSZGSXMV84KIudx8APeiryV4QrQ4wEHri 5hvdTnrMKhAx3IS2Z7U+7IAbpsAaks1nkYJGjBvJm2byZE0KwfrRfFhUU8wMlVZHitNh 8NFP/LcQsDdwCiTRC22HGZbPlaCXTa9gB09TckePL2CccaVUwDzbLqpK3gANC5RebDYu xwtg3nMMj8UF5nQkaONwV7xr8WcF9TvD0S8auLxQMp5G4IAmaWDEQQKpDcu8Fa159JI0 0+niwJoWz3ZYf6EesVrJsO4n/mN3hWAUGgaFj2OK6LYM+5Xgab/R1Q7u+yPpnJhsXCOw WIMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RnhB61uT; 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-85747-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85747-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. [139.178.88.99]) by mx.google.com with ESMTPS id i14-20020a170902c94e00b001db3592bb36si4279135pla.279.2024.02.28.13.54.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 13:54:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85747-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RnhB61uT; 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-85747-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85747-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 E8BA128749D for ; Wed, 28 Feb 2024 21:54:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E147072909; Wed, 28 Feb 2024 21:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="RnhB61uT" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 7F0517005A; Wed, 28 Feb 2024 21:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157245; cv=none; b=ZQZ5qjY+P9XTQxPD0MkrLbNSUZcTTHatPI5+XxL/2O+2Xzqp/in9PM6ZqfeGxL1MhKfsP73FOBU/g5BZJU4rJPDqxKr5IbuCcrPXAh6UvyDeroVzzCaN7MHWBN+uQLgJZCmQ1bJiLs6buekGrDzj0n48MAWO+fbnxU9zEdIqi/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157245; c=relaxed/simple; bh=+udCsYwCCLroqTJ3NW8T4zKSPlLtm2ihTeKdecE4u60=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=eew427jK8LomOfZiOjrDuzgk5Ygwse73IFcH/ovG0CemtRS62zn851uZv5ErIk83iL0P6P1XGd+2VFX7GJam9tmDvRsJDPJF8rR9bRyK2eGABDnmOeBoPYqKa+iFXP3V412V3/cGBHgA0tSVCozRcGbETuZvVNJoF4v8oq2QSh4= 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=RnhB61uT; arc=none smtp.client-ip=205.220.168.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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41SLJT97011242; Wed, 28 Feb 2024 21:53:48 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=JSVKryuam2bUhRANM9hEqbHjM26jbCrdVMAbYCzj5zk=; b=Rn hB61uTdV9vJHvSVXb0KqyGcQMGt0hXenK1PQr6M8JjfFd+wSTHTe+yBVdHDSypcJ /kBFHzejDt5Q8A4k3tptMkyYlqgl7OD2N/BHGpa6odBgqSqG7cH/ocsO5u39Hz6J ZXClemwhl+aTdMpKMAY+cXj1QshDsgLosAAAkxmAVVl2LNK2+/OkPRZbd2131rgZ 07DnMAnWDrTYylI855hDo4thtyNI9BKb2PQ/KKmyoH2qiaMRsDLDoL4sdW18hWxf L0Vmcb1ll8Nx1XoILYAQcRJS1PhfmIhbywyss72FEucPs+e0Ww2fQdfR8GvbrLtB 5e/ICk2l45FQ0ugx396w== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wja0egdh1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 21:53:48 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41SLrlYU015855 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 21:53:47 GMT Received: from [10.110.100.241] (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.1118.40; Wed, 28 Feb 2024 13:53:44 -0800 Message-ID: <8a5d15aa-96e2-4d9c-9479-bf2ba8fb2a79@quicinc.com> Date: Wed, 28 Feb 2024 13:53:43 -0800 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: [PATCH net-next v2] net: Modify mono_delivery_time with clockid_delivery_time Content-Language: en-US To: Willem de Bruijn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , , Andrew Halaney , "Martin KaFai Lau" , Martin KaFai Lau CC: References: <20240228011219.1119105-1-quic_abchauha@quicinc.com> <65df56f6ba002_7162829435@willemb.c.googlers.com.notmuch> <65df94185a2c1_b2ad829442@willemb.c.googlers.com.notmuch> From: "Abhishek Chauhan (ABC)" In-Reply-To: <65df94185a2c1_b2ad829442@willemb.c.googlers.com.notmuch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-GUID: is35nZS8Glz5KFjqMaUUxVah4K7yuXRb X-Proofpoint-ORIG-GUID: is35nZS8Glz5KFjqMaUUxVah4K7yuXRb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 impostorscore=0 adultscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 spamscore=0 mlxlogscore=657 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402280174 On 2/28/2024 12:14 PM, Willem de Bruijn wrote: > Abhishek Chauhan (ABC) wrote: >> >> >> On 2/28/2024 7:53 AM, Willem de Bruijn wrote: >>> Abhishek Chauhan wrote: >>>> Bridge driver today has no support to forward the userspace timestamp >>>> packets and ends up resetting the timestamp. ETF qdisc checks the >>>> packet coming from userspace and encounters to be 0 thereby dropping >>>> time sensitive packets. These changes will allow userspace timestamps >>>> packets to be forwarded from the bridge to NIC drivers. >>>> >>>> Existing functionality of mono_delivery_time is not altered here >>>> instead just extended with userspace tstamp support for bridge >>>> forwarding path. >>>> >>>> Signed-off-by: Abhishek Chauhan >>>> --- >>>> Changes since v1 >>>> - Changed the commit subject as i am modifying the mono_delivery_time >>>> bit with clockid_delivery_time. >>>> - Took care of suggestion mentioned by Willem to use the same bit for >>>> userspace delivery time as there are no conflicts between TCP and >>>> SCM_TXTIME, because explicit cmsg makes no sense for TCP and only >>>> RAW and DGRAM sockets interprets it. >>> >>> The variable rename churn makes it hard to spot the functional >>> changes. Perhaps it makes sense just keep the variable name as is, >>> even though the "mono" is not always technically correct anymore. >>> >> >> >> I think a better approach would be to keep the variable as ease and add >> comments and documentation in the header file of skbuff.h like >> how i have done in this patch. The reason why i say this is >> a. We can avoid alot of code churn just to solve this basic problem of >> propagating timestamp through forwarding bridge path >> b. Re-use the same variable name and have better documentation >> c. Complexity will be as minimal as possible. >> >> Let me know what you think. > > Agreed > Okay i will make the changes accordingly. >>> Or else to split into two patches. One that renames the field. >>> And one that adds the new behavior of setting the bit for SO_TXTIME. >>> >> >> Regarding the sidenote. I dont see how they are using clock_id to determine >> if the skb->tstamp is set in monotonic. Please correct me or point me to >> the piece of code which is doing so. > > That's really out of scope of this series anyway > Sounds good. Really appreciate your review and discussion on this topic. >> >> I hope the check against sock_flag is a better implementation as >> it clearly stats and is inline with the implementation that the tstamp is >> coming from userspace. >> skb->mono_delivery_time = sock_flag(sk, SOCK_TXTIME); > > Enabling the socket flag is not sufficient to configure a delivery > time on a packet. A transmit time must be communicated per packet > with cork->transmit_time. And on top of that, it is cheaper to test. So to re-use the same bit of mono_delivery_time. I want to set this bit when user-space sets the timestamps using SCM_TXTIME. Is it okay if i do the below when we make skb in ipv4/ipv6 and raw packets to ensure that bridge doesn't reset the packet tstamp or do you have a better suggestion to set the bit so br_forward_finish does not reset the timestamp. skb->mono_delivery_time = sock_flag(sk, SOCK_TXTIME);