Skip to content

Commit 8a3b718

Browse files
committed
Merge branch 'bpf-add-offload-as-a-first-class-citizen'
Jakub Kicinski says: ==================== bpf: add offload as a first class citizen This series is my stab at what was discussed at a recent IOvisor bi-weekly call. The idea is to make the device translator run at the program load time. This makes the offload more explicit to the user space. It also makes it easy for the device translator to insert information into the original verifier log. v2: - include linux/bug.h instead of asm/bug.h; - rebased on top of Craig's verifier fix (no changes, the last patch just removes more code now). I checked the set doesn't conflict with Jiri's, Josef's or Roman's patches, but missed Craig's fix :( v1: - rename the ifindex member on load; - improve commit messages; - split nfp patches more. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 28e8c19 + b37a530 commit 8a3b718

File tree

36 files changed

+686
-666
lines changed

36 files changed

+686
-666
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7775,7 +7775,7 @@ static const struct net_device_ops bnxt_netdev_ops = {
77757775
#endif
77767776
.ndo_udp_tunnel_add = bnxt_udp_tunnel_add,
77777777
.ndo_udp_tunnel_del = bnxt_udp_tunnel_del,
7778-
.ndo_xdp = bnxt_xdp,
7778+
.ndo_bpf = bnxt_xdp,
77797779
.ndo_bridge_getlink = bnxt_bridge_getlink,
77807780
.ndo_bridge_setlink = bnxt_bridge_setlink,
77817781
.ndo_get_phys_port_name = bnxt_get_phys_port_name

drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
208208
return 0;
209209
}
210210

211-
int bnxt_xdp(struct net_device *dev, struct netdev_xdp *xdp)
211+
int bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp)
212212
{
213213
struct bnxt *bp = netdev_priv(dev);
214214
int rc;

drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts);
1616
bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
1717
struct page *page, u8 **data_ptr, unsigned int *len,
1818
u8 *event);
19-
int bnxt_xdp(struct net_device *dev, struct netdev_xdp *xdp);
19+
int bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp);
2020

2121
#endif

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ static int nicvf_xdp_setup(struct nicvf *nic, struct bpf_prog *prog)
17411741
return 0;
17421742
}
17431743

1744-
static int nicvf_xdp(struct net_device *netdev, struct netdev_xdp *xdp)
1744+
static int nicvf_xdp(struct net_device *netdev, struct netdev_bpf *xdp)
17451745
{
17461746
struct nicvf *nic = netdev_priv(netdev);
17471747

@@ -1774,7 +1774,7 @@ static const struct net_device_ops nicvf_netdev_ops = {
17741774
.ndo_tx_timeout = nicvf_tx_timeout,
17751775
.ndo_fix_features = nicvf_fix_features,
17761776
.ndo_set_features = nicvf_set_features,
1777-
.ndo_xdp = nicvf_xdp,
1777+
.ndo_bpf = nicvf_xdp,
17781778
};
17791779

17801780
static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11648,12 +11648,12 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi,
1164811648
}
1164911649

1165011650
/**
11651-
* i40e_xdp - implements ndo_xdp for i40e
11651+
* i40e_xdp - implements ndo_bpf for i40e
1165211652
* @dev: netdevice
1165311653
* @xdp: XDP command
1165411654
**/
1165511655
static int i40e_xdp(struct net_device *dev,
11656-
struct netdev_xdp *xdp)
11656+
struct netdev_bpf *xdp)
1165711657
{
1165811658
struct i40e_netdev_priv *np = netdev_priv(dev);
1165911659
struct i40e_vsi *vsi = np->vsi;
@@ -11705,7 +11705,7 @@ static const struct net_device_ops i40e_netdev_ops = {
1170511705
.ndo_features_check = i40e_features_check,
1170611706
.ndo_bridge_getlink = i40e_ndo_bridge_getlink,
1170711707
.ndo_bridge_setlink = i40e_ndo_bridge_setlink,
11708-
.ndo_xdp = i40e_xdp,
11708+
.ndo_bpf = i40e_xdp,
1170911709
};
1171011710

1171111711
/**

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10004,7 +10004,7 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog)
1000410004
return 0;
1000510005
}
1000610006

10007-
static int ixgbe_xdp(struct net_device *dev, struct netdev_xdp *xdp)
10007+
static int ixgbe_xdp(struct net_device *dev, struct netdev_bpf *xdp)
1000810008
{
1000910009
struct ixgbe_adapter *adapter = netdev_priv(dev);
1001010010

@@ -10113,7 +10113,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
1011310113
.ndo_udp_tunnel_add = ixgbe_add_udp_tunnel_port,
1011410114
.ndo_udp_tunnel_del = ixgbe_del_udp_tunnel_port,
1011510115
.ndo_features_check = ixgbe_features_check,
10116-
.ndo_xdp = ixgbe_xdp,
10116+
.ndo_bpf = ixgbe_xdp,
1011710117
.ndo_xdp_xmit = ixgbe_xdp_xmit,
1011810118
.ndo_xdp_flush = ixgbe_xdp_flush,
1011910119
};

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,7 @@ static u32 mlx4_xdp_query(struct net_device *dev)
29162916
return prog_id;
29172917
}
29182918

2919-
static int mlx4_xdp(struct net_device *dev, struct netdev_xdp *xdp)
2919+
static int mlx4_xdp(struct net_device *dev, struct netdev_bpf *xdp)
29202920
{
29212921
switch (xdp->command) {
29222922
case XDP_SETUP_PROG:
@@ -2958,7 +2958,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
29582958
.ndo_udp_tunnel_del = mlx4_en_del_vxlan_port,
29592959
.ndo_features_check = mlx4_en_features_check,
29602960
.ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate,
2961-
.ndo_xdp = mlx4_xdp,
2961+
.ndo_bpf = mlx4_xdp,
29622962
};
29632963

29642964
static const struct net_device_ops mlx4_netdev_ops_master = {
@@ -2995,7 +2995,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
29952995
.ndo_udp_tunnel_del = mlx4_en_del_vxlan_port,
29962996
.ndo_features_check = mlx4_en_features_check,
29972997
.ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate,
2998-
.ndo_xdp = mlx4_xdp,
2998+
.ndo_bpf = mlx4_xdp,
29992999
};
30003000

30013001
struct mlx4_en_bond {

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,7 +3831,7 @@ static u32 mlx5e_xdp_query(struct net_device *dev)
38313831
return prog_id;
38323832
}
38333833

3834-
static int mlx5e_xdp(struct net_device *dev, struct netdev_xdp *xdp)
3834+
static int mlx5e_xdp(struct net_device *dev, struct netdev_bpf *xdp)
38353835
{
38363836
switch (xdp->command) {
38373837
case XDP_SETUP_PROG:
@@ -3883,7 +3883,7 @@ static const struct net_device_ops mlx5e_netdev_ops = {
38833883
.ndo_rx_flow_steer = mlx5e_rx_flow_steer,
38843884
#endif
38853885
.ndo_tx_timeout = mlx5e_tx_timeout,
3886-
.ndo_xdp = mlx5e_xdp,
3886+
.ndo_bpf = mlx5e_xdp,
38873887
#ifdef CONFIG_NET_POLL_CONTROLLER
38883888
.ndo_poll_controller = mlx5e_netpoll,
38893889
#endif

0 commit comments

Comments
 (0)