diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-20 16:24:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-20 16:24:14 -0500 |
commit | d9993be65a77f500ae926176baa264816bfe3816 (patch) | |
tree | bbb8c86114bf86e5ca3d1fbf89de3d98be5519ba | |
parent | c4266263249f22479eb1abb1a1709c38240b1597 (diff) | |
parent | aa3e219997e4b949be4199660936099ded0b401f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
-rw-r--r-- | drivers/net/typhoon.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/mcs7830.c | 12 | ||||
-rw-r--r-- | include/net/ip6_route.h | 10 | ||||
-rw-r--r-- | include/net/sch_generic.h | 6 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 12 | ||||
-rw-r--r-- | net/ipv6/xfrm6_output.c | 16 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 20 |
7 files changed, 46 insertions, 31 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 5b83c3f35f47..a3c46f6a15e7 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -1004,7 +1004,6 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | strcpy(info->driver, KBUILD_MODNAME); | 1006 | strcpy(info->driver, KBUILD_MODNAME); |
1007 | strcpy(info->version, UTS_RELEASE); | ||
1008 | strcpy(info->bus_info, pci_name(pci_dev)); | 1007 | strcpy(info->bus_info, pci_name(pci_dev)); |
1009 | } | 1008 | } |
1010 | 1009 | ||
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index a6281e3987b5..b701f593cd59 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * MOSCHIP MCS7830 based USB 2.0 Ethernet Devices | 2 | * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices |
3 | * | 3 | * |
4 | * based on usbnet.c, asix.c and the vendor provided mcs7830 driver | 4 | * based on usbnet.c, asix.c and the vendor provided mcs7830 driver |
5 | * | 5 | * |
@@ -11,6 +11,9 @@ | |||
11 | * | 11 | * |
12 | * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!). | 12 | * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!). |
13 | * | 13 | * |
14 | * 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"), | ||
15 | * per active notification by manufacturer | ||
16 | * | ||
14 | * TODO: | 17 | * TODO: |
15 | * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?) | 18 | * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?) |
16 | * - implement ethtool_ops get_pauseparam/set_pauseparam | 19 | * - implement ethtool_ops get_pauseparam/set_pauseparam |
@@ -60,6 +63,7 @@ | |||
60 | #define MCS7830_MAX_MCAST 64 | 63 | #define MCS7830_MAX_MCAST 64 |
61 | 64 | ||
62 | #define MCS7830_VENDOR_ID 0x9710 | 65 | #define MCS7830_VENDOR_ID 0x9710 |
66 | #define MCS7832_PRODUCT_ID 0x7832 | ||
63 | #define MCS7830_PRODUCT_ID 0x7830 | 67 | #define MCS7830_PRODUCT_ID 0x7830 |
64 | #define MCS7730_PRODUCT_ID 0x7730 | 68 | #define MCS7730_PRODUCT_ID 0x7730 |
65 | 69 | ||
@@ -626,7 +630,7 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
626 | } | 630 | } |
627 | 631 | ||
628 | static const struct driver_info moschip_info = { | 632 | static const struct driver_info moschip_info = { |
629 | .description = "MOSCHIP 7830/7730 usb-NET adapter", | 633 | .description = "MOSCHIP 7830/7832/7730 usb-NET adapter", |
630 | .bind = mcs7830_bind, | 634 | .bind = mcs7830_bind, |
631 | .rx_fixup = mcs7830_rx_fixup, | 635 | .rx_fixup = mcs7830_rx_fixup, |
632 | .flags = FLAG_ETHER, | 636 | .flags = FLAG_ETHER, |
@@ -645,6 +649,10 @@ static const struct driver_info sitecom_info = { | |||
645 | 649 | ||
646 | static const struct usb_device_id products[] = { | 650 | static const struct usb_device_id products[] = { |
647 | { | 651 | { |
652 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID), | ||
653 | .driver_info = (unsigned long) &moschip_info, | ||
654 | }, | ||
655 | { | ||
648 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), | 656 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), |
649 | .driver_info = (unsigned long) &moschip_info, | 657 | .driver_info = (unsigned long) &moschip_info, |
650 | }, | 658 | }, |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index e06e0ca1e91b..8552f0a2e854 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -175,5 +175,15 @@ static inline int ipv6_unicast_destination(struct sk_buff *skb) | |||
175 | return rt->rt6i_flags & RTF_LOCAL; | 175 | return rt->rt6i_flags & RTF_LOCAL; |
176 | } | 176 | } |
177 | 177 | ||
178 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | ||
179 | |||
180 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | ||
181 | { | ||
182 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
183 | |||
184 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | ||
185 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | ||
186 | } | ||
187 | |||
178 | #endif | 188 | #endif |
179 | #endif | 189 | #endif |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 786cc396cb4a..0af57ebae762 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -611,11 +611,7 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
611 | { | 611 | { |
612 | struct sk_buff *n; | 612 | struct sk_buff *n; |
613 | 613 | ||
614 | if ((action == TC_ACT_STOLEN || action == TC_ACT_QUEUED) && | 614 | n = skb_clone(skb, gfp_mask); |
615 | !skb_shared(skb)) | ||
616 | n = skb_get(skb); | ||
617 | else | ||
618 | n = skb_clone(skb, gfp_mask); | ||
619 | 615 | ||
620 | if (n) { | 616 | if (n) { |
621 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); | 617 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 99157b4cd56e..94b5bf132b2e 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -56,7 +56,7 @@ | |||
56 | #include <net/checksum.h> | 56 | #include <net/checksum.h> |
57 | #include <linux/mroute6.h> | 57 | #include <linux/mroute6.h> |
58 | 58 | ||
59 | static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 59 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
60 | 60 | ||
61 | int __ip6_local_out(struct sk_buff *skb) | 61 | int __ip6_local_out(struct sk_buff *skb) |
62 | { | 62 | { |
@@ -145,14 +145,6 @@ static int ip6_finish_output2(struct sk_buff *skb) | |||
145 | return -EINVAL; | 145 | return -EINVAL; |
146 | } | 146 | } |
147 | 147 | ||
148 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | ||
149 | { | ||
150 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
151 | |||
152 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | ||
153 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | ||
154 | } | ||
155 | |||
156 | static int ip6_finish_output(struct sk_buff *skb) | 148 | static int ip6_finish_output(struct sk_buff *skb) |
157 | { | 149 | { |
158 | if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || | 150 | if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || |
@@ -601,7 +593,7 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) | |||
601 | return offset; | 593 | return offset; |
602 | } | 594 | } |
603 | 595 | ||
604 | static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | 596 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) |
605 | { | 597 | { |
606 | struct sk_buff *frag; | 598 | struct sk_buff *frag; |
607 | struct rt6_info *rt = (struct rt6_info*)skb_dst(skb); | 599 | struct rt6_info *rt = (struct rt6_info*)skb_dst(skb); |
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 6434bd5ce088..8e688b3de9ab 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/netfilter_ipv6.h> | 17 | #include <linux/netfilter_ipv6.h> |
18 | #include <net/dst.h> | 18 | #include <net/dst.h> |
19 | #include <net/ipv6.h> | 19 | #include <net/ipv6.h> |
20 | #include <net/ip6_route.h> | ||
20 | #include <net/xfrm.h> | 21 | #include <net/xfrm.h> |
21 | 22 | ||
22 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | 23 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, |
@@ -88,8 +89,21 @@ static int xfrm6_output_finish(struct sk_buff *skb) | |||
88 | return xfrm_output(skb); | 89 | return xfrm_output(skb); |
89 | } | 90 | } |
90 | 91 | ||
92 | static int __xfrm6_output(struct sk_buff *skb) | ||
93 | { | ||
94 | struct dst_entry *dst = skb_dst(skb); | ||
95 | struct xfrm_state *x = dst->xfrm; | ||
96 | |||
97 | if ((x && x->props.mode == XFRM_MODE_TUNNEL) && | ||
98 | ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || | ||
99 | dst_allfrag(skb_dst(skb)))) { | ||
100 | return ip6_fragment(skb, xfrm6_output_finish); | ||
101 | } | ||
102 | return xfrm6_output_finish(skb); | ||
103 | } | ||
104 | |||
91 | int xfrm6_output(struct sk_buff *skb) | 105 | int xfrm6_output(struct sk_buff *skb) |
92 | { | 106 | { |
93 | return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, | 107 | return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, |
94 | skb_dst(skb)->dev, xfrm6_output_finish); | 108 | skb_dst(skb)->dev, __xfrm6_output); |
95 | } | 109 | } |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index cb331dea7fe0..42396c965dd6 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -270,7 +270,6 @@ static unsigned int sfq_drop(struct Qdisc *sch) | |||
270 | /* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */ | 270 | /* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */ |
271 | d = q->next[q->tail]; | 271 | d = q->next[q->tail]; |
272 | q->next[q->tail] = q->next[d]; | 272 | q->next[q->tail] = q->next[d]; |
273 | q->allot[q->next[d]] += q->quantum; | ||
274 | skb = q->qs[d].prev; | 273 | skb = q->qs[d].prev; |
275 | len = qdisc_pkt_len(skb); | 274 | len = qdisc_pkt_len(skb); |
276 | __skb_unlink(skb, &q->qs[d]); | 275 | __skb_unlink(skb, &q->qs[d]); |
@@ -321,14 +320,13 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
321 | sfq_inc(q, x); | 320 | sfq_inc(q, x); |
322 | if (q->qs[x].qlen == 1) { /* The flow is new */ | 321 | if (q->qs[x].qlen == 1) { /* The flow is new */ |
323 | if (q->tail == SFQ_DEPTH) { /* It is the first flow */ | 322 | if (q->tail == SFQ_DEPTH) { /* It is the first flow */ |
324 | q->tail = x; | ||
325 | q->next[x] = x; | 323 | q->next[x] = x; |
326 | q->allot[x] = q->quantum; | ||
327 | } else { | 324 | } else { |
328 | q->next[x] = q->next[q->tail]; | 325 | q->next[x] = q->next[q->tail]; |
329 | q->next[q->tail] = x; | 326 | q->next[q->tail] = x; |
330 | q->tail = x; | ||
331 | } | 327 | } |
328 | q->tail = x; | ||
329 | q->allot[x] = q->quantum; | ||
332 | } | 330 | } |
333 | if (++sch->q.qlen <= q->limit) { | 331 | if (++sch->q.qlen <= q->limit) { |
334 | sch->bstats.bytes += qdisc_pkt_len(skb); | 332 | sch->bstats.bytes += qdisc_pkt_len(skb); |
@@ -359,13 +357,13 @@ sfq_dequeue(struct Qdisc *sch) | |||
359 | { | 357 | { |
360 | struct sfq_sched_data *q = qdisc_priv(sch); | 358 | struct sfq_sched_data *q = qdisc_priv(sch); |
361 | struct sk_buff *skb; | 359 | struct sk_buff *skb; |
362 | sfq_index a, old_a; | 360 | sfq_index a, next_a; |
363 | 361 | ||
364 | /* No active slots */ | 362 | /* No active slots */ |
365 | if (q->tail == SFQ_DEPTH) | 363 | if (q->tail == SFQ_DEPTH) |
366 | return NULL; | 364 | return NULL; |
367 | 365 | ||
368 | a = old_a = q->next[q->tail]; | 366 | a = q->next[q->tail]; |
369 | 367 | ||
370 | /* Grab packet */ | 368 | /* Grab packet */ |
371 | skb = __skb_dequeue(&q->qs[a]); | 369 | skb = __skb_dequeue(&q->qs[a]); |
@@ -376,17 +374,15 @@ sfq_dequeue(struct Qdisc *sch) | |||
376 | /* Is the slot empty? */ | 374 | /* Is the slot empty? */ |
377 | if (q->qs[a].qlen == 0) { | 375 | if (q->qs[a].qlen == 0) { |
378 | q->ht[q->hash[a]] = SFQ_DEPTH; | 376 | q->ht[q->hash[a]] = SFQ_DEPTH; |
379 | a = q->next[a]; | 377 | next_a = q->next[a]; |
380 | if (a == old_a) { | 378 | if (a == next_a) { |
381 | q->tail = SFQ_DEPTH; | 379 | q->tail = SFQ_DEPTH; |
382 | return skb; | 380 | return skb; |
383 | } | 381 | } |
384 | q->next[q->tail] = a; | 382 | q->next[q->tail] = next_a; |
385 | q->allot[a] += q->quantum; | ||
386 | } else if ((q->allot[a] -= qdisc_pkt_len(skb)) <= 0) { | 383 | } else if ((q->allot[a] -= qdisc_pkt_len(skb)) <= 0) { |
387 | q->tail = a; | ||
388 | a = q->next[a]; | ||
389 | q->allot[a] += q->quantum; | 384 | q->allot[a] += q->quantum; |
385 | q->tail = a; | ||
390 | } | 386 | } |
391 | return skb; | 387 | return skb; |
392 | } | 388 | } |