Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp21427rbb; Fri, 23 Feb 2024 10:20:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUG0/ZJIZocGOz3oXnUKB1S3Ys0djbctHT5sNURGGGJuU0T3CpNTG6EFFYnV0NfWqMs8k63LfFzdPwMgEj8o7x1zjpmYcDe7xIQfRXejA== X-Google-Smtp-Source: AGHT+IF0rJK3yJEW6xJyVaagambO3sYrBly50fRzAZtOxr7oQXdPSWigxtR9ER7IJCbb1IEJ29fy X-Received: by 2002:a17:907:1019:b0:a3e:42cf:f6ae with SMTP id ox25-20020a170907101900b00a3e42cff6aemr319942ejb.19.1708712418599; Fri, 23 Feb 2024 10:20:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708712418; cv=pass; d=google.com; s=arc-20160816; b=VQLKig2TCMz7lUfIMRXGUKEoh9R+1tqpt90A4zIPPeewBX6klXUpzmmB57A7ZPeSk4 N9B0D06LOuZ91kG6JQBdOvtRYQpuDxUIVuzXYHIbllPkRmSRU5P8YFuwoWgFWk3duTlj KXfBrjVVtaWqgklkSPretsxDqTPiDREVwEoAkzsNWqTAv2TNANFnJhX1zWsq8KZsPs5h GVFASvZUy63uva1E3L7dhHMfWB8Fo65tjJExRWxP84UO2BJEDLzW1vWwovuMAgKNm0EQ CE2HngDmRMWPkILFUfNKYY/Yaz63BC1PEIFfGXfqCMB5JxcM/rTcVd5rMM4wl6DFtcvo 9iKg== 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 :dkim-filter; bh=QvbrHms9ETKk/v/CsD8CfF4FaoDekyg4wG/YRj8GOqI=; fh=1UEXF8WEdTRZGz3zsBPr9blJ8rxkIELeUsA6ymhnv1o=; b=X8++CxSFOQ+xVsl9TYxloGrUkIRZpRl4B15V9rlsRIRDIh8ztwm0sCxcDsHCUhZQ4C v/J7YK+eJD1ThIMBt+rJ2909MTLL6ZaqAMU8lY6Ai9sFqpGtNhVOgIj3ZXFkEb34mghE chWkK53do50gOaHxed4dAyRl8l9NILpWr6x0J8uSpwqdo+LaY9fB+45AtH+90vfVm4aD uye/Fv5pupTHhzXUgJd0cfxdOye/ap0jp2zkgzMpAfCiyxvdOite6BLRtiWvuuJRUJUS X7uHljC8er0cEBSezOGqbTbBYIsHefifpHFymvJtwbr6I6dElI1aZCkq/TEbRKzGlzBl 1lqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=mjZbgi9O; arc=pass (i=1 spf=pass spfdomain=uliege.be dkim=pass dkdomain=uliege.be dmarc=pass fromdomain=uliege.be); spf=pass (google.com: domain of linux-kernel+bounces-78967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d19-20020a170906641300b00a3da6c9f514si6335257ejm.913.2024.02.23.10.20.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 10:20:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=mjZbgi9O; arc=pass (i=1 spf=pass spfdomain=uliege.be dkim=pass dkdomain=uliege.be dmarc=pass fromdomain=uliege.be); spf=pass (google.com: domain of linux-kernel+bounces-78967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4FA811F27308 for ; Fri, 23 Feb 2024 18:20:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F44014263E; Fri, 23 Feb 2024 18:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=uliege.be header.i=@uliege.be header.b="mjZbgi9O" Received: from serv108.segi.ulg.ac.be (serv108.segi.ulg.ac.be [139.165.32.111]) (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 1D2E012D1F9; Fri, 23 Feb 2024 18:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=139.165.32.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708712410; cv=none; b=qvhKL1lCvUlTULkTZhGoknuRzDAnQw1YtiWQil3KabYJztirSix4hSJhKgwwBAWeHpAtM/5+yHdOx/1SYO0mttuswpjTt/vPp//nb6UsVcapoXXvy+iC7BrL8+QVxhxzvH3jIO2tRhWRU8qfx7wR+T4lgASS5QjtK9+GU90Q00o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708712410; c=relaxed/simple; bh=L17zNUCxvNnm7yyqQ7WS5W8AZHiSgpBGe/zD9/AGBOs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y0ZOBfUI5EnREzcYLk0OQ0IThrN2nncDvlDcnhl3e88aHHSMymL3Q8oukEs2ptCEesTB+5MKiyOVu2J3l77+o3eSjsWXBujsnOVQg5W5bvEQ1pPrE5Ely5MbNzH2IRhoixfCb1rS1zBv/tdl2UWQx8SedzZrqniVAcppl/NWKcM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uliege.be; spf=pass smtp.mailfrom=uliege.be; dkim=pass (2048-bit key) header.d=uliege.be header.i=@uliege.be header.b=mjZbgi9O; arc=none smtp.client-ip=139.165.32.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uliege.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uliege.be Received: from [192.168.1.55] (125.179-65-87.adsl-dyn.isp.belgacom.be [87.65.179.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by serv108.segi.ulg.ac.be (Postfix) with ESMTPSA id CE777200C247; Fri, 23 Feb 2024 19:20:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 serv108.segi.ulg.ac.be CE777200C247 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uliege.be; s=ulg20190529; t=1708712405; bh=QvbrHms9ETKk/v/CsD8CfF4FaoDekyg4wG/YRj8GOqI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mjZbgi9O1KiS3zphKQB3YRcvJaUIZGjlHWJbEWKciGZrv9WW10zNrgHKW/5d3UY/9 Q/+npasTrG7gWq0+wNIoVxufjRcpPgyvg+4DGR6qZaX6+j1LANaU+p1oze7zVtdpLe KAgWj+CTITrjLGKVbMbSKsItLiwk5gwGIzxmlTOTA3eX3qO5VSOlTRgurILwzGswLM Rpn5VjpTQRu0ft89eDT3Viy4gwi2Fuu8TJnn1uOIqvix24WEEBsufY69LmzJcn1z3W Ajp0GFK5pWsq1uzU1n+qpfiXWZt2DUeMjOTCZrshgQ+LRgBII3M99txJB28MqE+cNV IcQbMvSws1W0A== Message-ID: Date: Fri, 23 Feb 2024 19:20:04 +0100 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 v4 3/3] net: exthdrs: ioam6: send trace event Content-Language: en-US To: netdev@vger.kernel.org Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, justin.iurman@uliege.be References: <20240223144135.12826-1-justin.iurman@uliege.be> <20240223144135.12826-4-justin.iurman@uliege.be> From: Justin Iurman In-Reply-To: <20240223144135.12826-4-justin.iurman@uliege.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/23/24 15:41, Justin Iurman wrote: > If we're processing an IOAM Pre-allocated Trace Option-Type (the only > one supported currently), and if we're the destination, then send the > trace as an ioam6 event to the multicast group. This way, user space > apps will be able to collect IOAM data (for a trace, it only makes sense > to send events if we're the destination). > > Signed-off-by: Justin Iurman > --- > net/ipv6/exthdrs.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c > index 02e9ffb63af1..003f35d9b42b 100644 > --- a/net/ipv6/exthdrs.c > +++ b/net/ipv6/exthdrs.c > @@ -50,6 +50,7 @@ > #endif > #include > #include > +#include > #include > #include > > @@ -954,6 +955,11 @@ static bool ipv6_hop_ioam(struct sk_buff *skb, int optoff) > + optoff + sizeof(*hdr)); > > ioam6_fill_trace_data(skb, ns, trace, true); > + > + if (skb_dst(skb)->dev->flags & IFF_LOOPBACK) Hmm, now that I think about this a bit more, I'm not sure we should force a node to be the destination in order to send the event. Instead, we could just remove the "am I the destination" check and directly call ioam6_event(), which does check if there is at least one listener before sending the event. I see two reasons for the change: (a) one may want (for whatever reason) to capture IOAM traces on transit nodes, or (b) one may use inline (instead of encap) IOAM injection where the destination may be outside the IOAM domain (i.e., destination != decap/egress IOAM node), which is not RFC8200-compliant and requires removing the IOAM Option-Type in-flight from the HbH, but that's another story. Any opinion? > + ioam6_event(IOAM6_EVENT_TRACE, dev_net(skb->dev), > + GFP_ATOMIC, (void *)trace, > + hdr->opt_len - 2); > break; > default: > break;