From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.15 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013280; b=dIdnEUUV8mb8dxmoXYLYkbqRoepL5Kuy88Fxp3HhZKGZLmlrqJ70S/YAdZMIR1pzsxo0 uGYHRoUS+inkW7ODD6rOTKAH/9VOlv5Mti1gGKIHTIFtBML52+VB4/TRsIaPMUiT4s/z/ DMauVO4b5/6HSSzM3cXaxWpfdTX8J1Lrj5agSXFlA/XkOBFoUl0bX4sqkOzBYhwoZ4fuk q3/9xAoRA7r9yFTOzKqF88Uz4S8Rjsir67aD1kP6qnxNc4MUiWeV2++nzAnyb2jfoLJRp 4lwTbCFhUMsO0j5cuFCb74GjiyK9y17fF6rheYoECyrgBD2+fN2li8mF1Wx73b64hqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013280; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=3UYm6L97WiG4/sOrCa38d1+XzZbLjtCMJh8nv2u4zeE=; b=DDKuO4OKmpb4JrPr7XGipA76LUDupqtk2SOUGXxXBjOo1ZBbahxmD9dE4STE98o21K3g boo1c7nlPquzVKPx0M1MktpWFcJo54sGYNiPeRI3pSkKlbhXFdYSYNI0vECs+mdf7OJ+b k8WMJbrfIBsfnbIZ0v0tNVz2AumrIUWiK9lkADjcD0nEDd8K3xUK0D/Q+fXLu8W/5lvyf e3nMSt/lbEPwwcV3ZUz5BqWi12Qu6GUdmVXKDHlIXwM19wMQi4OohSR2/6yrR4mVtTVKE KheenJisJjhH4LYN5mIBjRpxZ/9N4xAO6t2xKj+cXcVBCi6SMcFjW5ORNg10judSN4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mdoFcVRu; arc=none smtp.remote-ip=91.218.175.15 Received: from mta0.migadu.com (out-15.mta0.migadu.com [91.218.175.15]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFA04606A31C for ; Mon, 30 Nov 2026 04:34:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CFA04606A31C 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mdoFcVRu X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=BwwYiFebuwXuIZ/ovDQDKB4z/tfliAStAKvMVoKvF4Y=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796013276; v=1; x=1796618076; b=mdoFcVRu/j/8Wv38wbAu1So+Ovfhxre4QDXWIE2fMyQ7nhBkFklQO2uscpD2yDrXN3gjn649 7WJYTmV/oLeYuwjeACJX/rwYM8vr4Ld1NAAU7ect4DZc7WakxWhvN3ZoXN/rHBoF/RynT58aicH HGwg2f4YVrVbvupHJbRWcU0I= X-Envelope-To: linux-kernel@vger.kernel.org Received: by mta12.migadu.com with ESMTPS id 3a63024b67896a95; Mon, 30 Nov 2026 04:34:36 +0000 X-Mizu-Trace-ID: 3a63024b67896a95 X-Migadu-Flow: FLOW_OUT Date: Mon, 30 Nov 2026 12:34:27 +0800 From: Hangbin Liu To: Jay Vosburgh , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Nikolay Aleksandrov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH net-next v2] bonding: check XDP support before enslaving changes state Message-ID: References: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn> On Fri, Nov 27, 2026 at 02:37:28PM +0800, Hangbin Liu wrote: > From: Hangbin Liu > > The XDP capability checks in bond_enslave() - ndo_bpf/ndo_xdp_xmit > presence and whether the slave already runs an XDP program - run only > after the slave has been opened, linked and published to the > datapath. On failure the slave may already be bond->curr_active_slave > or reachable through bond->slave_cnt and the upper device list, so a > lot of state has to be undone, and bond_xdp_xmit() can observe the > slave before its capability was ever verified. > > Move both checks into the validation section at the top of > bond_enslave(), before the first state change, so a rejected slave > returns directly with nothing mutated. bond_xdp_set() repeats the > same two checks for every slave, so factor them into a common > bond_slave_xdp_check() helper used by both paths. > > Signed-off-by: Hangbin Liu > --- > For Sashiko: > > please ignore the bond's promiscuity/allmulti/ns maddrs leak issue > when xdp setup failed. It will be addressed in another patch. > > please ignore the no unwind for bond_3ad_bind_slave if > dev_xdp_propagate failed. It will be addressed in another patch. > --- > Changes in v2: > - move the duplicate checking in bond_xdp_set to the new check function. > - Move the bond_xdp_xmit() fix in another patch and target to net (sashiko) > - Link to v1: https://patch.msgid.link/20261124-bond_xdp_fix-v1-1-e67983924324@kylinos.cn > --- Patch doesn't apply to latest net-next due to recent 802.3ad update. I will rebase the code and repost a new version. --- pw-bot: cr