Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
authorDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2012 06:02:28 +0000 (23:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2012 06:02:28 +0000 (23:02 -0700)
John Linville says:

====================
Several drivers see updates: mwifiex, ath9k, iwlwifi, brcmsmac,
wlcore/wl12xx/wl18xx, and a handful of others.  The bcma bus got a
lot of attention from Hauke Mehrtens.  The cfg80211 component gets
a flurry of patches for multi-channel support, and the mac80211
component gets the first few VHT (11ac) and 60GHz (11ad) patches.
This also includes the removal of the iwmc3200 drivers, since the
hardware never became available to normal people.

Additionally, the NFC subsystem gets a series of updates.  According to
Samuel, "Here are the interesting bits:

- A better error management for the HCI stack.
- An LLCP "late" binding implementation for a better NFC SAP usage. SAPs are
  now reserved only when there's a client for it.
- Support for Sony RC-S360 (a.k.a. PaSoRi) pn533 based dongle. We can read and
  write NFC tags and also establish a p2p link with this dongle now.
- A few LLCP fixes."

Finally, this includes another pull of the fixes from the wireless
tree in order to resolve some merge issues.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c
include/net/ip_fib.h
net/core/skbuff.c
net/ipv4/fib_frontend.c
net/ipv4/fib_rules.c
net/ipv4/route.c
net/ipv4/tcp_output.c

index 6cbab0369738da048b83fe497367eafc59c3618f..ac9091f9d42b44751cd739e94696bdf2ece60484 100644 (file)
@@ -298,6 +298,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
        {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)},
        {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)},
        {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)},
