Skip to content

Commit c46a024

Browse files
committed
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 ...
2 parents 2459c60 + e453581 commit c46a024

File tree

32 files changed

+174
-119
lines changed

32 files changed

+174
-119
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10587,8 +10587,7 @@ F: drivers/virtio/virtio_input.c
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ struct bnx2x {
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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12054,7 +12054,7 @@ static int bnx2x_init_bp(struct bnx2x *bp)
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)
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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,19 +1372,23 @@ void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
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,
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 @@ int bnx2x_stats_safe_exec(struct bnx2x *bp,
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,7 +2414,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, enum bfi_fwboot_type boot_type,
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)
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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,10 +3701,6 @@ bnad_pci_probe(struct pci_dev *pdev,
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
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,
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

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,17 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx,
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,
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,
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,
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,
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)
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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,9 @@ static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
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)
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)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw,
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent,
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,
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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,18 +1039,14 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans,
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,
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)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
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
}

0 commit comments

Comments
 (0)