aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-01 23:51:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-01 23:51:18 -0400
commitc46a024ea5eb0165114dbbc8c82c29b7bcf66e71 (patch)
treec91b0abf09c1fa5ddd566572dafa735aea05b592 /drivers/net/ethernet
parent2459c6099b14b363e7212819a2d823cc167a1cd5 (diff)
parente453581dd518f60b45a8d2b9cf344e2a87d5267e (diff)
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 ...
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c9
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c20
-rw-r--r--drivers/net/ethernet/brocade/bna/bfa_ioc.c4
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c4
-rw-r--r--drivers/net/ethernet/brocade/bna/cna_fwimg.c7
-rw-r--r--drivers/net/ethernet/sfc/rx.c42
7 files changed, 54 insertions, 34 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index a3b0f7a0c61e..1f82a04ce01a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1774,7 +1774,7 @@ struct bnx2x {
1774 int stats_state; 1774 int stats_state;
1775 1775
1776 /* used for synchronization of concurrent threads statistics handling */ 1776 /* used for synchronization of concurrent threads statistics handling */
1777 struct mutex stats_lock; 1777 struct semaphore stats_lock;
1778 1778
1779 /* used by dmae command loader */ 1779 /* used by dmae command loader */
1780 struct dmae_command stats_dmae; 1780 struct dmae_command stats_dmae;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index fd52ce95127e..33501bcddc48 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12054,7 +12054,7 @@ static int bnx2x_init_bp(struct bnx2x *bp)
12054 mutex_init(&bp->port.phy_mutex); 12054 mutex_init(&bp->port.phy_mutex);
12055 mutex_init(&bp->fw_mb_mutex); 12055 mutex_init(&bp->fw_mb_mutex);
12056 mutex_init(&bp->drv_info_mutex); 12056 mutex_init(&bp->drv_info_mutex);
12057 mutex_init(&bp->stats_lock); 12057 sema_init(&bp->stats_lock, 1);
12058 bp->drv_info_mng_owner = false; 12058 bp->drv_info_mng_owner = false;
12059 12059
12060 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); 12060 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
@@ -13690,9 +13690,10 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
13690 cancel_delayed_work_sync(&bp->sp_task); 13690 cancel_delayed_work_sync(&bp->sp_task);
13691 cancel_delayed_work_sync(&bp->period_task); 13691 cancel_delayed_work_sync(&bp->period_task);
13692 13692
13693 mutex_lock(&bp->stats_lock); 13693 if (!down_timeout(&bp->stats_lock, HZ / 10)) {
13694 bp->stats_state = STATS_STATE_DISABLED; 13694 bp->stats_state = STATS_STATE_DISABLED;
13695 mutex_unlock(&bp->stats_lock); 13695 up(&bp->stats_lock);
13696 }
13696 13697
13697 bnx2x_save_statistics(bp); 13698 bnx2x_save_statistics(bp);
13698 13699
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 266b055c2360..69d699f0730a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -1372,19 +1372,23 @@ void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
1372 * that context in case someone is in the middle of a transition. 1372 * that context in case someone is in the middle of a transition.
1373 * For other events, wait a bit until lock is taken. 1373 * For other events, wait a bit until lock is taken.
1374 */ 1374 */
1375 if (!mutex_trylock(&bp->stats_lock)) { 1375 if (down_trylock(&bp->stats_lock)) {
1376 if (event == STATS_EVENT_UPDATE) 1376 if (event == STATS_EVENT_UPDATE)
1377 return; 1377 return;
1378 1378
1379 DP(BNX2X_MSG_STATS, 1379 DP(BNX2X_MSG_STATS,
1380 "Unlikely stats' lock contention [event %d]\n", event); 1380 "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 }
1382 } 1386 }
1383 1387
1384 bnx2x_stats_stm[state][event].action(bp); 1388 bnx2x_stats_stm[state][event].action(bp);
1385 bp->stats_state = bnx2x_stats_stm[state][event].next_state; 1389 bp->stats_state = bnx2x_stats_stm[state][event].next_state;
1386 1390
1387 mutex_unlock(&bp->stats_lock); 1391 up(&bp->stats_lock);
1388 1392
1389 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) 1393 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
1390 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", 1394 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
@@ -1970,7 +1974,11 @@ int bnx2x_stats_safe_exec(struct bnx2x *bp,
1970 /* Wait for statistics to end [while blocking further requests], 1974 /* Wait for statistics to end [while blocking further requests],
1971 * then run supplied function 'safely'. 1975 * then run supplied function 'safely'.
1972 */ 1976 */
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 }
1974 1982
1975 bnx2x_stats_comp(bp); 1983 bnx2x_stats_comp(bp);
1976 while (bp->stats_pending && cnt--) 1984 while (bp->stats_pending && cnt--)
@@ -1988,7 +1996,7 @@ out:
1988 /* No need to restart statistics - if they're enabled, the timer 1996 /* No need to restart statistics - if they're enabled, the timer
1989 * will restart the statistics. 1997 * will restart the statistics.
1990 */ 1998 */
1991 mutex_unlock(&bp->stats_lock); 1999 up(&bp->stats_lock);
1992 2000out_no_lock:
1993 return rc; 2001 return rc;
1994} 2002}
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
index 594a2ab36d31..68f3c13c9ef6 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
@@ -2414,7 +2414,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, enum bfi_fwboot_type boot_type,
2414 if (status == BFA_STATUS_OK) 2414 if (status == BFA_STATUS_OK)
2415 bfa_ioc_lpu_start(ioc); 2415 bfa_ioc_lpu_start(ioc);
2416 else 2416 else
2417 bfa_nw_iocpf_timeout(ioc); 2417 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT);
2418 2418
2419 return status; 2419 return status;
2420} 2420}
@@ -3029,7 +3029,7 @@ bfa_ioc_poll_fwinit(struct bfa_ioc *ioc)
3029 } 3029 }
3030 3030
3031 if (ioc->iocpf.poll_time >= BFA_IOC_TOV) { 3031 if (ioc->iocpf.poll_time >= BFA_IOC_TOV) {
3032 bfa_nw_iocpf_timeout(ioc); 3032 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT);
3033 } else { 3033 } else {
3034 ioc->iocpf.poll_time += BFA_IOC_POLL_TOV; 3034 ioc->iocpf.poll_time += BFA_IOC_POLL_TOV;
3035 mod_timer(&ioc->iocpf_timer, jiffies + 3035 mod_timer(&ioc->iocpf_timer, jiffies +
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 37072a83f9d6..caae6cb2bc1a 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3701,10 +3701,6 @@ bnad_pci_probe(struct pci_dev *pdev,
3701 setup_timer(&bnad->bna.ioceth.ioc.sem_timer, bnad_iocpf_sem_timeout, 3701 setup_timer(&bnad->bna.ioceth.ioc.sem_timer, bnad_iocpf_sem_timeout,
3702 ((unsigned long)bnad)); 3702 ((unsigned long)bnad));
3703 3703
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
3708 /* 3704 /*
3709 * Start the chip 3705 * Start the chip
3710 * If the call back comes with error, we bail out. 3706 * If the call back comes with error, we bail out.
diff --git a/drivers/net/ethernet/brocade/bna/cna_fwimg.c b/drivers/net/ethernet/brocade/bna/cna_fwimg.c
index ebf462d8082f..badea368bdc8 100644
--- a/drivers/net/ethernet/brocade/bna/cna_fwimg.c
+++ b/drivers/net/ethernet/brocade/bna/cna_fwimg.c
@@ -30,6 +30,7 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
30 u32 *bfi_image_size, char *fw_name) 30 u32 *bfi_image_size, char *fw_name)
31{ 31{
32 const struct firmware *fw; 32 const struct firmware *fw;
33 u32 n;
33 34
34 if (request_firmware(&fw, fw_name, &pdev->dev)) { 35 if (request_firmware(&fw, fw_name, &pdev->dev)) {
35 pr_alert("Can't locate firmware %s\n", fw_name); 36 pr_alert("Can't locate firmware %s\n", fw_name);
@@ -40,6 +41,12 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
40 *bfi_image_size = fw->size/sizeof(u32); 41 *bfi_image_size = fw->size/sizeof(u32);
41 bfi_fw = fw; 42 bfi_fw = fw;
42 43
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
43 return *bfi_image; 50 return *bfi_image;
44error: 51error:
45 return NULL; 52 return NULL;
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index c0ad95d2f63d..809ea4610a77 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -224,12 +224,17 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx,
224 } 224 }
225} 225}
226 226
227static void efx_free_rx_buffer(struct efx_rx_buffer *rx_buf) 227static void efx_free_rx_buffers(struct efx_rx_queue *rx_queue,
228 struct efx_rx_buffer *rx_buf,
229 unsigned int num_bufs)
228{ 230{
229 if (rx_buf->page) { 231 do {
230 put_page(rx_buf->page); 232 if (rx_buf->page) {
231 rx_buf->page = NULL; 233 put_page(rx_buf->page);
232 } 234 rx_buf->page = NULL;
235 }
236 rx_buf = efx_rx_buf_next(rx_queue, rx_buf);
237 } while (--num_bufs);
233} 238}
234 239
235/* Attempt to recycle the page if there is an RX recycle ring; the page can 240/* 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,
278 /* If this is the last buffer in a page, unmap and free it. */ 283 /* If this is the last buffer in a page, unmap and free it. */
279 if (rx_buf->flags & EFX_RX_BUF_LAST_IN_PAGE) { 284 if (rx_buf->flags & EFX_RX_BUF_LAST_IN_PAGE) {
280 efx_unmap_rx_buffer(rx_queue->efx, rx_buf); 285 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);
282 } 287 }
283 rx_buf->page = NULL; 288 rx_buf->page = NULL;
284} 289}
@@ -304,10 +309,7 @@ static void efx_discard_rx_packet(struct efx_channel *channel,
304 309
305 efx_recycle_rx_pages(channel, rx_buf, n_frags); 310 efx_recycle_rx_pages(channel, rx_buf, n_frags);
306 311
307 do { 312 efx_free_rx_buffers(rx_queue, rx_buf, n_frags);
308 efx_free_rx_buffer(rx_buf);
309 rx_buf = efx_rx_buf_next(rx_queue, rx_buf);
310 } while (--n_frags);
311} 313}
312 314
313/** 315/**
@@ -431,11 +433,10 @@ efx_rx_packet_gro(struct efx_channel *channel, struct efx_rx_buffer *rx_buf,
431 433
432 skb = napi_get_frags(napi); 434 skb = napi_get_frags(napi);
433 if (unlikely(!skb)) { 435 if (unlikely(!skb)) {
434 while (n_frags--) { 436 struct efx_rx_queue *rx_queue;
435 put_page(rx_buf->page); 437
436 rx_buf->page = NULL; 438 rx_queue = efx_channel_get_rx_queue(channel);
437 rx_buf = efx_rx_buf_next(&channel->rx_queue, rx_buf); 439 efx_free_rx_buffers(rx_queue, rx_buf, n_frags);
438 }
439 return; 440 return;
440 } 441 }
441 442
@@ -622,7 +623,10 @@ static void efx_rx_deliver(struct efx_channel *channel, u8 *eh,
622 623
623 skb = efx_rx_mk_skb(channel, rx_buf, n_frags, eh, hdr_len); 624 skb = efx_rx_mk_skb(channel, rx_buf, n_frags, eh, hdr_len);
624 if (unlikely(skb == NULL)) { 625 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);
626 return; 630 return;
627 } 631 }
628 skb_record_rx_queue(skb, channel->rx_queue.core_index); 632 skb_record_rx_queue(skb, channel->rx_queue.core_index);
@@ -661,8 +665,12 @@ void __efx_rx_packet(struct efx_channel *channel)
661 * loopback layer, and free the rx_buf here 665 * loopback layer, and free the rx_buf here
662 */ 666 */
663 if (unlikely(efx->loopback_selftest)) { 667 if (unlikely(efx->loopback_selftest)) {
668 struct efx_rx_queue *rx_queue;
669
664 efx_loopback_rx_packet(efx, eh, rx_buf->len); 670 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);
666 goto out; 674 goto out;
667 } 675 }
668 676