+       {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)},
        {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
        {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
        {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
index e91fedd22db2a9e06d477452b906e84f38b3b28d..5697acefeba38e5351c7c962d6816e639d59cd49 100644 (file)
@@ -106,12 +106,10 @@ struct fib_result {
        unsigned char   nh_sel;
        unsigned char   type;
        unsigned char   scope;
+       u32             tclassid;
        struct fib_info *fi;
        struct fib_table *table;
        struct list_head *fa_head;
-#ifdef CONFIG_IP_MULTIPLE_TABLES
-       struct fib_rule *r;
-#endif
 };
 
 struct fib_result_nl {
@@ -215,10 +213,6 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
 extern int __net_init fib4_rules_init(struct net *net);
 extern void __net_exit fib4_rules_exit(struct net *net);
 
-#ifdef CONFIG_IP_ROUTE_CLASSID
-extern u32 fib_rules_tclass(const struct fib_result *res);
-#endif
-
 extern struct fib_table *fib_new_table(struct net *net, u32 id);
 extern struct fib_table *fib_get_table(struct net *net, u32 id);
 
@@ -229,7 +223,7 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
                             struct fib_result *res)
 {
        if (!net->ipv4.fib_has_custom_rules) {
-               res->r = NULL;
+               res->tclassid = 0;
                if (net->ipv4.fib_local &&
                    !fib_table_lookup(net->ipv4.fib_local, flp, res,
                                      FIB_LOOKUP_NOREF))
@@ -289,7 +283,7 @@ static inline void fib_combine_itag(u32 *itag, const struct fib_result *res)
 #endif
        *itag = FIB_RES_NH(*res).nh_tclassid<<16;
 #ifdef CONFIG_IP_MULTIPLE_TABLES
-       rtag = fib_rules_tclass(res);
+       rtag = res->tclassid;
        if (*itag == 0)
                *itag = (rtag<<16);
        *itag |= (rtag>>16);
index 506f678e9d952bd29ac0b704d3cffffe66d05002..8b6d38fdb443a1d65ed29c487225e47f6c8fa1ac 100644 (file)
@@ -296,9 +296,12 @@ EXPORT_SYMBOL(build_skb);
 struct netdev_alloc_cache {
        struct page *page;
        unsigned int offset;
+       unsigned int pagecnt_bias;
 };
 static DEFINE_PER_CPU(struct netdev_alloc_cache, netdev_alloc_cache);
 
+#define NETDEV_PAGECNT_BIAS (PAGE_SIZE / SMP_CACHE_BYTES)
+
 /**
  * netdev_alloc_frag - allocate a page fragment
  * @fragsz: fragment size
@@ -317,17 +320,26 @@ void *netdev_alloc_frag(unsigned int fragsz)
        if (unlikely(!nc->page)) {
 refill:
                nc->page = alloc_page(GFP_ATOMIC | __GFP_COLD);
+               if (unlikely(!nc->page))
+                       goto end;
+recycle:
+               atomic_set(&nc->page->_count, NETDEV_PAGECNT_BIAS);
+               nc->pagecnt_bias = NETDEV_PAGECNT_BIAS;
                nc->offset = 0;
        }
-       if (likely(nc->page)) {
-               if (nc->offset + fragsz > PAGE_SIZE) {
-                       put_page(nc->page);
-                       goto refill;
-               }
-               data = page_address(nc->page) + nc->offset;
-               nc->offset += fragsz;
-               get_page(nc->page);
+
+       if (nc->offset + fragsz > PAGE_SIZE) {
+               /* avoid unnecessary locked operations if possible */
+               if ((atomic_read(&nc->page->_count) == nc->pagecnt_bias) ||
+                   atomic_sub_and_test(nc->pagecnt_bias, &nc->page->_count))
+                       goto recycle;
+               goto refill;
        }
+
+       data = page_address(nc->page) + nc->offset;
+       nc->offset += fragsz;
+       nc->pagecnt_bias--;
+end:
        local_irq_restore(flags);
        return data;
 }
index 81f85716a894a8c42a506641271b3f77af45f104..7a31194ec63344f6c0abec0fec41d807dc34fdfb 100644 (file)
@@ -169,10 +169,6 @@ static inline unsigned int __inet_dev_addr_type(struct net *net,
        if (ipv4_is_multicast(addr))
                return RTN_MULTICAST;
 
-#ifdef CONFIG_IP_MULTIPLE_TABLES
-       res.r = NULL;
-#endif
-
        local_table = fib_get_table(net, RT_TABLE_LOCAL);
        if (local_table) {
                ret = RTN_UNICAST;
@@ -934,10 +930,6 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
                .flowi4_scope = frn->fl_scope,
        };
 
-#ifdef CONFIG_IP_MULTIPLE_TABLES
-       res.r = NULL;
-#endif
-
        frn->err = -ENOENT;
        if (tb) {
                local_bh_disable();
index c06da93b0b7022a44303e204431f52b6abec55d7..a83d74e498d23af8c104bc3d68eca5ca4a8ac228 100644 (file)
@@ -47,13 +47,6 @@ struct fib4_rule {
 #endif
 };
 
-#ifdef CONFIG_IP_ROUTE_CLASSID
-u32 fib_rules_tclass(const struct fib_result *res)
-{
-       return res->r ? ((struct fib4_rule *) res->r)->tclassid : 0;
-}
-#endif
-
 int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
 {
        struct fib_lookup_arg arg = {
@@ -63,8 +56,12 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
        int err;
 
        err = fib_rules_lookup(net->ipv4.rules_ops, flowi4_to_flowi(flp), 0, &arg);
-       res->r = arg.rule;
-
+#ifdef CONFIG_IP_ROUTE_CLASSID
+       if (arg.rule)
+               res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid;
+       else
+               res->tclassid = 0;
+#endif
        return err;
 }
 EXPORT_SYMBOL_GPL(__fib_lookup);
index 9319bf1f8354b622f61a7cfcfcbdf5f754ff783c..aad21819316df6a1e90e8953854d965abf03fe46 100644 (file)
@@ -1735,7 +1735,7 @@ static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4,
 
 #ifdef CONFIG_IP_ROUTE_CLASSID
 #ifdef CONFIG_IP_MULTIPLE_TABLES
-       set_class_tag(rt, fib_rules_tclass(res));
+       set_class_tag(rt, res->tclassid);
 #endif
        set_class_tag(rt, itag);
 #endif
@@ -2353,11 +2353,9 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
        __be32 orig_saddr;
        int orig_oif;
 
+       res.tclassid    = 0;
        res.fi          = NULL;
        res.table       = NULL;
-#ifdef CONFIG_IP_MULTIPLE_TABLES
-       res.r           = NULL;
-#endif
 
        orig_daddr = fl4->daddr;
        orig_saddr = fl4->saddr;
index 03854abfd9d87f6a6adc5485a3f373c2b91df016..15a7c7bc3e58f733ec1c8a8f66be59733e38d682 100644 (file)
@@ -838,7 +838,7 @@ static void tcp_tasklet_func(unsigned long data)
                if (!sock_owned_by_user(sk)) {
                        if ((1 << sk->sk_state) &
                            (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 |
-                            TCPF_CLOSING | TCPF_CLOSE_WAIT))
+                            TCPF_CLOSING | TCPF_CLOSE_WAIT | TCPF_LAST_ACK))
                                tcp_write_xmit(sk,
                                               tcp_current_mss(sk),
                                               0, 0,
@@ -868,7 +868,7 @@ void tcp_release_cb(struct sock *sk)
        if (test_and_clear_bit(TSQ_OWNED, &tp->tsq_flags)) {
                if ((1 << sk->sk_state) &
                    (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 |
-                    TCPF_CLOSING | TCPF_CLOSE_WAIT))
+                    TCPF_CLOSING | TCPF_CLOSE_WAIT | TCPF_LAST_ACK))
                        tcp_write_xmit(sk,
                                       tcp_current_mss(sk),
                                       0, 0,