Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
[linux-2.6-microblaze.git] / include / linux / netdevice.h
index 39e28e1..b0e303f 100644 (file)
@@ -65,6 +65,8 @@ struct wpan_dev;
 struct mpls_dev;
 /* UDP Tunnel offloads */
 struct udp_tunnel_info;
+struct udp_tunnel_nic_info;
+struct udp_tunnel_nic;
 struct bpf_prog;
 struct xdp_buff;
 
@@ -874,8 +876,6 @@ enum bpf_netdev_command {
         */
        XDP_SETUP_PROG,
        XDP_SETUP_PROG_HW,
-       XDP_QUERY_PROG,
-       XDP_QUERY_PROG_HW,
        /* BPF program for offload callbacks, invoked at program load time. */
        BPF_OFFLOAD_MAP_ALLOC,
        BPF_OFFLOAD_MAP_FREE,
@@ -886,6 +886,19 @@ struct bpf_prog_offload_ops;
 struct netlink_ext_ack;
 struct xdp_umem;
 struct xdp_dev_bulk_queue;
+struct bpf_xdp_link;
+
+enum bpf_xdp_mode {
+       XDP_MODE_SKB = 0,
+       XDP_MODE_DRV = 1,
+       XDP_MODE_HW = 2,
+       __MAX_XDP_MODE
+};
+
+struct bpf_xdp_entity {
+       struct bpf_prog *prog;
+       struct bpf_xdp_link *link;
+};
 
 struct netdev_bpf {
        enum bpf_netdev_command command;
@@ -896,12 +909,6 @@ struct netdev_bpf {
                        struct bpf_prog *prog;
                        struct netlink_ext_ack *extack;
                };
-               /* XDP_QUERY_PROG, XDP_QUERY_PROG_HW */
-               struct {
-                       u32 prog_id;
-                       /* flags with which program was installed */
-                       u32 prog_flags;
-               };
                /* BPF_OFFLOAD_MAP_ALLOC, BPF_OFFLOAD_MAP_FREE */
                struct {
                        struct bpf_offloaded_map *offmap;
@@ -1742,6 +1749,8 @@ enum netdev_priv_flags {
  *     @real_num_rx_queues:    Number of RX queues currently active in device
  *     @xdp_prog:              XDP sockets filter program pointer
  *     @gro_flush_timeout:     timeout for GRO layer in NAPI
+ *     @napi_defer_hard_irqs:  If not zero, provides a counter that would
+ *                             allow to avoid NIC hard IRQ, on busy queues.
  *
  *     @rx_handler:            handler for received packets
  *     @rx_handler_data:       XXX: need comments on this one
@@ -1836,6 +1845,10 @@ enum netdev_priv_flags {
  *
  *     @macsec_ops:    MACsec offloading ops
  *
+ *     @udp_tunnel_nic_info:   static structure describing the UDP tunnel
+ *                             offload capabilities of the device
+ *     @udp_tunnel_nic:        UDP tunnel offload state
+ *
  *     FIXME: cleanup struct net_device such that network protocol info
  *     moves out.
  */
@@ -2052,6 +2065,8 @@ struct net_device {
        struct timer_list       watchdog_timer;
        int                     watchdog_timeo;
 
+       u32                     proto_down_reason;
+
        struct list_head        todo_list;
        int __percpu            *pcpu_refcnt;
 
@@ -2134,6 +2149,11 @@ struct net_device {
        /* MACsec management functions */
        const struct macsec_ops *macsec_ops;
 #endif
+       const struct udp_tunnel_nic_info        *udp_tunnel_nic_info;
+       struct udp_tunnel_nic   *udp_tunnel_nic;
+
+       /* protected by rtnl_lock */
+       struct bpf_xdp_entity   xdp_state[__MAX_XDP_MODE];
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
@@ -3802,6 +3822,8 @@ int dev_get_port_parent_id(struct net_device *dev,
 bool netdev_port_same_parent_id(struct net_device *a, struct net_device *b);
 int dev_change_proto_down(struct net_device *dev, bool proto_down);
 int dev_change_proto_down_generic(struct net_device *dev, bool proto_down);
+void dev_change_proto_down_reason(struct net_device *dev, unsigned long mask,
+                                 u32 value);
 struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again);
 struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
                                    struct netdev_queue *txq, int *ret);
@@ -3809,8 +3831,9 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 typedef int (*bpf_op_t)(struct net_device *dev, struct netdev_bpf *bpf);
 int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
                      int fd, int expected_fd, u32 flags);
-u32 __dev_xdp_query(struct net_device *dev, bpf_op_t xdp_op,
-                   enum bpf_netdev_command cmd);
+int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
+u32 dev_xdp_prog_id(struct net_device *dev, enum bpf_xdp_mode mode);
+
 int xdp_umem_query(struct net_device *dev, u16 queue_id);
 
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
@@ -4819,6 +4842,11 @@ static inline bool netif_is_ovs_port(const struct net_device *dev)
        return dev->priv_flags & IFF_OVS_DATAPATH;
 }
 
+static inline bool netif_is_any_bridge_port(const struct net_device *dev)
+{
+       return netif_is_bridge_port(dev) || netif_is_ovs_port(dev);
+}
+
 static inline bool netif_is_team_master(const struct net_device *dev)
 {
        return dev->priv_flags & IFF_TEAM;