Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp345802lqj; Wed, 10 Apr 2024 12:08:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2Yh/sw1Hb+y7u0jOA7iymWLV5M22lyJGAedj/ygWCgTYq6hvDJkGKOqGpuuJi0Ep6gGo6Kc2PCDBOGDsGztFLDiJI4rfjakEdc8+0Pw== X-Google-Smtp-Source: AGHT+IHKzjaWNQW3iFoQoQqGopuSt9XbWDN3sFDGOCB8qn5COv6lFYgI684RPfgaH1hz48Dowupt X-Received: by 2002:a05:6a21:1f26:b0:1a7:a80a:3d4a with SMTP id ry38-20020a056a211f2600b001a7a80a3d4amr3329830pzb.56.1712776117400; Wed, 10 Apr 2024 12:08:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712776117; cv=pass; d=google.com; s=arc-20160816; b=oJov2HQogGDM6EPHfe79rVwcCU4vCivUDBHEQZxViwMzfMqEqvyghjzhVIXq6UHBYo h/i2FTpuTQa4Q1+wiTeXYMPRXLFzYdU9vzFQkV1F5b40RqhX9yPew5aS5J/yBPoKLqvu 5aYSvwOZ/LPrvVRA9O0KT7GHup1XaFjdwbp1Y7IC0c2+ofogRHlazmsImHOvbju6PkaJ bMBMzFW/cfnlD6JAMs8cDT8AjYFsZj2Gsb6J3mQ6BkQU966b/ka864QqAzzmrZb3tQBm giARNI9OEXIrtLlEcBI20ecnrNBfEJIv94/sKi/YXtp8WUzE4zkpypVzcUGLlQ+eNDSM S4gQ== 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=PZ/Jcg0UvM09pjZy5iffqsji//dpbDI69OcR0FigxVI=; fh=uhTEl8kPg6xs3Bvr46hHutHWH7IuZTkFWyRreB+zyKc=; b=Z1AEeGsiPzILiTRfNT0zXXO+XSziFRK4Xz3N8OrO1WxPLA+nnZifDUUFRdBAi8fc8A yyfM535cPZcTR9fU3UyntbbMnYbG79t0pBdRTvRkTHkO+U1LZjXaGnawoChrnFmril6j 5orini1MynU4+mhryhkLodAoORQLYpvBa9nMj0/aRR2NfJQDCh9B/WrS9BBeVEkWPP7L NxHznjgXCG8waHJIp9+yoAJjgV9OQhLuUAQ8nfufDy84mRBSy2usNRoMcLrhIoiMJWJn +vLURXl2R9dlF2klXUuIPRyMVLs5q1tb1rnlZ5+UJEB53kfSF52WOp2ltKX4sYk5Mvxc uITw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jCA39fUC; 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-139243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139243-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 f1-20020a17090a654100b002a53775b99fsi2003300pjs.22.2024.04.10.12.08.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 12:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139243-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=jCA39fUC; 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-139243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139243-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 C6E3B28582C for ; Wed, 10 Apr 2024 19:07:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91EBE180A99; Wed, 10 Apr 2024 19:07:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jCA39fUC" 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 3CA2B7460; Wed, 10 Apr 2024 19:07:44 +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=1712776066; cv=none; b=mxXBWdjsdeCZ2v8oFDzT5I6kZCCd0cjp7Il/2GrfSlTplErzlYK3AUZUlIoNB7k4CJnfEXny+88z/wzI5L2oDBKM00Onkq91pcS92Ko0mQCmZ2rsYUlk98Ul/ohMOMZVq7+L9LIqYIimx2qdBZj98uEVEQghU8d6B+llhR5cKr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712776066; c=relaxed/simple; bh=OVRSpBkIl1y9Opvj2OA7aXUnrKiMuWoC9L9r8cY7FaY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=otuDsTw3M2k1u7nuKImfN+Nc8Qa6bigeZCPVKlbj1/ETNdnHs19p+FsAeKpVP9JR3upVCK2Tsx4B1gFlBGaSamzyD2Ppo0nwsDLVklT8VCxVXxvve8h0xb2pcENS6A7Tc+nlLGNbzsEjfq3KD1fXvuExmjcfCKJP3X3IVu5XRZE= 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=jCA39fUC; 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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43AJ0HM6001428; Wed, 10 Apr 2024 19:07:25 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=PZ/Jcg0UvM09pjZy5iffqsji//dpbDI69OcR0FigxVI=; b=jC A39fUCDyc/iEuKH41z3JNWgMoKptUxVGXoAwY0wCfIYsQ5T7zLgvlLAYrP8gptPh SG2GgBJ0qVeoKXZsbxxBWRuu2GPwV3c+amh+Ryc7oZpcHIz0wdEer8ABPQ1pMDj8 gq2RDCQPMUl7ZvuNqDmh7FMnCWbYcRgfCX27+CAaK5o3PRnXJEVWLb0I9yMW5ble RjQ2x2T2vVIGyk+eUS/hs2vRTjcYGEptjX4nHMytDrFEKjp1+x4J/Rt5ln6cKL5o uIculxhEwjz7eVmi2PxYxj9vFpF2Z/1A5wBIQ5yZQ2Dun6gd5Xj2LujYAb9gK98Q OwCHuNlaiuCu5KEhR/YA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xdpnfu0n1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Apr 2024 19:07:24 +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 43AJ7MOY020552 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Apr 2024 19:07:23 GMT Received: from [10.46.19.239] (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.4; Wed, 10 Apr 2024 12:07:19 -0700 Message-ID: Date: Wed, 10 Apr 2024 12:07:18 -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 v1 2/3] net: assign enum to skb->tstamp_type to distinguish between tstamp 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 , Daniel Borkmann , bpf CC: References: <20240409210547.3815806-1-quic_abchauha@quicinc.com> <20240409210547.3815806-3-quic_abchauha@quicinc.com> <6616b1ceeecad_2a98a529472@willemb.c.googlers.com.notmuch> From: "Abhishek Chauhan (ABC)" In-Reply-To: <6616b1ceeecad_2a98a529472@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: ann3hOHn-a19bKj71aC3r0m1mYg9OdAd X-Proofpoint-ORIG-GUID: ann3hOHn-a19bKj71aC3r0m1mYg9OdAd 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-04-10_04,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404100140 On 4/10/2024 8:35 AM, Willem de Bruijn wrote: > Abhishek Chauhan wrote: >> As we are renaming the mono_delivery_time to tstamp_type, it makes >> sense to start assigning tstamp_type based out if enum defined as >> part of this commit >> >> Earlier we used bool arg flag to check if the tstamp is mono in >> function skb_set_delivery_time, Now the signature of the functions >> accepts enum to distinguish between mono and real time. >> >> Link: https://lore.kernel.org/netdev/bc037db4-58bb-4861-ac31-a361a93841d3@linux.dev/ >> Signed-off-by: Abhishek Chauhan >> --- >> include/linux/skbuff.h | 13 +++++++++---- >> net/bridge/netfilter/nf_conntrack_bridge.c | 2 +- >> net/core/dev.c | 2 +- >> net/core/filter.c | 4 ++-- >> net/ipv4/ip_output.c | 2 +- >> net/ipv4/tcp_output.c | 14 +++++++------- >> net/ipv6/ip6_output.c | 2 +- >> net/ipv6/tcp_ipv6.c | 2 +- >> net/sched/act_bpf.c | 2 +- >> net/sched/cls_bpf.c | 2 +- >> 10 files changed, 25 insertions(+), 20 deletions(-) >> >> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h >> index 8210d699d8e9..6160185f0fe0 100644 >> --- a/include/linux/skbuff.h >> +++ b/include/linux/skbuff.h >> @@ -701,6 +701,11 @@ typedef unsigned int sk_buff_data_t; >> #else >> typedef unsigned char *sk_buff_data_t; >> #endif >> + >> >> >> +enum skb_tstamp_type { >> + SKB_TSTAMP_TYPE_RX_REAL = 0, /* A RX (receive) time in real */ >> + SKB_TSTAMP_TYPE_TX_MONO = 1, /* A TX (delivery) time in mono */ >> +}; > > I'd drop the RX_/TX_. This is just a version of clockid_t, compressed > to minimize space taken in sk_buff. Simpler to keep to the CLOCK_.. > types. Where a clock was set (TX vs RX) is not relevant to the code > that later references skb->tstamp. > Make sense. tstamp can be either mono, real , tai ... etc . Directionality doesnt matter Let me check this and update. >> static inline void skb_set_delivery_time(struct sk_buff *skb, ktime_t kt, >> - bool mono) >> + enum skb_tstamp_type tstamp_type) >> { >> skb->tstamp = kt; >> - skb->tstamp_type = kt && mono; >> + skb->tstamp_type = kt && tstamp_type; > > Already introduce a switch here? > I will introduce a switch here based on tstamp_type passed. >