Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp191553lqb; Tue, 28 May 2024 12:33:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMmhuk1df2qq2bLIbGKvj309paM79hivqKuoNsQgdUpOZ9WBqImkBANudlhZAYQs7xhBUJwvf19eAZ0H1lFyKIlvPR3fVmb3wdOoMW0w== X-Google-Smtp-Source: AGHT+IFDubSt3gi8H8hvd7LYJMAIMsjPFuh995GJlBk02OajPnSvErKXmOnuuQi6Hvuq9Mb7K+bh X-Received: by 2002:a05:6358:2909:b0:183:7f41:8c10 with SMTP id e5c5f4694b2df-197e566fb8dmr1004433055d.31.1716924832547; Tue, 28 May 2024 12:33:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716924832; cv=pass; d=google.com; s=arc-20160816; b=s2z4D+roovqmJfQyYDz6JHsRuHVMMnqPfS1zAS174oqG1DGY8XQoUD3evytzdXFNFZ Uojp/3PDAy9byrh5pClCfxO472hfIuYYEjZmRQeRB+I0hhpJnku+jdAO3o6NTYly1NGu CC58dxSQEVrTR+e3uc4AboL303rLkisob2mq8GC/x9rfzZXINO0XSuLqQTZulWoosmU5 U57YITqpQ4Xur74e3zWm1ADpjcUzTGj5E2y5TB6NljUEi7riBnbE+P++IbJQjtxdjkiB 2Mmqa5akRUI30qlAitknWyTLT1pzNt+ftyCPwzt+XrJig5A+LguNSY1eGynrZp/sg+2n blVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:date:message-id:dkim-signature; bh=gz3k3DiyCGoMOQPg4X/3emTcMizgWP/27mI/YhTD5m0=; fh=jFONJHaOpZar/ECtuKihShpaK4P9lUY84um/D469FCA=; b=rieyP7xG4kql1Hn9za3RuPKAXw4kfciIqZ8r8hFVqWypU0j+dcDNjskpvoQt6mnLMJ EtDxdELfllX4JfnSd04gUej/iNPjukt/pDWA9KeLIzmHpBmt9wyuUDDjj9RuT8WQBniM +80UrvxH0dxfs2svwRRZKvLF8oK2uF8+FZkbVjV3KpKDWphsBC3KaH+0OLY7LpSXhvzU BqKIVEp1+Hp8Gs7nfpFOC78vbh/0pXYUJYuYLCNE5YHT5bjXgVGX/uZ2mPXzezUvuSLG xgkTxzN4bDbhdvQIR74IQXbgZXZ0yNl6XqbrKTZAAz7SElQTS9hncFaR3LcIvAUUu65L uxeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PiXETvYR; 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-192942-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822ae564fbsi8606861a12.765.2024.05.28.12.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:33:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192942-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=@linux.dev header.s=key1 header.b=PiXETvYR; 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-192942-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192942-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 00073283D10 for ; Tue, 28 May 2024 19:30:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3173E174EC6; Tue, 28 May 2024 19:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PiXETvYR" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 558722628C; Tue, 28 May 2024 19:30:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924650; cv=none; b=AFpsArXgGyros7iO9ZvAVXwOs/iznRaSTAK/MHTAC/Hcsf8prFaBAPbwSdToLTgN1HXCAGVRqE64RuTMvMZIUEZNV5wg+wiofrXpeXH1DEYqTGKTp2451NcipNOZYPUn+41ftSzHpAG3sJk+rx4KT9WZpBZ6JDkly6+p+6JHFjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924650; c=relaxed/simple; bh=fI4YZIUdESe+KXQcRqR67vysxo0zhiFA5TgqGIaSsnk=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=iwWyXlCzNe2DTtc5rG9HmTqe27yd1P2uTSf81jM2/91rIH9D5XZjN4c/CPMUtQYsAFzBfxLILbvMAepMxAqlYzm7vkV222XWvp5kbuHV49kIGUEZuCCA928n9vhL2lSo31d4HiJFU6dF46z4feEFVrUgViJmtGC+P1a+7CGWGpI= 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=PiXETvYR; arc=none smtp.client-ip=91.218.175.182 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 X-Envelope-To: willemdebruijn.kernel@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716924646; 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=gz3k3DiyCGoMOQPg4X/3emTcMizgWP/27mI/YhTD5m0=; b=PiXETvYR6IRMfXEe4gOpDNS9DV3O6W5Gp/M9XzKmFpHzF3IzhEUJabyVl4aKIkY6A9mOQT iWn91fhLI0re1yqfYGa1lq6hNJCm5Y1NbaEitw8hyImb02S6L8FGAx+V9l0wb/W4Td4y6C M5NLDgB6mMCoLSKpQhDcsOYZygSBmig= X-Envelope-To: quic_abchauha@quicinc.com X-Envelope-To: kernel@quicinc.com X-Envelope-To: willemb@google.com X-Envelope-To: davem@davemloft.net X-Envelope-To: edumazet@google.com X-Envelope-To: kuba@kernel.org X-Envelope-To: pabeni@redhat.com X-Envelope-To: netdev@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: ahalaney@redhat.com X-Envelope-To: martin.lau@kernel.org X-Envelope-To: daniel@iogearbox.net X-Envelope-To: bpf@vger.kernel.org Message-ID: Date: Tue, 28 May 2024 12:30:37 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau Subject: Re: [PATCH bpf-next v8 1/3] net: Rename mono_delivery_time to tstamp_type for scalabilty To: Willem de Bruijn , "Abhishek Chauhan (ABC)" Cc: kernel@quicinc.com, Willem de Bruijn , "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 References: <20240509211834.3235191-1-quic_abchauha@quicinc.com> <20240509211834.3235191-2-quic_abchauha@quicinc.com> <6bdba7b6-fd22-4ea5-a356-12268674def1@quicinc.com> <665613536e82e_2a1fb929437@willemb.c.googlers.com.notmuch> Content-Language: en-US In-Reply-To: <665613536e82e_2a1fb929437@willemb.c.googlers.com.notmuch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 5/28/24 10:24 AM, Willem de Bruijn wrote: > Abhishek Chauhan (ABC) wrote: > >>> +static inline void skb_set_delivery_type_by_clockid(struct sk_buff *skb, >>> + ktime_t kt, clockid_t clockid) >>> +{ >>> + u8 tstamp_type = SKB_CLOCK_REALTIME; >>> + >>> + switch (clockid) { >>> + case CLOCK_REALTIME: >>> + break; >>> + case CLOCK_MONOTONIC: >>> + tstamp_type = SKB_CLOCK_MONOTONIC; >>> + break; >>> + default: >> >> Willem and Martin, I was thinking we should remove this warn_on_once from below line. Some systems also use panic on warn. >> So i think this might result in unnecessary crashes. >> >> Let me know what you think. >> >> Logs which are complaining. >> https://syzkaller.appspot.com/x/log.txt?x=118c3ae8980000 > > I received reports too. Agreed that we need to fix these reports. > > The alternative is to limit sk_clockid to supported ones, by failing > setsockopt SO_TXTIME on an unsupported clock. > > That changes established ABI behavior. But I don't see how another > clock can be used in any realistic way anyway. > > Putting it out there as an option. It's riskier, but in the end I > believe a better fix than just allowing this state to continue. Failing early would be my preference also. The current ABI is arguably at least confusing (if not broken) considering other clockid is silently ignored by the kernel. > > A third option would be to not fail the system call, but silently > fall back to CLOCK_REALTIME. Essentially what happens in the datapath > in skb_set_delivery_type_by_clockid now. That is surprising behavior, > we should not do that. Not sure if it makes sense to go back to this option only after there is breakage report with a legit usage?