Commit 62522d36d74a843e78d17f2dffc90468c6762803
Exists in
master
and in
39 other branches
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Showing 19 changed files Side-by-side Diff
- drivers/net/8139cp.c
- drivers/net/8139too.c
- drivers/net/gianfar.c
- drivers/net/phy/lxt.c
- drivers/net/r8169.c
- drivers/net/usb/asix.c
- drivers/net/wimax/i2400m/fw.c
- drivers/net/wireless/iwlwifi/iwl-agn-tx.c
- include/linux/skbuff.h
- net/8021q/vlan_core.c
- net/caif/cfrfml.c
- net/caif/cfveil.c
- net/core/dev.c
- net/core/gen_estimator.c
- net/core/pktgen.c
- net/ipv4/ipmr.c
- net/ipv6/icmp.c
- net/ipv6/ip6mr.c
- net/mac80211/mlme.c
drivers/net/8139cp.c
drivers/net/8139too.c
... | ... | @@ -860,6 +860,7 @@ |
860 | 860 | } |
861 | 861 | |
862 | 862 | /* if unknown chip, assume array element #0, original RTL-8139 in this case */ |
863 | + i = 0; | |
863 | 864 | dev_dbg(&pdev->dev, "unknown chip version, assuming RTL-8139\n"); |
864 | 865 | dev_dbg(&pdev->dev, "TxConfig = 0x%x\n", RTL_R32 (TxConfig)); |
865 | 866 | tp->chipset = 0; |
866 | 867 | |
... | ... | @@ -2088,8 +2089,8 @@ |
2088 | 2089 | * again when we think we are done. |
2089 | 2090 | */ |
2090 | 2091 | spin_lock_irqsave(&tp->lock, flags); |
2091 | - RTL_W16_F(IntrMask, rtl8139_intr_mask); | |
2092 | 2092 | __napi_complete(napi); |
2093 | + RTL_W16_F(IntrMask, rtl8139_intr_mask); | |
2093 | 2094 | spin_unlock_irqrestore(&tp->lock, flags); |
2094 | 2095 | } |
2095 | 2096 | spin_unlock(&tp->rx_lock); |
drivers/net/gianfar.c
... | ... | @@ -747,8 +747,7 @@ |
747 | 747 | FSL_GIANFAR_DEV_HAS_CSUM | |
748 | 748 | FSL_GIANFAR_DEV_HAS_VLAN | |
749 | 749 | FSL_GIANFAR_DEV_HAS_MAGIC_PACKET | |
750 | - FSL_GIANFAR_DEV_HAS_EXTENDED_HASH | | |
751 | - FSL_GIANFAR_DEV_HAS_TIMER; | |
750 | + FSL_GIANFAR_DEV_HAS_EXTENDED_HASH; | |
752 | 751 | |
753 | 752 | ctype = of_get_property(np, "phy-connection-type", NULL); |
754 | 753 |
drivers/net/phy/lxt.c
... | ... | @@ -53,6 +53,9 @@ |
53 | 53 | |
54 | 54 | #define MII_LXT971_ISR 19 /* Interrupt Status Register */ |
55 | 55 | |
56 | +/* register definitions for the 973 */ | |
57 | +#define MII_LXT973_PCR 16 /* Port Configuration Register */ | |
58 | +#define PCR_FIBER_SELECT 1 | |
56 | 59 | |
57 | 60 | MODULE_DESCRIPTION("Intel LXT PHY driver"); |
58 | 61 | MODULE_AUTHOR("Andy Fleming"); |
... | ... | @@ -119,6 +122,33 @@ |
119 | 122 | return err; |
120 | 123 | } |
121 | 124 | |
125 | +static int lxt973_probe(struct phy_device *phydev) | |
126 | +{ | |
127 | + int val = phy_read(phydev, MII_LXT973_PCR); | |
128 | + | |
129 | + if (val & PCR_FIBER_SELECT) { | |
130 | + /* | |
131 | + * If fiber is selected, then the only correct setting | |
132 | + * is 100Mbps, full duplex, and auto negotiation off. | |
133 | + */ | |
134 | + val = phy_read(phydev, MII_BMCR); | |
135 | + val |= (BMCR_SPEED100 | BMCR_FULLDPLX); | |
136 | + val &= ~BMCR_ANENABLE; | |
137 | + phy_write(phydev, MII_BMCR, val); | |
138 | + /* Remember that the port is in fiber mode. */ | |
139 | + phydev->priv = lxt973_probe; | |
140 | + } else { | |
141 | + phydev->priv = NULL; | |
142 | + } | |
143 | + return 0; | |
144 | +} | |
145 | + | |
146 | +static int lxt973_config_aneg(struct phy_device *phydev) | |
147 | +{ | |
148 | + /* Do nothing if port is in fiber mode. */ | |
149 | + return phydev->priv ? 0 : genphy_config_aneg(phydev); | |
150 | +} | |
151 | + | |
122 | 152 | static struct phy_driver lxt970_driver = { |
123 | 153 | .phy_id = 0x78100000, |
124 | 154 | .name = "LXT970", |
... | ... | @@ -146,6 +176,18 @@ |
146 | 176 | .driver = { .owner = THIS_MODULE,}, |
147 | 177 | }; |
148 | 178 | |
179 | +static struct phy_driver lxt973_driver = { | |
180 | + .phy_id = 0x00137a10, | |
181 | + .name = "LXT973", | |
182 | + .phy_id_mask = 0xfffffff0, | |
183 | + .features = PHY_BASIC_FEATURES, | |
184 | + .flags = 0, | |
185 | + .probe = lxt973_probe, | |
186 | + .config_aneg = lxt973_config_aneg, | |
187 | + .read_status = genphy_read_status, | |
188 | + .driver = { .owner = THIS_MODULE,}, | |
189 | +}; | |
190 | + | |
149 | 191 | static int __init lxt_init(void) |
150 | 192 | { |
151 | 193 | int ret; |
152 | 194 | |
... | ... | @@ -157,9 +199,15 @@ |
157 | 199 | ret = phy_driver_register(&lxt971_driver); |
158 | 200 | if (ret) |
159 | 201 | goto err2; |
202 | + | |
203 | + ret = phy_driver_register(&lxt973_driver); | |
204 | + if (ret) | |
205 | + goto err3; | |
160 | 206 | return 0; |
161 | 207 | |
162 | - err2: | |
208 | + err3: | |
209 | + phy_driver_unregister(&lxt971_driver); | |
210 | + err2: | |
163 | 211 | phy_driver_unregister(&lxt970_driver); |
164 | 212 | err1: |
165 | 213 | return ret; |
... | ... | @@ -169,6 +217,7 @@ |
169 | 217 | { |
170 | 218 | phy_driver_unregister(&lxt970_driver); |
171 | 219 | phy_driver_unregister(&lxt971_driver); |
220 | + phy_driver_unregister(&lxt973_driver); | |
172 | 221 | } |
173 | 222 | |
174 | 223 | module_init(lxt_init); |
drivers/net/r8169.c
... | ... | @@ -560,10 +560,10 @@ |
560 | 560 | udelay(25); |
561 | 561 | } |
562 | 562 | /* |
563 | - * Some configurations require a small delay even after the write | |
564 | - * completed indication or the next write might fail. | |
563 | + * According to hardware specs a 20us delay is required after write | |
564 | + * complete indication, but before sending next command. | |
565 | 565 | */ |
566 | - udelay(25); | |
566 | + udelay(20); | |
567 | 567 | } |
568 | 568 | |
569 | 569 | static int mdio_read(void __iomem *ioaddr, int reg_addr) |
... | ... | @@ -583,6 +583,12 @@ |
583 | 583 | } |
584 | 584 | udelay(25); |
585 | 585 | } |
586 | + /* | |
587 | + * According to hardware specs a 20us delay is required after read | |
588 | + * complete indication, but before sending next command. | |
589 | + */ | |
590 | + udelay(20); | |
591 | + | |
586 | 592 | return value; |
587 | 593 | } |
588 | 594 |
drivers/net/usb/asix.c
drivers/net/wimax/i2400m/fw.c
... | ... | @@ -1192,7 +1192,7 @@ |
1192 | 1192 | unsigned module_type, header_len, major_version, minor_version, |
1193 | 1193 | module_id, module_vendor, date, size; |
1194 | 1194 | |
1195 | - module_type = bcf_hdr->module_type; | |
1195 | + module_type = le32_to_cpu(bcf_hdr->module_type); | |
1196 | 1196 | header_len = sizeof(u32) * le32_to_cpu(bcf_hdr->header_len); |
1197 | 1197 | major_version = (le32_to_cpu(bcf_hdr->header_version) & 0xffff0000) |
1198 | 1198 | >> 16; |
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
... | ... | @@ -1147,6 +1147,7 @@ |
1147 | 1147 | struct ieee80211_sta *sta; |
1148 | 1148 | struct iwl_station_priv *sta_priv; |
1149 | 1149 | |
1150 | + rcu_read_lock(); | |
1150 | 1151 | sta = ieee80211_find_sta(priv->vif, hdr->addr1); |
1151 | 1152 | if (sta) { |
1152 | 1153 | sta_priv = (void *)sta->drv_priv; |
... | ... | @@ -1155,6 +1156,7 @@ |
1155 | 1156 | atomic_dec_return(&sta_priv->pending_frames) == 0) |
1156 | 1157 | ieee80211_sta_block_awake(priv->hw, sta, false); |
1157 | 1158 | } |
1159 | + rcu_read_unlock(); | |
1158 | 1160 | |
1159 | 1161 | ieee80211_tx_status_irqsafe(priv->hw, skb); |
1160 | 1162 | } |
include/linux/skbuff.h
... | ... | @@ -380,7 +380,10 @@ |
380 | 380 | kmemcheck_bitfield_begin(flags2); |
381 | 381 | __u16 queue_mapping:16; |
382 | 382 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
383 | - __u8 ndisc_nodetype:2; | |
383 | + __u8 ndisc_nodetype:2, | |
384 | + deliver_no_wcard:1; | |
385 | +#else | |
386 | + __u8 deliver_no_wcard:1; | |
384 | 387 | #endif |
385 | 388 | kmemcheck_bitfield_end(flags2); |
386 | 389 |
net/8021q/vlan_core.c
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | return NET_RX_DROP; |
13 | 13 | |
14 | 14 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
15 | - goto drop; | |
15 | + skb->deliver_no_wcard = 1; | |
16 | 16 | |
17 | 17 | skb->skb_iif = skb->dev->ifindex; |
18 | 18 | __vlan_hwaccel_put_tag(skb, vlan_tci); |
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | struct sk_buff *p; |
85 | 85 | |
86 | 86 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
87 | - goto drop; | |
87 | + skb->deliver_no_wcard = 1; | |
88 | 88 | |
89 | 89 | skb->skb_iif = skb->dev->ifindex; |
90 | 90 | __vlan_hwaccel_put_tag(skb, vlan_tci); |
net/caif/cfrfml.c
... | ... | @@ -83,7 +83,7 @@ |
83 | 83 | if (!cfsrvl_ready(service, &ret)) |
84 | 84 | return ret; |
85 | 85 | |
86 | - if (!cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) { | |
86 | + if (cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) { | |
87 | 87 | pr_err("CAIF: %s():Packet too large - size=%d\n", |
88 | 88 | __func__, cfpkt_getlen(pkt)); |
89 | 89 | return -EOVERFLOW; |
net/caif/cfveil.c
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | return ret; |
85 | 85 | caif_assert(layr->dn != NULL); |
86 | 86 | caif_assert(layr->dn->transmit != NULL); |
87 | - if (!cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) { | |
87 | + if (cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) { | |
88 | 88 | pr_warning("CAIF: %s(): Packet too large - size=%d\n", |
89 | 89 | __func__, cfpkt_getlen(pkt)); |
90 | 90 | return -EOVERFLOW; |
net/core/dev.c
... | ... | @@ -2273,11 +2273,9 @@ |
2273 | 2273 | if (skb_rx_queue_recorded(skb)) { |
2274 | 2274 | u16 index = skb_get_rx_queue(skb); |
2275 | 2275 | if (unlikely(index >= dev->num_rx_queues)) { |
2276 | - if (net_ratelimit()) { | |
2277 | - pr_warning("%s received packet on queue " | |
2278 | - "%u, but number of RX queues is %u\n", | |
2279 | - dev->name, index, dev->num_rx_queues); | |
2280 | - } | |
2276 | + WARN_ONCE(dev->num_rx_queues > 1, "%s received packet " | |
2277 | + "on queue %u, but number of RX queues is %u\n", | |
2278 | + dev->name, index, dev->num_rx_queues); | |
2281 | 2279 | goto done; |
2282 | 2280 | } |
2283 | 2281 | rxqueue = dev->_rx + index; |
2284 | 2282 | |
2285 | 2283 | |
... | ... | @@ -2815,13 +2813,24 @@ |
2815 | 2813 | if (!skb->skb_iif) |
2816 | 2814 | skb->skb_iif = skb->dev->ifindex; |
2817 | 2815 | |
2816 | + /* | |
2817 | + * bonding note: skbs received on inactive slaves should only | |
2818 | + * be delivered to pkt handlers that are exact matches. Also | |
2819 | + * the deliver_no_wcard flag will be set. If packet handlers | |
2820 | + * are sensitive to duplicate packets these skbs will need to | |
2821 | + * be dropped at the handler. The vlan accel path may have | |
2822 | + * already set the deliver_no_wcard flag. | |
2823 | + */ | |
2818 | 2824 | null_or_orig = NULL; |
2819 | 2825 | orig_dev = skb->dev; |
2820 | 2826 | master = ACCESS_ONCE(orig_dev->master); |
2821 | - if (master) { | |
2822 | - if (skb_bond_should_drop(skb, master)) | |
2827 | + if (skb->deliver_no_wcard) | |
2828 | + null_or_orig = orig_dev; | |
2829 | + else if (master) { | |
2830 | + if (skb_bond_should_drop(skb, master)) { | |
2831 | + skb->deliver_no_wcard = 1; | |
2823 | 2832 | null_or_orig = orig_dev; /* deliver only exact match */ |
2824 | - else | |
2833 | + } else | |
2825 | 2834 | skb->dev = master; |
2826 | 2835 | } |
2827 | 2836 |
net/core/gen_estimator.c
... | ... | @@ -107,6 +107,7 @@ |
107 | 107 | |
108 | 108 | /* Protects against soft lockup during large deletion */ |
109 | 109 | static struct rb_root est_root = RB_ROOT; |
110 | +static DEFINE_SPINLOCK(est_tree_lock); | |
110 | 111 | |
111 | 112 | static void est_timer(unsigned long arg) |
112 | 113 | { |
... | ... | @@ -201,7 +202,6 @@ |
201 | 202 | * |
202 | 203 | * Returns 0 on success or a negative error code. |
203 | 204 | * |
204 | - * NOTE: Called under rtnl_mutex | |
205 | 205 | */ |
206 | 206 | int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
207 | 207 | struct gnet_stats_rate_est *rate_est, |
... | ... | @@ -232,6 +232,7 @@ |
232 | 232 | est->last_packets = bstats->packets; |
233 | 233 | est->avpps = rate_est->pps<<10; |
234 | 234 | |
235 | + spin_lock(&est_tree_lock); | |
235 | 236 | if (!elist[idx].timer.function) { |
236 | 237 | INIT_LIST_HEAD(&elist[idx].list); |
237 | 238 | setup_timer(&elist[idx].timer, est_timer, idx); |
... | ... | @@ -242,6 +243,7 @@ |
242 | 243 | |
243 | 244 | list_add_rcu(&est->list, &elist[idx].list); |
244 | 245 | gen_add_node(est); |
246 | + spin_unlock(&est_tree_lock); | |
245 | 247 | |
246 | 248 | return 0; |
247 | 249 | } |
248 | 250 | |
... | ... | @@ -261,13 +263,13 @@ |
261 | 263 | * |
262 | 264 | * Removes the rate estimator specified by &bstats and &rate_est. |
263 | 265 | * |
264 | - * NOTE: Called under rtnl_mutex | |
265 | 266 | */ |
266 | 267 | void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, |
267 | 268 | struct gnet_stats_rate_est *rate_est) |
268 | 269 | { |
269 | 270 | struct gen_estimator *e; |
270 | 271 | |
272 | + spin_lock(&est_tree_lock); | |
271 | 273 | while ((e = gen_find_node(bstats, rate_est))) { |
272 | 274 | rb_erase(&e->node, &est_root); |
273 | 275 | |
... | ... | @@ -278,6 +280,7 @@ |
278 | 280 | list_del_rcu(&e->list); |
279 | 281 | call_rcu(&e->e_rcu, __gen_kill_estimator); |
280 | 282 | } |
283 | + spin_unlock(&est_tree_lock); | |
281 | 284 | } |
282 | 285 | EXPORT_SYMBOL(gen_kill_estimator); |
283 | 286 | |
284 | 287 | |
... | ... | @@ -312,9 +315,15 @@ |
312 | 315 | bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, |
313 | 316 | const struct gnet_stats_rate_est *rate_est) |
314 | 317 | { |
318 | + bool res; | |
319 | + | |
315 | 320 | ASSERT_RTNL(); |
316 | 321 | |
317 | - return gen_find_node(bstats, rate_est) != NULL; | |
322 | + spin_lock(&est_tree_lock); | |
323 | + res = gen_find_node(bstats, rate_est) != NULL; | |
324 | + spin_unlock(&est_tree_lock); | |
325 | + | |
326 | + return res; | |
318 | 327 | } |
319 | 328 | EXPORT_SYMBOL(gen_estimator_active); |
net/core/pktgen.c
... | ... | @@ -2170,7 +2170,7 @@ |
2170 | 2170 | end_time = ktime_now(); |
2171 | 2171 | |
2172 | 2172 | pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time)); |
2173 | - pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay); | |
2173 | + pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay); | |
2174 | 2174 | } |
2175 | 2175 | |
2176 | 2176 | static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev) |
net/ipv4/ipmr.c
... | ... | @@ -267,8 +267,10 @@ |
267 | 267 | { |
268 | 268 | struct mr_table *mrt, *next; |
269 | 269 | |
270 | - list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list) | |
270 | + list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list) { | |
271 | + list_del(&mrt->list); | |
271 | 272 | kfree(mrt); |
273 | + } | |
272 | 274 | fib_rules_unregister(net->ipv4.mr_rules_ops); |
273 | 275 | } |
274 | 276 | #else |
net/ipv6/icmp.c
... | ... | @@ -483,7 +483,7 @@ |
483 | 483 | np->tclass, NULL, &fl, (struct rt6_info*)dst, |
484 | 484 | MSG_DONTWAIT, np->dontfrag); |
485 | 485 | if (err) { |
486 | - ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS); | |
486 | + ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTERRORS); | |
487 | 487 | ip6_flush_pending_frames(sk); |
488 | 488 | goto out_put; |
489 | 489 | } |
... | ... | @@ -565,7 +565,7 @@ |
565 | 565 | np->dontfrag); |
566 | 566 | |
567 | 567 | if (err) { |
568 | - ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS); | |
568 | + ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTERRORS); | |
569 | 569 | ip6_flush_pending_frames(sk); |
570 | 570 | goto out_put; |
571 | 571 | } |
net/ipv6/ip6mr.c
... | ... | @@ -254,8 +254,10 @@ |
254 | 254 | { |
255 | 255 | struct mr6_table *mrt, *next; |
256 | 256 | |
257 | - list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) | |
257 | + list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) { | |
258 | + list_del(&mrt->list); | |
258 | 259 | ip6mr_free_table(mrt); |
260 | + } | |
259 | 261 | fib_rules_unregister(net->ipv6.mr6_rules_ops); |
260 | 262 | } |
261 | 263 | #else |
net/mac80211/mlme.c
... | ... | @@ -1760,9 +1760,45 @@ |
1760 | 1760 | mutex_unlock(&ifmgd->mtx); |
1761 | 1761 | |
1762 | 1762 | if (skb->len >= 24 + 2 /* mgmt + deauth reason */ && |
1763 | - (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH) | |
1764 | - cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); | |
1763 | + (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH) { | |
1764 | + struct ieee80211_local *local = sdata->local; | |
1765 | + struct ieee80211_work *wk; | |
1765 | 1766 | |
1767 | + mutex_lock(&local->work_mtx); | |
1768 | + list_for_each_entry(wk, &local->work_list, list) { | |
1769 | + if (wk->sdata != sdata) | |
1770 | + continue; | |
1771 | + | |
1772 | + if (wk->type != IEEE80211_WORK_ASSOC) | |
1773 | + continue; | |
1774 | + | |
1775 | + if (memcmp(mgmt->bssid, wk->filter_ta, ETH_ALEN)) | |
1776 | + continue; | |
1777 | + if (memcmp(mgmt->sa, wk->filter_ta, ETH_ALEN)) | |
1778 | + continue; | |
1779 | + | |
1780 | + /* | |
1781 | + * Printing the message only here means we can't | |
1782 | + * spuriously print it, but it also means that it | |
1783 | + * won't be printed when the frame comes in before | |
1784 | + * we even tried to associate or in similar cases. | |
1785 | + * | |
1786 | + * Ultimately, I suspect cfg80211 should print the | |
1787 | + * messages instead. | |
1788 | + */ | |
1789 | + printk(KERN_DEBUG | |
1790 | + "%s: deauthenticated from %pM (Reason: %u)\n", | |
1791 | + sdata->name, mgmt->bssid, | |
1792 | + le16_to_cpu(mgmt->u.deauth.reason_code)); | |
1793 | + | |
1794 | + list_del_rcu(&wk->list); | |
1795 | + free_work(wk); | |
1796 | + break; | |
1797 | + } | |
1798 | + mutex_unlock(&local->work_mtx); | |
1799 | + | |
1800 | + cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); | |
1801 | + } | |
1766 | 1802 | out: |
1767 | 1803 | kfree_skb(skb); |
1768 | 1804 | } |