History

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

Pull networking fixes from David Miller: 1) Various VTI tunnel (mark handling, PMTU) bug fixes from Alexander Duyck and Steffen Klassert. 2) Revert ethtool PHY query change, it wasn't correct. The PHY address selected by the driver running the PHY to MAC connection decides what PHY address GET ethtool operations return information from. 3) Fix handling of sequence number bits for encryption IV generation in ESP driver, from Herbert Xu. 4) UDP can return -EAGAIN when we hit a bad checksum on receive, even when there are other packets in the receive queue which is wrong. Just respect the error returned from the generic socket recv datagram helper. From Eric Dumazet. 5) Fix BNA driver firmware loading on big-endian systems, from Ivan Vecera. 6) Fix regression in that we were inheriting the congestion control of the listening socket for new connections, the intended behavior always was to use the default in this case. From Neal Cardwell. 7) Fix NULL deref in brcmfmac driver, from Arend van Spriel. 8) OTP parsing fix in iwlwifi from Liad Kaufman. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) vti6: Add pmtu handling to vti6_xmit. Revert "net: core: 'ethtool' issue with querying phy settings" bnx2x: Move statistics implementation into semaphores xen: netback: read hotplug script once at start of day. xen: netback: fix printf format string warning Revert "netfilter: ensure number of counters is >0 in do_replace()" net: dsa: Properly propagate errors from dsa_switch_setup_one tcp: fix child sockets to use system default congestion control if not set udp: fix behavior of wrong checksums sfc: free multiple Rx buffers when required bna: fix soft lock-up during firmware initialization failure bna: remove unreasonable iocpf timer start bna: fix firmware loading on big-endian machines bridge: fix br_multicast_query_expired() bug via-rhine: Resigning as maintainer brcmfmac: avoid null pointer access when brcmf_msgbuf_get_pktid() fails mac80211: Fix mac80211.h docbook comments iwlwifi: nvm: fix otp parsing in 8000 hw family iwlwifi: pcie: fix tracking of cmd_in_flight ip_vti/ip6_vti: Preserve skb->mark after rcv_cb call ...

Linus Torvalds committed 11 years ago

Commit c46a0242 parents 2459c60 e45358132 files · +174 −119Browse files

Unified · Split

32 files
  1. MAINTAINERS +1 −2
  2. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 −1
  3. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +5 −4
  4. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +14 −6
  5. drivers/net/ethernet/brocade/bna/bfa_ioc.c +2 −2
  6. drivers/net/ethernet/brocade/bna/bnad.c +0 −4
  7. drivers/net/ethernet/brocade/bna/cna_fwimg.c +7 −0
  8. drivers/net/ethernet/sfc/rx.c +25 −17
  9. drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +5 −7
  10. drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +1 −1
  11. drivers/net/wireless/iwlwifi/pcie/internal.h +3 −3
  12. drivers/net/wireless/iwlwifi/pcie/trans.c +2 −2
  13. drivers/net/wireless/iwlwifi/pcie/tx.c +9 −14
  14. drivers/net/xen-netback/netback.c +1 −1
  15. drivers/net/xen-netback/xenbus.c +19 −14
  16. include/net/inet_connection_sock.h +2 −1
  17. include/net/mac80211.h +4 −3
  18. net/bridge/br_multicast.c +1 −1
  19. net/bridge/netfilter/ebtables.c +0 −4
  20. net/core/ethtool.c +1 −9
  21. net/dsa/dsa.c +2 −2
  22. net/ipv4/esp4.c +2 −1
  23. net/ipv4/ip_vti.c +10 −4
  24. net/ipv4/tcp_cong.c +4 −1
  25. net/ipv4/tcp_minisocks.c +4 −1
  26. net/ipv4/udp.c +2 −4
  27. net/ipv6/esp6.c +2 −1
  28. net/ipv6/ip6_vti.c +24 −3
  29. net/ipv6/udp.c +2 −4
  30. net/xfrm/xfrm_input.c +16 −1
  31. net/xfrm/xfrm_replay.c +2 −0
  32. net/xfrm/xfrm_state.c +1 −1
