From patchwork Fri Feb 17 00:41:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin KaFai Lau X-Patchwork-Id: 13144163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6D6DC61DA4 for ; Fri, 17 Feb 2023 00:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjBQAmC (ORCPT ); Thu, 16 Feb 2023 19:42:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjBQAmB (ORCPT ); Thu, 16 Feb 2023 19:42:01 -0500 Received: from out-143.mta1.migadu.com (out-143.mta1.migadu.com [95.215.58.143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5037B5381A for ; Thu, 16 Feb 2023 16:41:58 -0800 (PST) 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=1676594517; 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; bh=U4yHl9ElYv4hsxmnACxDjREG81Ji8UwANWSQPcHWxJQ=; b=S/nnnAZhzHQ0GThAKwpQhPSNinVMRNO5PTyywJvi9Fa+xaYfSZDd/XLuzHLZTdwfr3q9gj E01JiDldQY2gKQvtzKF+KjH8Q7GtVvpFlMapcSYZ5X8QMSKd7uj7LN9bNJEaWAs1jy4/86 PB7RteXj+KZiJEu228JybXTR2ipA0AI= From: Martin KaFai Lau To: bpf@vger.kernel.org Cc: 'Alexei Starovoitov ' , 'Andrii Nakryiko ' , 'Daniel Borkmann ' , netdev@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next 0/4] bpf: A fix and a change to bpf_fib_lookup Date: Thu, 16 Feb 2023 16:41:46 -0800 Message-Id: <20230217004150.2980689-1-martin.lau@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net From: Martin KaFai Lau This set fixes the bpf_fib_lookup such that it won't return a NUD_FAILED neigh which may have invalid dmac. It also adds a SKIP_NEIGH lookup flag to have bpf_fib_lookup skipping the neigh lookup. Please see individual patch for details. Martin KaFai Lau (4): bpf: Disable bh in bpf_test_run for xdp and tc prog bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup selftests/bpf: Add bpf_fib_lookup test include/uapi/linux/bpf.h | 1 + net/bpf/test_run.c | 2 + net/core/filter.c | 37 ++-- tools/include/uapi/linux/bpf.h | 1 + .../selftests/bpf/prog_tests/fib_lookup.c | 187 ++++++++++++++++++ .../testing/selftests/bpf/progs/fib_lookup.c | 22 +++ 6 files changed, 238 insertions(+), 12 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/fib_lookup.c create mode 100644 tools/testing/selftests/bpf/progs/fib_lookup.c