Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / include / linux / netdevice.h
index 2f03cd9..7c41593 100644 (file)
@@ -47,6 +47,7 @@
 #include <uapi/linux/if_bonding.h>
 #include <uapi/linux/pkt_cls.h>
 #include <linux/hashtable.h>
+#include <linux/rbtree.h>
 
 struct netpoll_info;
 struct device;
@@ -208,6 +209,7 @@ struct sk_buff;
 
 struct netdev_hw_addr {
        struct list_head        list;
+       struct rb_node          node;
        unsigned char           addr[MAX_ADDR_LEN];
        unsigned char           type;
 #define NETDEV_HW_ADDR_T_LAN           1
@@ -224,6 +226,9 @@ struct netdev_hw_addr {
 struct netdev_hw_addr_list {
        struct list_head        list;
        int                     count;
+
+       /* Auxiliary tree for faster lookup on addition and deletion */
+       struct rb_root          tree;
 };
 
 #define netdev_hw_addr_list_count(l) ((l)->count)
@@ -722,13 +727,13 @@ bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
 
 /* This structure contains an instance of an RX queue. */
 struct netdev_rx_queue {
+       struct xdp_rxq_info             xdp_rxq;
 #ifdef CONFIG_RPS
        struct rps_map __rcu            *rps_map;
        struct rps_dev_flow_table __rcu *rps_flow_table;
 #endif
        struct kobject                  kobj;
        struct net_device               *dev;
-       struct xdp_rxq_info             xdp_rxq;
 #ifdef CONFIG_XDP_SOCKETS
        struct xsk_buff_pool            *pool;
 #endif
@@ -4022,6 +4027,10 @@ int netdev_rx_handler_register(struct net_device *dev,
 void netdev_rx_handler_unregister(struct net_device *dev);
 
 bool dev_valid_name(const char *name);
+static inline bool is_socket_ioctl_cmd(unsigned int cmd)
+{
+       return _IOC_TYPE(cmd) == SOCK_IOC_TYPE;
+}
 int get_user_ifreq(struct ifreq *ifr, void __user **ifrdata, void __user *arg);
 int put_user_ifreq(struct ifreq *ifr, void __user *arg);
 int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr,