From nobody Tue Oct 7 19:22:12 2025 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 250E62BE035 for ; Tue, 8 Jul 2025 08:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751963074; cv=none; b=F+4YNgvIdeeFYDuK1HNE18pRtSMUgFuCYBcpQP5nwHGmmNe+dqIHnOst7nCLdPh6xmBMhwQlSmidjxg+pPc7CXx+xz9i/JzLXi5ElkQ0NYQCGHbU5vg8GdC4edvtnC4ZE6LcmyPVyXw61Q/QaXniu9YUkK0bcATt7tnjpYfXLtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751963074; c=relaxed/simple; bh=S/4ysQBNXSNRLbsTxzjmiKYVJK4WRI1JFEgfz8Ho5Ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JJdl1OtztlDEeu8FtT5Hc8yBwh/hBzWeyGhS/65iLLQjiDoE07w2BkNcNrvIHoX5Ijq7u84BdZXx76ISOW8VsqEvS0dH7b1ayhzdjD2gGsr2nRT5KYxJgWvyDDakD2ajHzwu1V+F9wn11jPgG9I1V8szOICREN4TrHvse1+CNFQ= 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=dSewunOP; arc=none smtp.client-ip=91.218.175.185 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="dSewunOP" 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=1751963069; 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=hMuwkXar/JP+QSBlJ36t2NR92ukOZdEZlTj2WN/ipWk=; b=dSewunOPNjJfgXkA/XqClycrlr1PjVDawPl5xDY28XKxCVzA8I/HrgRuQYSyVzdWsc1CDg QlDbm2o3lP8kQmxmGkaU1H2Hn2IXIzVsdAYnFOKxZnljYjBSio+AcgEDF86oJJ4/ASLo3o /DtbZ4ZoQLvqbHgbq5xj4npYHZt1LTk= 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 v2 5/7] bpf: Remove attach_type in bpf_netns_link Date: Tue, 8 Jul 2025 16:22:26 +0800 Message-ID: <20250708082228.824766-6-chen.dylane@linux.dev> In-Reply-To: <20250708082228.824766-1-chen.dylane@linux.dev> References: <20250708082228.824766-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. 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