Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp654095rdb; Thu, 22 Feb 2024 15:35:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdoNoFxs2P3H12wsjW1pLOuWJH949zRrsThcejWnIb79aXsLr2spxxGp2sUy+95Bs+xKnPsVSjchCRozFpdcrItC/JzzcFfcOjMFT50w== X-Google-Smtp-Source: AGHT+IFuWOa9WfT8UW7AWz4YHlgVsCtdPvSeaQY2tNeTOukhwQR/yhJNIPSH4yy3GBEZSMOApe2s X-Received: by 2002:a17:903:2b03:b0:1dc:3273:7f53 with SMTP id mc3-20020a1709032b0300b001dc32737f53mr444216plb.18.1708644918326; Thu, 22 Feb 2024 15:35:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708644918; cv=pass; d=google.com; s=arc-20160816; b=jyBFFBHiAT/F2xjDOM6FGcHWwFRGhBBZ7NkPmrT/JIovMTwpz5Prl36IKs03veE+HZ DIMTjpDJ9K1+U9sTS8vh/YzpqpOu8vpJDHTMPlXsP8CgwNosE7S1x2eqDNoAjBkI8izf 9HhAaUljcXYQjYjKkWDgFamncCGrYwxi+pw3xzn5+MNuEcTYmbAbDUiERoHANfPPZGpI o72uP5l2GYTnSmT/glYsYTyyChs+cLbjFZnLdTXFITnRhqR72yBg17YUexSPNoH1fKYE oEM5hlsht/15VPou1k5MQvRRasUobtJRt5RDCyFxaWKOR3DuyWjU6VzaUYuJhT195WsY rr2Q== 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=jm1S3B6YgXtA9UYCo45jiNojmUAOAVOpxmbA/k8iOA3K4S8f02qVfYcVYvF+R7tuXJ w8/a7aOaBliNtkWsaEEmPJ7vqKPMiLn8qLFlRsBB1K2Bm0/7I183SfbZUVKfiCHzY9Qk 0PSpb2CZo28UF+zZEmhAnmtHGgk+DIP1E14CNOr+jy5dyQOQyrev71rb4h3HlEQhLRfX Wmeg0BZVeGG3drPvmerrZHx27OAvxSMLyaRSjGdbCD6GN94RKJgUKNa/KmBH8YPH0kyN airyMYwSxitf5A1gKLlWav8dq8PP03Uu3kwH+CXBb77F2SQfVhIhA1WHgq/kP8p+fyQV ijVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=eqCd71v0; 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-77537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77537-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n16-20020a170903111000b001d8a813bb9asi11187112plh.160.2024.02.22.15.35.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 15:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=eqCd71v0; 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-77537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77537-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 83BCBB22E90 for ; Thu, 22 Feb 2024 23:34:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF7A322339; Thu, 22 Feb 2024 23:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=uliege.be header.i=@uliege.be header.b="eqCd71v0" 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 D340C19452; Thu, 22 Feb 2024 23:34:00 +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=1708644842; cv=none; b=FSgtrYWbpfcXDw0wxdnJKsyra3RX02c2NimRmByOYPU0Spe3mJKXY+ftY4enfzA5VNywTVFRBP4g+fjSQDzD6aNnm7D0bpsq8zkBoD/8v0mexiLz0p5DG0pCMqqGv+GM0y+50XLRfELqEMPGIT709V92xvNcxrFmom2LAMhZ9eA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708644842; c=relaxed/simple; bh=w7q0OZpmbQ4iJGkY22z3KyxTMX1Cmy0aLTK8x/4EEWI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qosvjrD1K05Do/pDmGfpVzBb3NC8o2NHjpASN4k3eaqMD+zxL59TgnHHNS2zn3m9Unt0B8q1jA3KaASeC6zharuYKj/4rhK1G1ZpSw0q4/mke5OtTsm0g4JyghHAVD+oesyvx2v+TGmM1OZrQX7hT5FaVlIcJg8+4kwJZ1VwEY8= 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=eqCd71v0; 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 ubuntu.home (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 6F251200C980; Fri, 23 Feb 2024 00:33:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 serv108.segi.ulg.ac.be 6F251200C980 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uliege.be; s=ulg20190529; t=1708644837; bh=ohnw1X5t6/nbcUS24rw3MYJUUJQ4h7ERcV3d3m5S1+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqCd71v0KKdVOC8riTFHBvRMBv6tbxQC3WUvppjDctj38oInNzBC66qEQDmXf5P0m x3UlcU5n7jNmY/djLkBOFA4hfgiQkXkPKKLuMl6u+Vde+KpBbtSMsZzu3it8O++kx9 O9ofuM4pjQBQbuts3gcUELwiBVyWCB4mEp4Bn0Ojo4fkeqdx+pSXnJ6R6Se8qeJrA+ Is3QnAQSVIl+4IjIGQnBjcDQ7fv9JpV6/WxAzYW8iLRLBS5884BqSxr5jRij0I286q NG8iIqCEdStXTZG5OyBd0gBzeegzWkZEOSmCxmtAfVXT7mMX+jC2kerwQG5CuNmBtl CjKufj49V8JnQ== 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 v3 3/3] net: exthdrs: ioam6: send trace event Date: Fri, 23 Feb 2024 00:33:37 +0100 Message-Id: <20240222233337.5342-4-justin.iurman@uliege.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222233337.5342-1-justin.iurman@uliege.be> References: <20240222233337.5342-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