From nobody Tue Dec 16 08:34:36 2025 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 1613E281368 for ; Thu, 10 Jul 2025 03:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752117776; cv=none; b=nmoIHVJWbX0RXdW+DE3cBwHmGkeT2jsm7pB37LW+zjNiLKj6hQC/XgSbVDEc64YEKNYKkBFg/k0NkbKChWwz7a75o9SWUHBoTviAqv5HfOFd7eLcy2XCVSGU6wX20X5f4mtAA55PW+IcvkmibTHr8TpptRzwCU1o+8MoY/e3Xd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752117776; c=relaxed/simple; bh=CQ8vjEjDD0uwQT3exfZofUrNYwBjM/CnaOn7WW5pOSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aM0sbXX7sKIuh1nsKFih1aB8x8AGWB8b1XFs9mqXvhRUM8brmYAF1tGmQtk1JIdKRnoCmt8/lKhFb/XvtUq2Ci8MmuYv4fN/zoNAxhsDHSUoyXvdQVUKji0SC5XYHb0waj9sR5o9iIeNxKwRPwgYIOuGL4kMegJICa5v8/u1sv4= 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=MkLbufA0; arc=none smtp.client-ip=91.218.175.188 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="MkLbufA0" 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=1752117771; 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=YM07Fcya19W3fzWxTt2G5+PxuhYqLe8OGckrmvK6sig=; b=MkLbufA0rmYJNvXUiOUWnijTPPGJXmgxSLXW3v9Cy0G1d2IkrWx77ybrpfTlYjjuK2sd7h 9ZKlGtu7jsk6csGGEKbgCSr+DSkw8cUygcnhtrkjwDJfmwPsfxGhTPv3B9EKRsP5HdGpOV sey6qJAWSweQ0/3A9YuAyAla/V3Cf2M= 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 v4 3/7] bpf: Remove attach_type in sockmap_link Date: Thu, 10 Jul 2025 11:20:34 +0800 Message-ID: <20250710032038.888700-4-chen.dylane@linux.dev> In-Reply-To: <20250710032038.888700-1-chen.dylane@linux.dev> References: <20250710032038.888700-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 sockmap_link. Acked-by: Daniel Borkmann Acked-by: Jiri Olsa Signed-off-by: Tao Chen Acked-by: John Fastabend map, NULL, link->prog, li= nk, - sockmap_link->attach_type)); + link->attach_type)); =20 bpf_map_put_with_uref(sockmap_link->map); sockmap_link->map =3D NULL; @@ -1772,7 +1771,7 @@ static int sock_map_link_update_prog(struct bpf_link = *link, } =20 ret =3D sock_map_prog_link_lookup(sockmap_link->map, &pprog, &plink, - sockmap_link->attach_type); + link->attach_type); if (ret) goto out; =20 @@ -1817,7 +1816,7 @@ static int sock_map_link_fill_info(const struct bpf_l= ink *link, u32 map_id =3D sock_map_link_get_map_id(sockmap_link); =20 info->sockmap.map_id =3D map_id; - info->sockmap.attach_type =3D sockmap_link->attach_type; + info->sockmap.attach_type =3D link->attach_type; return 0; } =20 @@ -1828,7 +1827,7 @@ static void sock_map_link_show_fdinfo(const struct bp= f_link *link, u32 map_id =3D sock_map_link_get_map_id(sockmap_link); =20 seq_printf(seq, "map_id:\t%u\n", map_id); - seq_printf(seq, "attach_type:\t%u\n", sockmap_link->attach_type); + seq_printf(seq, "attach_type:\t%u\n", link->attach_type); } =20 static const struct bpf_link_ops sock_map_link_ops =3D { @@ -1869,7 +1868,6 @@ int sock_map_link_create(const union bpf_attr *attr, = struct bpf_prog *prog) bpf_link_init(&sockmap_link->link, BPF_LINK_TYPE_SOCKMAP, &sock_map_link_= ops, prog, attach_type); sockmap_link->map =3D map; - sockmap_link->attach_type =3D attach_type; =20 ret =3D bpf_link_prime(&sockmap_link->link, &link_primer); if (ret) { --=20 2.48.1