Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking changes from David Miller:
"The most important bit here is the TCP syncookies issue, which seems
to have been busted for some time. That fix has been verified in
production by the reporter.

1) Persistent TUN devices erroneously hold on to the network namespace
in such a way that it cannot be shutdown. Fix from Stanislav
Kinsbursky with help from Eric Dumazet.

2) TCP SYN cookies have been broken for a while due to how the route
lookup flow key is managed, connections can be delayed by as much
as 20 seconds due to this bug. Fix from Eric Dumazet.

3) Missing jiffies.h include in lib/dynamic_queue_limits.c can break
the build, from Tom Herbert.

4) Add USB device ID for Sitecom LN-031, from Joerg Neikes.

5) Fix OOPS in delayed workqueue in iwlegacy, from Stanislaw Gruszka.

6) rt2x00 TX queue can be disabled forever due to races, fix by
synchronizing pause/unpause with a lock. Also from Stanislaw
Gruszka.

7) Statistics and endian fix in bnx2x driver from Yuval Mintz, Eilon
Greenstein, and Ariel Elior."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
tun: don't hold network namespace by tun sockets
bnx2x: FCoE statistics id fixed
bnx2x: dcb bit indices flags used as bits
bnx2x: added cpu_to_le16 when preparing ramrod's data
bnx2x: pfc statistics counts pfc events twice
rt2x00: fix random stalls
iwl3945: fix possible il->txq NULL pointer dereference in delayed works
dql: Fix undefined jiffies
tcp: fix syncookie regression
usb: asix: Patch for Sitecom LN-031

