]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/netdevice.h
mm/hotplug: invalid PFNs from pfn_to_online_page()
[mirror_ubuntu-bionic-kernel.git] / include / linux / netdevice.h
index ef789e1d679efd349ed0b20c315defac1f1fb27c..ff81218d6f66daf42ae1abd1acae877035313f65 100644 (file)
@@ -1380,6 +1380,7 @@ struct net_device_ops {
  * @IFF_PHONY_HEADROOM: the headroom value is controlled by an external
  *     entity (i.e. the master device for bridged veth)
  * @IFF_MACSEC: device is a MACsec device
+ * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device
  */
 enum netdev_priv_flags {
        IFF_802_1Q_VLAN                 = 1<<0,
@@ -1410,6 +1411,7 @@ enum netdev_priv_flags {
        IFF_RXFH_CONFIGURED             = 1<<25,
        IFF_PHONY_HEADROOM              = 1<<26,
        IFF_MACSEC                      = 1<<27,
+       IFF_L3MDEV_RX_HANDLER           = 1<<28,
 };
 
 #define IFF_802_1Q_VLAN                        IFF_802_1Q_VLAN
@@ -1439,6 +1441,7 @@ enum netdev_priv_flags {
 #define IFF_TEAM                       IFF_TEAM
 #define IFF_RXFH_CONFIGURED            IFF_RXFH_CONFIGURED
 #define IFF_MACSEC                     IFF_MACSEC
+#define IFF_L3MDEV_RX_HANDLER          IFF_L3MDEV_RX_HANDLER
 
 /**
  *     struct net_device - The DEVICE structure.
@@ -1669,8 +1672,6 @@ struct net_device {
        unsigned long           base_addr;
        int                     irq;
 
-       atomic_t                carrier_changes;
-
        /*
         *      Some hardware also needs these fields (state,dev_list,
         *      napi_list,unreg_list,close_list) but they are not
@@ -1708,6 +1709,10 @@ struct net_device {
        atomic_long_t           tx_dropped;
        atomic_long_t           rx_nohandler;
 
+       /* Stats to monitor link on/off, flapping */
+       atomic_t                carrier_up_count;
+       atomic_t                carrier_down_count;
+
 #ifdef CONFIG_WIRELESS_EXT
        const struct iw_handler_def *wireless_handlers;
        struct iw_public_data   *wireless_data;
@@ -2335,6 +2340,13 @@ struct netdev_notifier_info {
        struct netlink_ext_ack  *extack;
 };
 
+struct netdev_notifier_info_ext {
+       struct netdev_notifier_info info; /* must be first */
+       union {
+               u32 mtu;
+       } ext;
+};
+
 struct netdev_notifier_change_info {
        struct netdev_notifier_info info; /* must be first */
        unsigned int flags_changed;
@@ -2703,11 +2715,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp,
        if (PTR_ERR(pp) != -EINPROGRESS)
                NAPI_GRO_CB(skb)->flush |= flush;
 }
+static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
+                                              struct sk_buff **pp,
+                                              int flush,
+                                              struct gro_remcsum *grc)
+{
+       if (PTR_ERR(pp) != -EINPROGRESS) {
+               NAPI_GRO_CB(skb)->flush |= flush;
+               skb_gro_remcsum_cleanup(skb, grc);
+               skb->remcsum_offload = 0;
+       }
+}
 #else
 static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush)
 {
        NAPI_GRO_CB(skb)->flush |= flush;
 }
+static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
+                                              struct sk_buff **pp,
+                                              int flush,
+                                              struct gro_remcsum *grc)
+{
+       NAPI_GRO_CB(skb)->flush |= flush;
+       skb_gro_remcsum_cleanup(skb, grc);
+       skb->remcsum_offload = 0;
+}
 #endif
 
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
@@ -3529,7 +3561,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
        if (debug_value == 0)   /* no output */
                return 0;
        /* set low N bits */
-       return (1 << debug_value) - 1;
+       return (1U << debug_value) - 1;
 }
 
 static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
@@ -4218,6 +4250,11 @@ static inline bool netif_supports_nofcs(struct net_device *dev)
        return dev->priv_flags & IFF_SUPP_NOFCS;
 }
 
+static inline bool netif_has_l3_rx_handler(const struct net_device *dev)
+{
+       return dev->priv_flags & IFF_L3MDEV_RX_HANDLER;
+}
+
 static inline bool netif_is_l3_master(const struct net_device *dev)
 {
        return dev->priv_flags & IFF_L3MDEV_MASTER;
@@ -4402,8 +4439,8 @@ do {                                                              \
        WARN(1, "netdevice: %s%s\n" format, netdev_name(dev),   \
             netdev_reg_state(dev), ##args)
 
-#define netdev_WARN_ONCE(dev, condition, format, arg...)               \
-       WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev)       \
+#define netdev_WARN_ONCE(dev, format, args...)                         \
+       WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev),      \
                  netdev_reg_state(dev), ##args)
 
 /* netif printk helpers, similar to netdev_printk */