MAINTAINERS+1−2
@@ -10587,8 +10587,7 @@ F: drivers/virtio/virtio_input.c · 10586 unmodified lines
1058710587 F: include/uapi/linux/virtio_input.h
1058810588
1058910589 VIA RHINE NETWORK DRIVER
10590−M: Roger Luethi <rl@hellgate.ch>
10591−S: Maintained
10590+S: Orphan
1059210591 F: drivers/net/ethernet/via/via-rhine.c
1059310592
1059410593 VIA SD/MMC CARD CONTROLLER DRIVER
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+1−1
@@ -1774,7 +1774,7 @@ struct bnx2x { · 1773 unmodified lines
17741774 int stats_state;
17751775
17761776 /* used for synchronization of concurrent threads statistics handling */
1777− struct mutex stats_lock;
1777+ struct semaphore stats_lock;
17781778
17791779 /* used by dmae command loader */
17801780 struct dmae_command stats_dmae;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+5−4
@@ -12054,7 +12054,7 @@ static int bnx2x_init_bp(struct bnx2x *bp) · 12053 unmodified lines
1205412054 mutex_init(&bp->port.phy_mutex);
1205512055 mutex_init(&bp->fw_mb_mutex);
1205612056 mutex_init(&bp->drv_info_mutex);
12057− mutex_init(&bp->stats_lock);
12057+ sema_init(&bp->stats_lock, 1);
1205812058 bp->drv_info_mng_owner = false;
1205912059
1206012060 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
@@ -13690,9 +13690,10 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) · 1629 unmodified lines
1369013690 cancel_delayed_work_sync(&bp->sp_task);
1369113691 cancel_delayed_work_sync(&bp->period_task);
1369213692
13693− mutex_lock(&bp->stats_lock);
13694− bp->stats_state = STATS_STATE_DISABLED;
13695− mutex_unlock(&bp->stats_lock);
13693+ if (!down_timeout(&bp->stats_lock, HZ / 10)) {
13694+ bp->stats_state = STATS_STATE_DISABLED;
13695+ up(&bp->stats_lock);
13696+ }
1369613697
1369713698 bnx2x_save_statistics(bp);
1369813699
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+14−6
@@ -1372,19 +1372,23 @@ void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) · 1371 unmodified lines
13721372 * that context in case someone is in the middle of a transition.
13731373 * For other events, wait a bit until lock is taken.
13741374 */
1375− if (!mutex_trylock(&bp->stats_lock)) {
1375+ if (down_trylock(&bp->stats_lock)) {
13761376 if (event == STATS_EVENT_UPDATE)
13771377 return;
13781378
13791379 DP(BNX2X_MSG_STATS,
13801380 "Unlikely stats' lock contention [event %d]\n", event);
1381− mutex_lock(&bp->stats_lock);
1381+ if (unlikely(down_timeout(&bp->stats_lock, HZ / 10))) {
1382+ BNX2X_ERR("Failed to take stats lock [event %d]\n",
1383+ event);
1384+ return;
1385+ }
13821386 }
13831387
13841388 bnx2x_stats_stm[state][event].action(bp);
13851389 bp->stats_state = bnx2x_stats_stm[state][event].next_state;
13861390
1387− mutex_unlock(&bp->stats_lock);
1391+ up(&bp->stats_lock);
13881392
13891393 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
13901394 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
@@ -1970,7 +1974,11 @@ int bnx2x_stats_safe_exec(struct bnx2x *bp, · 579 unmodified lines
19701974 /* Wait for statistics to end [while blocking further requests],
19711975 * then run supplied function 'safely'.
19721976 */
1973− mutex_lock(&bp->stats_lock);
1977+ rc = down_timeout(&bp->stats_lock, HZ / 10);
1978+ if (unlikely(rc)) {
1979+ BNX2X_ERR("Failed to take statistics lock for safe execution\n");
1980+ goto out_no_lock;
1981+ }
19741982
19751983 bnx2x_stats_comp(bp);
19761984 while (bp->stats_pending && cnt--)
@@ -1988,7 +1996,7 @@ out: · 11 unmodified lines
19881996 /* No need to restart statistics - if they're enabled, the timer
19891997 * will restart the statistics.
19901998 */
1991− mutex_unlock(&bp->stats_lock);
1992−
1999+ up(&bp->stats_lock);
2000+out_no_lock:
19932001 return rc;
19942002 }
drivers/net/ethernet/brocade/bna/bfa_ioc.c+2−2
@@ -2414,7 +2414,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, enum bfi_fwboot_type boot_type, · 2413 unmodified lines
24142414 if (status == BFA_STATUS_OK)
24152415 bfa_ioc_lpu_start(ioc);
24162416 else
2417− bfa_nw_iocpf_timeout(ioc);
2417+ bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT);
24182418
24192419 return status;
24202420 }
@@ -3029,7 +3029,7 @@ bfa_ioc_poll_fwinit(struct bfa_ioc *ioc) · 608 unmodified lines
30293029 }
30303030
30313031 if (ioc->iocpf.poll_time >= BFA_IOC_TOV) {
3032− bfa_nw_iocpf_timeout(ioc);
3032+ bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT);
30333033 } else {
30343034 ioc->iocpf.poll_time += BFA_IOC_POLL_TOV;
30353035 mod_timer(&ioc->iocpf_timer, jiffies +
drivers/net/ethernet/brocade/bna/bnad.c+0−4
@@ -3701,10 +3701,6 @@ bnad_pci_probe(struct pci_dev *pdev, · 3700 unmodified lines
37013701 setup_timer(&bnad->bna.ioceth.ioc.sem_timer, bnad_iocpf_sem_timeout,
37023702 ((unsigned long)bnad));
37033703
3704− /* Now start the timer before calling IOC */
3705− mod_timer(&bnad->bna.ioceth.ioc.iocpf_timer,
3706− jiffies + msecs_to_jiffies(BNA_IOC_TIMER_FREQ));
3707−
37083704 /*
37093705 * Start the chip
37103706 * If the call back comes with error, we bail out.
drivers/net/ethernet/brocade/bna/cna_fwimg.c+7−0
@@ -30,6 +30,7 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image, · 29 unmodified lines
3030 u32 *bfi_image_size, char *fw_name)
3131 {
3232 const struct firmware *fw;
33+ u32 n;
3334
3435 if (request_firmware(&fw, fw_name, &pdev->dev)) {
3536 pr_alert("Can't locate firmware %s\n", fw_name);
@@ -40,6 +41,12 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image, · 4 unmodified lines
4041 *bfi_image_size = fw->size/sizeof(u32);
4142 bfi_fw = fw;
4243
44+ /* Convert loaded firmware to host order as it is stored in file
45+ * as sequence of LE32 integers.
46+ */
47+ for (n = 0; n < *bfi_image_size; n++)
48+ le32_to_cpus(*bfi_image + n);
49+
4350 return *bfi_image;
4451 error:
4552 return NULL;
drivers/net/ethernet/sfc/rx.c+25−17
@@ -224,12 +224,17 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx, · 223 unmodified lines
224224 }
225225 }
226226
227−static void efx_free_rx_buffer(struct efx_rx_buffer *rx_buf)
227+static void efx_free_rx_buffers(struct efx_rx_queue *rx_queue,
228+ struct efx_rx_buffer *rx_buf,
229+ unsigned int num_bufs)
228230 {
229− if (rx_buf->page) {
230− put_page(rx_buf->page);
231− rx_buf->page = NULL;
232− }
231+ do {
232+ if (rx_buf->page) {
233+ put_page(rx_buf->page);
234+ rx_buf->page = NULL;
235+ }
236+ rx_buf = efx_rx_buf_next(rx_queue, rx_buf);
237+ } while (--num_bufs);
233238 }
234239
235240 /* Attempt to recycle the page if there is an RX recycle ring; the page can
@@ -278,7 +283,7 @@ static void efx_fini_rx_buffer(struct efx_rx_queue *rx_queue, · 42 unmodified lines
278283 /* If this is the last buffer in a page, unmap and free it. */
279284 if (rx_buf->flags & EFX_RX_BUF_LAST_IN_PAGE) {
280285 efx_unmap_rx_buffer(rx_queue->efx, rx_buf);
281− efx_free_rx_buffer(rx_buf);
286+ efx_free_rx_buffers(rx_queue, rx_buf, 1);
282287 }
283288 rx_buf->page = NULL;
284289 }
@@ -304,10 +309,7 @@ static void efx_discard_rx_packet(struct efx_channel *channel, · 19 unmodified lines
304309
305310 efx_recycle_rx_pages(channel, rx_buf, n_frags);
306311
307− do {
308− efx_free_rx_buffer(rx_buf);
309− rx_buf = efx_rx_buf_next(rx_queue, rx_buf);
310− } while (--n_frags);
312+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);
311313 }
312314
313315 /**
@@ -431,11 +433,10 @@ efx_rx_packet_gro(struct efx_channel *channel, struct efx_rx_buffer *rx_buf, · 117 unmodified lines
431433
432434 skb = napi_get_frags(napi);
433435 if (unlikely(!skb)) {
434− while (n_frags--) {
435− put_page(rx_buf->page);
436− rx_buf->page = NULL;
437− rx_buf = efx_rx_buf_next(&channel->rx_queue, rx_buf);
438− }
436+ struct efx_rx_queue *rx_queue;
437+
438+ rx_queue = efx_channel_get_rx_queue(channel);
439+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);
439440 return;
440441 }
441442
@@ -622,7 +623,10 @@ static void efx_rx_deliver(struct efx_channel *channel, u8 *eh, · 180 unmodified lines
622623
623624 skb = efx_rx_mk_skb(channel, rx_buf, n_frags, eh, hdr_len);
624625 if (unlikely(skb == NULL)) {
625− efx_free_rx_buffer(rx_buf);
626+ struct efx_rx_queue *rx_queue;
627+
628+ rx_queue = efx_channel_get_rx_queue(channel);
629+ efx_free_rx_buffers(rx_queue, rx_buf, n_frags);
626630 return;
627631 }
628632 skb_record_rx_queue(skb, channel->rx_queue.core_index);
@@ -661,8 +665,12 @@ void __efx_rx_packet(struct efx_channel *channel) · 32 unmodified lines
661665 * loopback layer, and free the rx_buf here
662666 */
663667 if (unlikely(efx->loopback_selftest)) {
668+ struct efx_rx_queue *rx_queue;
669+
664670 efx_loopback_rx_packet(efx, eh, rx_buf->len);
665− efx_free_rx_buffer(rx_buf);
671+ rx_queue = efx_channel_get_rx_queue(channel);
672+ efx_free_rx_buffers(rx_queue, rx_buf,
673+ channel->rx_pkt_n_frags);
666674 goto out;
667675 }
668676
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c+5−7
@@ -511,11 +511,9 @@ static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx, · 510 unmodified lines
511511 msgbuf->rx_pktids,
512512 msgbuf->ioctl_resp_pktid);
513513 if (msgbuf->ioctl_resp_ret_len != 0) {
514− if (!skb) {
515− brcmf_err("Invalid packet id idx recv'd %d\n",
516− msgbuf->ioctl_resp_pktid);
514+ if (!skb)
517515 return -EBADF;
518− }
516+
519517 memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?
520518 len : msgbuf->ioctl_resp_ret_len);
521519 }
@@ -874,10 +872,8 @@ brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf) · 352 unmodified lines
874872 flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS;
875873 skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
876874 msgbuf->tx_pktids, idx);
877− if (!skb) {
878− brcmf_err("Invalid packet id idx recv'd %d\n", idx);
875+ if (!skb)
879876 return;
880− }
881877
882878 set_bit(flowid, msgbuf->txstatus_done_map);
883879 commonring = msgbuf->flowrings[flowid];
@@ -1156,6 +1152,8 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf) · 272 unmodified lines
11561152
11571153 skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,
11581154 msgbuf->rx_pktids, idx);
1155+ if (!skb)
1156+ return;
11591157
11601158 if (data_offset)
11611159 skb_pull(skb, data_offset);
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c+1−1
@@ -471,7 +471,7 @@ static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw, · 470 unmodified lines
471471 if (cfg->device_family != IWL_DEVICE_FAMILY_8000)
472472 return le16_to_cpup(nvm_sw + RADIO_CFG);
473473
474− return le32_to_cpup((__le32 *)(nvm_sw + RADIO_CFG_FAMILY_8000));
474+ return le32_to_cpup((__le32 *)(phy_sku + RADIO_CFG_FAMILY_8000));
475475
476476 }
477477
drivers/net/wireless/iwlwifi/pcie/internal.h+3−3
@@ -1,7 +1,7 @@
11 /******************************************************************************
22 *
3− * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
4− * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
3+ * Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved.
4+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
55 *
66 * Portions of this file are derived from the ipw3945 project, as well
77 * as portions of the ieee80211 subsystem header files.
@@ -320,7 +320,7 @@ struct iwl_trans_pcie { · 312 unmodified lines
320320
321321 /*protect hw register */
322322 spinlock_t reg_lock;
323− bool cmd_in_flight;
323+ bool cmd_hold_nic_awake;
324324 bool ref_cmd_in_flight;
325325
326326 /* protect ref counter */
drivers/net/wireless/iwlwifi/pcie/trans.c+2−2
@@ -1372,7 +1372,7 @@ static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent, · 1371 unmodified lines
13721372
13731373 spin_lock_irqsave(&trans_pcie->reg_lock, *flags);
13741374
1375− if (trans_pcie->cmd_in_flight)
1375+ if (trans_pcie->cmd_hold_nic_awake)
13761376 goto out;
13771377
13781378 /* this bit wakes up the NIC */
@@ -1438,7 +1438,7 @@ static void iwl_trans_pcie_release_nic_access(struct iwl_trans *trans, · 59 unmodified lines
14381438 */
14391439 __acquire(&trans_pcie->reg_lock);
14401440
1441− if (trans_pcie->cmd_in_flight)
1441+ if (trans_pcie->cmd_hold_nic_awake)
14421442 goto out;
14431443
14441444 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
drivers/net/wireless/iwlwifi/pcie/tx.c+9−14
@@ -1039,18 +1039,14 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, · 1038 unmodified lines
10391039 iwl_trans_pcie_ref(trans);
10401040 }
10411041
1042− if (trans_pcie->cmd_in_flight)
1043− return 0;
1044−
1045− trans_pcie->cmd_in_flight = true;
1046−
10471042 /*
10481043 * wake up the NIC to make sure that the firmware will see the host
10491044 * command - we will let the NIC sleep once all the host commands
10501045 * returned. This needs to be done only on NICs that have
10511046 * apmg_wake_up_wa set.
10521047 */
1053− if (trans->cfg->base_params->apmg_wake_up_wa) {
1048+ if (trans->cfg->base_params->apmg_wake_up_wa &&
1049+ !trans_pcie->cmd_hold_nic_awake) {
10541050 __iwl_trans_pcie_set_bit(trans, CSR_GP_CNTRL,
10551051 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
10561052 if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)
@@ -1064,10 +1060,10 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, · 7 unmodified lines
10641060 if (ret < 0) {
10651061 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
10661062 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1067− trans_pcie->cmd_in_flight = false;
10681063 IWL_ERR(trans, "Failed to wake NIC for hcmd\n");
10691064 return -EIO;
10701065 }
1066+ trans_pcie->cmd_hold_nic_awake = true;
10711067 }
10721068
10731069 return 0;
@@ -1085,15 +1081,14 @@ static int iwl_pcie_clear_cmd_in_flight(struct iwl_trans *trans) · 11 unmodified lines
10851081 iwl_trans_pcie_unref(trans);
10861082 }
10871083
1088− if (WARN_ON(!trans_pcie->cmd_in_flight))
1089− return 0;
1090−
1091− trans_pcie->cmd_in_flight = false;
1084+ if (trans->cfg->base_params->apmg_wake_up_wa) {
1085+ if (WARN_ON(!trans_pcie->cmd_hold_nic_awake))
1086+ return 0;
10921087
1093− if (trans->cfg->base_params->apmg_wake_up_wa)
1088+ trans_pcie->cmd_hold_nic_awake = false;
10941089 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
1095− CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1096−
1090+ CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1091+ }
10971092 return 0;
10981093 }
10991094
drivers/net/xen-netback/netback.c+1−1
@@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue, · 1249 unmodified lines
12501250 netdev_err(queue->vif->dev,
12511251 "txreq.offset: %x, size: %u, end: %lu\n",
12521252 txreq.offset, txreq.size,
1253− (txreq.offset&~PAGE_MASK) + txreq.size);
1253+ (unsigned long)(txreq.offset&~PAGE_MASK) + txreq.size);
12541254 xenvif_fatal_tx_err(queue->vif);
12551255 break;
12561256 }
drivers/net/xen-netback/xenbus.c+19−14
@@ -34,6 +34,8 @@ struct backend_info { · 33 unmodified lines
3434 enum xenbus_state frontend_state;
3535 struct xenbus_watch hotplug_status_watch;
3636 u8 have_hotplug_status_watch:1;
37+
38+ const char *hotplug_script;
3739 };
3840
3941 static int connect_rings(struct backend_info *be, struct xenvif_queue *queue);
@@ -238,6 +240,7 @@ static int netback_remove(struct xenbus_device *dev) · 198 unmodified lines
238240 xenvif_free(be->vif);
239241 be->vif = NULL;
240242 }
243+ kfree(be->hotplug_script);
241244 kfree(be);
242245 dev_set_drvdata(&dev->dev, NULL);
243246 return 0;
@@ -255,6 +258,7 @@ static int netback_probe(struct xenbus_device *dev, · 11 unmodified lines
255258 struct xenbus_transaction xbt;
256259 int err;
257260 int sg;
261+ const char *script;
258262 struct backend_info *be = kzalloc(sizeof(struct backend_info),
259263 GFP_KERNEL);
260264 if (!be) {
@@ -347,6 +351,15 @@ static int netback_probe(struct xenbus_device *dev, · 86 unmodified lines
347351 if (err)
348352 pr_debug("Error writing multi-queue-max-queues\n");
349353
354+ script = xenbus_read(XBT_NIL, dev->nodename, "script", NULL);
355+ if (IS_ERR(script)) {
356+ err = PTR_ERR(script);
357+ xenbus_dev_fatal(dev, err, "reading script");
358+ goto fail;
359+ }
360+
361+ be->hotplug_script = script;
362+
350363 err = xenbus_switch_state(dev, XenbusStateInitWait);
351364 if (err)
352365 goto fail;
@@ -379,22 +392,14 @@ static int netback_uevent(struct xenbus_device *xdev, · 26 unmodified lines
379392 struct kobj_uevent_env *env)
380393 {
381394 struct backend_info *be = dev_get_drvdata(&xdev->dev);
382− char *val;
383395
384− val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
385− if (IS_ERR(val)) {
386− int err = PTR_ERR(val);
387− xenbus_dev_fatal(xdev, err, "reading script");
388− return err;
389− } else {
390− if (add_uevent_var(env, "script=%s", val)) {
391− kfree(val);
392− return -ENOMEM;
393− }
394− kfree(val);
395− }
396+ if (!be)
397+ return 0;
398+
399+ if (add_uevent_var(env, "script=%s", be->hotplug_script))
400+ return -ENOMEM;
396401
397− if (!be || !be->vif)
402+ if (!be->vif)
398403 return 0;
399404
400405 return add_uevent_var(env, "vif=%s", be->vif->dev->name);
include/net/inet_connection_sock.h+2−1
@@ -98,7 +98,8 @@ struct inet_connection_sock { · 97 unmodified lines
9898 const struct tcp_congestion_ops *icsk_ca_ops;
9999 const struct inet_connection_sock_af_ops *icsk_af_ops;
100100 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
101− __u8 icsk_ca_state:7,
101+ __u8 icsk_ca_state:6,
102+ icsk_ca_setsockopt:1,
102103 icsk_ca_dst_locked:1;
103104 __u8 icsk_retransmits;
104105 __u8 icsk_pending;
include/net/mac80211.h+4−3
@@ -354,7 +354,7 @@ enum ieee80211_rssi_event_data { · 353 unmodified lines
354354 };
355355
356356 /**
357− * enum ieee80211_rssi_event - data attached to an %RSSI_EVENT
357+ * struct ieee80211_rssi_event - data attached to an %RSSI_EVENT
358358 * @data: See &enum ieee80211_rssi_event_data
359359 */
360360 struct ieee80211_rssi_event {
@@ -388,7 +388,7 @@ enum ieee80211_mlme_event_status { · 27 unmodified lines
388388 };
389389
390390 /**
391− * enum ieee80211_mlme_event - data attached to an %MLME_EVENT
391+ * struct ieee80211_mlme_event - data attached to an %MLME_EVENT
392392 * @data: See &enum ieee80211_mlme_event_data
393393 * @status: See &enum ieee80211_mlme_event_status
394394 * @reason: the reason code if applicable
@@ -401,9 +401,10 @@ struct ieee80211_mlme_event { · 6 unmodified lines
401401
402402 /**
403403 * struct ieee80211_event - event to be sent to the driver
404− * @type The event itself. See &enum ieee80211_event_type.
404+ * @type: The event itself. See &enum ieee80211_event_type.
405405 * @rssi: relevant if &type is %RSSI_EVENT
406406 * @mlme: relevant if &type is %AUTH_EVENT
407+ * @u: union holding the above two fields
407408 */
408409 struct ieee80211_event {
409410 enum ieee80211_event_type type;
net/bridge/br_multicast.c+1−1
@@ -1822,7 +1822,7 @@ static void br_multicast_query_expired(struct net_bridge *br, · 1821 unmodified lines
18221822 if (query->startup_sent < br->multicast_startup_query_count)
18231823 query->startup_sent++;
18241824
1825− RCU_INIT_POINTER(querier, NULL);
1825+ RCU_INIT_POINTER(querier->port, NULL);
18261826 br_multicast_send_query(br, NULL, query);
18271827 spin_unlock(&br->multicast_lock);
18281828 }
net/bridge/netfilter/ebtables.c+0−4
@@ -1117,8 +1117,6 @@ static int do_replace(struct net *net, const void __user *user, · 1116 unmodified lines
11171117 return -ENOMEM;
11181118 if (tmp.num_counters >= INT_MAX / sizeof(struct ebt_counter))
11191119 return -ENOMEM;
1120− if (tmp.num_counters == 0)
1121− return -EINVAL;
11221120
11231121 tmp.name[sizeof(tmp.name) - 1] = 0;
11241122
@@ -2161,8 +2159,6 @@ static int compat_copy_ebt_replace_from_user(struct ebt_replace *repl, · 1036 unmodified lines
21612159 return -ENOMEM;
21622160 if (tmp.num_counters >= INT_MAX / sizeof(struct ebt_counter))
21632161 return -ENOMEM;
2164− if (tmp.num_counters == 0)
2165− return -EINVAL;
21662162
21672163 memcpy(repl, &tmp, offsetof(struct ebt_replace, hook_entry));
21682164
net/core/ethtool.c+1−9
@@ -359,15 +359,7 @@ static int ethtool_get_settings(struct net_device *dev, void __user *useraddr) · 358 unmodified lines
359359 int err;
360360 struct ethtool_cmd cmd;
361361
362− if (!dev->ethtool_ops->get_settings)
363− return -EOPNOTSUPP;
364−
365− if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
366− return -EFAULT;
367−
368− cmd.cmd = ETHTOOL_GSET;
369−
370− err = dev->ethtool_ops->get_settings(dev, &cmd);
362+ err = __ethtool_get_settings(dev, &cmd);
371363 if (err < 0)
372364 return err;
373365
net/dsa/dsa.c+2−2
@@ -359,7 +359,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, · 358 unmodified lines
359359 */
360360 ds = kzalloc(sizeof(*ds) + drv->priv_size, GFP_KERNEL);
361361 if (ds == NULL)
362− return NULL;
362+ return ERR_PTR(-ENOMEM);
363363
364364 ds->dst = dst;
365365 ds->index = index;
@@ -370,7 +370,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, · 4 unmodified lines
370370
371371 ret = dsa_switch_setup_one(ds, parent);
372372 if (ret)
373− return NULL;
373+ return ERR_PTR(ret);
374374
375375 return ds;
376376 }
net/ipv4/esp4.c+2−1
@@ -256,7 +256,8 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) · 255 unmodified lines
256256 aead_givcrypt_set_crypt(req, sg, sg, clen, iv);
257257 aead_givcrypt_set_assoc(req, asg, assoclen);
258258 aead_givcrypt_set_giv(req, esph->enc_data,
259− XFRM_SKB_CB(skb)->seq.output.low);
259+ XFRM_SKB_CB(skb)->seq.output.low +
260+ ((u64)XFRM_SKB_CB(skb)->seq.output.hi << 32));
260261
261262 ESP_SKB_CB(skb)->tmp = tmp;
262263 err = crypto_aead_givencrypt(req);
net/ipv4/ip_vti.c+10−4
@@ -65,7 +65,6 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi, · 64 unmodified lines
6565 goto drop;
6666
6767 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
68− skb->mark = be32_to_cpu(tunnel->parms.i_key);
6968
7069 return xfrm_input(skb, nexthdr, spi, encap_type);
7170 }
@@ -91,6 +90,8 @@ static int vti_rcv_cb(struct sk_buff *skb, int err) · 19 unmodified lines
9190 struct pcpu_sw_netstats *tstats;
9291 struct xfrm_state *x;
9392 struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4;
93+ u32 orig_mark = skb->mark;
94+ int ret;
9495
9596 if (!tunnel)
9697 return 1;
@@ -107,7 +108,11 @@ static int vti_rcv_cb(struct sk_buff *skb, int err) · 10 unmodified lines
107108 x = xfrm_input_state(skb);
108109 family = x->inner_mode->afinfo->family;
109110
110− if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family))
111+ skb->mark = be32_to_cpu(tunnel->parms.i_key);
112+ ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
113+ skb->mark = orig_mark;
114+
115+ if (!ret)
111116 return -EPERM;
112117
113118 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev)));
@@ -216,8 +221,6 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) · 102 unmodified lines
216221
217222 memset(&fl, 0, sizeof(fl));
218223
219− skb->mark = be32_to_cpu(tunnel->parms.o_key);
220−
221224 switch (skb->protocol) {
222225 case htons(ETH_P_IP):
223226 xfrm_decode_session(skb, &fl, AF_INET);
@@ -233,6 +236,9 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) · 9 unmodified lines
233236 return NETDEV_TX_OK;
234237 }
235238
239+ /* override mark with tunnel output key */
240+ fl.flowi_mark = be32_to_cpu(tunnel->parms.o_key);
241+
236242 return vti_xmit(skb, dev, &fl);
237243 }
238244
net/ipv4/tcp_cong.c+4−1
@@ -187,6 +187,7 @@ static void tcp_reinit_congestion_control(struct sock *sk, · 186 unmodified lines
187187
188188 tcp_cleanup_congestion_control(sk);
189189 icsk->icsk_ca_ops = ca;
190+ icsk->icsk_ca_setsockopt = 1;
190191
191192 if (sk->sk_state != TCP_CLOSE && icsk->icsk_ca_ops->init)
192193 icsk->icsk_ca_ops->init(sk);
@@ -335,8 +336,10 @@ int tcp_set_congestion_control(struct sock *sk, const char *name) · 142 unmodified lines
335336 rcu_read_lock();
336337 ca = __tcp_ca_find_autoload(name);
337338 /* No change asking for existing value */
338− if (ca == icsk->icsk_ca_ops)
339+ if (ca == icsk->icsk_ca_ops) {
340+ icsk->icsk_ca_setsockopt = 1;
339341 goto out;
342+ }
340343 if (!ca)
341344 err = -ENOENT;
342345 else if (!((ca->flags & TCP_CONG_NON_RESTRICTED) ||
net/ipv4/tcp_minisocks.c+4−1
@@ -420,7 +420,10 @@ void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst) · 419 unmodified lines
420420 rcu_read_unlock();
421421 }
422422
423− if (!ca_got_dst && !try_module_get(icsk->icsk_ca_ops->owner))
423+ /* If no valid choice made yet, assign current system default ca. */
424+ if (!ca_got_dst &&
425+ (!icsk->icsk_ca_setsockopt ||
426+ !try_module_get(icsk->icsk_ca_ops->owner)))
424427 tcp_assign_congestion_control(sk);
425428
426429 tcp_set_ca_state(sk, TCP_CA_Open);
net/ipv4/udp.c+2−4
@@ -1345,10 +1345,8 @@ csum_copy_err: · 1344 unmodified lines
13451345 }
13461346 unlock_sock_fast(sk, slow);
13471347
1348− if (noblock)
1349− return -EAGAIN;
1350−
1351− /* starting over for a new packet */
1348+ /* starting over for a new packet, but check if we need to yield */
1349+ cond_resched();
13521350 msg->msg_flags &= ~MSG_TRUNC;
13531351 goto try_again;
13541352 }
net/ipv6/esp6.c+2−1
@@ -248,7 +248,8 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) · 247 unmodified lines
248248 aead_givcrypt_set_crypt(req, sg, sg, clen, iv);
249249 aead_givcrypt_set_assoc(req, asg, assoclen);
250250 aead_givcrypt_set_giv(req, esph->enc_data,
251− XFRM_SKB_CB(skb)->seq.output.low);
251+ XFRM_SKB_CB(skb)->seq.output.low +
252+ ((u64)XFRM_SKB_CB(skb)->seq.output.hi << 32));
252253
253254 ESP_SKB_CB(skb)->tmp = tmp;
254255 err = crypto_aead_givencrypt(req);
net/ipv6/ip6_vti.c+24−3
@@ -322,7 +322,6 @@ static int vti6_rcv(struct sk_buff *skb) · 321 unmodified lines
322322 }
323323
324324 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t;
325− skb->mark = be32_to_cpu(t->parms.i_key);
326325
327326 rcu_read_unlock();
328327
@@ -342,6 +341,8 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err) · 13 unmodified lines
342341 struct pcpu_sw_netstats *tstats;
343342 struct xfrm_state *x;
344343 struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;
344+ u32 orig_mark = skb->mark;
345+ int ret;
345346
346347 if (!t)
347348 return 1;
@@ -358,7 +359,11 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err) · 10 unmodified lines
358359 x = xfrm_input_state(skb);
359360 family = x->inner_mode->afinfo->family;
360361
361− if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family))
362+ skb->mark = be32_to_cpu(t->parms.i_key);
363+ ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
364+ skb->mark = orig_mark;
365+
366+ if (!ret)
362367 return -EPERM;
363368
364369 skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));
@@ -430,6 +435,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) · 65 unmodified lines
430435 struct net_device *tdev;
431436 struct xfrm_state *x;
432437 int err = -1;
438+ int mtu;
433439
434440 if (!dst)
435441 goto tx_err_link_failure;
@@ -463,6 +469,19 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) · 27 unmodified lines
463469 skb_dst_set(skb, dst);
464470 skb->dev = skb_dst(skb)->dev;
465471
472+ mtu = dst_mtu(dst);
473+ if (!skb->ignore_df && skb->len > mtu) {
474+ skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);
475+
476+ if (skb->protocol == htons(ETH_P_IPV6))
477+ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
478+ else
479+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
480+ htonl(mtu));
481+
482+ return -EMSGSIZE;
483+ }
484+
466485 err = dst_output(skb);
467486 if (net_xmit_eval(err) == 0) {
468487 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
@@ -495,7 +514,6 @@ vti6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) · 26 unmodified lines
495514 int ret;
496515
497516 memset(&fl, 0, sizeof(fl));
498− skb->mark = be32_to_cpu(t->parms.o_key);
499517
500518 switch (skb->protocol) {
501519 case htons(ETH_P_IPV6):
@@ -516,6 +534,9 @@ vti6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) · 14 unmodified lines
516534 goto tx_err;
517535 }
518536
537+ /* override mark with tunnel output key */
538+ fl.flowi_mark = be32_to_cpu(t->parms.o_key);
539+
519540 ret = vti6_xmit(skb, dev, &fl);
520541 if (ret < 0)
521542 goto tx_err;
net/ipv6/udp.c+2−4
@@ -525,10 +525,8 @@ csum_copy_err: · 524 unmodified lines
525525 }
526526 unlock_sock_fast(sk, slow);
527527
528− if (noblock)
529− return -EAGAIN;
530−
531− /* starting over for a new packet */
528+ /* starting over for a new packet, but check if we need to yield */
529+ cond_resched();
532530 msg->msg_flags &= ~MSG_TRUNC;
533531 goto try_again;
534532 }
net/xfrm/xfrm_input.c+16−1
@@ -13,6 +13,8 @@ · 12 unmodified lines
1313 #include <net/dst.h>
1414 #include <net/ip.h>
1515 #include <net/xfrm.h>
16+#include <net/ip_tunnels.h>
17+#include <net/ip6_tunnel.h>
1618
1719 static struct kmem_cache *secpath_cachep __read_mostly;
1820
@@ -186,6 +188,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) · 167 unmodified lines
186188 struct xfrm_state *x = NULL;
187189 xfrm_address_t *daddr;
188190 struct xfrm_mode *inner_mode;
191+ u32 mark = skb->mark;
189192 unsigned int family;
190193 int decaps = 0;
191194 int async = 0;
@@ -203,6 +206,18 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) · 11 unmodified lines
203206 XFRM_SPI_SKB_CB(skb)->daddroff);
204207 family = XFRM_SPI_SKB_CB(skb)->family;
205208
209+ /* if tunnel is present override skb->mark value with tunnel i_key */
210+ if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4) {
211+ switch (family) {
212+ case AF_INET:
213+ mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4->parms.i_key);
214+ break;
215+ case AF_INET6:
216+ mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6->parms.i_key);
217+ break;
218+ }
219+ }
220+
206221 /* Allocate new secpath or COW existing one. */
207222 if (!skb->sp || atomic_read(&skb->sp->refcnt) != 1) {
208223 struct sec_path *sp;
@@ -229,7 +244,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) · 20 unmodified lines
229244 goto drop;
230245 }
231246
232− x = xfrm_state_lookup(net, skb->mark, daddr, spi, nexthdr, family);
247+ x = xfrm_state_lookup(net, mark, daddr, spi, nexthdr, family);
233248 if (x == NULL) {
234249 XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES);
235250 xfrm_audit_state_notfound(skb, family, spi, seq);
net/xfrm/xfrm_replay.c+2−0
@@ -99,6 +99,7 @@ static int xfrm_replay_overflow(struct xfrm_state *x, struct sk_buff *skb) · 98 unmodified lines
9999
100100 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
101101 XFRM_SKB_CB(skb)->seq.output.low = ++x->replay.oseq;
102+ XFRM_SKB_CB(skb)->seq.output.hi = 0;
102103 if (unlikely(x->replay.oseq == 0)) {
103104 x->replay.oseq--;
104105 xfrm_audit_state_replay_overflow(x, skb);
@@ -177,6 +178,7 @@ static int xfrm_replay_overflow_bmp(struct xfrm_state *x, struct sk_buff *skb) · 72 unmodified lines
177178
178179 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
179180 XFRM_SKB_CB(skb)->seq.output.low = ++replay_esn->oseq;
181+ XFRM_SKB_CB(skb)->seq.output.hi = 0;
180182 if (unlikely(replay_esn->oseq == 0)) {
181183 replay_esn->oseq--;
182184 xfrm_audit_state_replay_overflow(x, skb);
net/xfrm/xfrm_state.c+1−1
@@ -927,8 +927,8 @@ struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi, · 926 unmodified lines
927927 x->id.spi != spi)
928928 continue;
929929
930− spin_unlock_bh(&net->xfrm.xfrm_state_lock);
931930 xfrm_state_hold(x);
931+ spin_unlock_bh(&net->xfrm.xfrm_state_lock);
932932 return x;
933933 }
934934 spin_unlock_bh(&net->xfrm.xfrm_state_lock);