diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 59dc05f38247..561c8bc8976d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -338,18 +338,16 @@ struct napi_struct { | |||
338 | 338 | ||
339 | unsigned long state; | 339 | unsigned long state; |
340 | int weight; | 340 | int weight; |
341 | unsigned int gro_count; | ||
341 | int (*poll)(struct napi_struct *, int); | 342 | int (*poll)(struct napi_struct *, int); |
342 | #ifdef CONFIG_NETPOLL | 343 | #ifdef CONFIG_NETPOLL |
343 | spinlock_t poll_lock; | 344 | spinlock_t poll_lock; |
344 | int poll_owner; | 345 | int poll_owner; |
345 | #endif | 346 | #endif |
346 | |||
347 | unsigned int gro_count; | ||
348 | |||
349 | struct net_device *dev; | 347 | struct net_device *dev; |
350 | struct list_head dev_list; | ||
351 | struct sk_buff *gro_list; | 348 | struct sk_buff *gro_list; |
352 | struct sk_buff *skb; | 349 | struct sk_buff *skb; |
350 | struct list_head dev_list; | ||
353 | }; | 351 | }; |
354 | 352 | ||
355 | enum { | 353 | enum { |
@@ -906,11 +904,12 @@ struct netdev_fcoe_hbainfo { | |||
906 | * feature set might be less than what was returned by ndo_fix_features()). | 904 | * feature set might be less than what was returned by ndo_fix_features()). |
907 | * Must return >0 or -errno if it changed dev->features itself. | 905 | * Must return >0 or -errno if it changed dev->features itself. |
908 | * | 906 | * |
909 | * int (*ndo_fdb_add)(struct ndmsg *ndm, struct net_device *dev, | 907 | * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[], |
910 | * unsigned char *addr, u16 flags) | 908 | * struct net_device *dev, |
909 | * const unsigned char *addr, u16 flags) | ||
911 | * Adds an FDB entry to dev for addr. | 910 | * Adds an FDB entry to dev for addr. |
912 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, | 911 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, |
913 | * unsigned char *addr) | 912 | * const unsigned char *addr) |
914 | * Deletes the FDB entry from dev coresponding to addr. | 913 | * Deletes the FDB entry from dev coresponding to addr. |
915 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, | 914 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, |
916 | * struct net_device *dev, int idx) | 915 | * struct net_device *dev, int idx) |
@@ -1016,12 +1015,13 @@ struct net_device_ops { | |||
1016 | void (*ndo_neigh_destroy)(struct neighbour *n); | 1015 | void (*ndo_neigh_destroy)(struct neighbour *n); |
1017 | 1016 | ||
1018 | int (*ndo_fdb_add)(struct ndmsg *ndm, | 1017 | int (*ndo_fdb_add)(struct ndmsg *ndm, |
1018 | struct nlattr *tb[], | ||
1019 | struct net_device *dev, | 1019 | struct net_device *dev, |
1020 | unsigned char *addr, | 1020 | const unsigned char *addr, |
1021 | u16 flags); | 1021 | u16 flags); |
1022 | int (*ndo_fdb_del)(struct ndmsg *ndm, | 1022 | int (*ndo_fdb_del)(struct ndmsg *ndm, |
1023 | struct net_device *dev, | 1023 | struct net_device *dev, |
1024 | unsigned char *addr); | 1024 | const unsigned char *addr); |
1025 | int (*ndo_fdb_dump)(struct sk_buff *skb, | 1025 | int (*ndo_fdb_dump)(struct sk_buff *skb, |
1026 | struct netlink_callback *cb, | 1026 | struct netlink_callback *cb, |
1027 | struct net_device *dev, | 1027 | struct net_device *dev, |
@@ -1322,6 +1322,8 @@ struct net_device { | |||
1322 | /* phy device may attach itself for hardware timestamping */ | 1322 | /* phy device may attach itself for hardware timestamping */ |
1323 | struct phy_device *phydev; | 1323 | struct phy_device *phydev; |
1324 | 1324 | ||
1325 | struct lock_class_key *qdisc_tx_busylock; | ||
1326 | |||
1325 | /* group the device belongs to */ | 1327 | /* group the device belongs to */ |
1326 | int group; | 1328 | int group; |
1327 | 1329 | ||
@@ -1401,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1401 | f(dev, &dev->_tx[i], arg); | 1403 | f(dev, &dev->_tx[i], arg); |
1402 | } | 1404 | } |
1403 | 1405 | ||
1406 | extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, | ||
1407 | struct sk_buff *skb); | ||
1408 | |||
1404 | /* | 1409 | /* |
1405 | * Net namespace inlines | 1410 | * Net namespace inlines |
1406 | */ | 1411 | */ |
@@ -1492,19 +1497,25 @@ struct napi_gro_cb { | |||
1492 | /* This indicates where we are processing relative to skb->data. */ | 1497 | /* This indicates where we are processing relative to skb->data. */ |
1493 | int data_offset; | 1498 | int data_offset; |
1494 | 1499 | ||
1495 | /* This is non-zero if the packet may be of the same flow. */ | ||
1496 | int same_flow; | ||
1497 | |||
1498 | /* This is non-zero if the packet cannot be merged with the new skb. */ | 1500 | /* This is non-zero if the packet cannot be merged with the new skb. */ |
1499 | int flush; | 1501 | int flush; |
1500 | 1502 | ||
1501 | /* Number of segments aggregated. */ | 1503 | /* Number of segments aggregated. */ |
1502 | int count; | 1504 | u16 count; |
1505 | |||
1506 | /* This is non-zero if the packet may be of the same flow. */ | ||
1507 | u8 same_flow; | ||
1503 | 1508 | ||
1504 | /* Free the skb? */ | 1509 | /* Free the skb? */ |
1505 | int free; | 1510 | u8 free; |
1506 | #define NAPI_GRO_FREE 1 | 1511 | #define NAPI_GRO_FREE 1 |
1507 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 | 1512 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 |
1513 | |||
1514 | /* jiffies when first packet was created/queued */ | ||
1515 | unsigned long age; | ||
1516 | |||
1517 | /* Used in ipv6_gro_receive() */ | ||
1518 | int proto; | ||
1508 | }; | 1519 | }; |
1509 | 1520 | ||
1510 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 1521 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
@@ -1553,7 +1564,7 @@ struct packet_type { | |||
1553 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | 1564 | #define NETDEV_PRE_TYPE_CHANGE 0x000E |
1554 | #define NETDEV_POST_TYPE_CHANGE 0x000F | 1565 | #define NETDEV_POST_TYPE_CHANGE 0x000F |
1555 | #define NETDEV_POST_INIT 0x0010 | 1566 | #define NETDEV_POST_INIT 0x0010 |
1556 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 1567 | #define NETDEV_UNREGISTER_FINAL 0x0011 |
1557 | #define NETDEV_RELEASE 0x0012 | 1568 | #define NETDEV_RELEASE 0x0012 |
1558 | #define NETDEV_NOTIFY_PEERS 0x0013 | 1569 | #define NETDEV_NOTIFY_PEERS 0x0013 |
1559 | #define NETDEV_JOIN 0x0014 | 1570 | #define NETDEV_JOIN 0x0014 |
@@ -1658,7 +1669,6 @@ extern int netpoll_trap(void); | |||
1658 | #endif | 1669 | #endif |
1659 | extern int skb_gro_receive(struct sk_buff **head, | 1670 | extern int skb_gro_receive(struct sk_buff **head, |
1660 | struct sk_buff *skb); | 1671 | struct sk_buff *skb); |
1661 | extern void skb_gro_reset_offset(struct sk_buff *skb); | ||
1662 | 1672 | ||
1663 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) | 1673 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) |
1664 | { | 1674 | { |
@@ -2152,7 +2162,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi, | |||
2152 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | 2162 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
2153 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, | 2163 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, |
2154 | struct sk_buff *skb); | 2164 | struct sk_buff *skb); |
2155 | extern void napi_gro_flush(struct napi_struct *napi); | 2165 | extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); |
2156 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); | 2166 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
2157 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, | 2167 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, |
2158 | struct sk_buff *skb, | 2168 | struct sk_buff *skb, |
@@ -2227,6 +2237,7 @@ static inline void dev_hold(struct net_device *dev) | |||
2227 | * kind of lower layer not just hardware media. | 2237 | * kind of lower layer not just hardware media. |
2228 | */ | 2238 | */ |
2229 | 2239 | ||
2240 | extern void linkwatch_init_dev(struct net_device *dev); | ||
2230 | extern void linkwatch_fire_event(struct net_device *dev); | 2241 | extern void linkwatch_fire_event(struct net_device *dev); |
2231 | extern void linkwatch_forget_dev(struct net_device *dev); | 2242 | extern void linkwatch_forget_dev(struct net_device *dev); |
2232 | 2243 | ||
@@ -2249,8 +2260,6 @@ extern void netif_carrier_on(struct net_device *dev); | |||
2249 | 2260 | ||
2250 | extern void netif_carrier_off(struct net_device *dev); | 2261 | extern void netif_carrier_off(struct net_device *dev); |
2251 | 2262 | ||
2252 | extern void netif_notify_peers(struct net_device *dev); | ||
2253 | |||
2254 | /** | 2263 | /** |
2255 | * netif_dormant_on - mark device as dormant. | 2264 | * netif_dormant_on - mark device as dormant. |
2256 | * @dev: network device | 2265 | * @dev: network device |
@@ -2560,9 +2569,9 @@ extern void __hw_addr_flush(struct netdev_hw_addr_list *list); | |||
2560 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); | 2569 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); |
2561 | 2570 | ||
2562 | /* Functions used for device addresses handling */ | 2571 | /* Functions used for device addresses handling */ |
2563 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, | 2572 | extern int dev_addr_add(struct net_device *dev, const unsigned char *addr, |
2564 | unsigned char addr_type); | 2573 | unsigned char addr_type); |
2565 | extern int dev_addr_del(struct net_device *dev, unsigned char *addr, | 2574 | extern int dev_addr_del(struct net_device *dev, const unsigned char *addr, |
2566 | unsigned char addr_type); | 2575 | unsigned char addr_type); |
2567 | extern int dev_addr_add_multiple(struct net_device *to_dev, | 2576 | extern int dev_addr_add_multiple(struct net_device *to_dev, |
2568 | struct net_device *from_dev, | 2577 | struct net_device *from_dev, |
@@ -2574,20 +2583,20 @@ extern void dev_addr_flush(struct net_device *dev); | |||
2574 | extern int dev_addr_init(struct net_device *dev); | 2583 | extern int dev_addr_init(struct net_device *dev); |
2575 | 2584 | ||
2576 | /* Functions used for unicast addresses handling */ | 2585 | /* Functions used for unicast addresses handling */ |
2577 | extern int dev_uc_add(struct net_device *dev, unsigned char *addr); | 2586 | extern int dev_uc_add(struct net_device *dev, const unsigned char *addr); |
2578 | extern int dev_uc_add_excl(struct net_device *dev, unsigned char *addr); | 2587 | extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); |
2579 | extern int dev_uc_del(struct net_device *dev, unsigned char *addr); | 2588 | extern int dev_uc_del(struct net_device *dev, const unsigned char *addr); |
2580 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); | 2589 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); |
2581 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); | 2590 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); |
2582 | extern void dev_uc_flush(struct net_device *dev); | 2591 | extern void dev_uc_flush(struct net_device *dev); |
2583 | extern void dev_uc_init(struct net_device *dev); | 2592 | extern void dev_uc_init(struct net_device *dev); |
2584 | 2593 | ||
2585 | /* Functions used for multicast addresses handling */ | 2594 | /* Functions used for multicast addresses handling */ |
2586 | extern int dev_mc_add(struct net_device *dev, unsigned char *addr); | 2595 | extern int dev_mc_add(struct net_device *dev, const unsigned char *addr); |
2587 | extern int dev_mc_add_global(struct net_device *dev, unsigned char *addr); | 2596 | extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); |
2588 | extern int dev_mc_add_excl(struct net_device *dev, unsigned char *addr); | 2597 | extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); |
2589 | extern int dev_mc_del(struct net_device *dev, unsigned char *addr); | 2598 | extern int dev_mc_del(struct net_device *dev, const unsigned char *addr); |
2590 | extern int dev_mc_del_global(struct net_device *dev, unsigned char *addr); | 2599 | extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); |
2591 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | 2600 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); |
2592 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | 2601 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); |
2593 | extern void dev_mc_flush(struct net_device *dev); | 2602 | extern void dev_mc_flush(struct net_device *dev); |
@@ -2599,8 +2608,7 @@ extern void __dev_set_rx_mode(struct net_device *dev); | |||
2599 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 2608 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
2600 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 2609 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
2601 | extern void netdev_state_change(struct net_device *dev); | 2610 | extern void netdev_state_change(struct net_device *dev); |
2602 | extern int netdev_bonding_change(struct net_device *dev, | 2611 | extern void netdev_notify_peers(struct net_device *dev); |
2603 | unsigned long event); | ||
2604 | extern void netdev_features_change(struct net_device *dev); | 2612 | extern void netdev_features_change(struct net_device *dev); |
2605 | /* Load a device via the kmod */ | 2613 | /* Load a device via the kmod */ |
2606 | extern void dev_load(struct net *net, const char *name); | 2614 | extern void dev_load(struct net *net, const char *name); |
@@ -2720,9 +2728,6 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2720 | return dev->name; | 2728 | return dev->name; |
2721 | } | 2729 | } |
2722 | 2730 | ||
2723 | extern int __netdev_printk(const char *level, const struct net_device *dev, | ||
2724 | struct va_format *vaf); | ||
2725 | |||
2726 | extern __printf(3, 4) | 2731 | extern __printf(3, 4) |
2727 | int netdev_printk(const char *level, const struct net_device *dev, | 2732 | int netdev_printk(const char *level, const struct net_device *dev, |
2728 | const char *format, ...); | 2733 | const char *format, ...); |