From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A0C291714BE; Tue, 15 Oct 2024 15:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007483; cv=none; b=pK5GqF4jjU/xKoQ5NRLB+e67TNe9pnG54ooPzgmUDjgnPNwEx0eUbBcb9DW90usqYIg3rLHwA9ywE2j7G4FmzS4o9oAeK4kk/KeqjxhjHy5oK8lWIjwTLQU76CHuPh2YOWpEikfyUVqGxGVeempPEfTTufDhGdOlUxjtKiC1h5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007483; c=relaxed/simple; bh=grArdQkCShh+C6dJgpxXV1EytHE5WpU0yGVIeKNoxNg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oJKREqFxUBM5gUFZVyYa9GtCUpzZyi5Wo7Eb7hh9AYdpg+wMPfeCyh65AhqpBd+DdY1PtGTh1TugoNXbkk5Ak0q8NTbd9oUSynKF7M844MrVe22BR0bADDgmPl0XmYix4NLYE7tKCnHWjy8jKurrf0mpVXbPN0OI3w0NPLSNtuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c+9nQ8G7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c+9nQ8G7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56560C4CEC6; Tue, 15 Oct 2024 15:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729007483; bh=grArdQkCShh+C6dJgpxXV1EytHE5WpU0yGVIeKNoxNg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c+9nQ8G7Y9i/LwN7VNpV0DrdRQZkNBQPlKR8dE3HSexY+pKDsTc/SCMK2hMsar88w syKDfIFrTL9X/Qg9yNQQ0AHFsO6hOj3SW0KGr9OCMmTBp8cWOiYxpJrdYVga0K1/SX 96iKIpBlsOWG/PRp4+eurZrZDHsM8qFZREzbIa0UZq+TDhm0ooUsjIJYDJs0L3PNHs bMgCuSovbXQTndefYSXXcNaQhTsofxc93EYdkTt49wyOVokXLmXFogNrvy8GkDw5tY Y6q0VoLjkA0JkzvDGD/z3Ed4BaigFe8R6RJ2lUUBoFA+Lab2t4Gy1m3D2uPOmRAeE5 cLFPyx5C3n3ig== Date: Tue, 15 Oct 2024 08:51:21 -0700 From: Jakub Kicinski To: Hangbin Liu Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Andrii Nakryiko , Jussi Maki , Jay Vosburgh , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Liang Li Subject: Re: [PATCH net] bpf: xdp: fallback to SKB mode if DRV flag is absent. Message-ID: <20241015085121.5f22e96f@kernel.org> In-Reply-To: <20241015033632.12120-1-liuhangbin@gmail.com> References: <20241015033632.12120-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 15 Oct 2024 03:36:32 +0000 Hangbin Liu wrote: > After commit c8a36f1945b2 ("bpf: xdp: Fix XDP mode when no mode flags > specified"), the mode is automatically set to XDP_MODE_DRV if the driver > implements the .ndo_bpf function. However, for drivers like bonding, which > only support native XDP for specific modes, this may result in an > "unsupported" response. > > In such cases, let's fall back to SKB mode if the user did not explicitly > request DRV mode. Looks like the issue is reported by QA rather than a real user. A weak -1 from me on building such unreliable heuristics into the kernel. As BPF CI's failure points out the ops can return EOPNOTSUPP for multiple reasons while dev_xdp_mode() only checks if the driver *has* ndo_bpf, not if it fails.