Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp887370rbd; Fri, 23 Feb 2024 06:43:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8y4VGp4xCmAewYYCSNenMYi+xY6J9RtQ86WdmQ0by9OaIqBb+HfqNoGvmH8UHvjc3gyit1htYJpmeuKuybVAiUDEuzM5dAAbIlsQ4pQ== X-Google-Smtp-Source: AGHT+IHQqRoKGKw2BvUYqvPn8h6ASeXrnY7yCzRfagRADSKvJ1TCLRDAMRe8rim6b6KHzsQHajRO X-Received: by 2002:a05:6808:1302:b0:3c1:35d1:e1f1 with SMTP id y2-20020a056808130200b003c135d1e1f1mr16995oiv.25.1708699425453; Fri, 23 Feb 2024 06:43:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708699425; cv=pass; d=google.com; s=arc-20160816; b=owit2epFSQwlLe9CCx7mJqFu05UH/+FnBNYpzCcvlLI+MooqQF1na+GqXSZdcFfxWU Gyv1nzuxKOGzq6KZXXYsCA3NN+tEhYmpZY00aw7C/KYAeiOvq8j01GTc/1Z4evFnaRwL hk911G92pBiksxbHWt4XZtLuOflRP5h6Jb8uOyaLozHt/N4vRVlPEAXco+6DYvMuKe1z lRmtBAGZz1g83LhyNN5ACXBC8JI+pMhFT3PsJN4zrf8nvC6l1/RcFe7MOHbKoyRYRtYf qYdZFR0zEVAYt2hU+VKFU/TmSTygG5T3X6XMN1iJtvZ+PGaIoEb65oc4i79wGSocjLvR Z8JQ== 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=UcUfAXN6JVmIsLlMmJXJirrwKr6+ad6fgsDvkrq6I2c=; fh=1UEXF8WEdTRZGz3zsBPr9blJ8rxkIELeUsA6ymhnv1o=; b=Mv518uPAdgNDMG9tpfkg3Q3VasnkvqqkJJC3KVua8WYhqAer3R7iBCdKWOWbpGpUXk vOAzfxl1SUQDlBuXfRc71SvEFwni7sEiU+55TWvzFC1tUdJIQ5fovb76M2jCZ7F6IU9g RaeMfUrjsWy153xrrLaBwO4W0HRU2kkQ6maiiRlxi5hipvvRqKgfRrN3kSoDGpXMT+Zc +d8F7QUusSOpZuphh1fxIaK+11WROEikKmx52UkG0JpF+BOatyCxzA455KaRJwYKejrL cPEBGAddLBXeTuiIHEnvtO2Vw6i0brVRDDWYce8vQ/KTbfgkvfKvuUYbHaTerFawzplq NKsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=0BK9JCuA; 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-78512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78512-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iu14-20020ad45cce000000b0068fdafa8722si909721qvb.591.2024.02.23.06.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 06:43:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=0BK9JCuA; 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-78512-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78512-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 20EC61C22E2C for ; Fri, 23 Feb 2024 14:43:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18116823A1; Fri, 23 Feb 2024 14:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=uliege.be header.i=@uliege.be header.b="0BK9JCuA" 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 8E3A479CC; Fri, 23 Feb 2024 14:41:51 +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=1708699313; cv=none; b=cZfsH2DFOWiuV23RoY+E0SGWbMjwl6QkuVYpfIe7GnBQ/R1kzb24qPhGnhK7VPdosxmB7nrCX3l3K/Bj9tvmXiR5cSQpN6J12osKXSrYEOlF5p9OsicdrAFaWLutnoEP3Lhb3Iw3C7/+RIc0uOtSmkNbSl9RYu5TCzwyToc6r2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708699313; c=relaxed/simple; bh=ZlQwc3wckbIo6B/IZ6QBbkjJIGAEVMnxpMBxl0bFrYE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OKdk+y+CSJ9deFkA9Vhxfl84XR7XsPf54wY8EhJsz3e0GFne2KbDx17Jp8CHtMRvVqO6Srj+uHe8u/xI7ZkFJJXEDeNqATOgGtKM06iGB9kUuyYSoDlsYdgFXTqysH+ay53llDwHtC1qA/mPE+6Rvv3Xfvvc6W0vZ0BbCbab+5g= 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=0BK9JCuA; 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 D3F1A200C984; Fri, 23 Feb 2024 15:41:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 serv108.segi.ulg.ac.be D3F1A200C984 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uliege.be; s=ulg20190529; t=1708699304; bh=UcUfAXN6JVmIsLlMmJXJirrwKr6+ad6fgsDvkrq6I2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0BK9JCuAPXlWKMScVZcUjJqUJOZohb9t1vFW4v7P8IQ9i7ZZx1dQOo0t3Kp6uBQIn Po4XV628+Idoybnu7gLedNSmhDd1fqIzjWUve/Nh+OrjzcLe0UXzIUnxo42a/GzSFw Xq/xLr/nQ9JE4yTYRZqsC2QefF5ywFeLvzZEtjXJaARPQhiLoWL4j1jR3Uy4j8SxBE 1ToGbyr4UamAPV2lvSmRSZW6Kp61/JumgjhgQtd8Md3vTArOxC+c26KxHbNWUzKJ+b LmU4CZi4HG0Gdw80sDPNuFCqPIHAgaw5V70qt209giaAtKhe/g8+wZvK9qwjzZOvEm 9EzWBOfhL5J1w== 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 v4 3/3] net: exthdrs: ioam6: send trace event Date: Fri, 23 Feb 2024 15:41:35 +0100 Message-Id: <20240223144135.12826-4-justin.iurman@uliege.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240223144135.12826-1-justin.iurman@uliege.be> References: <20240223144135.12826-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 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) + ioam6_event(IOAM6_EVENT_TRACE, dev_net(skb->dev), + GFP_ATOMIC, (void *)trace, + hdr->opt_len - 2); break; default: break; -- 2.34.1