From nobody Tue Oct 7 16:40:40 2025 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 DFA4D1EE7DC for ; Wed, 9 Jul 2025 03:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752030617; cv=none; b=qevgFibXPZ47vDaNCqBfYebkhn/AU3FiUdp1aAa9SubQC30sPrUD2cgQajAy76K7wN+/WeCSz3cIoxB+aNc/J/03D+J8HVNpnwYeSTy4TPXd4Xz/yRbYhAMG0JUViAkPTeW2iUGjO+otjgmRD8r+7bRxF6bCTMTJxILSnN/iTQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752030617; c=relaxed/simple; bh=UdIgkYyOOa7hCxMjPOwfAkzf8A+cA2dmARHAg+FBH5s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OCrx7KCsaixaDopLb4czv6NFmC8C9S4yNgSgK6RLa/5t7V3LGAKC/jZzMsKDQ4rmYSmFmRkBKajcew7WEMMbVqmNe3NXQU7YQ+2++n8tlfsTEalsqgmbV7WtgzA5jghaKSBMyGWF90j2d6RBDS4tWOl2DKA8ZpLwVa3/oH26NC4= 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=VE/WhMjR; arc=none smtp.client-ip=95.215.58.178 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VE/WhMjR" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1752030611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dD8eyIMRPg4u1jgNvJQ/ElVilPMWhJf81CmtaFeXe3k=; b=VE/WhMjRYUoSEBsl05KdPQXbMq+ZS8rr0sk2TbD+WzUpikn6+nifvDapuEvbIk2w3DbGY6 fsxDltr+0bSuJCbKT5SA/VRPkgqkhr6qAhaMxm4KbbK6hxUBGXZ3UkFsJ7++jPgJaizrn5 0c+uz866yZrqhbDTI/GAXGQTbqRnqcU= From: Tao Chen To: daniel@iogearbox.net, razor@blackwall.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, mattbobrowski@google.com, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, horms@kernel.org, willemb@google.com, jakub@cloudflare.com, pablo@netfilter.org, kadlec@netfilter.org, hawk@kernel.org Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Tao Chen Subject: [PATCH bpf-next v3 5/7] bpf: Remove attach_type in bpf_netns_link Date: Wed, 9 Jul 2025 11:08:00 +0800 Message-ID: <20250709030802.850175-6-chen.dylane@linux.dev> In-Reply-To: <20250709030802.850175-1-chen.dylane@linux.dev> References: <20250709030802.850175-1-chen.dylane@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use attach_type in bpf_link, and remove it in bpf_netns_link. Acked-by: Jiri Olsa Signed-off-by: Tao Chen --- kernel/bpf/net_namespace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/bpf/net_namespace.c b/kernel/bpf/net_namespace.c index 63702c86275..6d27bd97c95 100644 --- a/kernel/bpf/net_namespace.c +++ b/kernel/bpf/net_namespace.c @@ -11,7 +11,6 @@ =20 struct bpf_netns_link { struct bpf_link link; - enum bpf_attach_type type; enum netns_bpf_attach_type netns_type; =20 /* We don't hold a ref to net in order to auto-detach the link @@ -216,7 +215,7 @@ static int bpf_netns_link_fill_info(const struct bpf_li= nk *link, mutex_unlock(&netns_bpf_mutex); =20 info->netns.netns_ino =3D inum; - info->netns.attach_type =3D net_link->type; + info->netns.attach_type =3D link->attach_type; return 0; } =20 @@ -230,7 +229,7 @@ static void bpf_netns_link_show_fdinfo(const struct bpf= _link *link, "netns_ino:\t%u\n" "attach_type:\t%u\n", info.netns.netns_ino, - info.netns.attach_type); + link->attach_type); } =20 static const struct bpf_link_ops bpf_netns_link_ops =3D { @@ -503,7 +502,6 @@ int netns_bpf_link_create(const union bpf_attr *attr, s= truct bpf_prog *prog) bpf_link_init(&net_link->link, BPF_LINK_TYPE_NETNS, &bpf_netns_link_ops, prog, type); net_link->net =3D net; - net_link->type =3D type; net_link->netns_type =3D netns_type; =20 err =3D bpf_link_prime(&net_link->link, &link_primer); --=20 2.48.1