+78 -45
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 1934 1934 } 1935 1935 1936 1936 if (bp->port.pmf) 1937 - bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); 1937 + bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0); 1938 1938 else 1939 1939 bnx2x__link_status_update(bp); 1940 1940
+9 -3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
··· 1179 1179 */ 1180 1180 static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) 1181 1181 { 1182 - if (!CHIP_IS_E1x(fp->bp)) 1182 + struct bnx2x *bp = fp->bp; 1183 + if (!CHIP_IS_E1x(bp)) { 1184 + #ifdef BCM_CNIC 1185 + /* there are special statistics counters for FCoE 136..140 */ 1186 + if (IS_FCOE_FP(fp)) 1187 + return bp->cnic_base_cl_id + (bp->pf_num >> 1); 1188 + #endif 1183 1189 return fp->cl_id; 1184 - else 1185 - return fp->cl_id + BP_PORT(fp->bp) * FP_SB_MAX_E1x; 1190 + } 1191 + return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x; 1186 1192 } 1187 1193 1188 1194 static inline void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp,
+5 -3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
··· 735 735 bp->dcbx_error); 736 736 737 737 /* mark DCBX result for PMF migration */ 738 - bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 1); 738 + bnx2x_update_drv_flags(bp, 739 + 1 << DRV_FLAGS_DCB_CONFIGURED, 740 + 1); 739 741 #ifdef BCM_DCBNL 740 742 /* 741 743 * Add new app tlvs to dcbnl ··· 1022 1020 DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n", 1023 1021 dcbx_lldp_params_offset); 1024 1022 1025 - bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0); 1023 + bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0); 1026 1024 1027 1025 if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) { 1028 1026 bnx2x_dcbx_admin_mib_updated_params(bp, ··· 1859 1857 * read it from shmem and update bp and netdev accordingly 1860 1858 */ 1861 1859 if (SHMEM2_HAS(bp, drv_flags) && 1862 - GET_FLAGS(SHMEM2_RD(bp, drv_flags), DRV_FLAGS_DCB_CONFIGURED)) { 1860 + GET_FLAGS(SHMEM2_RD(bp, drv_flags), 1 << DRV_FLAGS_DCB_CONFIGURED)) { 1863 1861 /* Read neg results if dcbx is in the FW */ 1864 1862 if (bnx2x_dcbx_read_shmem_neg_results(bp)) 1865 1863 return;
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
··· 5601 5601 5602 5602 /* Fill the ramrod data with provided parameters */ 5603 5603 rdata->function_mode = cpu_to_le16(start_params->mf_mode); 5604 - rdata->sd_vlan_tag = start_params->sd_vlan_tag; 5604 + rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag); 5605 5605 rdata->path_id = BP_PATH(bp); 5606 5606 rdata->network_cos_mode = start_params->network_cos_mode; 5607 5607
-12
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
··· 554 554 UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl); 555 555 556 556 /* collect PFC stats */ 557 - DIFF_64(diff.hi, new->tx_stat_gtpp_hi, 558 - pstats->pfc_frames_tx_hi, 559 - diff.lo, new->tx_stat_gtpp_lo, 560 - pstats->pfc_frames_tx_lo); 561 557 pstats->pfc_frames_tx_hi = new->tx_stat_gtpp_hi; 562 558 pstats->pfc_frames_tx_lo = new->tx_stat_gtpp_lo; 563 - ADD_64(pstats->pfc_frames_tx_hi, diff.hi, 564 - pstats->pfc_frames_tx_lo, diff.lo); 565 559 566 - DIFF_64(diff.hi, new->rx_stat_grpp_hi, 567 - pstats->pfc_frames_rx_hi, 568 - diff.lo, new->rx_stat_grpp_lo, 569 - pstats->pfc_frames_rx_lo); 570 560 pstats->pfc_frames_rx_hi = new->rx_stat_grpp_hi; 571 561 pstats->pfc_frames_rx_lo = new->rx_stat_grpp_lo; 572 - ADD_64(pstats->pfc_frames_rx_hi, diff.hi, 573 - pstats->pfc_frames_rx_lo, diff.lo); 574 562 } 575 563 576 564 estats->pause_frames_received_hi =
+12 -3
drivers/net/tun.c
··· 359 359 { 360 360 struct tun_struct *tun = netdev_priv(dev); 361 361 362 - sock_put(tun->socket.sk); 362 + sk_release_kernel(tun->socket.sk); 363 363 } 364 364 365 365 /* Net device open. */ ··· 980 980 return ret; 981 981 } 982 982 983 + static int tun_release(struct socket *sock) 984 + { 985 + if (sock->sk) 986 + sock_put(sock->sk); 987 + return 0; 988 + } 989 + 983 990 /* Ops structure to mimic raw sockets with tun */ 984 991 static const struct proto_ops tun_socket_ops = { 985 992 .sendmsg = tun_sendmsg, 986 993 .recvmsg = tun_recvmsg, 994 + .release = tun_release, 987 995 }; 988 996 989 997 static struct proto tun_proto = { ··· 1118 1110 tun->vnet_hdr_sz = sizeof(struct virtio_net_hdr); 1119 1111 1120 1112 err = -ENOMEM; 1121 - sk = sk_alloc(net, AF_UNSPEC, GFP_KERNEL, &tun_proto); 1113 + sk = sk_alloc(&init_net, AF_UNSPEC, GFP_KERNEL, &tun_proto); 1122 1114 if (!sk) 1123 1115 goto err_free_dev; 1124 1116 1117 + sk_change_net(sk, net); 1125 1118 tun->socket.wq = &tun->wq; 1126 1119 init_waitqueue_head(&tun->wq.wait); 1127 1120 tun->socket.ops = &tun_socket_ops; ··· 1183 1174 return 0; 1184 1175 1185 1176 err_free_sk: 1186 - sock_put(sk); 1177 + tun_free_netdev(dev); 1187 1178 err_free_dev: 1188 1179 free_netdev(dev); 1189 1180 failed:
+4
drivers/net/usb/asix.c
··· 1599 1599 USB_DEVICE (0x6189, 0x182d), 1600 1600 .driver_info = (unsigned long) &ax8817x_info, 1601 1601 }, { 1602 + // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter" 1603 + USB_DEVICE (0x0df6, 0x0056), 1604 + .driver_info = (unsigned long) &ax88178_info, 1605 + }, { 1602 1606 // corega FEther USB2-TX 1603 1607 USB_DEVICE (0x07aa, 0x0017), 1604 1608 .driver_info = (unsigned long) &ax8817x_info,
+1 -1
drivers/net/wireless/iwlegacy/3945-mac.c
··· 2475 2475 container_of(data, struct il_priv, alive_start.work); 2476 2476 2477 2477 mutex_lock(&il->mutex); 2478 - if (test_bit(S_EXIT_PENDING, &il->status)) 2478 + if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL) 2479 2479 goto out; 2480 2480 2481 2481 il3945_alive_start(il);
+4 -3
drivers/net/wireless/iwlegacy/3945.c
··· 1870 1870 struct il_priv *il = container_of(work, struct il_priv, 1871 1871 _3945.thermal_periodic.work); 1872 1872 1873 - if (test_bit(S_EXIT_PENDING, &il->status)) 1874 - return; 1875 - 1876 1873 mutex_lock(&il->mutex); 1874 + if (test_bit(S_EXIT_PENDING, &il->status) || il->txq == NULL) 1875 + goto out; 1876 + 1877 1877 il3945_reg_txpower_periodic(il); 1878 + out: 1878 1879 mutex_unlock(&il->mutex); 1879 1880 } 1880 1881
+5 -1
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 426 426 /* 427 427 * If the data queue was below the threshold before the txdone 428 428 * handler we must make sure the packet queue in the mac80211 stack 429 - * is reenabled when the txdone handler has finished. 429 + * is reenabled when the txdone handler has finished. This has to be 430 + * serialized with rt2x00mac_tx(), otherwise we can wake up queue 431 + * before it was stopped. 430 432 */ 433 + spin_lock_bh(&entry->queue->tx_lock); 431 434 if (!rt2x00queue_threshold(entry->queue)) 432 435 rt2x00queue_unpause_queue(entry->queue); 436 + spin_unlock_bh(&entry->queue->tx_lock); 433 437 } 434 438 EXPORT_SYMBOL_GPL(rt2x00lib_txdone); 435 439
+9
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 152 152 if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false))) 153 153 goto exit_fail; 154 154 155 + /* 156 + * Pausing queue has to be serialized with rt2x00lib_txdone(). Note 157 + * we should not use spin_lock_bh variant as bottom halve was already 158 + * disabled before ieee80211_xmit() call. 159 + */ 160 + spin_lock(&queue->tx_lock); 155 161 if (rt2x00queue_threshold(queue)) 156 162 rt2x00queue_pause_queue(queue); 163 + spin_unlock(&queue->tx_lock); 157 164 158 165 return; 159 166 160 167 exit_fail: 168 + spin_lock(&queue->tx_lock); 161 169 rt2x00queue_pause_queue(queue); 170 + spin_unlock(&queue->tx_lock); 162 171 exit_free_skb: 163 172 ieee80211_free_txskb(hw, skb); 164 173 }
+3
drivers/net/wireless/rt2x00/rt2x00queue.c
··· 619 619 else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags)) 620 620 rt2x00queue_align_frame(skb); 621 621 622 + /* 623 + * That function must be called with bh disabled. 624 + */ 622 625 spin_lock(&queue->tx_lock); 623 626 624 627 if (unlikely(rt2x00queue_full(queue))) {
+1
lib/dynamic_queue_limits.c
··· 7 7 #include <linux/types.h> 8 8 #include <linux/ctype.h> 9 9 #include <linux/kernel.h> 10 + #include <linux/jiffies.h> 10 11 #include <linux/dynamic_queue_limits.h> 11 12 12 13 #define POSDIFF(A, B) ((A) > (B) ? (A) - (B) : 0)
+16 -14
net/ipv4/syncookies.c
··· 278 278 struct rtable *rt; 279 279 __u8 rcv_wscale; 280 280 bool ecn_ok = false; 281 + struct flowi4 fl4; 281 282 282 283 if (!sysctl_tcp_syncookies || !th->ack || th->rst) 283 284 goto out; ··· 347 346 * hasn't changed since we received the original syn, but I see 348 347 * no easy way to do this. 349 348 */ 350 - { 351 - struct flowi4 fl4; 352 - 353 - flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk), 354 - RT_SCOPE_UNIVERSE, IPPROTO_TCP, 355 - inet_sk_flowi_flags(sk), 356 - (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, 357 - ireq->loc_addr, th->source, th->dest); 358 - security_req_classify_flow(req, flowi4_to_flowi(&fl4)); 359 - rt = ip_route_output_key(sock_net(sk), &fl4); 360 - if (IS_ERR(rt)) { 361 - reqsk_free(req); 362 - goto out; 363 - } 349 + flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk), 350 + RT_SCOPE_UNIVERSE, IPPROTO_TCP, 351 + inet_sk_flowi_flags(sk), 352 + (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, 353 + ireq->loc_addr, th->source, th->dest); 354 + security_req_classify_flow(req, flowi4_to_flowi(&fl4)); 355 + rt = ip_route_output_key(sock_net(sk), &fl4); 356 + if (IS_ERR(rt)) { 357 + reqsk_free(req); 358 + goto out; 364 359 } 365 360 366 361 /* Try to redo what tcp_v4_send_synack did. */ ··· 370 373 ireq->rcv_wscale = rcv_wscale; 371 374 372 375 ret = get_cookie_sock(sk, skb, req, &rt->dst); 376 + /* ip_queue_xmit() depends on our flow being setup 377 + * Normal sockets get it right from inet_csk_route_child_sock() 378 + */ 379 + if (ret) 380 + inet_sk(ret)->cork.fl.u.ip4 = fl4; 373 381 out: return ret; 374 382 }
+7 -3
net/ipv4/tcp_ipv4.c
··· 1466 1466 inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; 1467 1467 newinet->inet_id = newtp->write_seq ^ jiffies; 1468 1468 1469 - if (!dst && (dst = inet_csk_route_child_sock(sk, newsk, req)) == NULL) 1470 - goto put_and_exit; 1471 - 1469 + if (!dst) { 1470 + dst = inet_csk_route_child_sock(sk, newsk, req); 1471 + if (!dst) 1472 + goto put_and_exit; 1473 + } else { 1474 + /* syncookie case : see end of cookie_v4_check() */ 1475 + } 1472 1476 sk_setup_caps(newsk, dst); 1473 1477 1474 1478 tcp_mtup_init(newsk);