Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp350430rdb; Thu, 22 Feb 2024 05:56:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX60Ok/01Y0jYMcbZFSEjIMoomVLuFVv0XdAj+1D7pRp1B5/nWq8lqZajtnim9/GHNySmOrOW79kc2YR4r4N8Gq8eqchqPh28EcTYPELg== X-Google-Smtp-Source: AGHT+IHo36KJvl5YEOgz0VzCUwFIlYHLqDzv9y/7BsBuizpy2xLLhtoDhi1r+o54s3FSQzSRl9Ym X-Received: by 2002:a05:6359:1011:b0:17b:c8d:f3a7 with SMTP id ib17-20020a056359101100b0017b0c8df3a7mr19350050rwb.32.1708610183335; Thu, 22 Feb 2024 05:56:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708610183; cv=pass; d=google.com; s=arc-20160816; b=iIYI/3z3ODzUsE6F6m3m1m2oAW/zaEQmz09iRFwjYJ/IiKp/8usNaHmOlCUFz3/Oqx IFfNxHqUY0w+i+gV09RSDV0nwQ21ugYj2ecvS8MOhsJuA/E1s1qnwXd/w8pTAKu0e4+g yUFPSMAULT4Z2040EOyD8b/kTtlLfbCy8xjtW1Ipa2toDPSd4LLUFPG0Q5ykp5aU+d3Y 6Dtg8nZ7QjIobxdK1ftCBfL3fuLgd3DOY/qhEBrJhr/bqmIUzteh9JtGTeUttehF5me7 hWF0Q82I3vYt6cahZ8aN+wD3lSQaqvR5VxoWw6iasdfr1cXqT8FD8hEKjyBUPhk8sT+3 Z2Ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=ohnw1X5t6/nbcUS24rw3MYJUUJQ4h7ERcV3d3m5S1+E=; fh=1UEXF8WEdTRZGz3zsBPr9blJ8rxkIELeUsA6ymhnv1o=; b=xPKQaQ6SwhT4Rcl5qIUMvVYhqwqg/m153ferIj2LZYFuAmP0UC39vk0wYwizK+x6a5 feFauhE3NRiqOS5+07L9/iAs/YCCkyKn0d58gNYOxp2QCiLb5YL2saEUPPtVbmUtHjPj 6oKiu+Uxvqv1Lh74SbH0lB2TCTmSuVJDuZ1hwCiQdPnCNgRswXKw1nj1PL7Ss1S1jeq9 16MCaAYcsppqHSTlhzAEDLm+dchFOWhjOsgL+myTWU/aAieH+bJPsHXdNMSEFiENFR1K auLWICsetf5OOrTHFrm8MOLVQdNgGXiV+JrPu5wUJEQaDA1hCI20+qMEACIfK82ZOW2P 7q8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=iisk8n9p; 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-76619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76619-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i193-20020a636dca000000b005dc82a6d761si10236444pgc.123.2024.02.22.05.56.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:56:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=iisk8n9p; 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-76619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76619-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6198CB28568 for ; Thu, 22 Feb 2024 13:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42383146900; Thu, 22 Feb 2024 13:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=uliege.be header.i=@uliege.be header.b="iisk8n9p" 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 A60C9134CC2; Thu, 22 Feb 2024 13:42:45 +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=1708609367; cv=none; b=nrOoXUUadaIWHRUhNZKTtePIxu2LM6lSCXORiJc/gJkyJgPNHbTVqrdjJ+hlAD1rQGHbhHir751LSl0XS3xsRM4920eE/n3O3PkdXdcm4Csez0X+HnzTJowdcMXQ9qYmLbcY7TntDuyHQxelK8ubS7vOMTxwA8+4lwYxx2ri85Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708609367; c=relaxed/simple; bh=w7q0OZpmbQ4iJGkY22z3KyxTMX1Cmy0aLTK8x/4EEWI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RXmwjAaYWvU7l8ypgDYem2CIkqg9YyuRlGC6Gd9bbBN5BRfB4eDw2VSwNQGIOluktRkM2kJXzPE0rFqNoX/MV79WU0Wx6lXGrNS4A/f+I0CdiG1X4kswWN/iEG9stYpFm/LcnUIQJPwvMycFBZheZ9clxuXMlplEE5Dmh0drK1c= 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=iisk8n9p; 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 localhost.localdomain (125.179-65-87.adsl-dyn.isp.belgacom.be [87.65.179.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by serv108.segi.ulg.ac.be (Postfix) with ESMTPSA id C0278200DF89; Thu, 22 Feb 2024 14:42:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 serv108.segi.ulg.ac.be C0278200DF89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uliege.be; s=ulg20190529; t=1708609357; bh=ohnw1X5t6/nbcUS24rw3MYJUUJQ4h7ERcV3d3m5S1+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iisk8n9pS1HSF3c9g4DMHVKKJ3d5eaY+T4E/6zmc5LwNR8UV3FM0A23LacqY+FYFY RElvkOd88KFwQITaK0vcRozx/3P+vPYH+RbKAaS0IBM69aa8lYVmKmB1RyZk2MqIGF Uksz7mjdoPgXloV+s+jDfWPCX/v+PGdZS/3w8ZJ+RfTRJcvlDe7+yZtrvpruV85muR DyG2cVccIt+cRjlQ4vC+J20oxj1WY3ONiEfRjPRpYFRzXfeKurfPS2fKXeSJ5kygvO /nagO7TU9zg+Dvuv+TLWBesVpul5mleAAIodfNay3QXBagpnd2BStNqc43HjSKcBP7 b9BYep7N1kvOg== From: Justin Iurman 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 Subject: [PATCH net-next v2 3/3] net: exthdrs: ioam6: send trace event Date: Thu, 22 Feb 2024 14:42:20 +0100 Message-Id: <20240222134220.16698-4-justin.iurman@uliege.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222134220.16698-1-justin.iurman@uliege.be> References: <20240222134220.16698-1-justin.iurman@uliege.be> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 4952ae792450..b26dcf4d0239 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -50,6 +50,7 @@ #endif #include #include +#include #include #include @@ -944,6 +945,11 @@ static bool ipv6_hop_ioam(struct sk_buff *skb, int optoff) ip6_route_input(skb); ioam6_fill_trace_data(skb, ns, trace, true); + + if (skb_dst(skb)->dev->flags & IFF_LOOPBACK) + ioam6_event(IOAM6_EVENT_TRACE, dev_net(skb->dev), + GFP_ATOMIC, (void *)trace, + hdr->opt_len - 2); break; default: break; -- 2.34.1