e1000e: Move pm_qos_req to e1000e adapter
[deliverable/linux.git] / include / linux / netdevice.h
index dcf6ec27739b1d8bfb98c82e8902ca0b697df5f8..733d24f16cf8b5146d6f171ccf8e7143e1843344 100644 (file)
@@ -261,7 +261,6 @@ struct header_ops {
                           unsigned short type, const void *daddr,
                           const void *saddr, unsigned int len);
        int     (*parse)(const struct sk_buff *skb, unsigned char *haddr);
-       int     (*rebuild)(struct sk_buff *skb);
        int     (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
        void    (*cache_update)(struct hh_cache *hh,
                                const struct net_device *dev,
@@ -588,6 +587,7 @@ struct netdev_queue {
 #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)
@@ -795,7 +795,10 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
  * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
  *                               struct net_device *dev);
  *     Called when a packet needs to be transmitted.
- *     Must return NETDEV_TX_OK , NETDEV_TX_BUSY.
+ *     Returns NETDEV_TX_OK.  Can return NETDEV_TX_BUSY, but you should stop
+ *     the queue before that can happen; it's for obsolete devices and weird
+ *     corner cases, but the stack really does a non-trivial amount
+ *     of useless work if you return NETDEV_TX_BUSY.
  *        (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
  *     Required can not be NULL.
  *
@@ -875,6 +878,11 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
  * int (*ndo_set_vf_link_state)(struct net_device *dev, int vf, int link_state);
  * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
  *                       struct nlattr *port[]);
+ *
+ *      Enable or disable the VF ability to query its RSS Redirection Table and
+ *      Hash Key. This is needed since on some devices VF share this information
+ *      with PF and querying it may adduce a theoretical security risk.
+ * int (*ndo_set_vf_rss_query_en)(struct net_device *dev, int vf, bool setting);
  * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
  * int (*ndo_setup_tc)(struct net_device *dev, u8 tc)
  *     Called to setup 'tc' number of traffic classes in the net device. This
@@ -1026,15 +1034,12 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
  *     be otherwise expressed by feature flags. The check is called with
  *     the set of features that the stack has calculated and it returns
  *     those the driver believes to be appropriate.
- *
- * int (*ndo_switch_parent_id_get)(struct net_device *dev,
- *                                struct netdev_phys_item_id *psid);
- *     Called to get an ID of the switch chip this port is part of.
- *     If driver implements this, it indicates that it represents a port
- *     of a switch chip.
- * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
- *     Called to notify switch device port of bridge port STP
- *     state change.
+ * int (*ndo_set_tx_maxrate)(struct net_device *dev,
+ *                          int queue_index, u32 maxrate);
+ *     Called when a user wants to set a max-rate limitation of specific
+ *     TX queue.
+ * int (*ndo_get_iflink)(const struct net_device *dev);
+ *     Called to get the iflink value of this device.
  */
 struct net_device_ops {
        int                     (*ndo_init)(struct net_device *dev);
@@ -1099,6 +1104,9 @@ struct net_device_ops {
                                                   struct nlattr *port[]);
        int                     (*ndo_get_vf_port)(struct net_device *dev,
                                                   int vf, struct sk_buff *skb);
+       int                     (*ndo_set_vf_rss_query_en)(
+                                                  struct net_device *dev,
+                                                  int vf, bool setting);
        int                     (*ndo_setup_tc)(struct net_device *dev, u8 tc);
 #if IS_ENABLED(CONFIG_FCOE)
        int                     (*ndo_fcoe_enable)(struct net_device *dev);
@@ -1172,6 +1180,8 @@ struct net_device_ops {
                                                      bool new_carrier);
        int                     (*ndo_get_phys_port_id)(struct net_device *dev,
                                                        struct netdev_phys_item_id *ppid);
+       int                     (*ndo_get_phys_port_name)(struct net_device *dev,
+                                                         char *name, size_t len);
        void                    (*ndo_add_vxlan_port)(struct  net_device *dev,
                                                      sa_family_t sa_family,
                                                      __be16 port);
@@ -1191,12 +1201,10 @@ struct net_device_ops {
        netdev_features_t       (*ndo_features_check) (struct sk_buff *skb,
                                                       struct net_device *dev,
                                                       netdev_features_t features);
-#ifdef CONFIG_NET_SWITCHDEV
-       int                     (*ndo_switch_parent_id_get)(struct net_device *dev,
-                                                           struct netdev_phys_item_id *psid);
-       int                     (*ndo_switch_port_stp_update)(struct net_device *dev,
-                                                             u8 state);
-#endif
+       int                     (*ndo_set_tx_maxrate)(struct net_device *dev,
+                                                     int queue_index,
+                                                     u32 maxrate);
+       int                     (*ndo_get_iflink)(const struct net_device *dev);
 };
 
 /**
@@ -1328,7 +1336,7 @@ enum netdev_priv_flags {
  *     @mpls_features: Mask of features inheritable by MPLS
  *
  *     @ifindex:       interface index
- *     @iflink:        unique device identifier
+ *     @group:         The group, that the device belongs to
  *
  *     @stats:         Statistics struct, which was left as a legacy, use
  *                     rtnl_link_stats64 instead
@@ -1348,8 +1356,7 @@ enum netdev_priv_flags {
  *     @netdev_ops:    Includes several pointers to callbacks,
  *                     if one wants to override the ndo_*() functions
  *     @ethtool_ops:   Management operations
- *     @fwd_ops:       Management operations
- *     @header_ops:    Includes callbacks for creating,parsing,rebuilding,etc
+ *     @header_ops:    Includes callbacks for creating,parsing,caching,etc
  *                     of Layer 2 headers.
  *
  *     @flags:         Interface flags (a la BSD)
@@ -1489,7 +1496,6 @@ enum netdev_priv_flags {
  *
  *     @qdisc_tx_busylock:     XXX: need comments on this one
  *
- *     @group:         The group, that the device belongs to
  *     @pm_qos_req:    Power Management QoS object
  *
  *     FIXME: cleanup struct net_device such that network protocol info
@@ -1542,7 +1548,7 @@ struct net_device {
        netdev_features_t       mpls_features;
 
        int                     ifindex;
-       int                     iflink;
+       int                     group;
 
        struct net_device_stats stats;
 
@@ -1557,7 +1563,9 @@ struct net_device {
 #endif
        const struct net_device_ops *netdev_ops;
        const struct ethtool_ops *ethtool_ops;
-       const struct forwarding_accel_ops *fwd_ops;
+#ifdef CONFIG_NET_SWITCHDEV
+       const struct swdev_ops *swdev_ops;
+#endif
 
        const struct header_ops *header_ops;
 
@@ -1702,9 +1710,7 @@ struct net_device {
        struct netpoll_info __rcu       *npinfo;
 #endif
 
-#ifdef CONFIG_NET_NS
-       struct net              *nd_net;
-#endif
+       possible_net_t                  nd_net;
 
        /* mid-layer private */
        union {
@@ -1745,8 +1751,6 @@ struct net_device {
 #endif
        struct phy_device *phydev;
        struct lock_class_key *qdisc_tx_busylock;
-       int group;
-       struct pm_qos_request   pm_qos_req;
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
@@ -1844,10 +1848,7 @@ struct net *dev_net(const struct net_device *dev)
 static inline
 void dev_net_set(struct net_device *dev, struct net *net)
 {
-#ifdef CONFIG_NET_NS
-       release_net(dev->nd_net);
-       dev->nd_net = hold_net(net);
-#endif
+       write_pnet(&dev->nd_net, net);
 }
 
 static inline bool netdev_uses_dsa(struct net_device *dev)
@@ -2159,6 +2160,7 @@ void __dev_remove_pack(struct packet_type *pt);
 void dev_add_offload(struct packet_offload *po);
 void dev_remove_offload(struct packet_offload *po);
 
+int dev_get_iflink(const struct net_device *dev);
 struct net_device *__dev_get_by_flags(struct net *net, unsigned short flags,
                                      unsigned short mask);
 struct net_device *dev_get_by_name(struct net *net, const char *name);
@@ -2167,9 +2169,14 @@ struct net_device *__dev_get_by_name(struct net *net, const char *name);
 int dev_alloc_name(struct net_device *dev, const char *name);
 int dev_open(struct net_device *dev);
 int dev_close(struct net_device *dev);
+int dev_close_many(struct list_head *head, bool unlink);
 void dev_disable_lro(struct net_device *dev);
-int dev_loopback_xmit(struct sk_buff *newskb);
-int dev_queue_xmit(struct sk_buff *skb);
+int dev_loopback_xmit(struct sock *sk, struct sk_buff *newskb);
+int dev_queue_xmit_sk(struct sock *sk, struct sk_buff *skb);
+static inline int dev_queue_xmit(struct sk_buff *skb)
+{
+       return dev_queue_xmit_sk(skb->sk, skb);
+}
 int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);
 int register_netdevice(struct net_device *dev);
 void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
@@ -2185,6 +2192,12 @@ void netdev_freemem(struct net_device *dev);
 void synchronize_net(void);
 int init_dummy_netdev(struct net_device *dev);
 
+DECLARE_PER_CPU(int, xmit_recursion);
+static inline int dev_recursion_level(void)
+{
+       return this_cpu_read(xmit_recursion);
+}
+
 struct net_device *dev_get_by_index(struct net *net, int ifindex);
 struct net_device *__dev_get_by_index(struct net *net, int ifindex);
 struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
@@ -2403,15 +2416,6 @@ static inline int dev_parse_header(const struct sk_buff *skb,
        return dev->header_ops->parse(skb, haddr);
 }
 
-static inline int dev_rebuild_header(struct sk_buff *skb)
-{
-       const struct net_device *dev = skb->dev;
-
-       if (!dev->header_ops || !dev->header_ops->rebuild)
-               return 0;
-       return dev->header_ops->rebuild(skb);
-}
-
 typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
 int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
 static inline int unregister_gifconf(unsigned int family)
@@ -2933,7 +2937,11 @@ static inline void dev_consume_skb_any(struct sk_buff *skb)
 
 int netif_rx(struct sk_buff *skb);
 int netif_rx_ni(struct sk_buff *skb);
-int netif_receive_skb(struct sk_buff *skb);
+int netif_receive_skb_sk(struct sock *sk, struct sk_buff *skb);
+static inline int netif_receive_skb(struct sk_buff *skb)
+{
+       return netif_receive_skb_sk(skb->sk, skb);
+}
 gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
 void napi_gro_flush(struct napi_struct *napi, bool flush_old);
 struct sk_buff *napi_get_frags(struct napi_struct *napi);
@@ -2969,6 +2977,8 @@ int dev_set_mac_address(struct net_device *, struct sockaddr *);
 int dev_change_carrier(struct net_device *, bool new_carrier);
 int dev_get_phys_port_id(struct net_device *dev,
                         struct netdev_phys_item_id *ppid);
+int dev_get_phys_port_name(struct net_device *dev,
+                          char *name, size_t len);
 struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev);
 struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
                                    struct netdev_queue *txq, int *ret);
@@ -3673,6 +3683,9 @@ void netdev_change_features(struct net_device *dev);
 void netif_stacked_transfer_operstate(const struct net_device *rootdev,
                                        struct net_device *dev);
 
+netdev_features_t passthru_features_check(struct sk_buff *skb,
+                                         struct net_device *dev,
+                                         netdev_features_t features);
 netdev_features_t netif_skb_features(struct sk_buff *skb);
 
 static inline bool net_gso_ok(netdev_features_t features, int gso_type)
This page took 0.030916 seconds and 5 git commands to generate.