diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/cavium/thunder/nicvf_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_filter.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_main.c | 4 | ||||
-rw-r--r-- | drivers/net/tun.c | 4 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 4 | ||||
-rw-r--r-- | include/linux/netdevice.h | 23 | ||||
-rw-r--r-- | net/core/dev.c | 34 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 4 |
17 files changed, 56 insertions, 55 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4e3d569bf32e..96416f5d97f3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -7775,7 +7775,7 @@ static const struct net_device_ops bnxt_netdev_ops = { | |||
7775 | #endif | 7775 | #endif |
7776 | .ndo_udp_tunnel_add = bnxt_udp_tunnel_add, | 7776 | .ndo_udp_tunnel_add = bnxt_udp_tunnel_add, |
7777 | .ndo_udp_tunnel_del = bnxt_udp_tunnel_del, | 7777 | .ndo_udp_tunnel_del = bnxt_udp_tunnel_del, |
7778 | .ndo_xdp = bnxt_xdp, | 7778 | .ndo_bpf = bnxt_xdp, |
7779 | .ndo_bridge_getlink = bnxt_bridge_getlink, | 7779 | .ndo_bridge_getlink = bnxt_bridge_getlink, |
7780 | .ndo_bridge_setlink = bnxt_bridge_setlink, | 7780 | .ndo_bridge_setlink = bnxt_bridge_setlink, |
7781 | .ndo_get_phys_port_name = bnxt_get_phys_port_name | 7781 | .ndo_get_phys_port_name = bnxt_get_phys_port_name |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c index 06ce63c00821..261e5847557a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | |||
@@ -208,7 +208,7 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) | |||
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
210 | 210 | ||
211 | int bnxt_xdp(struct net_device *dev, struct netdev_xdp *xdp) | 211 | int bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp) |
212 | { | 212 | { |
213 | struct bnxt *bp = netdev_priv(dev); | 213 | struct bnxt *bp = netdev_priv(dev); |
214 | int rc; | 214 | int rc; |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h index 12a5ad66b564..414b748038ca 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h | |||
@@ -16,6 +16,6 @@ void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts); | |||
16 | bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons, | 16 | bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons, |
17 | struct page *page, u8 **data_ptr, unsigned int *len, | 17 | struct page *page, u8 **data_ptr, unsigned int *len, |
18 | u8 *event); | 18 | 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); |
20 | 20 | ||
21 | #endif | 21 | #endif |
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 71989e180289..a063c36c4c58 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c | |||
@@ -1741,7 +1741,7 @@ static int nicvf_xdp_setup(struct nicvf *nic, struct bpf_prog *prog) | |||
1741 | return 0; | 1741 | return 0; |
1742 | } | 1742 | } |
1743 | 1743 | ||
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) |
1745 | { | 1745 | { |
1746 | struct nicvf *nic = netdev_priv(netdev); | 1746 | struct nicvf *nic = netdev_priv(netdev); |
1747 | 1747 | ||
@@ -1774,7 +1774,7 @@ static const struct net_device_ops nicvf_netdev_ops = { | |||
1774 | .ndo_tx_timeout = nicvf_tx_timeout, | 1774 | .ndo_tx_timeout = nicvf_tx_timeout, |
1775 | .ndo_fix_features = nicvf_fix_features, | 1775 | .ndo_fix_features = nicvf_fix_features, |
1776 | .ndo_set_features = nicvf_set_features, | 1776 | .ndo_set_features = nicvf_set_features, |
1777 | .ndo_xdp = nicvf_xdp, | 1777 | .ndo_bpf = nicvf_xdp, |
1778 | }; | 1778 | }; |
1779 | 1779 | ||
1780 | static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 1780 | static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index dfecaeda0654..05b94d87a6c3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -11648,12 +11648,12 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, | |||
11648 | } | 11648 | } |
11649 | 11649 | ||
11650 | /** | 11650 | /** |
11651 | * i40e_xdp - implements ndo_xdp for i40e | 11651 | * i40e_xdp - implements ndo_bpf for i40e |
11652 | * @dev: netdevice | 11652 | * @dev: netdevice |
11653 | * @xdp: XDP command | 11653 | * @xdp: XDP command |
11654 | **/ | 11654 | **/ |
11655 | static int i40e_xdp(struct net_device *dev, | 11655 | static int i40e_xdp(struct net_device *dev, |
11656 | struct netdev_xdp *xdp) | 11656 | struct netdev_bpf *xdp) |
11657 | { | 11657 | { |
11658 | struct i40e_netdev_priv *np = netdev_priv(dev); | 11658 | struct i40e_netdev_priv *np = netdev_priv(dev); |
11659 | struct i40e_vsi *vsi = np->vsi; | 11659 | struct i40e_vsi *vsi = np->vsi; |
@@ -11705,7 +11705,7 @@ static const struct net_device_ops i40e_netdev_ops = { | |||
11705 | .ndo_features_check = i40e_features_check, | 11705 | .ndo_features_check = i40e_features_check, |
11706 | .ndo_bridge_getlink = i40e_ndo_bridge_getlink, | 11706 | .ndo_bridge_getlink = i40e_ndo_bridge_getlink, |
11707 | .ndo_bridge_setlink = i40e_ndo_bridge_setlink, | 11707 | .ndo_bridge_setlink = i40e_ndo_bridge_setlink, |
11708 | .ndo_xdp = i40e_xdp, | 11708 | .ndo_bpf = i40e_xdp, |
11709 | }; | 11709 | }; |
11710 | 11710 | ||
11711 | /** | 11711 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 507977994a03..e5dcb25be398 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -10004,7 +10004,7 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog) | |||
10004 | return 0; | 10004 | return 0; |
10005 | } | 10005 | } |
10006 | 10006 | ||
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) |
10008 | { | 10008 | { |
10009 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 10009 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
10010 | 10010 | ||
@@ -10113,7 +10113,7 @@ static const struct net_device_ops ixgbe_netdev_ops = { | |||
10113 | .ndo_udp_tunnel_add = ixgbe_add_udp_tunnel_port, | 10113 | .ndo_udp_tunnel_add = ixgbe_add_udp_tunnel_port, |
10114 | .ndo_udp_tunnel_del = ixgbe_del_udp_tunnel_port, | 10114 | .ndo_udp_tunnel_del = ixgbe_del_udp_tunnel_port, |
10115 | .ndo_features_check = ixgbe_features_check, | 10115 | .ndo_features_check = ixgbe_features_check, |
10116 | .ndo_xdp = ixgbe_xdp, | 10116 | .ndo_bpf = ixgbe_xdp, |
10117 | .ndo_xdp_xmit = ixgbe_xdp_xmit, | 10117 | .ndo_xdp_xmit = ixgbe_xdp_xmit, |
10118 | .ndo_xdp_flush = ixgbe_xdp_flush, | 10118 | .ndo_xdp_flush = ixgbe_xdp_flush, |
10119 | }; | 10119 | }; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index d611df2f274d..736a6ccaf05e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -2916,7 +2916,7 @@ static u32 mlx4_xdp_query(struct net_device *dev) | |||
2916 | return prog_id; | 2916 | return prog_id; |
2917 | } | 2917 | } |
2918 | 2918 | ||
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) |
2920 | { | 2920 | { |
2921 | switch (xdp->command) { | 2921 | switch (xdp->command) { |
2922 | case XDP_SETUP_PROG: | 2922 | case XDP_SETUP_PROG: |
@@ -2958,7 +2958,7 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
2958 | .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port, | 2958 | .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port, |
2959 | .ndo_features_check = mlx4_en_features_check, | 2959 | .ndo_features_check = mlx4_en_features_check, |
2960 | .ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate, | 2960 | .ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate, |
2961 | .ndo_xdp = mlx4_xdp, | 2961 | .ndo_bpf = mlx4_xdp, |
2962 | }; | 2962 | }; |
2963 | 2963 | ||
2964 | static const struct net_device_ops mlx4_netdev_ops_master = { | 2964 | static const struct net_device_ops mlx4_netdev_ops_master = { |
@@ -2995,7 +2995,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = { | |||
2995 | .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port, | 2995 | .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port, |
2996 | .ndo_features_check = mlx4_en_features_check, | 2996 | .ndo_features_check = mlx4_en_features_check, |
2997 | .ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate, | 2997 | .ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate, |
2998 | .ndo_xdp = mlx4_xdp, | 2998 | .ndo_bpf = mlx4_xdp, |
2999 | }; | 2999 | }; |
3000 | 3000 | ||
3001 | struct mlx4_en_bond { | 3001 | struct mlx4_en_bond { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 28ae00b3eb88..3b7b7bb84eb0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -3831,7 +3831,7 @@ static u32 mlx5e_xdp_query(struct net_device *dev) | |||
3831 | return prog_id; | 3831 | return prog_id; |
3832 | } | 3832 | } |
3833 | 3833 | ||
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) |
3835 | { | 3835 | { |
3836 | switch (xdp->command) { | 3836 | switch (xdp->command) { |
3837 | case XDP_SETUP_PROG: | 3837 | case XDP_SETUP_PROG: |
@@ -3883,7 +3883,7 @@ static const struct net_device_ops mlx5e_netdev_ops = { | |||
3883 | .ndo_rx_flow_steer = mlx5e_rx_flow_steer, | 3883 | .ndo_rx_flow_steer = mlx5e_rx_flow_steer, |
3884 | #endif | 3884 | #endif |
3885 | .ndo_tx_timeout = mlx5e_tx_timeout, | 3885 | .ndo_tx_timeout = mlx5e_tx_timeout, |
3886 | .ndo_xdp = mlx5e_xdp, | 3886 | .ndo_bpf = mlx5e_xdp, |
3887 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3887 | #ifdef CONFIG_NET_POLL_CONTROLLER |
3888 | .ndo_poll_controller = mlx5e_netpoll, | 3888 | .ndo_poll_controller = mlx5e_netpoll, |
3889 | #endif | 3889 | #endif |
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 185a3dd35a3f..f6c6ad4e8a59 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c | |||
@@ -3378,7 +3378,7 @@ nfp_net_xdp_setup(struct nfp_net *nn, struct bpf_prog *prog, u32 flags, | |||
3378 | return 0; | 3378 | return 0; |
3379 | } | 3379 | } |
3380 | 3380 | ||
3381 | static int nfp_net_xdp(struct net_device *netdev, struct netdev_xdp *xdp) | 3381 | static int nfp_net_xdp(struct net_device *netdev, struct netdev_bpf *xdp) |
3382 | { | 3382 | { |
3383 | struct nfp_net *nn = netdev_priv(netdev); | 3383 | struct nfp_net *nn = netdev_priv(netdev); |
3384 | 3384 | ||
@@ -3441,7 +3441,7 @@ const struct net_device_ops nfp_net_netdev_ops = { | |||
3441 | .ndo_get_phys_port_name = nfp_port_get_phys_port_name, | 3441 | .ndo_get_phys_port_name = nfp_port_get_phys_port_name, |
3442 | .ndo_udp_tunnel_add = nfp_net_add_vxlan_port, | 3442 | .ndo_udp_tunnel_add = nfp_net_add_vxlan_port, |
3443 | .ndo_udp_tunnel_del = nfp_net_del_vxlan_port, | 3443 | .ndo_udp_tunnel_del = nfp_net_del_vxlan_port, |
3444 | .ndo_xdp = nfp_net_xdp, | 3444 | .ndo_bpf = nfp_net_xdp, |
3445 | }; | 3445 | }; |
3446 | 3446 | ||
3447 | /** | 3447 | /** |
diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h index adb700512baa..a3a70ade411f 100644 --- a/drivers/net/ethernet/qlogic/qede/qede.h +++ b/drivers/net/ethernet/qlogic/qede/qede.h | |||
@@ -503,7 +503,7 @@ void qede_fill_rss_params(struct qede_dev *edev, | |||
503 | void qede_udp_tunnel_add(struct net_device *dev, struct udp_tunnel_info *ti); | 503 | void qede_udp_tunnel_add(struct net_device *dev, struct udp_tunnel_info *ti); |
504 | void qede_udp_tunnel_del(struct net_device *dev, struct udp_tunnel_info *ti); | 504 | void qede_udp_tunnel_del(struct net_device *dev, struct udp_tunnel_info *ti); |
505 | 505 | ||
506 | int qede_xdp(struct net_device *dev, struct netdev_xdp *xdp); | 506 | int qede_xdp(struct net_device *dev, struct netdev_bpf *xdp); |
507 | 507 | ||
508 | #ifdef CONFIG_DCB | 508 | #ifdef CONFIG_DCB |
509 | void qede_set_dcbnl_ops(struct net_device *ndev); | 509 | void qede_set_dcbnl_ops(struct net_device *ndev); |
diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index f79e36e4060a..c1a0708a7d7c 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c | |||
@@ -1065,7 +1065,7 @@ static int qede_xdp_set(struct qede_dev *edev, struct bpf_prog *prog) | |||
1065 | return 0; | 1065 | return 0; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | int qede_xdp(struct net_device *dev, struct netdev_xdp *xdp) | 1068 | int qede_xdp(struct net_device *dev, struct netdev_bpf *xdp) |
1069 | { | 1069 | { |
1070 | struct qede_dev *edev = netdev_priv(dev); | 1070 | struct qede_dev *edev = netdev_priv(dev); |
1071 | 1071 | ||
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index e5ee9f274a71..8f9b3eb82137 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c | |||
@@ -556,7 +556,7 @@ static const struct net_device_ops qede_netdev_ops = { | |||
556 | .ndo_udp_tunnel_add = qede_udp_tunnel_add, | 556 | .ndo_udp_tunnel_add = qede_udp_tunnel_add, |
557 | .ndo_udp_tunnel_del = qede_udp_tunnel_del, | 557 | .ndo_udp_tunnel_del = qede_udp_tunnel_del, |
558 | .ndo_features_check = qede_features_check, | 558 | .ndo_features_check = qede_features_check, |
559 | .ndo_xdp = qede_xdp, | 559 | .ndo_bpf = qede_xdp, |
560 | #ifdef CONFIG_RFS_ACCEL | 560 | #ifdef CONFIG_RFS_ACCEL |
561 | .ndo_rx_flow_steer = qede_rx_flow_steer, | 561 | .ndo_rx_flow_steer = qede_rx_flow_steer, |
562 | #endif | 562 | #endif |
@@ -594,7 +594,7 @@ static const struct net_device_ops qede_netdev_vf_xdp_ops = { | |||
594 | .ndo_udp_tunnel_add = qede_udp_tunnel_add, | 594 | .ndo_udp_tunnel_add = qede_udp_tunnel_add, |
595 | .ndo_udp_tunnel_del = qede_udp_tunnel_del, | 595 | .ndo_udp_tunnel_del = qede_udp_tunnel_del, |
596 | .ndo_features_check = qede_features_check, | 596 | .ndo_features_check = qede_features_check, |
597 | .ndo_xdp = qede_xdp, | 597 | .ndo_bpf = qede_xdp, |
598 | }; | 598 | }; |
599 | 599 | ||
600 | /* ------------------------------------------------------------------------- | 600 | /* ------------------------------------------------------------------------- |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 8125956f62a1..1a326b697221 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1141,7 +1141,7 @@ static u32 tun_xdp_query(struct net_device *dev) | |||
1141 | return 0; | 1141 | return 0; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | static int tun_xdp(struct net_device *dev, struct netdev_xdp *xdp) | 1144 | static int tun_xdp(struct net_device *dev, struct netdev_bpf *xdp) |
1145 | { | 1145 | { |
1146 | switch (xdp->command) { | 1146 | switch (xdp->command) { |
1147 | case XDP_SETUP_PROG: | 1147 | case XDP_SETUP_PROG: |
@@ -1185,7 +1185,7 @@ static const struct net_device_ops tap_netdev_ops = { | |||
1185 | .ndo_features_check = passthru_features_check, | 1185 | .ndo_features_check = passthru_features_check, |
1186 | .ndo_set_rx_headroom = tun_set_headroom, | 1186 | .ndo_set_rx_headroom = tun_set_headroom, |
1187 | .ndo_get_stats64 = tun_net_get_stats64, | 1187 | .ndo_get_stats64 = tun_net_get_stats64, |
1188 | .ndo_xdp = tun_xdp, | 1188 | .ndo_bpf = tun_xdp, |
1189 | }; | 1189 | }; |
1190 | 1190 | ||
1191 | static void tun_flow_init(struct tun_struct *tun) | 1191 | static void tun_flow_init(struct tun_struct *tun) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index fc059f193e7d..edf984406ba0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -2088,7 +2088,7 @@ static u32 virtnet_xdp_query(struct net_device *dev) | |||
2088 | return 0; | 2088 | return 0; |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | static int virtnet_xdp(struct net_device *dev, struct netdev_xdp *xdp) | 2091 | static int virtnet_xdp(struct net_device *dev, struct netdev_bpf *xdp) |
2092 | { | 2092 | { |
2093 | switch (xdp->command) { | 2093 | switch (xdp->command) { |
2094 | case XDP_SETUP_PROG: | 2094 | case XDP_SETUP_PROG: |
@@ -2115,7 +2115,7 @@ static const struct net_device_ops virtnet_netdev = { | |||
2115 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2115 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2116 | .ndo_poll_controller = virtnet_netpoll, | 2116 | .ndo_poll_controller = virtnet_netpoll, |
2117 | #endif | 2117 | #endif |
2118 | .ndo_xdp = virtnet_xdp, | 2118 | .ndo_bpf = virtnet_xdp, |
2119 | .ndo_xdp_xmit = virtnet_xdp_xmit, | 2119 | .ndo_xdp_xmit = virtnet_xdp_xmit, |
2120 | .ndo_xdp_flush = virtnet_xdp_flush, | 2120 | .ndo_xdp_flush = virtnet_xdp_flush, |
2121 | .ndo_features_check = passthru_features_check, | 2121 | .ndo_features_check = passthru_features_check, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7de7656550c2..9af9feaaeb64 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -779,10 +779,10 @@ enum tc_setup_type { | |||
779 | TC_SETUP_CBS, | 779 | TC_SETUP_CBS, |
780 | }; | 780 | }; |
781 | 781 | ||
782 | /* These structures hold the attributes of xdp state that are being passed | 782 | /* These structures hold the attributes of bpf state that are being passed |
783 | * to the netdevice through the xdp op. | 783 | * to the netdevice through the bpf op. |
784 | */ | 784 | */ |
785 | enum xdp_netdev_command { | 785 | enum bpf_netdev_command { |
786 | /* Set or clear a bpf program used in the earliest stages of packet | 786 | /* Set or clear a bpf program used in the earliest stages of packet |
787 | * rx. The prog will have been loaded as BPF_PROG_TYPE_XDP. The callee | 787 | * rx. The prog will have been loaded as BPF_PROG_TYPE_XDP. The callee |
788 | * is responsible for calling bpf_prog_put on any old progs that are | 788 | * is responsible for calling bpf_prog_put on any old progs that are |
@@ -801,8 +801,8 @@ enum xdp_netdev_command { | |||
801 | 801 | ||
802 | struct netlink_ext_ack; | 802 | struct netlink_ext_ack; |
803 | 803 | ||
804 | struct netdev_xdp { | 804 | struct netdev_bpf { |
805 | enum xdp_netdev_command command; | 805 | enum bpf_netdev_command command; |
806 | union { | 806 | union { |
807 | /* XDP_SETUP_PROG */ | 807 | /* XDP_SETUP_PROG */ |
808 | struct { | 808 | struct { |
@@ -1124,9 +1124,10 @@ struct dev_ifalias { | |||
1124 | * appropriate rx headroom value allows avoiding skb head copy on | 1124 | * appropriate rx headroom value allows avoiding skb head copy on |
1125 | * forward. Setting a negative value resets the rx headroom to the | 1125 | * forward. Setting a negative value resets the rx headroom to the |
1126 | * default value. | 1126 | * default value. |
1127 | * int (*ndo_xdp)(struct net_device *dev, struct netdev_xdp *xdp); | 1127 | * int (*ndo_bpf)(struct net_device *dev, struct netdev_bpf *bpf); |
1128 | * This function is used to set or query state related to XDP on the | 1128 | * This function is used to set or query state related to XDP on the |
1129 | * netdevice. See definition of enum xdp_netdev_command for details. | 1129 | * netdevice and manage BPF offload. See definition of |
1130 | * enum bpf_netdev_command for details. | ||
1130 | * int (*ndo_xdp_xmit)(struct net_device *dev, struct xdp_buff *xdp); | 1131 | * int (*ndo_xdp_xmit)(struct net_device *dev, struct xdp_buff *xdp); |
1131 | * This function is used to submit a XDP packet for transmit on a | 1132 | * This function is used to submit a XDP packet for transmit on a |
1132 | * netdevice. | 1133 | * netdevice. |
@@ -1315,8 +1316,8 @@ struct net_device_ops { | |||
1315 | struct sk_buff *skb); | 1316 | struct sk_buff *skb); |
1316 | void (*ndo_set_rx_headroom)(struct net_device *dev, | 1317 | void (*ndo_set_rx_headroom)(struct net_device *dev, |
1317 | int needed_headroom); | 1318 | int needed_headroom); |
1318 | int (*ndo_xdp)(struct net_device *dev, | 1319 | int (*ndo_bpf)(struct net_device *dev, |
1319 | struct netdev_xdp *xdp); | 1320 | struct netdev_bpf *bpf); |
1320 | int (*ndo_xdp_xmit)(struct net_device *dev, | 1321 | int (*ndo_xdp_xmit)(struct net_device *dev, |
1321 | struct xdp_buff *xdp); | 1322 | struct xdp_buff *xdp); |
1322 | void (*ndo_xdp_flush)(struct net_device *dev); | 1323 | void (*ndo_xdp_flush)(struct net_device *dev); |
@@ -3311,10 +3312,10 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d | |||
3311 | struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 3312 | struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
3312 | struct netdev_queue *txq, int *ret); | 3313 | struct netdev_queue *txq, int *ret); |
3313 | 3314 | ||
3314 | typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp); | 3315 | typedef int (*bpf_op_t)(struct net_device *dev, struct netdev_bpf *bpf); |
3315 | int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, | 3316 | int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, |
3316 | int fd, u32 flags); | 3317 | int fd, u32 flags); |
3317 | u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, u32 *prog_id); | 3318 | u8 __dev_xdp_attached(struct net_device *dev, bpf_op_t xdp_op, u32 *prog_id); |
3318 | 3319 | ||
3319 | int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 3320 | int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
3320 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 3321 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
diff --git a/net/core/dev.c b/net/core/dev.c index 1423cf4d695c..10cde58d3275 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4545,7 +4545,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
4545 | return ret; | 4545 | return ret; |
4546 | } | 4546 | } |
4547 | 4547 | ||
4548 | static int generic_xdp_install(struct net_device *dev, struct netdev_xdp *xdp) | 4548 | static int generic_xdp_install(struct net_device *dev, struct netdev_bpf *xdp) |
4549 | { | 4549 | { |
4550 | struct bpf_prog *old = rtnl_dereference(dev->xdp_prog); | 4550 | struct bpf_prog *old = rtnl_dereference(dev->xdp_prog); |
4551 | struct bpf_prog *new = xdp->prog; | 4551 | struct bpf_prog *new = xdp->prog; |
@@ -7090,26 +7090,26 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down) | |||
7090 | } | 7090 | } |
7091 | EXPORT_SYMBOL(dev_change_proto_down); | 7091 | EXPORT_SYMBOL(dev_change_proto_down); |
7092 | 7092 | ||
7093 | u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, u32 *prog_id) | 7093 | u8 __dev_xdp_attached(struct net_device *dev, bpf_op_t bpf_op, u32 *prog_id) |
7094 | { | 7094 | { |
7095 | struct netdev_xdp xdp; | 7095 | struct netdev_bpf xdp; |
7096 | 7096 | ||
7097 | memset(&xdp, 0, sizeof(xdp)); | 7097 | memset(&xdp, 0, sizeof(xdp)); |
7098 | xdp.command = XDP_QUERY_PROG; | 7098 | xdp.command = XDP_QUERY_PROG; |
7099 | 7099 | ||
7100 | /* Query must always succeed. */ | 7100 | /* Query must always succeed. */ |
7101 | WARN_ON(xdp_op(dev, &xdp) < 0); | 7101 | WARN_ON(bpf_op(dev, &xdp) < 0); |
7102 | if (prog_id) | 7102 | if (prog_id) |
7103 | *prog_id = xdp.prog_id; | 7103 | *prog_id = xdp.prog_id; |
7104 | 7104 | ||
7105 | return xdp.prog_attached; | 7105 | return xdp.prog_attached; |
7106 | } | 7106 | } |
7107 | 7107 | ||
7108 | static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op, | 7108 | static int dev_xdp_install(struct net_device *dev, bpf_op_t bpf_op, |
7109 | struct netlink_ext_ack *extack, u32 flags, | 7109 | struct netlink_ext_ack *extack, u32 flags, |
7110 | struct bpf_prog *prog) | 7110 | struct bpf_prog *prog) |
7111 | { | 7111 | { |
7112 | struct netdev_xdp xdp; | 7112 | struct netdev_bpf xdp; |
7113 | 7113 | ||
7114 | memset(&xdp, 0, sizeof(xdp)); | 7114 | memset(&xdp, 0, sizeof(xdp)); |
7115 | if (flags & XDP_FLAGS_HW_MODE) | 7115 | if (flags & XDP_FLAGS_HW_MODE) |
@@ -7120,7 +7120,7 @@ static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op, | |||
7120 | xdp.flags = flags; | 7120 | xdp.flags = flags; |
7121 | xdp.prog = prog; | 7121 | xdp.prog = prog; |
7122 | 7122 | ||
7123 | return xdp_op(dev, &xdp); | 7123 | return bpf_op(dev, &xdp); |
7124 | } | 7124 | } |
7125 | 7125 | ||
7126 | /** | 7126 | /** |
@@ -7137,24 +7137,24 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, | |||
7137 | { | 7137 | { |
7138 | const struct net_device_ops *ops = dev->netdev_ops; | 7138 | const struct net_device_ops *ops = dev->netdev_ops; |
7139 | struct bpf_prog *prog = NULL; | 7139 | struct bpf_prog *prog = NULL; |
7140 | xdp_op_t xdp_op, xdp_chk; | 7140 | bpf_op_t bpf_op, bpf_chk; |
7141 | int err; | 7141 | int err; |
7142 | 7142 | ||
7143 | ASSERT_RTNL(); | 7143 | ASSERT_RTNL(); |
7144 | 7144 | ||
7145 | xdp_op = xdp_chk = ops->ndo_xdp; | 7145 | bpf_op = bpf_chk = ops->ndo_bpf; |
7146 | if (!xdp_op && (flags & (XDP_FLAGS_DRV_MODE | XDP_FLAGS_HW_MODE))) | 7146 | if (!bpf_op && (flags & (XDP_FLAGS_DRV_MODE | XDP_FLAGS_HW_MODE))) |
7147 | return -EOPNOTSUPP; | 7147 | return -EOPNOTSUPP; |
7148 | if (!xdp_op || (flags & XDP_FLAGS_SKB_MODE)) | 7148 | if (!bpf_op || (flags & XDP_FLAGS_SKB_MODE)) |
7149 | xdp_op = generic_xdp_install; | 7149 | bpf_op = generic_xdp_install; |
7150 | if (xdp_op == xdp_chk) | 7150 | if (bpf_op == bpf_chk) |
7151 | xdp_chk = generic_xdp_install; | 7151 | bpf_chk = generic_xdp_install; |
7152 | 7152 | ||
7153 | if (fd >= 0) { | 7153 | if (fd >= 0) { |
7154 | if (xdp_chk && __dev_xdp_attached(dev, xdp_chk, NULL)) | 7154 | if (bpf_chk && __dev_xdp_attached(dev, bpf_chk, NULL)) |
7155 | return -EEXIST; | 7155 | return -EEXIST; |
7156 | if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) && | 7156 | if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) && |
7157 | __dev_xdp_attached(dev, xdp_op, NULL)) | 7157 | __dev_xdp_attached(dev, bpf_op, NULL)) |
7158 | return -EBUSY; | 7158 | return -EBUSY; |
7159 | 7159 | ||
7160 | prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP); | 7160 | prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP); |
@@ -7162,7 +7162,7 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, | |||
7162 | return PTR_ERR(prog); | 7162 | return PTR_ERR(prog); |
7163 | } | 7163 | } |
7164 | 7164 | ||
7165 | err = dev_xdp_install(dev, xdp_op, extack, flags, prog); | 7165 | err = dev_xdp_install(dev, bpf_op, extack, flags, prog); |
7166 | if (err < 0 && prog) | 7166 | if (err < 0 && prog) |
7167 | bpf_prog_put(prog); | 7167 | bpf_prog_put(prog); |
7168 | 7168 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8a8c51937edf..dc5ad84ac096 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1270,10 +1270,10 @@ static u8 rtnl_xdp_attached_mode(struct net_device *dev, u32 *prog_id) | |||
1270 | *prog_id = generic_xdp_prog->aux->id; | 1270 | *prog_id = generic_xdp_prog->aux->id; |
1271 | return XDP_ATTACHED_SKB; | 1271 | return XDP_ATTACHED_SKB; |
1272 | } | 1272 | } |
1273 | if (!ops->ndo_xdp) | 1273 | if (!ops->ndo_bpf) |
1274 | return XDP_ATTACHED_NONE; | 1274 | return XDP_ATTACHED_NONE; |
1275 | 1275 | ||
1276 | return __dev_xdp_attached(dev, ops->ndo_xdp, prog_id); | 1276 | return __dev_xdp_attached(dev, ops->ndo_bpf, prog_id); |
1277 | } | 1277 | } |
1278 | 1278 | ||
1279 | static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev) | 1279 | static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev) |