bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] tools: Update bpf header
@ 2021-06-29 17:37 Rumen Telbizov
  0 siblings, 0 replies; 2+ messages in thread
From: Rumen Telbizov @ 2021-06-29 17:37 UTC (permalink / raw)
  To: bpf; +Cc: David Ahern, Daniel Borkmann, Jesper Dangaard Brouer

Update bpf header under tools to bring in the bpf_fib_lookup
struct changes.

Signed-off-by: Rumen Telbizov <telbizov@gmail.com>
---
 tools/include/uapi/linux/bpf.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index ec6d85a81744..6c78cc9c3c75 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -5925,8 +5925,20 @@ struct bpf_fib_lookup {
  /* output */
  __be16 h_vlan_proto;
  __be16 h_vlan_TCI;
- __u8 smac[6];     /* ETH_ALEN */
- __u8 dmac[6];     /* ETH_ALEN */
+
+ union {
+ /* input */
+ struct {
+ __u32 mark;   /* fwmark for policy routing */
+ /* 2 4-byte holes for input */
+ };
+
+ /* output: source and dest mac */
+ struct {
+ __u8 smac[6]; /* ETH_ALEN */
+ __u8 dmac[6]; /* ETH_ALEN */
+ };
+ };
 };

 struct bpf_redir_neigh {
--
2.30.1 (Apple Git-130)

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH 0/3] Add support for fwmark to bpf_fib_lookup
@ 2021-06-29 18:55 Rumen Telbizov
  2021-06-29 18:55 ` [PATCH 2/3] tools: Update bpf header Rumen Telbizov
  0 siblings, 1 reply; 2+ messages in thread
From: Rumen Telbizov @ 2021-06-29 18:55 UTC (permalink / raw)
  To: bpf; +Cc: dsahern, Rumen Telbizov

Add support for fwmark to bpf_fib_lookup.

Patch 1: adds the support to the uapi and updates the lookup helper.
Patch 2: copies the uapi change to the tools directory.
Patch 3: adds test cases.

Rumen Telbizov (3):
  bpf: Add support for mark with bpf_fib_lookup
  tools: Update bpf header
  selftests: Add selftests for fwmark support in bpf_fib_lookup

 include/uapi/linux/bpf.h                      |  16 +-
 net/core/filter.c                             |   4 +-
 tools/include/uapi/linux/bpf.h                |  16 +-
 tools/testing/selftests/bpf/Makefile          |   1 +
 .../selftests/bpf/progs/test_bpf_fib_lookup.c | 135 ++++++++++++++
 .../selftests/bpf/test_bpf_fib_lookup.sh      | 166 ++++++++++++++++++
 6 files changed, 332 insertions(+), 6 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_bpf_fib_lookup.c
 create mode 100755 tools/testing/selftests/bpf/test_bpf_fib_lookup.sh

-- 
2.30.1 (Apple Git-130)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-29 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 17:37 [PATCH 2/3] tools: Update bpf header Rumen Telbizov
2021-06-29 18:55 [PATCH 0/3] Add support for fwmark to bpf_fib_lookup Rumen Telbizov
2021-06-29 18:55 ` [PATCH 2/3] tools: Update bpf header Rumen Telbizov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).