net: l3mdev: Add hook in ip and ipv6
[cascardo/linux.git] / include / linux / netdevice.h
index 934ca86..c2f5112 100644 (file)
@@ -569,28 +569,27 @@ struct netdev_queue {
 #if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
        int                     numa_node;
 #endif
+       unsigned long           tx_maxrate;
+       /*
+        * Number of TX timeouts for this queue
+        * (/sys/class/net/DEV/Q/trans_timeout)
+        */
+       unsigned long           trans_timeout;
 /*
  * write-mostly part
  */
        spinlock_t              _xmit_lock ____cacheline_aligned_in_smp;
        int                     xmit_lock_owner;
        /*
-        * please use this field instead of dev->trans_start
+        * Time (in jiffies) of last Tx
         */
        unsigned long           trans_start;
 
-       /*
-        * Number of TX timeouts for this queue
-        * (/sys/class/net/DEV/Q/trans_timeout)
-        */
-       unsigned long           trans_timeout;
-
        unsigned long           state;
 
 #ifdef CONFIG_BQL
        struct dql              dql;
 #endif
-       unsigned long           tx_maxrate;
 } ____cacheline_aligned_in_smp;
 
 static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
@@ -1546,7 +1545,6 @@ enum netdev_priv_flags {
  *
  *     @offload_fwd_mark:      Offload device fwding mark
  *
- *     @trans_start:           Time (in jiffies) of last Tx
  *     @watchdog_timeo:        Represents the timeout that is used by
  *                             the watchdog (see dev_watchdog())
  *     @watchdog_timer:        List of timers
@@ -1795,13 +1793,6 @@ struct net_device {
 #endif
 
        /* These may be needed for future network-power-down code. */
-
-       /*
-        * trans_start here is expensive for high speed devices on SMP,
-        * please use netdev_queue->trans_start instead.
-        */
-       unsigned long           trans_start;
-
        struct timer_list       watchdog_timer;
 
        int __percpu            *pcpu_refcnt;
@@ -3264,7 +3255,10 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
                                    struct netdev_queue *txq, int *ret);
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
-bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
+bool is_skb_forwardable(const struct net_device *dev,
+                       const struct sk_buff *skb);
+
+void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
 
 extern int             netdev_budget;
 
@@ -3481,6 +3475,15 @@ static inline void txq_trans_update(struct netdev_queue *txq)
                txq->trans_start = jiffies;
 }
 
+/* legacy drivers only, netdev_start_xmit() sets txq->trans_start */
+static inline void netif_trans_update(struct net_device *dev)
+{
+       struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
+
+       if (txq->trans_start != jiffies)
+               txq->trans_start = jiffies;
+}
+
 /**
  *     netif_tx_lock - grab network device transmit lock
  *     @dev: network device
@@ -3992,7 +3995,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb);
 
 static inline bool net_gso_ok(netdev_features_t features, int gso_type)
 {
-       netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT;
+       netdev_features_t feature = (netdev_features_t)gso_type << NETIF_F_GSO_SHIFT;
 
        /* check flags correspondence */
        BUILD_BUG_ON(SKB_GSO_TCPV4   != (NETIF_F_TSO >> NETIF_F_GSO_SHIFT));