diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
commit | f8965467f366fd18f01feafb5db10512d7b4422c (patch) | |
tree | 3706a9cd779859271ca61b85c63a1bc3f82d626e /include/linux/netdevice.h | |
parent | a26272e5200765691e67d6780e52b32498fdb659 (diff) | |
parent | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
qlcnic: adding co maintainer
ixgbe: add support for active DA cables
ixgbe: dcb, do not tag tc_prio_control frames
ixgbe: fix ixgbe_tx_is_paused logic
ixgbe: always enable vlan strip/insert when DCB is enabled
ixgbe: remove some redundant code in setting FCoE FIP filter
ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
ixgbe: fix header len when unsplit packet overflows to data buffer
ipv6: Never schedule DAD timer on dead address
ipv6: Use POSTDAD state
ipv6: Use state_lock to protect ifa state
ipv6: Replace inet6_ifaddr->dead with state
cxgb4: notify upper drivers if the device is already up when they load
cxgb4: keep interrupts available when the ports are brought down
cxgb4: fix initial addition of MAC address
cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
cnic: Convert cnic_local_flags to atomic ops.
can: Fix SJA1000 command register writes on SMP systems
bridge: fix build for CONFIG_SYSFS disabled
ARCNET: Limit com20020 PCI ID matches for SOHARD cards
...
Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).
Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 292 |
1 files changed, 188 insertions, 104 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3857517f1ca5..a1bff6518166 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -219,34 +219,6 @@ struct neighbour; | |||
219 | struct neigh_parms; | 219 | struct neigh_parms; |
220 | struct sk_buff; | 220 | struct sk_buff; |
221 | 221 | ||
222 | struct netif_rx_stats { | ||
223 | unsigned total; | ||
224 | unsigned dropped; | ||
225 | unsigned time_squeeze; | ||
226 | unsigned cpu_collision; | ||
227 | }; | ||
228 | |||
229 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); | ||
230 | |||
231 | struct dev_addr_list { | ||
232 | struct dev_addr_list *next; | ||
233 | u8 da_addr[MAX_ADDR_LEN]; | ||
234 | u8 da_addrlen; | ||
235 | u8 da_synced; | ||
236 | int da_users; | ||
237 | int da_gusers; | ||
238 | }; | ||
239 | |||
240 | /* | ||
241 | * We tag multicasts with these structures. | ||
242 | */ | ||
243 | |||
244 | #define dev_mc_list dev_addr_list | ||
245 | #define dmi_addr da_addr | ||
246 | #define dmi_addrlen da_addrlen | ||
247 | #define dmi_users da_users | ||
248 | #define dmi_gusers da_gusers | ||
249 | |||
250 | struct netdev_hw_addr { | 222 | struct netdev_hw_addr { |
251 | struct list_head list; | 223 | struct list_head list; |
252 | unsigned char addr[MAX_ADDR_LEN]; | 224 | unsigned char addr[MAX_ADDR_LEN]; |
@@ -255,8 +227,10 @@ struct netdev_hw_addr { | |||
255 | #define NETDEV_HW_ADDR_T_SAN 2 | 227 | #define NETDEV_HW_ADDR_T_SAN 2 |
256 | #define NETDEV_HW_ADDR_T_SLAVE 3 | 228 | #define NETDEV_HW_ADDR_T_SLAVE 3 |
257 | #define NETDEV_HW_ADDR_T_UNICAST 4 | 229 | #define NETDEV_HW_ADDR_T_UNICAST 4 |
230 | #define NETDEV_HW_ADDR_T_MULTICAST 5 | ||
258 | int refcount; | 231 | int refcount; |
259 | bool synced; | 232 | bool synced; |
233 | bool global_use; | ||
260 | struct rcu_head rcu_head; | 234 | struct rcu_head rcu_head; |
261 | }; | 235 | }; |
262 | 236 | ||
@@ -265,16 +239,20 @@ struct netdev_hw_addr_list { | |||
265 | int count; | 239 | int count; |
266 | }; | 240 | }; |
267 | 241 | ||
268 | #define netdev_uc_count(dev) ((dev)->uc.count) | 242 | #define netdev_hw_addr_list_count(l) ((l)->count) |
269 | #define netdev_uc_empty(dev) ((dev)->uc.count == 0) | 243 | #define netdev_hw_addr_list_empty(l) (netdev_hw_addr_list_count(l) == 0) |
270 | #define netdev_for_each_uc_addr(ha, dev) \ | 244 | #define netdev_hw_addr_list_for_each(ha, l) \ |
271 | list_for_each_entry(ha, &dev->uc.list, list) | 245 | list_for_each_entry(ha, &(l)->list, list) |
272 | 246 | ||
273 | #define netdev_mc_count(dev) ((dev)->mc_count) | 247 | #define netdev_uc_count(dev) netdev_hw_addr_list_count(&(dev)->uc) |
274 | #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) | 248 | #define netdev_uc_empty(dev) netdev_hw_addr_list_empty(&(dev)->uc) |
249 | #define netdev_for_each_uc_addr(ha, dev) \ | ||
250 | netdev_hw_addr_list_for_each(ha, &(dev)->uc) | ||
275 | 251 | ||
276 | #define netdev_for_each_mc_addr(mclist, dev) \ | 252 | #define netdev_mc_count(dev) netdev_hw_addr_list_count(&(dev)->mc) |
277 | for (mclist = dev->mc_list; mclist; mclist = mclist->next) | 253 | #define netdev_mc_empty(dev) netdev_hw_addr_list_empty(&(dev)->mc) |
254 | #define netdev_for_each_mc_addr(ha, dev) \ | ||
255 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) | ||
278 | 256 | ||
279 | struct hh_cache { | 257 | struct hh_cache { |
280 | struct hh_cache *hh_next; /* Next entry */ | 258 | struct hh_cache *hh_next; /* Next entry */ |
@@ -531,6 +509,85 @@ struct netdev_queue { | |||
531 | unsigned long tx_dropped; | 509 | unsigned long tx_dropped; |
532 | } ____cacheline_aligned_in_smp; | 510 | } ____cacheline_aligned_in_smp; |
533 | 511 | ||
512 | #ifdef CONFIG_RPS | ||
513 | /* | ||
514 | * This structure holds an RPS map which can be of variable length. The | ||
515 | * map is an array of CPUs. | ||
516 | */ | ||
517 | struct rps_map { | ||
518 | unsigned int len; | ||
519 | struct rcu_head rcu; | ||
520 | u16 cpus[0]; | ||
521 | }; | ||
522 | #define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16))) | ||
523 | |||
524 | /* | ||
525 | * The rps_dev_flow structure contains the mapping of a flow to a CPU and the | ||
526 | * tail pointer for that CPU's input queue at the time of last enqueue. | ||
527 | */ | ||
528 | struct rps_dev_flow { | ||
529 | u16 cpu; | ||
530 | u16 fill; | ||
531 | unsigned int last_qtail; | ||
532 | }; | ||
533 | |||
534 | /* | ||
535 | * The rps_dev_flow_table structure contains a table of flow mappings. | ||
536 | */ | ||
537 | struct rps_dev_flow_table { | ||
538 | unsigned int mask; | ||
539 | struct rcu_head rcu; | ||
540 | struct work_struct free_work; | ||
541 | struct rps_dev_flow flows[0]; | ||
542 | }; | ||
543 | #define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \ | ||
544 | (_num * sizeof(struct rps_dev_flow))) | ||
545 | |||
546 | /* | ||
547 | * The rps_sock_flow_table contains mappings of flows to the last CPU | ||
548 | * on which they were processed by the application (set in recvmsg). | ||
549 | */ | ||
550 | struct rps_sock_flow_table { | ||
551 | unsigned int mask; | ||
552 | u16 ents[0]; | ||
553 | }; | ||
554 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | ||
555 | (_num * sizeof(u16))) | ||
556 | |||
557 | #define RPS_NO_CPU 0xffff | ||
558 | |||
559 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, | ||
560 | u32 hash) | ||
561 | { | ||
562 | if (table && hash) { | ||
563 | unsigned int cpu, index = hash & table->mask; | ||
564 | |||
565 | /* We only give a hint, preemption can change cpu under us */ | ||
566 | cpu = raw_smp_processor_id(); | ||
567 | |||
568 | if (table->ents[index] != cpu) | ||
569 | table->ents[index] = cpu; | ||
570 | } | ||
571 | } | ||
572 | |||
573 | static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | ||
574 | u32 hash) | ||
575 | { | ||
576 | if (table && hash) | ||
577 | table->ents[hash & table->mask] = RPS_NO_CPU; | ||
578 | } | ||
579 | |||
580 | extern struct rps_sock_flow_table *rps_sock_flow_table; | ||
581 | |||
582 | /* This structure contains an instance of an RX queue. */ | ||
583 | struct netdev_rx_queue { | ||
584 | struct rps_map *rps_map; | ||
585 | struct rps_dev_flow_table *rps_flow_table; | ||
586 | struct kobject kobj; | ||
587 | struct netdev_rx_queue *first; | ||
588 | atomic_t count; | ||
589 | } ____cacheline_aligned_in_smp; | ||
590 | #endif /* CONFIG_RPS */ | ||
534 | 591 | ||
535 | /* | 592 | /* |
536 | * This structure defines the management hooks for network devices. | 593 | * This structure defines the management hooks for network devices. |
@@ -630,6 +687,9 @@ struct netdev_queue { | |||
630 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | 687 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); |
631 | * int (*ndo_get_vf_config)(struct net_device *dev, | 688 | * int (*ndo_get_vf_config)(struct net_device *dev, |
632 | * int vf, struct ifla_vf_info *ivf); | 689 | * int vf, struct ifla_vf_info *ivf); |
690 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, | ||
691 | * struct nlattr *port[]); | ||
692 | * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb); | ||
633 | */ | 693 | */ |
634 | #define HAVE_NET_DEVICE_OPS | 694 | #define HAVE_NET_DEVICE_OPS |
635 | struct net_device_ops { | 695 | struct net_device_ops { |
@@ -668,6 +728,7 @@ struct net_device_ops { | |||
668 | unsigned short vid); | 728 | unsigned short vid); |
669 | #ifdef CONFIG_NET_POLL_CONTROLLER | 729 | #ifdef CONFIG_NET_POLL_CONTROLLER |
670 | void (*ndo_poll_controller)(struct net_device *dev); | 730 | void (*ndo_poll_controller)(struct net_device *dev); |
731 | void (*ndo_netpoll_cleanup)(struct net_device *dev); | ||
671 | #endif | 732 | #endif |
672 | int (*ndo_set_vf_mac)(struct net_device *dev, | 733 | int (*ndo_set_vf_mac)(struct net_device *dev, |
673 | int queue, u8 *mac); | 734 | int queue, u8 *mac); |
@@ -678,6 +739,11 @@ struct net_device_ops { | |||
678 | int (*ndo_get_vf_config)(struct net_device *dev, | 739 | int (*ndo_get_vf_config)(struct net_device *dev, |
679 | int vf, | 740 | int vf, |
680 | struct ifla_vf_info *ivf); | 741 | struct ifla_vf_info *ivf); |
742 | int (*ndo_set_vf_port)(struct net_device *dev, | ||
743 | int vf, | ||
744 | struct nlattr *port[]); | ||
745 | int (*ndo_get_vf_port)(struct net_device *dev, | ||
746 | int vf, struct sk_buff *skb); | ||
681 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 747 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
682 | int (*ndo_fcoe_enable)(struct net_device *dev); | 748 | int (*ndo_fcoe_enable)(struct net_device *dev); |
683 | int (*ndo_fcoe_disable)(struct net_device *dev); | 749 | int (*ndo_fcoe_disable)(struct net_device *dev); |
@@ -768,6 +834,7 @@ struct net_device { | |||
768 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 834 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
769 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | 835 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ |
770 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | 836 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ |
837 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ | ||
771 | 838 | ||
772 | /* Segmentation offload features */ | 839 | /* Segmentation offload features */ |
773 | #define NETIF_F_GSO_SHIFT 16 | 840 | #define NETIF_F_GSO_SHIFT 16 |
@@ -824,7 +891,7 @@ struct net_device { | |||
824 | unsigned char operstate; /* RFC2863 operstate */ | 891 | unsigned char operstate; /* RFC2863 operstate */ |
825 | unsigned char link_mode; /* mapping policy to operstate */ | 892 | unsigned char link_mode; /* mapping policy to operstate */ |
826 | 893 | ||
827 | unsigned mtu; /* interface MTU value */ | 894 | unsigned int mtu; /* interface MTU value */ |
828 | unsigned short type; /* interface hardware type */ | 895 | unsigned short type; /* interface hardware type */ |
829 | unsigned short hard_header_len; /* hardware hdr length */ | 896 | unsigned short hard_header_len; /* hardware hdr length */ |
830 | 897 | ||
@@ -844,12 +911,10 @@ struct net_device { | |||
844 | unsigned char addr_len; /* hardware address length */ | 911 | unsigned char addr_len; /* hardware address length */ |
845 | unsigned short dev_id; /* for shared network cards */ | 912 | unsigned short dev_id; /* for shared network cards */ |
846 | 913 | ||
847 | struct netdev_hw_addr_list uc; /* Secondary unicast | ||
848 | mac addresses */ | ||
849 | int uc_promisc; | ||
850 | spinlock_t addr_list_lock; | 914 | spinlock_t addr_list_lock; |
851 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 915 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ |
852 | int mc_count; /* Number of installed mcasts */ | 916 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ |
917 | int uc_promisc; | ||
853 | unsigned int promiscuity; | 918 | unsigned int promiscuity; |
854 | unsigned int allmulti; | 919 | unsigned int allmulti; |
855 | 920 | ||
@@ -882,6 +947,15 @@ struct net_device { | |||
882 | 947 | ||
883 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 948 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
884 | 949 | ||
950 | #ifdef CONFIG_RPS | ||
951 | struct kset *queues_kset; | ||
952 | |||
953 | struct netdev_rx_queue *_rx; | ||
954 | |||
955 | /* Number of RX queues allocated at alloc_netdev_mq() time */ | ||
956 | unsigned int num_rx_queues; | ||
957 | #endif | ||
958 | |||
885 | struct netdev_queue rx_queue; | 959 | struct netdev_queue rx_queue; |
886 | 960 | ||
887 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; | 961 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
@@ -1310,19 +1384,44 @@ static inline int unregister_gifconf(unsigned int family) | |||
1310 | } | 1384 | } |
1311 | 1385 | ||
1312 | /* | 1386 | /* |
1313 | * Incoming packets are placed on per-cpu queues so that | 1387 | * Incoming packets are placed on per-cpu queues |
1314 | * no locking is needed. | ||
1315 | */ | 1388 | */ |
1316 | struct softnet_data { | 1389 | struct softnet_data { |
1317 | struct Qdisc *output_queue; | 1390 | struct Qdisc *output_queue; |
1318 | struct sk_buff_head input_pkt_queue; | 1391 | struct Qdisc **output_queue_tailp; |
1319 | struct list_head poll_list; | 1392 | struct list_head poll_list; |
1320 | struct sk_buff *completion_queue; | 1393 | struct sk_buff *completion_queue; |
1321 | 1394 | struct sk_buff_head process_queue; | |
1395 | |||
1396 | /* stats */ | ||
1397 | unsigned int processed; | ||
1398 | unsigned int time_squeeze; | ||
1399 | unsigned int cpu_collision; | ||
1400 | unsigned int received_rps; | ||
1401 | |||
1402 | #ifdef CONFIG_RPS | ||
1403 | struct softnet_data *rps_ipi_list; | ||
1404 | |||
1405 | /* Elements below can be accessed between CPUs for RPS */ | ||
1406 | struct call_single_data csd ____cacheline_aligned_in_smp; | ||
1407 | struct softnet_data *rps_ipi_next; | ||
1408 | unsigned int cpu; | ||
1409 | unsigned int input_queue_head; | ||
1410 | #endif | ||
1411 | unsigned dropped; | ||
1412 | struct sk_buff_head input_pkt_queue; | ||
1322 | struct napi_struct backlog; | 1413 | struct napi_struct backlog; |
1323 | }; | 1414 | }; |
1324 | 1415 | ||
1325 | DECLARE_PER_CPU(struct softnet_data,softnet_data); | 1416 | static inline void input_queue_head_add(struct softnet_data *sd, |
1417 | unsigned int len) | ||
1418 | { | ||
1419 | #ifdef CONFIG_RPS | ||
1420 | sd->input_queue_head += len; | ||
1421 | #endif | ||
1422 | } | ||
1423 | |||
1424 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); | ||
1326 | 1425 | ||
1327 | #define HAVE_NETIF_QUEUE | 1426 | #define HAVE_NETIF_QUEUE |
1328 | 1427 | ||
@@ -1949,6 +2048,22 @@ extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
1949 | extern int register_netdev(struct net_device *dev); | 2048 | extern int register_netdev(struct net_device *dev); |
1950 | extern void unregister_netdev(struct net_device *dev); | 2049 | extern void unregister_netdev(struct net_device *dev); |
1951 | 2050 | ||
2051 | /* General hardware address lists handling functions */ | ||
2052 | extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, | ||
2053 | struct netdev_hw_addr_list *from_list, | ||
2054 | int addr_len, unsigned char addr_type); | ||
2055 | extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, | ||
2056 | struct netdev_hw_addr_list *from_list, | ||
2057 | int addr_len, unsigned char addr_type); | ||
2058 | extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list, | ||
2059 | struct netdev_hw_addr_list *from_list, | ||
2060 | int addr_len); | ||
2061 | extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, | ||
2062 | struct netdev_hw_addr_list *from_list, | ||
2063 | int addr_len); | ||
2064 | extern void __hw_addr_flush(struct netdev_hw_addr_list *list); | ||
2065 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); | ||
2066 | |||
1952 | /* Functions used for device addresses handling */ | 2067 | /* Functions used for device addresses handling */ |
1953 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, | 2068 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, |
1954 | unsigned char addr_type); | 2069 | unsigned char addr_type); |
@@ -1960,26 +2075,34 @@ extern int dev_addr_add_multiple(struct net_device *to_dev, | |||
1960 | extern int dev_addr_del_multiple(struct net_device *to_dev, | 2075 | extern int dev_addr_del_multiple(struct net_device *to_dev, |
1961 | struct net_device *from_dev, | 2076 | struct net_device *from_dev, |
1962 | unsigned char addr_type); | 2077 | unsigned char addr_type); |
2078 | extern void dev_addr_flush(struct net_device *dev); | ||
2079 | extern int dev_addr_init(struct net_device *dev); | ||
2080 | |||
2081 | /* Functions used for unicast addresses handling */ | ||
2082 | extern int dev_uc_add(struct net_device *dev, unsigned char *addr); | ||
2083 | extern int dev_uc_del(struct net_device *dev, unsigned char *addr); | ||
2084 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); | ||
2085 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); | ||
2086 | extern void dev_uc_flush(struct net_device *dev); | ||
2087 | extern void dev_uc_init(struct net_device *dev); | ||
2088 | |||
2089 | /* Functions used for multicast addresses handling */ | ||
2090 | extern int dev_mc_add(struct net_device *dev, unsigned char *addr); | ||
2091 | extern int dev_mc_add_global(struct net_device *dev, unsigned char *addr); | ||
2092 | extern int dev_mc_del(struct net_device *dev, unsigned char *addr); | ||
2093 | extern int dev_mc_del_global(struct net_device *dev, unsigned char *addr); | ||
2094 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | ||
2095 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
2096 | extern void dev_mc_flush(struct net_device *dev); | ||
2097 | extern void dev_mc_init(struct net_device *dev); | ||
1963 | 2098 | ||
1964 | /* Functions used for secondary unicast and multicast support */ | 2099 | /* Functions used for secondary unicast and multicast support */ |
1965 | extern void dev_set_rx_mode(struct net_device *dev); | 2100 | extern void dev_set_rx_mode(struct net_device *dev); |
1966 | extern void __dev_set_rx_mode(struct net_device *dev); | 2101 | extern void __dev_set_rx_mode(struct net_device *dev); |
1967 | extern int dev_unicast_delete(struct net_device *dev, void *addr); | ||
1968 | extern int dev_unicast_add(struct net_device *dev, void *addr); | ||
1969 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); | ||
1970 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); | ||
1971 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | ||
1972 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | ||
1973 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | ||
1974 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
1975 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | ||
1976 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | ||
1977 | extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | ||
1978 | extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | ||
1979 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 2102 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
1980 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 2103 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
1981 | extern void netdev_state_change(struct net_device *dev); | 2104 | extern void netdev_state_change(struct net_device *dev); |
1982 | extern void netdev_bonding_change(struct net_device *dev, | 2105 | extern int netdev_bonding_change(struct net_device *dev, |
1983 | unsigned long event); | 2106 | unsigned long event); |
1984 | extern void netdev_features_change(struct net_device *dev); | 2107 | extern void netdev_features_change(struct net_device *dev); |
1985 | /* Load a device via the kmod */ | 2108 | /* Load a device via the kmod */ |
@@ -1989,6 +2112,7 @@ extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | |||
1989 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | 2112 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); |
1990 | 2113 | ||
1991 | extern int netdev_max_backlog; | 2114 | extern int netdev_max_backlog; |
2115 | extern int netdev_tstamp_prequeue; | ||
1992 | extern int weight_p; | 2116 | extern int weight_p; |
1993 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 2117 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
1994 | extern int skb_checksum_help(struct sk_buff *skb); | 2118 | extern int skb_checksum_help(struct sk_buff *skb); |
@@ -2049,54 +2173,14 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
2049 | dev->gso_max_size = size; | 2173 | dev->gso_max_size = size; |
2050 | } | 2174 | } |
2051 | 2175 | ||
2052 | static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | 2176 | extern int __skb_bond_should_drop(struct sk_buff *skb, |
2053 | struct net_device *master) | 2177 | struct net_device *master); |
2054 | { | ||
2055 | if (skb->pkt_type == PACKET_HOST) { | ||
2056 | u16 *dest = (u16 *) eth_hdr(skb)->h_dest; | ||
2057 | 2178 | ||
2058 | memcpy(dest, master->dev_addr, ETH_ALEN); | ||
2059 | } | ||
2060 | } | ||
2061 | |||
2062 | /* On bonding slaves other than the currently active slave, suppress | ||
2063 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | ||
2064 | * ARP on active-backup slaves with arp_validate enabled. | ||
2065 | */ | ||
2066 | static inline int skb_bond_should_drop(struct sk_buff *skb, | 2179 | static inline int skb_bond_should_drop(struct sk_buff *skb, |
2067 | struct net_device *master) | 2180 | struct net_device *master) |
2068 | { | 2181 | { |
2069 | if (master) { | 2182 | if (master) |
2070 | struct net_device *dev = skb->dev; | 2183 | return __skb_bond_should_drop(skb, master); |
2071 | |||
2072 | if (master->priv_flags & IFF_MASTER_ARPMON) | ||
2073 | dev->last_rx = jiffies; | ||
2074 | |||
2075 | if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) { | ||
2076 | /* Do address unmangle. The local destination address | ||
2077 | * will be always the one master has. Provides the right | ||
2078 | * functionality in a bridge. | ||
2079 | */ | ||
2080 | skb_bond_set_mac_by_master(skb, master); | ||
2081 | } | ||
2082 | |||
2083 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { | ||
2084 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | ||
2085 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | ||
2086 | return 0; | ||
2087 | |||
2088 | if (master->priv_flags & IFF_MASTER_ALB) { | ||
2089 | if (skb->pkt_type != PACKET_BROADCAST && | ||
2090 | skb->pkt_type != PACKET_MULTICAST) | ||
2091 | return 0; | ||
2092 | } | ||
2093 | if (master->priv_flags & IFF_MASTER_8023AD && | ||
2094 | skb->protocol == __cpu_to_be16(ETH_P_SLOW)) | ||
2095 | return 0; | ||
2096 | |||
2097 | return 1; | ||
2098 | } | ||
2099 | } | ||
2100 | return 0; | 2184 | return 0; |
2101 | } | 2185 | } |
2102 | 2186 | ||