]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/netdevice.h
Merge tag 'powerpc-spectre-rsb' of powerpc-CVE-2019-18660.bundle
[linux.git] / include / linux / netdevice.h
index c20f190b4c189615c4eebaa84da6b89c1077f223..cf0923579af4f50f60b1daa2aece483787e260cd 100644 (file)
@@ -848,6 +848,7 @@ enum tc_setup_type {
        TC_SETUP_ROOT_QDISC,
        TC_SETUP_QDISC_GRED,
        TC_SETUP_QDISC_TAPRIO,
+       TC_SETUP_FT,
 };
 
 /* These structures hold the attributes of bpf state that are being passed
@@ -925,6 +926,15 @@ struct dev_ifalias {
 struct devlink;
 struct tlsdev_ops;
 
+struct netdev_name_node {
+       struct hlist_node hlist;
+       struct list_head list;
+       struct net_device *dev;
+       const char *name;
+};
+
+int netdev_name_node_alt_create(struct net_device *dev, const char *name);
+int netdev_name_node_alt_destroy(struct net_device *dev, const char *name);
 
 /*
  * This structure defines the management hooks for network devices.
@@ -1317,6 +1327,10 @@ struct net_device_ops {
                                                   struct nlattr *port[]);
        int                     (*ndo_get_vf_port)(struct net_device *dev,
                                                   int vf, struct sk_buff *skb);
+       int                     (*ndo_get_vf_guid)(struct net_device *dev,
+                                                  int vf,
+                                                  struct ifla_vf_guid *node_guid,
+                                                  struct ifla_vf_guid *port_guid);
        int                     (*ndo_set_vf_guid)(struct net_device *dev,
                                                   int vf, u64 guid,
                                                   int guid_type);
@@ -1564,7 +1578,7 @@ enum netdev_priv_flags {
  *             (i.e. as seen by users in the "Space.c" file).  It is the name
  *             of the interface.
  *
- *     @name_hlist:    Device name hash chain, please keep it close to name[]
+ *     @name_node:     Name hashlist node
  *     @ifalias:       SNMP alias
  *     @mem_end:       Shared memory end
  *     @mem_start:     Shared memory start
@@ -1780,7 +1794,7 @@ enum netdev_priv_flags {
 
 struct net_device {
        char                    name[IFNAMSIZ];
-       struct hlist_node       name_hlist;
+       struct netdev_name_node *name_node;
        struct dev_ifalias      __rcu *ifalias;
        /*
         *      I/O specific fields
@@ -2387,11 +2401,23 @@ struct pcpu_sw_netstats {
 } __aligned(4 * sizeof(u64));
 
 struct pcpu_lstats {
-       u64 packets;
-       u64 bytes;
+       u64_stats_t packets;
+       u64_stats_t bytes;
        struct u64_stats_sync syncp;
 } __aligned(2 * sizeof(u64));
 
+void dev_lstats_read(struct net_device *dev, u64 *packets, u64 *bytes);
+
+static inline void dev_lstats_add(struct net_device *dev, unsigned int len)
+{
+       struct pcpu_lstats *lstats = this_cpu_ptr(dev->lstats);
+
+       u64_stats_update_begin(&lstats->syncp);
+       u64_stats_add(&lstats->bytes, len);
+       u64_stats_inc(&lstats->packets);
+       u64_stats_update_end(&lstats->syncp);
+}
+
 #define __netdev_alloc_pcpu_stats(type, gfp)                           \
 ({                                                                     \
        typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\
@@ -2487,6 +2513,9 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd);
 
 int register_netdevice_notifier(struct notifier_block *nb);
 int unregister_netdevice_notifier(struct notifier_block *nb);
+int register_netdevice_notifier_net(struct net *net, struct notifier_block *nb);
+int unregister_netdevice_notifier_net(struct net *net,
+                                     struct notifier_block *nb);
 
 struct netdev_notifier_info {
        struct net_device       *dev;
@@ -2557,6 +2586,9 @@ extern rwlock_t                           dev_base_lock;          /* Device list lock */
                list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_continue(net, d)               \
                list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
+#define for_each_netdev_continue_reverse(net, d)               \
+               list_for_each_entry_continue_reverse(d, &(net)->dev_base_head, \
+                                                    dev_list)
 #define for_each_netdev_continue_rcu(net, d)           \
        list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_in_bond_rcu(bond, slave)       \
@@ -4081,9 +4113,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
                                    unsigned char name_assign_type,
                                    void (*setup)(struct net_device *),
                                    unsigned int txqs, unsigned int rxqs);
-int dev_get_valid_name(struct net *net, struct net_device *dev,
-                      const char *name);
-
 #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
        alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)