diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-01 15:24:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-01 15:24:04 -0500 |
commit | 9836f4080fd5b680cc2d9656355c1a7c681b1ffd (patch) | |
tree | e65c4386dbeb125891b06b01be107323e176ac7f /drivers | |
parent | e364a3416d81c7717dd642dc9b3ab132b7885f66 (diff) | |
parent | 6d84b986b26bac1d4d678ff10c10a633bf53f834 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6
Diffstat (limited to 'drivers')
30 files changed, 150 insertions, 220 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 35b7bc52a2d1..d563049859a8 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2005-2009 Solarflare Communications Inc. | 4 | * Copyright 2005-2011 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h index cbce62b9c996..3d83a1f74fef 100644 --- a/drivers/net/sfc/efx.h +++ b/drivers/net/sfc/efx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 272cfe724e1b..158d5b5630b6 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -28,7 +28,8 @@ struct efx_ethtool_stat { | |||
28 | enum { | 28 | enum { |
29 | EFX_ETHTOOL_STAT_SOURCE_mac_stats, | 29 | EFX_ETHTOOL_STAT_SOURCE_mac_stats, |
30 | EFX_ETHTOOL_STAT_SOURCE_nic, | 30 | EFX_ETHTOOL_STAT_SOURCE_nic, |
31 | EFX_ETHTOOL_STAT_SOURCE_channel | 31 | EFX_ETHTOOL_STAT_SOURCE_channel, |
32 | EFX_ETHTOOL_STAT_SOURCE_tx_queue | ||
32 | } source; | 33 | } source; |
33 | unsigned offset; | 34 | unsigned offset; |
34 | u64(*get_stat) (void *field); /* Reader function */ | 35 | u64(*get_stat) (void *field); /* Reader function */ |
@@ -86,6 +87,10 @@ static u64 efx_get_atomic_stat(void *field) | |||
86 | EFX_ETHTOOL_STAT(field, channel, n_##field, \ | 87 | EFX_ETHTOOL_STAT(field, channel, n_##field, \ |
87 | unsigned int, efx_get_uint_stat) | 88 | unsigned int, efx_get_uint_stat) |
88 | 89 | ||
90 | #define EFX_ETHTOOL_UINT_TXQ_STAT(field) \ | ||
91 | EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \ | ||
92 | unsigned int, efx_get_uint_stat) | ||
93 | |||
89 | static struct efx_ethtool_stat efx_ethtool_stats[] = { | 94 | static struct efx_ethtool_stat efx_ethtool_stats[] = { |
90 | EFX_ETHTOOL_U64_MAC_STAT(tx_bytes), | 95 | EFX_ETHTOOL_U64_MAC_STAT(tx_bytes), |
91 | EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes), | 96 | EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes), |
@@ -116,6 +121,10 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = { | |||
116 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_non_tcpudp), | 121 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_non_tcpudp), |
117 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_mac_src_error), | 122 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_mac_src_error), |
118 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_ip_src_error), | 123 | EFX_ETHTOOL_ULONG_MAC_STAT(tx_ip_src_error), |
124 | EFX_ETHTOOL_UINT_TXQ_STAT(tso_bursts), | ||
125 | EFX_ETHTOOL_UINT_TXQ_STAT(tso_long_headers), | ||
126 | EFX_ETHTOOL_UINT_TXQ_STAT(tso_packets), | ||
127 | EFX_ETHTOOL_UINT_TXQ_STAT(pushes), | ||
119 | EFX_ETHTOOL_U64_MAC_STAT(rx_bytes), | 128 | EFX_ETHTOOL_U64_MAC_STAT(rx_bytes), |
120 | EFX_ETHTOOL_U64_MAC_STAT(rx_good_bytes), | 129 | EFX_ETHTOOL_U64_MAC_STAT(rx_good_bytes), |
121 | EFX_ETHTOOL_U64_MAC_STAT(rx_bad_bytes), | 130 | EFX_ETHTOOL_U64_MAC_STAT(rx_bad_bytes), |
@@ -237,8 +246,8 @@ static void efx_ethtool_get_drvinfo(struct net_device *net_dev, | |||
237 | strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); | 246 | strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); |
238 | strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version)); | 247 | strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version)); |
239 | if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0) | 248 | if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0) |
240 | siena_print_fwver(efx, info->fw_version, | 249 | efx_mcdi_print_fwver(efx, info->fw_version, |
241 | sizeof(info->fw_version)); | 250 | sizeof(info->fw_version)); |
242 | strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); | 251 | strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); |
243 | } | 252 | } |
244 | 253 | ||
@@ -470,6 +479,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, | |||
470 | struct efx_mac_stats *mac_stats = &efx->mac_stats; | 479 | struct efx_mac_stats *mac_stats = &efx->mac_stats; |
471 | struct efx_ethtool_stat *stat; | 480 | struct efx_ethtool_stat *stat; |
472 | struct efx_channel *channel; | 481 | struct efx_channel *channel; |
482 | struct efx_tx_queue *tx_queue; | ||
473 | struct rtnl_link_stats64 temp; | 483 | struct rtnl_link_stats64 temp; |
474 | int i; | 484 | int i; |
475 | 485 | ||
@@ -495,6 +505,15 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, | |||
495 | data[i] += stat->get_stat((void *)channel + | 505 | data[i] += stat->get_stat((void *)channel + |
496 | stat->offset); | 506 | stat->offset); |
497 | break; | 507 | break; |
508 | case EFX_ETHTOOL_STAT_SOURCE_tx_queue: | ||
509 | data[i] = 0; | ||
510 | efx_for_each_channel(channel, efx) { | ||
511 | efx_for_each_channel_tx_queue(tx_queue, channel) | ||
512 | data[i] += | ||
513 | stat->get_stat((void *)tx_queue | ||
514 | + stat->offset); | ||
515 | } | ||
516 | break; | ||
498 | } | 517 | } |
499 | } | 518 | } |
500 | } | 519 | } |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 61ddd2c6e750..734fcfb52e85 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -1478,36 +1478,26 @@ static void falcon_init_rx_cfg(struct efx_nic *efx) | |||
1478 | /* RX control FIFO thresholds (32 entries) */ | 1478 | /* RX control FIFO thresholds (32 entries) */ |
1479 | const unsigned ctrl_xon_thr = 20; | 1479 | const unsigned ctrl_xon_thr = 20; |
1480 | const unsigned ctrl_xoff_thr = 25; | 1480 | const unsigned ctrl_xoff_thr = 25; |
1481 | /* RX data FIFO thresholds (256-byte units; size varies) */ | ||
1482 | int data_xon_thr = efx_nic_rx_xon_thresh >> 8; | ||
1483 | int data_xoff_thr = efx_nic_rx_xoff_thresh >> 8; | ||
1484 | efx_oword_t reg; | 1481 | efx_oword_t reg; |
1485 | 1482 | ||
1486 | efx_reado(efx, ®, FR_AZ_RX_CFG); | 1483 | efx_reado(efx, ®, FR_AZ_RX_CFG); |
1487 | if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) { | 1484 | if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) { |
1488 | /* Data FIFO size is 5.5K */ | 1485 | /* Data FIFO size is 5.5K */ |
1489 | if (data_xon_thr < 0) | ||
1490 | data_xon_thr = 512 >> 8; | ||
1491 | if (data_xoff_thr < 0) | ||
1492 | data_xoff_thr = 2048 >> 8; | ||
1493 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0); | 1486 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0); |
1494 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE, | 1487 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE, |
1495 | huge_buf_size); | 1488 | huge_buf_size); |
1496 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, data_xon_thr); | 1489 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8); |
1497 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, data_xoff_thr); | 1490 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8); |
1498 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr); | 1491 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr); |
1499 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr); | 1492 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr); |
1500 | } else { | 1493 | } else { |
1501 | /* Data FIFO size is 80K; register fields moved */ | 1494 | /* Data FIFO size is 80K; register fields moved */ |
1502 | if (data_xon_thr < 0) | ||
1503 | data_xon_thr = 27648 >> 8; /* ~3*max MTU */ | ||
1504 | if (data_xoff_thr < 0) | ||
1505 | data_xoff_thr = 54272 >> 8; /* ~80Kb - 3*max MTU */ | ||
1506 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0); | 1495 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0); |
1507 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE, | 1496 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE, |
1508 | huge_buf_size); | 1497 | huge_buf_size); |
1509 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, data_xon_thr); | 1498 | /* Send XON and XOFF at ~3 * max MTU away from empty/full */ |
1510 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, data_xoff_thr); | 1499 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8); |
1500 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8); | ||
1511 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); | 1501 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); |
1512 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); | 1502 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); |
1513 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); | 1503 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); |
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c index 2dd16f0b3ced..b9cc846811d6 100644 --- a/drivers/net/sfc/falcon_boards.c +++ b/drivers/net/sfc/falcon_boards.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2007-2009 Solarflare Communications Inc. | 3 | * Copyright 2007-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c index b49e84394641..2c9ee5db3bf7 100644 --- a/drivers/net/sfc/falcon_xmac.c +++ b/drivers/net/sfc/falcon_xmac.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/io.h b/drivers/net/sfc/io.h index 6da4ae20a039..dc45110b2456 100644 --- a/drivers/net/sfc/io.h +++ b/drivers/net/sfc/io.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index b716e827b291..8bba8955f310 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2008-2009 Solarflare Communications Inc. | 3 | * Copyright 2008-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -602,7 +602,7 @@ void efx_mcdi_process_event(struct efx_channel *channel, | |||
602 | ************************************************************************** | 602 | ************************************************************************** |
603 | */ | 603 | */ |
604 | 604 | ||
605 | int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build) | 605 | void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len) |
606 | { | 606 | { |
607 | u8 outbuf[ALIGN(MC_CMD_GET_VERSION_V1_OUT_LEN, 4)]; | 607 | u8 outbuf[ALIGN(MC_CMD_GET_VERSION_V1_OUT_LEN, 4)]; |
608 | size_t outlength; | 608 | size_t outlength; |
@@ -616,29 +616,20 @@ int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build) | |||
616 | if (rc) | 616 | if (rc) |
617 | goto fail; | 617 | goto fail; |
618 | 618 | ||
619 | if (outlength == MC_CMD_GET_VERSION_V0_OUT_LEN) { | ||
620 | *version = 0; | ||
621 | *build = MCDI_DWORD(outbuf, GET_VERSION_OUT_FIRMWARE); | ||
622 | return 0; | ||
623 | } | ||
624 | |||
625 | if (outlength < MC_CMD_GET_VERSION_V1_OUT_LEN) { | 619 | if (outlength < MC_CMD_GET_VERSION_V1_OUT_LEN) { |
626 | rc = -EIO; | 620 | rc = -EIO; |
627 | goto fail; | 621 | goto fail; |
628 | } | 622 | } |
629 | 623 | ||
630 | ver_words = (__le16 *)MCDI_PTR(outbuf, GET_VERSION_OUT_VERSION); | 624 | ver_words = (__le16 *)MCDI_PTR(outbuf, GET_VERSION_OUT_VERSION); |
631 | *version = (((u64)le16_to_cpu(ver_words[0]) << 48) | | 625 | snprintf(buf, len, "%u.%u.%u.%u", |
632 | ((u64)le16_to_cpu(ver_words[1]) << 32) | | 626 | le16_to_cpu(ver_words[0]), le16_to_cpu(ver_words[1]), |
633 | ((u64)le16_to_cpu(ver_words[2]) << 16) | | 627 | le16_to_cpu(ver_words[2]), le16_to_cpu(ver_words[3])); |
634 | le16_to_cpu(ver_words[3])); | 628 | return; |
635 | *build = MCDI_DWORD(outbuf, GET_VERSION_OUT_FIRMWARE); | ||
636 | |||
637 | return 0; | ||
638 | 629 | ||
639 | fail: | 630 | fail: |
640 | netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); | 631 | netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); |
641 | return rc; | 632 | buf[0] = 0; |
642 | } | 633 | } |
643 | 634 | ||
644 | int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | 635 | int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, |
diff --git a/drivers/net/sfc/mcdi.h b/drivers/net/sfc/mcdi.h index c792f1d65e48..aced2a7856fc 100644 --- a/drivers/net/sfc/mcdi.h +++ b/drivers/net/sfc/mcdi.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2008-2009 Solarflare Communications Inc. | 3 | * Copyright 2008-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -93,7 +93,7 @@ extern void efx_mcdi_process_event(struct efx_channel *channel, | |||
93 | #define MCDI_EVENT_FIELD(_ev, _field) \ | 93 | #define MCDI_EVENT_FIELD(_ev, _field) \ |
94 | EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) | 94 | EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) |
95 | 95 | ||
96 | extern int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build); | 96 | extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); |
97 | extern int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | 97 | extern int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, |
98 | bool *was_attached_out); | 98 | bool *was_attached_out); |
99 | extern int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, | 99 | extern int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, |
diff --git a/drivers/net/sfc/mcdi_mac.c b/drivers/net/sfc/mcdi_mac.c index f88f4bf986ff..33f7294edb47 100644 --- a/drivers/net/sfc/mcdi_mac.c +++ b/drivers/net/sfc/mcdi_mac.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2009 Solarflare Communications Inc. | 3 | * Copyright 2009-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/mcdi_pcol.h b/drivers/net/sfc/mcdi_pcol.h index 90359e644006..b86a15f221ad 100644 --- a/drivers/net/sfc/mcdi_pcol.h +++ b/drivers/net/sfc/mcdi_pcol.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2009 Solarflare Communications Inc. | 3 | * Copyright 2009-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c index 0e97eed663c6..ec3f740f5465 100644 --- a/drivers/net/sfc/mcdi_phy.c +++ b/drivers/net/sfc/mcdi_phy.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2009 Solarflare Communications Inc. | 3 | * Copyright 2009-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index 56b0266b441f..19e68c26d103 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2009 Solarflare Communications Inc. | 3 | * Copyright 2006-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -51,13 +51,10 @@ int efx_mdio_reset_mmd(struct efx_nic *port, int mmd, | |||
51 | return spins ? spins : -ETIMEDOUT; | 51 | return spins ? spins : -ETIMEDOUT; |
52 | } | 52 | } |
53 | 53 | ||
54 | static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal) | 54 | static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd) |
55 | { | 55 | { |
56 | int status; | 56 | int status; |
57 | 57 | ||
58 | if (LOOPBACK_INTERNAL(efx)) | ||
59 | return 0; | ||
60 | |||
61 | if (mmd != MDIO_MMD_AN) { | 58 | if (mmd != MDIO_MMD_AN) { |
62 | /* Read MMD STATUS2 to check it is responding. */ | 59 | /* Read MMD STATUS2 to check it is responding. */ |
63 | status = efx_mdio_read(efx, mmd, MDIO_STAT2); | 60 | status = efx_mdio_read(efx, mmd, MDIO_STAT2); |
@@ -68,20 +65,6 @@ static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal) | |||
68 | } | 65 | } |
69 | } | 66 | } |
70 | 67 | ||
71 | /* Read MMD STATUS 1 to check for fault. */ | ||
72 | status = efx_mdio_read(efx, mmd, MDIO_STAT1); | ||
73 | if (status & MDIO_STAT1_FAULT) { | ||
74 | if (fault_fatal) { | ||
75 | netif_err(efx, hw, efx->net_dev, | ||
76 | "PHY MMD %d reporting fatal" | ||
77 | " fault: status %x\n", mmd, status); | ||
78 | return -EIO; | ||
79 | } else { | ||
80 | netif_dbg(efx, hw, efx->net_dev, | ||
81 | "PHY MMD %d reporting status" | ||
82 | " %x (expected)\n", mmd, status); | ||
83 | } | ||
84 | } | ||
85 | return 0; | 68 | return 0; |
86 | } | 69 | } |
87 | 70 | ||
@@ -130,8 +113,7 @@ int efx_mdio_wait_reset_mmds(struct efx_nic *efx, unsigned int mmd_mask) | |||
130 | return rc; | 113 | return rc; |
131 | } | 114 | } |
132 | 115 | ||
133 | int efx_mdio_check_mmds(struct efx_nic *efx, | 116 | int efx_mdio_check_mmds(struct efx_nic *efx, unsigned int mmd_mask) |
134 | unsigned int mmd_mask, unsigned int fatal_mask) | ||
135 | { | 117 | { |
136 | int mmd = 0, probe_mmd, devs1, devs2; | 118 | int mmd = 0, probe_mmd, devs1, devs2; |
137 | u32 devices; | 119 | u32 devices; |
@@ -161,13 +143,9 @@ int efx_mdio_check_mmds(struct efx_nic *efx, | |||
161 | 143 | ||
162 | /* Check all required MMDs are responding and happy. */ | 144 | /* Check all required MMDs are responding and happy. */ |
163 | while (mmd_mask) { | 145 | while (mmd_mask) { |
164 | if (mmd_mask & 1) { | 146 | if ((mmd_mask & 1) && efx_mdio_check_mmd(efx, mmd)) |
165 | int fault_fatal = fatal_mask & 1; | 147 | return -EIO; |
166 | if (efx_mdio_check_mmd(efx, mmd, fault_fatal)) | ||
167 | return -EIO; | ||
168 | } | ||
169 | mmd_mask = mmd_mask >> 1; | 148 | mmd_mask = mmd_mask >> 1; |
170 | fatal_mask = fatal_mask >> 1; | ||
171 | mmd++; | 149 | mmd++; |
172 | } | 150 | } |
173 | 151 | ||
@@ -337,7 +315,7 @@ int efx_mdio_test_alive(struct efx_nic *efx) | |||
337 | "no MDIO PHY present with ID %d\n", efx->mdio.prtad); | 315 | "no MDIO PHY present with ID %d\n", efx->mdio.prtad); |
338 | rc = -EINVAL; | 316 | rc = -EINVAL; |
339 | } else { | 317 | } else { |
340 | rc = efx_mdio_check_mmds(efx, efx->mdio.mmds, 0); | 318 | rc = efx_mdio_check_mmds(efx, efx->mdio.mmds); |
341 | } | 319 | } |
342 | 320 | ||
343 | mutex_unlock(&efx->mac_lock); | 321 | mutex_unlock(&efx->mac_lock); |
diff --git a/drivers/net/sfc/mdio_10g.h b/drivers/net/sfc/mdio_10g.h index 75791d3d4963..df0703940c83 100644 --- a/drivers/net/sfc/mdio_10g.h +++ b/drivers/net/sfc/mdio_10g.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2009 Solarflare Communications Inc. | 3 | * Copyright 2006-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -68,8 +68,7 @@ extern int efx_mdio_reset_mmd(struct efx_nic *efx, int mmd, | |||
68 | int spins, int spintime); | 68 | int spins, int spintime); |
69 | 69 | ||
70 | /* As efx_mdio_check_mmd but for multiple MMDs */ | 70 | /* As efx_mdio_check_mmd but for multiple MMDs */ |
71 | int efx_mdio_check_mmds(struct efx_nic *efx, | 71 | int efx_mdio_check_mmds(struct efx_nic *efx, unsigned int mmd_mask); |
72 | unsigned int mmd_mask, unsigned int fatal_mask); | ||
73 | 72 | ||
74 | /* Check the link status of specified mmds in bit mask */ | 73 | /* Check the link status of specified mmds in bit mask */ |
75 | extern bool efx_mdio_links_ok(struct efx_nic *efx, unsigned int mmd_mask); | 74 | extern bool efx_mdio_links_ok(struct efx_nic *efx, unsigned int mmd_mask); |
diff --git a/drivers/net/sfc/mtd.c b/drivers/net/sfc/mtd.c index d38627448c22..e646bfce2d84 100644 --- a/drivers/net/sfc/mtd.c +++ b/drivers/net/sfc/mtd.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 15b9068e5b87..215d5c51bfa0 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2005-2009 Solarflare Communications Inc. | 4 | * Copyright 2005-2011 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -41,7 +41,7 @@ | |||
41 | * | 41 | * |
42 | **************************************************************************/ | 42 | **************************************************************************/ |
43 | 43 | ||
44 | #define EFX_DRIVER_VERSION "3.0" | 44 | #define EFX_DRIVER_VERSION "3.1" |
45 | 45 | ||
46 | #ifdef EFX_ENABLE_DEBUG | 46 | #ifdef EFX_ENABLE_DEBUG |
47 | #define EFX_BUG_ON_PARANOID(x) BUG_ON(x) | 47 | #define EFX_BUG_ON_PARANOID(x) BUG_ON(x) |
@@ -214,15 +214,17 @@ struct efx_tx_queue { | |||
214 | * If both this and page are %NULL, the buffer slot is currently free. | 214 | * If both this and page are %NULL, the buffer slot is currently free. |
215 | * @page: The associated page buffer, if any. | 215 | * @page: The associated page buffer, if any. |
216 | * If both this and skb are %NULL, the buffer slot is currently free. | 216 | * If both this and skb are %NULL, the buffer slot is currently free. |
217 | * @data: Pointer to ethernet header | ||
218 | * @len: Buffer length, in bytes. | 217 | * @len: Buffer length, in bytes. |
218 | * @is_page: Indicates if @page is valid. If false, @skb is valid. | ||
219 | */ | 219 | */ |
220 | struct efx_rx_buffer { | 220 | struct efx_rx_buffer { |
221 | dma_addr_t dma_addr; | 221 | dma_addr_t dma_addr; |
222 | struct sk_buff *skb; | 222 | union { |
223 | struct page *page; | 223 | struct sk_buff *skb; |
224 | char *data; | 224 | struct page *page; |
225 | } u; | ||
225 | unsigned int len; | 226 | unsigned int len; |
227 | bool is_page; | ||
226 | }; | 228 | }; |
227 | 229 | ||
228 | /** | 230 | /** |
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index 1d0b8b6f25c4..e8396614daf3 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2011 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -41,26 +41,6 @@ | |||
41 | #define RX_DC_ENTRIES 64 | 41 | #define RX_DC_ENTRIES 64 |
42 | #define RX_DC_ENTRIES_ORDER 3 | 42 | #define RX_DC_ENTRIES_ORDER 3 |
43 | 43 | ||
44 | /* RX FIFO XOFF watermark | ||
45 | * | ||
46 | * When the amount of the RX FIFO increases used increases past this | ||
47 | * watermark send XOFF. Only used if RX flow control is enabled (ethtool -A) | ||
48 | * This also has an effect on RX/TX arbitration | ||
49 | */ | ||
50 | int efx_nic_rx_xoff_thresh = -1; | ||
51 | module_param_named(rx_xoff_thresh_bytes, efx_nic_rx_xoff_thresh, int, 0644); | ||
52 | MODULE_PARM_DESC(rx_xoff_thresh_bytes, "RX fifo XOFF threshold"); | ||
53 | |||
54 | /* RX FIFO XON watermark | ||
55 | * | ||
56 | * When the amount of the RX FIFO used decreases below this | ||
57 | * watermark send XON. Only used if TX flow control is enabled (ethtool -A) | ||
58 | * This also has an effect on RX/TX arbitration | ||
59 | */ | ||
60 | int efx_nic_rx_xon_thresh = -1; | ||
61 | module_param_named(rx_xon_thresh_bytes, efx_nic_rx_xon_thresh, int, 0644); | ||
62 | MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold"); | ||
63 | |||
64 | /* If EFX_MAX_INT_ERRORS internal errors occur within | 44 | /* If EFX_MAX_INT_ERRORS internal errors occur within |
65 | * EFX_INT_ERROR_EXPIRE seconds, we consider the NIC broken and | 45 | * EFX_INT_ERROR_EXPIRE seconds, we consider the NIC broken and |
66 | * disable it. | 46 | * disable it. |
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h index eb0586925b51..d9de1b647d41 100644 --- a/drivers/net/sfc/nic.h +++ b/drivers/net/sfc/nic.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2011 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -142,20 +142,14 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx) | |||
142 | 142 | ||
143 | /** | 143 | /** |
144 | * struct siena_nic_data - Siena NIC state | 144 | * struct siena_nic_data - Siena NIC state |
145 | * @fw_version: Management controller firmware version | ||
146 | * @fw_build: Firmware build number | ||
147 | * @mcdi: Management-Controller-to-Driver Interface | 145 | * @mcdi: Management-Controller-to-Driver Interface |
148 | * @wol_filter_id: Wake-on-LAN packet filter id | 146 | * @wol_filter_id: Wake-on-LAN packet filter id |
149 | */ | 147 | */ |
150 | struct siena_nic_data { | 148 | struct siena_nic_data { |
151 | u64 fw_version; | ||
152 | u32 fw_build; | ||
153 | struct efx_mcdi_iface mcdi; | 149 | struct efx_mcdi_iface mcdi; |
154 | int wol_filter_id; | 150 | int wol_filter_id; |
155 | }; | 151 | }; |
156 | 152 | ||
157 | extern void siena_print_fwver(struct efx_nic *efx, char *buf, size_t len); | ||
158 | |||
159 | extern struct efx_nic_type falcon_a1_nic_type; | 153 | extern struct efx_nic_type falcon_a1_nic_type; |
160 | extern struct efx_nic_type falcon_b0_nic_type; | 154 | extern struct efx_nic_type falcon_b0_nic_type; |
161 | extern struct efx_nic_type siena_a0_nic_type; | 155 | extern struct efx_nic_type siena_a0_nic_type; |
@@ -194,7 +188,6 @@ extern void efx_nic_eventq_read_ack(struct efx_channel *channel); | |||
194 | /* MAC/PHY */ | 188 | /* MAC/PHY */ |
195 | extern void falcon_drain_tx_fifo(struct efx_nic *efx); | 189 | extern void falcon_drain_tx_fifo(struct efx_nic *efx); |
196 | extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx); | 190 | extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx); |
197 | extern int efx_nic_rx_xoff_thresh, efx_nic_rx_xon_thresh; | ||
198 | 191 | ||
199 | /* Interrupts and test events */ | 192 | /* Interrupts and test events */ |
200 | extern int efx_nic_init_interrupt(struct efx_nic *efx); | 193 | extern int efx_nic_init_interrupt(struct efx_nic *efx); |
diff --git a/drivers/net/sfc/phy.h b/drivers/net/sfc/phy.h index 1dab609757fb..b3b79472421e 100644 --- a/drivers/net/sfc/phy.h +++ b/drivers/net/sfc/phy.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2007-2009 Solarflare Communications Inc. | 3 | * Copyright 2007-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/qt202x_phy.c b/drivers/net/sfc/qt202x_phy.c index ea3ae0089315..55f90924247e 100644 --- a/drivers/net/sfc/qt202x_phy.c +++ b/drivers/net/sfc/qt202x_phy.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2009 Solarflare Communications Inc. | 3 | * Copyright 2006-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/regs.h b/drivers/net/sfc/regs.h index 8227de62014f..cc2c86b76a7b 100644 --- a/drivers/net/sfc/regs.h +++ b/drivers/net/sfc/regs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c index 3925fd621177..c0fdb59030fb 100644 --- a/drivers/net/sfc/rx.c +++ b/drivers/net/sfc/rx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2005-2009 Solarflare Communications Inc. | 4 | * Copyright 2005-2011 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -89,24 +89,37 @@ static unsigned int rx_refill_limit = 95; | |||
89 | */ | 89 | */ |
90 | #define EFX_RXD_HEAD_ROOM 2 | 90 | #define EFX_RXD_HEAD_ROOM 2 |
91 | 91 | ||
92 | static inline unsigned int efx_rx_buf_offset(struct efx_rx_buffer *buf) | 92 | /* Offset of ethernet header within page */ |
93 | static inline unsigned int efx_rx_buf_offset(struct efx_nic *efx, | ||
94 | struct efx_rx_buffer *buf) | ||
93 | { | 95 | { |
94 | /* Offset is always within one page, so we don't need to consider | 96 | /* Offset is always within one page, so we don't need to consider |
95 | * the page order. | 97 | * the page order. |
96 | */ | 98 | */ |
97 | return (__force unsigned long) buf->data & (PAGE_SIZE - 1); | 99 | return (((__force unsigned long) buf->dma_addr & (PAGE_SIZE - 1)) + |
100 | efx->type->rx_buffer_hash_size); | ||
98 | } | 101 | } |
99 | static inline unsigned int efx_rx_buf_size(struct efx_nic *efx) | 102 | static inline unsigned int efx_rx_buf_size(struct efx_nic *efx) |
100 | { | 103 | { |
101 | return PAGE_SIZE << efx->rx_buffer_order; | 104 | return PAGE_SIZE << efx->rx_buffer_order; |
102 | } | 105 | } |
103 | 106 | ||
104 | static inline u32 efx_rx_buf_hash(struct efx_rx_buffer *buf) | 107 | static u8 *efx_rx_buf_eh(struct efx_nic *efx, struct efx_rx_buffer *buf) |
105 | { | 108 | { |
109 | if (buf->is_page) | ||
110 | return page_address(buf->u.page) + efx_rx_buf_offset(efx, buf); | ||
111 | else | ||
112 | return ((u8 *)buf->u.skb->data + | ||
113 | efx->type->rx_buffer_hash_size); | ||
114 | } | ||
115 | |||
116 | static inline u32 efx_rx_buf_hash(const u8 *eh) | ||
117 | { | ||
118 | /* The ethernet header is always directly after any hash. */ | ||
106 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || NET_IP_ALIGN % 4 == 0 | 119 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || NET_IP_ALIGN % 4 == 0 |
107 | return __le32_to_cpup((const __le32 *)(buf->data - 4)); | 120 | return __le32_to_cpup((const __le32 *)(eh - 4)); |
108 | #else | 121 | #else |
109 | const u8 *data = (const u8 *)(buf->data - 4); | 122 | const u8 *data = eh - 4; |
110 | return ((u32)data[0] | | 123 | return ((u32)data[0] | |
111 | (u32)data[1] << 8 | | 124 | (u32)data[1] << 8 | |
112 | (u32)data[2] << 16 | | 125 | (u32)data[2] << 16 | |
@@ -129,6 +142,7 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) | |||
129 | struct efx_nic *efx = rx_queue->efx; | 142 | struct efx_nic *efx = rx_queue->efx; |
130 | struct net_device *net_dev = efx->net_dev; | 143 | struct net_device *net_dev = efx->net_dev; |
131 | struct efx_rx_buffer *rx_buf; | 144 | struct efx_rx_buffer *rx_buf; |
145 | struct sk_buff *skb; | ||
132 | int skb_len = efx->rx_buffer_len; | 146 | int skb_len = efx->rx_buffer_len; |
133 | unsigned index, count; | 147 | unsigned index, count; |
134 | 148 | ||
@@ -136,24 +150,23 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) | |||
136 | index = rx_queue->added_count & rx_queue->ptr_mask; | 150 | index = rx_queue->added_count & rx_queue->ptr_mask; |
137 | rx_buf = efx_rx_buffer(rx_queue, index); | 151 | rx_buf = efx_rx_buffer(rx_queue, index); |
138 | 152 | ||
139 | rx_buf->skb = netdev_alloc_skb(net_dev, skb_len); | 153 | rx_buf->u.skb = skb = netdev_alloc_skb(net_dev, skb_len); |
140 | if (unlikely(!rx_buf->skb)) | 154 | if (unlikely(!skb)) |
141 | return -ENOMEM; | 155 | return -ENOMEM; |
142 | rx_buf->page = NULL; | ||
143 | 156 | ||
144 | /* Adjust the SKB for padding and checksum */ | 157 | /* Adjust the SKB for padding and checksum */ |
145 | skb_reserve(rx_buf->skb, NET_IP_ALIGN); | 158 | skb_reserve(skb, NET_IP_ALIGN); |
146 | rx_buf->len = skb_len - NET_IP_ALIGN; | 159 | rx_buf->len = skb_len - NET_IP_ALIGN; |
147 | rx_buf->data = (char *)rx_buf->skb->data; | 160 | rx_buf->is_page = false; |
148 | rx_buf->skb->ip_summed = CHECKSUM_UNNECESSARY; | 161 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
149 | 162 | ||
150 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, | 163 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, |
151 | rx_buf->data, rx_buf->len, | 164 | skb->data, rx_buf->len, |
152 | PCI_DMA_FROMDEVICE); | 165 | PCI_DMA_FROMDEVICE); |
153 | if (unlikely(pci_dma_mapping_error(efx->pci_dev, | 166 | if (unlikely(pci_dma_mapping_error(efx->pci_dev, |
154 | rx_buf->dma_addr))) { | 167 | rx_buf->dma_addr))) { |
155 | dev_kfree_skb_any(rx_buf->skb); | 168 | dev_kfree_skb_any(skb); |
156 | rx_buf->skb = NULL; | 169 | rx_buf->u.skb = NULL; |
157 | return -EIO; | 170 | return -EIO; |
158 | } | 171 | } |
159 | 172 | ||
@@ -211,10 +224,9 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue) | |||
211 | index = rx_queue->added_count & rx_queue->ptr_mask; | 224 | index = rx_queue->added_count & rx_queue->ptr_mask; |
212 | rx_buf = efx_rx_buffer(rx_queue, index); | 225 | rx_buf = efx_rx_buffer(rx_queue, index); |
213 | rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN; | 226 | rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN; |
214 | rx_buf->skb = NULL; | 227 | rx_buf->u.page = page; |
215 | rx_buf->page = page; | ||
216 | rx_buf->data = page_addr + EFX_PAGE_IP_ALIGN; | ||
217 | rx_buf->len = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN; | 228 | rx_buf->len = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN; |
229 | rx_buf->is_page = true; | ||
218 | ++rx_queue->added_count; | 230 | ++rx_queue->added_count; |
219 | ++rx_queue->alloc_page_count; | 231 | ++rx_queue->alloc_page_count; |
220 | ++state->refcnt; | 232 | ++state->refcnt; |
@@ -235,19 +247,17 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue) | |||
235 | static void efx_unmap_rx_buffer(struct efx_nic *efx, | 247 | static void efx_unmap_rx_buffer(struct efx_nic *efx, |
236 | struct efx_rx_buffer *rx_buf) | 248 | struct efx_rx_buffer *rx_buf) |
237 | { | 249 | { |
238 | if (rx_buf->page) { | 250 | if (rx_buf->is_page && rx_buf->u.page) { |
239 | struct efx_rx_page_state *state; | 251 | struct efx_rx_page_state *state; |
240 | 252 | ||
241 | EFX_BUG_ON_PARANOID(rx_buf->skb); | 253 | state = page_address(rx_buf->u.page); |
242 | |||
243 | state = page_address(rx_buf->page); | ||
244 | if (--state->refcnt == 0) { | 254 | if (--state->refcnt == 0) { |
245 | pci_unmap_page(efx->pci_dev, | 255 | pci_unmap_page(efx->pci_dev, |
246 | state->dma_addr, | 256 | state->dma_addr, |
247 | efx_rx_buf_size(efx), | 257 | efx_rx_buf_size(efx), |
248 | PCI_DMA_FROMDEVICE); | 258 | PCI_DMA_FROMDEVICE); |
249 | } | 259 | } |
250 | } else if (likely(rx_buf->skb)) { | 260 | } else if (!rx_buf->is_page && rx_buf->u.skb) { |
251 | pci_unmap_single(efx->pci_dev, rx_buf->dma_addr, | 261 | pci_unmap_single(efx->pci_dev, rx_buf->dma_addr, |
252 | rx_buf->len, PCI_DMA_FROMDEVICE); | 262 | rx_buf->len, PCI_DMA_FROMDEVICE); |
253 | } | 263 | } |
@@ -256,12 +266,12 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx, | |||
256 | static void efx_free_rx_buffer(struct efx_nic *efx, | 266 | static void efx_free_rx_buffer(struct efx_nic *efx, |
257 | struct efx_rx_buffer *rx_buf) | 267 | struct efx_rx_buffer *rx_buf) |
258 | { | 268 | { |
259 | if (rx_buf->page) { | 269 | if (rx_buf->is_page && rx_buf->u.page) { |
260 | __free_pages(rx_buf->page, efx->rx_buffer_order); | 270 | __free_pages(rx_buf->u.page, efx->rx_buffer_order); |
261 | rx_buf->page = NULL; | 271 | rx_buf->u.page = NULL; |
262 | } else if (likely(rx_buf->skb)) { | 272 | } else if (!rx_buf->is_page && rx_buf->u.skb) { |
263 | dev_kfree_skb_any(rx_buf->skb); | 273 | dev_kfree_skb_any(rx_buf->u.skb); |
264 | rx_buf->skb = NULL; | 274 | rx_buf->u.skb = NULL; |
265 | } | 275 | } |
266 | } | 276 | } |
267 | 277 | ||
@@ -277,7 +287,7 @@ static void efx_fini_rx_buffer(struct efx_rx_queue *rx_queue, | |||
277 | static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue, | 287 | static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue, |
278 | struct efx_rx_buffer *rx_buf) | 288 | struct efx_rx_buffer *rx_buf) |
279 | { | 289 | { |
280 | struct efx_rx_page_state *state = page_address(rx_buf->page); | 290 | struct efx_rx_page_state *state = page_address(rx_buf->u.page); |
281 | struct efx_rx_buffer *new_buf; | 291 | struct efx_rx_buffer *new_buf; |
282 | unsigned fill_level, index; | 292 | unsigned fill_level, index; |
283 | 293 | ||
@@ -292,16 +302,14 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue, | |||
292 | } | 302 | } |
293 | 303 | ||
294 | ++state->refcnt; | 304 | ++state->refcnt; |
295 | get_page(rx_buf->page); | 305 | get_page(rx_buf->u.page); |
296 | 306 | ||
297 | index = rx_queue->added_count & rx_queue->ptr_mask; | 307 | index = rx_queue->added_count & rx_queue->ptr_mask; |
298 | new_buf = efx_rx_buffer(rx_queue, index); | 308 | new_buf = efx_rx_buffer(rx_queue, index); |
299 | new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1); | 309 | new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1); |
300 | new_buf->skb = NULL; | 310 | new_buf->u.page = rx_buf->u.page; |
301 | new_buf->page = rx_buf->page; | ||
302 | new_buf->data = (void *) | ||
303 | ((__force unsigned long)rx_buf->data ^ (PAGE_SIZE >> 1)); | ||
304 | new_buf->len = rx_buf->len; | 311 | new_buf->len = rx_buf->len; |
312 | new_buf->is_page = true; | ||
305 | ++rx_queue->added_count; | 313 | ++rx_queue->added_count; |
306 | } | 314 | } |
307 | 315 | ||
@@ -315,16 +323,15 @@ static void efx_recycle_rx_buffer(struct efx_channel *channel, | |||
315 | struct efx_rx_buffer *new_buf; | 323 | struct efx_rx_buffer *new_buf; |
316 | unsigned index; | 324 | unsigned index; |
317 | 325 | ||
318 | if (rx_buf->page != NULL && efx->rx_buffer_len <= EFX_RX_HALF_PAGE && | 326 | if (rx_buf->is_page && efx->rx_buffer_len <= EFX_RX_HALF_PAGE && |
319 | page_count(rx_buf->page) == 1) | 327 | page_count(rx_buf->u.page) == 1) |
320 | efx_resurrect_rx_buffer(rx_queue, rx_buf); | 328 | efx_resurrect_rx_buffer(rx_queue, rx_buf); |
321 | 329 | ||
322 | index = rx_queue->added_count & rx_queue->ptr_mask; | 330 | index = rx_queue->added_count & rx_queue->ptr_mask; |
323 | new_buf = efx_rx_buffer(rx_queue, index); | 331 | new_buf = efx_rx_buffer(rx_queue, index); |
324 | 332 | ||
325 | memcpy(new_buf, rx_buf, sizeof(*new_buf)); | 333 | memcpy(new_buf, rx_buf, sizeof(*new_buf)); |
326 | rx_buf->page = NULL; | 334 | rx_buf->u.page = NULL; |
327 | rx_buf->skb = NULL; | ||
328 | ++rx_queue->added_count; | 335 | ++rx_queue->added_count; |
329 | } | 336 | } |
330 | 337 | ||
@@ -428,7 +435,7 @@ static void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue, | |||
428 | * data at the end of the skb will be trashed. So | 435 | * data at the end of the skb will be trashed. So |
429 | * we have no choice but to leak the fragment. | 436 | * we have no choice but to leak the fragment. |
430 | */ | 437 | */ |
431 | *leak_packet = (rx_buf->skb != NULL); | 438 | *leak_packet = !rx_buf->is_page; |
432 | efx_schedule_reset(efx, RESET_TYPE_RX_RECOVERY); | 439 | efx_schedule_reset(efx, RESET_TYPE_RX_RECOVERY); |
433 | } else { | 440 | } else { |
434 | if (net_ratelimit()) | 441 | if (net_ratelimit()) |
@@ -448,19 +455,18 @@ static void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue, | |||
448 | */ | 455 | */ |
449 | static void efx_rx_packet_gro(struct efx_channel *channel, | 456 | static void efx_rx_packet_gro(struct efx_channel *channel, |
450 | struct efx_rx_buffer *rx_buf, | 457 | struct efx_rx_buffer *rx_buf, |
451 | bool checksummed) | 458 | const u8 *eh, bool checksummed) |
452 | { | 459 | { |
453 | struct napi_struct *napi = &channel->napi_str; | 460 | struct napi_struct *napi = &channel->napi_str; |
454 | gro_result_t gro_result; | 461 | gro_result_t gro_result; |
455 | 462 | ||
456 | /* Pass the skb/page into the GRO engine */ | 463 | /* Pass the skb/page into the GRO engine */ |
457 | if (rx_buf->page) { | 464 | if (rx_buf->is_page) { |
458 | struct efx_nic *efx = channel->efx; | 465 | struct efx_nic *efx = channel->efx; |
459 | struct page *page = rx_buf->page; | 466 | struct page *page = rx_buf->u.page; |
460 | struct sk_buff *skb; | 467 | struct sk_buff *skb; |
461 | 468 | ||
462 | EFX_BUG_ON_PARANOID(rx_buf->skb); | 469 | rx_buf->u.page = NULL; |
463 | rx_buf->page = NULL; | ||
464 | 470 | ||
465 | skb = napi_get_frags(napi); | 471 | skb = napi_get_frags(napi); |
466 | if (!skb) { | 472 | if (!skb) { |
@@ -469,11 +475,11 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
469 | } | 475 | } |
470 | 476 | ||
471 | if (efx->net_dev->features & NETIF_F_RXHASH) | 477 | if (efx->net_dev->features & NETIF_F_RXHASH) |
472 | skb->rxhash = efx_rx_buf_hash(rx_buf); | 478 | skb->rxhash = efx_rx_buf_hash(eh); |
473 | 479 | ||
474 | skb_shinfo(skb)->frags[0].page = page; | 480 | skb_shinfo(skb)->frags[0].page = page; |
475 | skb_shinfo(skb)->frags[0].page_offset = | 481 | skb_shinfo(skb)->frags[0].page_offset = |
476 | efx_rx_buf_offset(rx_buf); | 482 | efx_rx_buf_offset(efx, rx_buf); |
477 | skb_shinfo(skb)->frags[0].size = rx_buf->len; | 483 | skb_shinfo(skb)->frags[0].size = rx_buf->len; |
478 | skb_shinfo(skb)->nr_frags = 1; | 484 | skb_shinfo(skb)->nr_frags = 1; |
479 | 485 | ||
@@ -487,11 +493,10 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
487 | 493 | ||
488 | gro_result = napi_gro_frags(napi); | 494 | gro_result = napi_gro_frags(napi); |
489 | } else { | 495 | } else { |
490 | struct sk_buff *skb = rx_buf->skb; | 496 | struct sk_buff *skb = rx_buf->u.skb; |
491 | 497 | ||
492 | EFX_BUG_ON_PARANOID(!skb); | ||
493 | EFX_BUG_ON_PARANOID(!checksummed); | 498 | EFX_BUG_ON_PARANOID(!checksummed); |
494 | rx_buf->skb = NULL; | 499 | rx_buf->u.skb = NULL; |
495 | 500 | ||
496 | gro_result = napi_gro_receive(napi, skb); | 501 | gro_result = napi_gro_receive(napi, skb); |
497 | } | 502 | } |
@@ -513,9 +518,6 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, | |||
513 | bool leak_packet = false; | 518 | bool leak_packet = false; |
514 | 519 | ||
515 | rx_buf = efx_rx_buffer(rx_queue, index); | 520 | rx_buf = efx_rx_buffer(rx_queue, index); |
516 | EFX_BUG_ON_PARANOID(!rx_buf->data); | ||
517 | EFX_BUG_ON_PARANOID(rx_buf->skb && rx_buf->page); | ||
518 | EFX_BUG_ON_PARANOID(!(rx_buf->skb || rx_buf->page)); | ||
519 | 521 | ||
520 | /* This allows the refill path to post another buffer. | 522 | /* This allows the refill path to post another buffer. |
521 | * EFX_RXD_HEAD_ROOM ensures that the slot we are using | 523 | * EFX_RXD_HEAD_ROOM ensures that the slot we are using |
@@ -554,12 +556,12 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, | |||
554 | /* Prefetch nice and early so data will (hopefully) be in cache by | 556 | /* Prefetch nice and early so data will (hopefully) be in cache by |
555 | * the time we look at it. | 557 | * the time we look at it. |
556 | */ | 558 | */ |
557 | prefetch(rx_buf->data); | 559 | prefetch(efx_rx_buf_eh(efx, rx_buf)); |
558 | 560 | ||
559 | /* Pipeline receives so that we give time for packet headers to be | 561 | /* Pipeline receives so that we give time for packet headers to be |
560 | * prefetched into cache. | 562 | * prefetched into cache. |
561 | */ | 563 | */ |
562 | rx_buf->len = len; | 564 | rx_buf->len = len - efx->type->rx_buffer_hash_size; |
563 | out: | 565 | out: |
564 | if (channel->rx_pkt) | 566 | if (channel->rx_pkt) |
565 | __efx_rx_packet(channel, | 567 | __efx_rx_packet(channel, |
@@ -574,45 +576,43 @@ void __efx_rx_packet(struct efx_channel *channel, | |||
574 | { | 576 | { |
575 | struct efx_nic *efx = channel->efx; | 577 | struct efx_nic *efx = channel->efx; |
576 | struct sk_buff *skb; | 578 | struct sk_buff *skb; |
577 | 579 | u8 *eh = efx_rx_buf_eh(efx, rx_buf); | |
578 | rx_buf->data += efx->type->rx_buffer_hash_size; | ||
579 | rx_buf->len -= efx->type->rx_buffer_hash_size; | ||
580 | 580 | ||
581 | /* If we're in loopback test, then pass the packet directly to the | 581 | /* If we're in loopback test, then pass the packet directly to the |
582 | * loopback layer, and free the rx_buf here | 582 | * loopback layer, and free the rx_buf here |
583 | */ | 583 | */ |
584 | if (unlikely(efx->loopback_selftest)) { | 584 | if (unlikely(efx->loopback_selftest)) { |
585 | efx_loopback_rx_packet(efx, rx_buf->data, rx_buf->len); | 585 | efx_loopback_rx_packet(efx, eh, rx_buf->len); |
586 | efx_free_rx_buffer(efx, rx_buf); | 586 | efx_free_rx_buffer(efx, rx_buf); |
587 | return; | 587 | return; |
588 | } | 588 | } |
589 | 589 | ||
590 | if (rx_buf->skb) { | 590 | if (!rx_buf->is_page) { |
591 | prefetch(skb_shinfo(rx_buf->skb)); | 591 | skb = rx_buf->u.skb; |
592 | 592 | ||
593 | skb_reserve(rx_buf->skb, efx->type->rx_buffer_hash_size); | 593 | prefetch(skb_shinfo(skb)); |
594 | skb_put(rx_buf->skb, rx_buf->len); | 594 | |
595 | skb_reserve(skb, efx->type->rx_buffer_hash_size); | ||
596 | skb_put(skb, rx_buf->len); | ||
595 | 597 | ||
596 | if (efx->net_dev->features & NETIF_F_RXHASH) | 598 | if (efx->net_dev->features & NETIF_F_RXHASH) |
597 | rx_buf->skb->rxhash = efx_rx_buf_hash(rx_buf); | 599 | skb->rxhash = efx_rx_buf_hash(eh); |
598 | 600 | ||
599 | /* Move past the ethernet header. rx_buf->data still points | 601 | /* Move past the ethernet header. rx_buf->data still points |
600 | * at the ethernet header */ | 602 | * at the ethernet header */ |
601 | rx_buf->skb->protocol = eth_type_trans(rx_buf->skb, | 603 | skb->protocol = eth_type_trans(skb, efx->net_dev); |
602 | efx->net_dev); | ||
603 | 604 | ||
604 | skb_record_rx_queue(rx_buf->skb, channel->channel); | 605 | skb_record_rx_queue(skb, channel->channel); |
605 | } | 606 | } |
606 | 607 | ||
607 | if (likely(checksummed || rx_buf->page)) { | 608 | if (likely(checksummed || rx_buf->is_page)) { |
608 | efx_rx_packet_gro(channel, rx_buf, checksummed); | 609 | efx_rx_packet_gro(channel, rx_buf, eh, checksummed); |
609 | return; | 610 | return; |
610 | } | 611 | } |
611 | 612 | ||
612 | /* We now own the SKB */ | 613 | /* We now own the SKB */ |
613 | skb = rx_buf->skb; | 614 | skb = rx_buf->u.skb; |
614 | rx_buf->skb = NULL; | 615 | rx_buf->u.skb = NULL; |
615 | EFX_BUG_ON_PARANOID(!skb); | ||
616 | 616 | ||
617 | /* Set the SKB flags */ | 617 | /* Set the SKB flags */ |
618 | skb_checksum_none_assert(skb); | 618 | skb_checksum_none_assert(skb); |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index f936892aa423..a0f49b348d62 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/selftest.h b/drivers/net/sfc/selftest.h index aed495a4dad7..dba5456e70f3 100644 --- a/drivers/net/sfc/selftest.h +++ b/drivers/net/sfc/selftest.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2008 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index bf8456176443..e4dd8986b1fe 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -227,13 +227,6 @@ static int siena_probe_nic(struct efx_nic *efx) | |||
227 | if (rc) | 227 | if (rc) |
228 | goto fail1; | 228 | goto fail1; |
229 | 229 | ||
230 | rc = efx_mcdi_fwver(efx, &nic_data->fw_version, &nic_data->fw_build); | ||
231 | if (rc) { | ||
232 | netif_err(efx, probe, efx->net_dev, | ||
233 | "Failed to read MCPU firmware version - rc %d\n", rc); | ||
234 | goto fail1; /* MCPU absent? */ | ||
235 | } | ||
236 | |||
237 | /* Let the BMC know that the driver is now in charge of link and | 230 | /* Let the BMC know that the driver is now in charge of link and |
238 | * filter settings. We must do this before we reset the NIC */ | 231 | * filter settings. We must do this before we reset the NIC */ |
239 | rc = efx_mcdi_drv_attach(efx, true, &already_attached); | 232 | rc = efx_mcdi_drv_attach(efx, true, &already_attached); |
@@ -348,11 +341,6 @@ static int siena_init_nic(struct efx_nic *efx) | |||
348 | FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8); | 341 | FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8); |
349 | efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3); | 342 | efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3); |
350 | 343 | ||
351 | if (efx_nic_rx_xoff_thresh >= 0 || efx_nic_rx_xon_thresh >= 0) | ||
352 | /* No MCDI operation has been defined to set thresholds */ | ||
353 | netif_err(efx, hw, efx->net_dev, | ||
354 | "ignoring RX flow control thresholds\n"); | ||
355 | |||
356 | /* Enable event logging */ | 344 | /* Enable event logging */ |
357 | rc = efx_mcdi_log_ctrl(efx, true, false, 0); | 345 | rc = efx_mcdi_log_ctrl(efx, true, false, 0); |
358 | if (rc) | 346 | if (rc) |
@@ -514,16 +502,6 @@ static void siena_stop_nic_stats(struct efx_nic *efx) | |||
514 | efx_mcdi_mac_stats(efx, efx->stats_buffer.dma_addr, 0, 0, 0); | 502 | efx_mcdi_mac_stats(efx, efx->stats_buffer.dma_addr, 0, 0, 0); |
515 | } | 503 | } |
516 | 504 | ||
517 | void siena_print_fwver(struct efx_nic *efx, char *buf, size_t len) | ||
518 | { | ||
519 | struct siena_nic_data *nic_data = efx->nic_data; | ||
520 | snprintf(buf, len, "%u.%u.%u.%u", | ||
521 | (unsigned int)(nic_data->fw_version >> 48), | ||
522 | (unsigned int)(nic_data->fw_version >> 32 & 0xffff), | ||
523 | (unsigned int)(nic_data->fw_version >> 16 & 0xffff), | ||
524 | (unsigned int)(nic_data->fw_version & 0xffff)); | ||
525 | } | ||
526 | |||
527 | /************************************************************************** | 505 | /************************************************************************** |
528 | * | 506 | * |
529 | * Wake on LAN | 507 | * Wake on LAN |
diff --git a/drivers/net/sfc/spi.h b/drivers/net/sfc/spi.h index 879b7f6bde3d..71f2e3ebe1c7 100644 --- a/drivers/net/sfc/spi.h +++ b/drivers/net/sfc/spi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005 Fen Systems Ltd. | 3 | * Copyright 2005 Fen Systems Ltd. |
4 | * Copyright 2006 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index f102912eba91..efdceb35aaae 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2007-2009 Solarflare Communications Inc. | 3 | * Copyright 2007-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -196,7 +196,7 @@ static int tenxpress_phy_init(struct efx_nic *efx) | |||
196 | if (rc < 0) | 196 | if (rc < 0) |
197 | return rc; | 197 | return rc; |
198 | 198 | ||
199 | rc = efx_mdio_check_mmds(efx, TENXPRESS_REQUIRED_DEVS, 0); | 199 | rc = efx_mdio_check_mmds(efx, TENXPRESS_REQUIRED_DEVS); |
200 | if (rc < 0) | 200 | if (rc < 0) |
201 | return rc; | 201 | return rc; |
202 | } | 202 | } |
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 1a51653bb92b..139801908217 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2005-2009 Solarflare Communications Inc. | 4 | * Copyright 2005-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
diff --git a/drivers/net/sfc/txc43128_phy.c b/drivers/net/sfc/txc43128_phy.c index 351794a79215..d9886addcc99 100644 --- a/drivers/net/sfc/txc43128_phy.c +++ b/drivers/net/sfc/txc43128_phy.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2010 Solarflare Communications Inc. | 3 | * Copyright 2006-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -193,7 +193,7 @@ static int txc_reset_phy(struct efx_nic *efx) | |||
193 | goto fail; | 193 | goto fail; |
194 | 194 | ||
195 | /* Check that all the MMDs we expect are present and responding. */ | 195 | /* Check that all the MMDs we expect are present and responding. */ |
196 | rc = efx_mdio_check_mmds(efx, TXC_REQUIRED_DEVS, 0); | 196 | rc = efx_mdio_check_mmds(efx, TXC_REQUIRED_DEVS); |
197 | if (rc < 0) | 197 | if (rc < 0) |
198 | goto fail; | 198 | goto fail; |
199 | 199 | ||
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h index e0d63083c3a8..e4dd3a7f304b 100644 --- a/drivers/net/sfc/workarounds.h +++ b/drivers/net/sfc/workarounds.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2009 Solarflare Communications Inc. | 3 | * Copyright 2006-2010 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |