From b966b2b11b05f88be6e429c591085ac8ed7eb1e6 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 13 Mar 2012 18:19:51 -0700 Subject: [PATCH] --- yaml --- r: 288448 b: refs/heads/master c: e0adb9902fb338a9fe634c3c2a3e474075c733ba h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/sparc/Makefile | 2 +- .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +- .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 12 ++------ .../net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 8 ++--- .../net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +- .../net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 12 ++++++++ trunk/drivers/net/tun.c | 15 ++-------- trunk/drivers/net/usb/asix.c | 4 --- .../drivers/net/wireless/iwlegacy/3945-mac.c | 2 +- trunk/drivers/net/wireless/iwlegacy/3945.c | 7 ++--- trunk/drivers/net/wireless/rt2x00/rt2x00dev.c | 6 +--- trunk/drivers/net/wireless/rt2x00/rt2x00mac.c | 9 ------ .../drivers/net/wireless/rt2x00/rt2x00queue.c | 3 -- trunk/lib/dynamic_queue_limits.c | 1 - trunk/net/ipv4/syncookies.c | 30 +++++++++---------- trunk/net/ipv4/tcp_ipv4.c | 10 ++----- 17 files changed, 47 insertions(+), 80 deletions(-) diff --git a/[refs] b/[refs] index afcd4783a7a7..7f3951b6846a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b8fa7d410a8f693db75548c843c3bb1db2d5ed1a +refs/heads/master: e0adb9902fb338a9fe634c3c2a3e474075c733ba diff --git a/trunk/arch/sparc/Makefile b/trunk/arch/sparc/Makefile index ad1fb5d969f3..eddcfb36aafb 100644 --- a/trunk/arch/sparc/Makefile +++ b/trunk/arch/sparc/Makefile @@ -31,7 +31,7 @@ UTS_MACHINE := sparc #KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7 KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 -KBUILD_AFLAGS += -m32 +KBUILD_AFLAGS += -m32 -Wa,-Av8 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000 # Since 2.5.40, the first stage is left not btfix-ed. diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 99389c8dda21..7aee46983be4 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -1934,7 +1934,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) } if (bp->port.pmf) - bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0); + bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); else bnx2x__link_status_update(bp); diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 4f40f7d7d8c6..bf27c54ff2e0 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h @@ -1179,16 +1179,10 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp, */ static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) { - struct bnx2x *bp = fp->bp; - if (!CHIP_IS_E1x(bp)) { -#ifdef BCM_CNIC - /* there are special statistics counters for FCoE 136..140 */ - if (IS_FCOE_FP(fp)) - return bp->cnic_base_cl_id + (bp->pf_num >> 1); -#endif + if (!CHIP_IS_E1x(fp->bp)) return fp->cl_id; - } - return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x; + else + return fp->cl_id + BP_PORT(fp->bp) * FP_SB_MAX_E1x; } static inline void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp, diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c index 6d82ade4c31c..5051cf3deb20 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c @@ -735,9 +735,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state) bp->dcbx_error); /* mark DCBX result for PMF migration */ - bnx2x_update_drv_flags(bp, - 1 << DRV_FLAGS_DCB_CONFIGURED, - 1); + bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 1); #ifdef BCM_DCBNL /* * Add new app tlvs to dcbnl @@ -1022,7 +1020,7 @@ void bnx2x_dcbx_init(struct bnx2x *bp) DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n", dcbx_lldp_params_offset); - bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0); + bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) { bnx2x_dcbx_admin_mib_updated_params(bp, @@ -1859,7 +1857,7 @@ void bnx2x_dcbx_pmf_update(struct bnx2x *bp) * read it from shmem and update bp and netdev accordingly */ if (SHMEM2_HAS(bp, drv_flags) && - GET_FLAGS(SHMEM2_RD(bp, drv_flags), 1 << DRV_FLAGS_DCB_CONFIGURED)) { + GET_FLAGS(SHMEM2_RD(bp, drv_flags), DRV_FLAGS_DCB_CONFIGURED)) { /* Read neg results if dcbx is in the FW */ if (bnx2x_dcbx_read_shmem_neg_results(bp)) return; diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 94110e9ce51d..cb6339c35571 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c @@ -5601,7 +5601,7 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, /* Fill the ramrod data with provided parameters */ rdata->function_mode = cpu_to_le16(start_params->mf_mode); - rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag); + rdata->sd_vlan_tag = start_params->sd_vlan_tag; rdata->path_id = BP_PATH(bp); rdata->network_cos_mode = start_params->network_cos_mode; diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index a766b25eec5f..1adef266fcd5 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c @@ -554,11 +554,23 @@ static void bnx2x_bmac_stats_update(struct bnx2x *bp) UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl); /* collect PFC stats */ + DIFF_64(diff.hi, new->tx_stat_gtpp_hi, + pstats->pfc_frames_tx_hi, + diff.lo, new->tx_stat_gtpp_lo, + pstats->pfc_frames_tx_lo); pstats->pfc_frames_tx_hi = new->tx_stat_gtpp_hi; pstats->pfc_frames_tx_lo = new->tx_stat_gtpp_lo; + ADD_64(pstats->pfc_frames_tx_hi, diff.hi, + pstats->pfc_frames_tx_lo, diff.lo); + DIFF_64(diff.hi, new->rx_stat_grpp_hi, + pstats->pfc_frames_rx_hi, + diff.lo, new->rx_stat_grpp_lo, + pstats->pfc_frames_rx_lo); pstats->pfc_frames_rx_hi = new->rx_stat_grpp_hi; pstats->pfc_frames_rx_lo = new->rx_stat_grpp_lo; + ADD_64(pstats->pfc_frames_rx_hi, diff.hi, + pstats->pfc_frames_rx_lo, diff.lo); } estats->pause_frames_received_hi = diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c index 2d7601dd6660..93c5d72711b0 100644 --- a/trunk/drivers/net/tun.c +++ b/trunk/drivers/net/tun.c @@ -359,7 +359,7 @@ static void tun_free_netdev(struct net_device *dev) { struct tun_struct *tun = netdev_priv(dev); - sk_release_kernel(tun->socket.sk); + sock_put(tun->socket.sk); } /* Net device open. */ @@ -980,18 +980,10 @@ static int tun_recvmsg(struct kiocb *iocb, struct socket *sock, return ret; } -static int tun_release(struct socket *sock) -{ - if (sock->sk) - sock_put(sock->sk); - return 0; -} - /* Ops structure to mimic raw sockets with tun */ static const struct proto_ops tun_socket_ops = { .sendmsg = tun_sendmsg, .recvmsg = tun_recvmsg, - .release = tun_release, }; static struct proto tun_proto = { @@ -1118,11 +1110,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) tun->vnet_hdr_sz = sizeof(struct virtio_net_hdr); err = -ENOMEM; - sk = sk_alloc(&init_net, AF_UNSPEC, GFP_KERNEL, &tun_proto); + sk = sk_alloc(net, AF_UNSPEC, GFP_KERNEL, &tun_proto); if (!sk) goto err_free_dev; - sk_change_net(sk, net); tun->socket.wq = &tun->wq; init_waitqueue_head(&tun->wq.wait); tun->socket.ops = &tun_socket_ops; @@ -1183,7 +1174,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) return 0; err_free_sk: - tun_free_netdev(dev); + sock_put(sk); err_free_dev: free_netdev(dev); failed: diff --git a/trunk/drivers/net/usb/asix.c b/trunk/drivers/net/usb/asix.c index d6da5eed5453..8e84f5bdd6ca 100644 --- a/trunk/drivers/net/usb/asix.c +++ b/trunk/drivers/net/usb/asix.c @@ -1598,10 +1598,6 @@ static const struct usb_device_id products [] = { // Sitecom LN-029 "USB 2.0 10/100 Ethernet adapter" USB_DEVICE (0x6189, 0x182d), .driver_info = (unsigned long) &ax8817x_info, -}, { - // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter" - USB_DEVICE (0x0df6, 0x0056), - .driver_info = (unsigned long) &ax88178_info, }, { // corega FEther USB2-TX USB_DEVICE (0x07aa, 0x0017), diff --git a/trunk/drivers/net/wireless/iwlegacy/3945-mac.c b/trunk/drivers/net/wireless/iwlegacy/3945-mac.c index a7dfba8d164e..54b2d391e91a 100644 --- a/trunk/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/trunk/drivers/net/wireless/iwlegacy/3945-mac.c @@ -2475,7 +2475,7 @@ il3945_bg_alive_start(struct work_struct *data) container_of(data, struct il_priv, alive_start.work); mutex_lock(&il->mutex); - if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL) + if (test_bit(S_EXIT_PENDING, &il->status)) goto out; il3945_alive_start(il); diff --git a/trunk/drivers/net/wireless/iwlegacy/3945.c b/trunk/drivers/net/wireless/iwlegacy/3945.c index c80eb9b31551..1489b1573a6a 100644 --- a/trunk/drivers/net/wireless/iwlegacy/3945.c +++ b/trunk/drivers/net/wireless/iwlegacy/3945.c @@ -1870,12 +1870,11 @@ il3945_bg_reg_txpower_periodic(struct work_struct *work) struct il_priv *il = container_of(work, struct il_priv, _3945.thermal_periodic.work); - mutex_lock(&il->mutex); - if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL) - goto out; + if (test_bit(S_EXIT_PENDING, &il->status)) + return; + mutex_lock(&il->mutex); il3945_reg_txpower_periodic(il); -out: mutex_unlock(&il->mutex); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c index fd356b7c0476..d2a1ea98d0f2 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -426,14 +426,10 @@ void rt2x00lib_txdone(struct queue_entry *entry, /* * If the data queue was below the threshold before the txdone * handler we must make sure the packet queue in the mac80211 stack - * is reenabled when the txdone handler has finished. This has to be - * serialized with rt2x00mac_tx(), otherwise we can wake up queue - * before it was stopped. + * is reenabled when the txdone handler has finished. */ - spin_lock_bh(&entry->queue->tx_lock); if (!rt2x00queue_threshold(entry->queue)) rt2x00queue_unpause_queue(entry->queue); - spin_unlock_bh(&entry->queue->tx_lock); } EXPORT_SYMBOL_GPL(rt2x00lib_txdone); diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c b/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c index 2df2eb6d3e06..ede3c58e6783 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -152,22 +152,13 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false))) goto exit_fail; - /* - * Pausing queue has to be serialized with rt2x00lib_txdone(). Note - * we should not use spin_lock_bh variant as bottom halve was already - * disabled before ieee80211_xmit() call. - */ - spin_lock(&queue->tx_lock); if (rt2x00queue_threshold(queue)) rt2x00queue_pause_queue(queue); - spin_unlock(&queue->tx_lock); return; exit_fail: - spin_lock(&queue->tx_lock); rt2x00queue_pause_queue(queue); - spin_unlock(&queue->tx_lock); exit_free_skb: ieee80211_free_txskb(hw, skb); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c index 9b1b2b7a7807..5adfb3eab9cd 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c @@ -619,9 +619,6 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags)) rt2x00queue_align_frame(skb); - /* - * That function must be called with bh disabled. - */ spin_lock(&queue->tx_lock); if (unlikely(rt2x00queue_full(queue))) { diff --git a/trunk/lib/dynamic_queue_limits.c b/trunk/lib/dynamic_queue_limits.c index 6ab4587d052b..3d1bdcdd7db4 100644 --- a/trunk/lib/dynamic_queue_limits.c +++ b/trunk/lib/dynamic_queue_limits.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #define POSDIFF(A, B) ((A) > (B) ? (A) - (B) : 0) diff --git a/trunk/net/ipv4/syncookies.c b/trunk/net/ipv4/syncookies.c index eab2a7fb15d1..51fdbb490437 100644 --- a/trunk/net/ipv4/syncookies.c +++ b/trunk/net/ipv4/syncookies.c @@ -278,7 +278,6 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, struct rtable *rt; __u8 rcv_wscale; bool ecn_ok = false; - struct flowi4 fl4; if (!sysctl_tcp_syncookies || !th->ack || th->rst) goto out; @@ -347,16 +346,20 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, * hasn't changed since we received the original syn, but I see * no easy way to do this. */ - flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk), - RT_SCOPE_UNIVERSE, IPPROTO_TCP, - inet_sk_flowi_flags(sk), - (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, - ireq->loc_addr, th->source, th->dest); - security_req_classify_flow(req, flowi4_to_flowi(&fl4)); - rt = ip_route_output_key(sock_net(sk), &fl4); - if (IS_ERR(rt)) { - reqsk_free(req); - goto out; + { + struct flowi4 fl4; + + flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk), + RT_SCOPE_UNIVERSE, IPPROTO_TCP, + inet_sk_flowi_flags(sk), + (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, + ireq->loc_addr, th->source, th->dest); + security_req_classify_flow(req, flowi4_to_flowi(&fl4)); + rt = ip_route_output_key(sock_net(sk), &fl4); + if (IS_ERR(rt)) { + reqsk_free(req); + goto out; + } } /* Try to redo what tcp_v4_send_synack did. */ @@ -370,10 +373,5 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, ireq->rcv_wscale = rcv_wscale; ret = get_cookie_sock(sk, skb, req, &rt->dst); - /* ip_queue_xmit() depends on our flow being setup - * Normal sockets get it right from inet_csk_route_child_sock() - */ - if (ret) - inet_sk(ret)->cork.fl.u.ip4 = fl4; out: return ret; } diff --git a/trunk/net/ipv4/tcp_ipv4.c b/trunk/net/ipv4/tcp_ipv4.c index fd54c5f8a255..94d683a61cba 100644 --- a/trunk/net/ipv4/tcp_ipv4.c +++ b/trunk/net/ipv4/tcp_ipv4.c @@ -1466,13 +1466,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; newinet->inet_id = newtp->write_seq ^ jiffies; - if (!dst) { - dst = inet_csk_route_child_sock(sk, newsk, req); - if (!dst) - goto put_and_exit; - } else { - /* syncookie case : see end of cookie_v4_check() */ - } + if (!dst && (dst = inet_csk_route_child_sock(sk, newsk, req)) == NULL) + goto put_and_exit; + sk_setup_caps(newsk, dst); tcp_mtup_init(newsk);