Skip to content

Commit

Permalink
Merge branch 'lighten uapi/bpf.h rebuilds'
Browse files Browse the repository at this point in the history
Jakub Kicinski says:

====================

Last change in the bpf headers - disentangling BPF uapi from
netdevice.h. Both linux/bpf.h and uapi/bpf.h changes should
now rebuild ~1k objects down from the original ~18k. There's
probably more that can be done but it's diminishing returns.

Split into two patches for ease of review.
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Alexei Starovoitov committed Dec 30, 2021
2 parents 1705c62 + aebb51e commit 35580f9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/amazon/ena/ena_netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <uapi/linux/bpf.h>

#include "ena_com.h"
#include "ena_eth_com.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/cavium/thunder/nicvf_queues.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/iommu.h>
#include <net/ip.h>
#include <net/tso.h>
#include <uapi/linux/bpf.h>

#include "nic_reg.h"
#include "nic.h"
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/microsoft/mana/mana_en.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Copyright (c) 2021, Microsoft Corporation. */

#include <uapi/linux/bpf.h>

#include <linux/inetdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/net_tstamp.h>
#include <linux/reset.h>
#include <net/page_pool.h>
#include <uapi/linux/bpf.h>

struct stmmac_resources {
void __iomem *addr;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/ti/cpsw_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_
#define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_

#include <uapi/linux/bpf.h>

#include "davinci_cpdma.h"

#define CPSW_DEBUG (NETIF_MSG_HW | NETIF_MSG_WOL | \
Expand Down
8 changes: 1 addition & 7 deletions include/linux/bpf-netns.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
#define _BPF_NETNS_H

#include <linux/mutex.h>
#include <net/netns/bpf.h>
#include <uapi/linux/bpf.h>

enum netns_bpf_attach_type {
NETNS_BPF_INVALID = -1,
NETNS_BPF_FLOW_DISSECTOR = 0,
NETNS_BPF_SK_LOOKUP,
MAX_NETNS_BPF_ATTACH_TYPE
};

static inline enum netns_bpf_attach_type
to_netns_bpf_attach_type(enum bpf_attach_type attach_type)
{
Expand Down
1 change: 1 addition & 0 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <net/inetpeer.h>
#include <net/fib_notifier.h>
#include <linux/indirect_call_wrapper.h>
#include <uapi/linux/bpf.h>

#ifdef CONFIG_IPV6_MULTIPLE_TABLES
#define FIB6_TABLE_HASHSZ 256
Expand Down
9 changes: 8 additions & 1 deletion include/net/netns/bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
#ifndef __NETNS_BPF_H__
#define __NETNS_BPF_H__

#include <linux/bpf-netns.h>
#include <linux/list.h>

struct bpf_prog;
struct bpf_prog_array;

enum netns_bpf_attach_type {
NETNS_BPF_INVALID = -1,
NETNS_BPF_FLOW_DISSECTOR = 0,
NETNS_BPF_SK_LOOKUP,
MAX_NETNS_BPF_ATTACH_TYPE
};

struct netns_bpf {
/* Array of programs to run compiled from progs or links */
struct bpf_prog_array __rcu *run_array[MAX_NETNS_BPF_ATTACH_TYPE];
Expand Down
1 change: 1 addition & 0 deletions kernel/bpf/net_namespace.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0

#include <linux/bpf.h>
#include <linux/bpf-netns.h>
#include <linux/filter.h>
#include <net/net_namespace.h>

Expand Down

0 comments on commit 35580f9

Please sign in to comment.