* [PATCH 16/18] tg3: Add 5717 NVRAM detection routines
From: Matt Carlson @ 2009-09-01 23:20 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
This patch adds NVRAM detection routines for the 5717.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 154 +++++++++++++++++++++++++++++++++++++----------------
drivers/net/tg3.h | 23 ++++++++-
2 files changed, 130 insertions(+), 47 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2310e56..bc9c13a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10853,6 +10853,33 @@ static void __devinit tg3_get_nvram_info(struct tg3 *tp)
}
}
+static void __devinit tg3_nvram_get_pagesize(struct tg3 *tp, u32 nvmcfg1)
+{
+ switch (nvmcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) {
+ case FLASH_5752PAGE_SIZE_256:
+ tp->nvram_pagesize = 256;
+ break;
+ case FLASH_5752PAGE_SIZE_512:
+ tp->nvram_pagesize = 512;
+ break;
+ case FLASH_5752PAGE_SIZE_1K:
+ tp->nvram_pagesize = 1024;
+ break;
+ case FLASH_5752PAGE_SIZE_2K:
+ tp->nvram_pagesize = 2048;
+ break;
+ case FLASH_5752PAGE_SIZE_4K:
+ tp->nvram_pagesize = 4096;
+ break;
+ case FLASH_5752PAGE_SIZE_264:
+ tp->nvram_pagesize = 264;
+ break;
+ case FLASH_5752PAGE_SIZE_528:
+ tp->nvram_pagesize = 528;
+ break;
+ }
+}
+
static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp)
{
u32 nvcfg1;
@@ -10884,26 +10911,7 @@ static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp)
}
if (tp->tg3_flags2 & TG3_FLG2_FLASH) {
- switch (nvcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) {
- case FLASH_5752PAGE_SIZE_256:
- tp->nvram_pagesize = 256;
- break;
- case FLASH_5752PAGE_SIZE_512:
- tp->nvram_pagesize = 512;
- break;
- case FLASH_5752PAGE_SIZE_1K:
- tp->nvram_pagesize = 1024;
- break;
- case FLASH_5752PAGE_SIZE_2K:
- tp->nvram_pagesize = 2048;
- break;
- case FLASH_5752PAGE_SIZE_4K:
- tp->nvram_pagesize = 4096;
- break;
- case FLASH_5752PAGE_SIZE_264:
- tp->nvram_pagesize = 264;
- break;
- }
+ tg3_nvram_get_pagesize(tp, nvcfg1);
} else {
/* For eeprom, set pagesize to maximum eeprom size */
tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
@@ -11156,34 +11164,84 @@ static void __devinit tg3_get_57780_nvram_info(struct tg3 *tp)
return;
}
- switch (nvcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) {
- case FLASH_5752PAGE_SIZE_256:
+ tg3_nvram_get_pagesize(tp, nvcfg1);
+ if (tp->nvram_pagesize != 264 && tp->nvram_pagesize != 528)
tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
- tp->nvram_pagesize = 256;
- break;
- case FLASH_5752PAGE_SIZE_512:
- tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
- tp->nvram_pagesize = 512;
- break;
- case FLASH_5752PAGE_SIZE_1K:
- tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
- tp->nvram_pagesize = 1024;
- break;
- case FLASH_5752PAGE_SIZE_2K:
- tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
- tp->nvram_pagesize = 2048;
- break;
- case FLASH_5752PAGE_SIZE_4K:
- tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
- tp->nvram_pagesize = 4096;
- break;
- case FLASH_5752PAGE_SIZE_264:
- tp->nvram_pagesize = 264;
+}
+
+
+static void __devinit tg3_get_5717_nvram_info(struct tg3 *tp)
+{
+ u32 nvcfg1;
+
+ nvcfg1 = tr32(NVRAM_CFG1);
+
+ switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
+ case FLASH_5717VENDOR_ATMEL_EEPROM:
+ case FLASH_5717VENDOR_MICRO_EEPROM:
+ tp->nvram_jedecnum = JEDEC_ATMEL;
+ tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
+ tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
+
+ nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
+ tw32(NVRAM_CFG1, nvcfg1);
+ return;
+ case FLASH_5717VENDOR_ATMEL_MDB011D:
+ case FLASH_5717VENDOR_ATMEL_ADB011B:
+ case FLASH_5717VENDOR_ATMEL_ADB011D:
+ case FLASH_5717VENDOR_ATMEL_MDB021D:
+ case FLASH_5717VENDOR_ATMEL_ADB021B:
+ case FLASH_5717VENDOR_ATMEL_ADB021D:
+ case FLASH_5717VENDOR_ATMEL_45USPT:
+ tp->nvram_jedecnum = JEDEC_ATMEL;
+ tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
+ tp->tg3_flags2 |= TG3_FLG2_FLASH;
+
+ switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
+ case FLASH_5717VENDOR_ATMEL_MDB021D:
+ case FLASH_5717VENDOR_ATMEL_ADB021B:
+ case FLASH_5717VENDOR_ATMEL_ADB021D:
+ tp->nvram_size = TG3_NVRAM_SIZE_256KB;
+ break;
+ default:
+ tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+ break;
+ }
break;
- case FLASH_5752PAGE_SIZE_528:
- tp->nvram_pagesize = 528;
+ case FLASH_5717VENDOR_ST_M_M25PE10:
+ case FLASH_5717VENDOR_ST_A_M25PE10:
+ case FLASH_5717VENDOR_ST_M_M45PE10:
+ case FLASH_5717VENDOR_ST_A_M45PE10:
+ case FLASH_5717VENDOR_ST_M_M25PE20:
+ case FLASH_5717VENDOR_ST_A_M25PE20:
+ case FLASH_5717VENDOR_ST_M_M45PE20:
+ case FLASH_5717VENDOR_ST_A_M45PE20:
+ case FLASH_5717VENDOR_ST_25USPT:
+ case FLASH_5717VENDOR_ST_45USPT:
+ tp->nvram_jedecnum = JEDEC_ST;
+ tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
+ tp->tg3_flags2 |= TG3_FLG2_FLASH;
+
+ switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
+ case FLASH_5717VENDOR_ST_M_M25PE20:
+ case FLASH_5717VENDOR_ST_A_M25PE20:
+ case FLASH_5717VENDOR_ST_M_M45PE20:
+ case FLASH_5717VENDOR_ST_A_M45PE20:
+ tp->nvram_size = TG3_NVRAM_SIZE_256KB;
+ break;
+ default:
+ tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+ break;
+ }
break;
+ default:
+ tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM;
+ return;
}
+
+ tg3_nvram_get_pagesize(tp, nvcfg1);
+ if (tp->nvram_pagesize != 264 && tp->nvram_pagesize != 528)
+ tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS;
}
/* Chips other than 5700/5701 use the NVRAM for fetching info. */
@@ -11228,6 +11286,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
tg3_get_5906_nvram_info(tp);
else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
tg3_get_57780_nvram_info(tp);
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ tg3_get_5717_nvram_info(tp);
else
tg3_get_nvram_info(tp);
@@ -13074,8 +13134,10 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
tw32_f(NVRAM_CMD, NVRAM_CMD_RESET);
else
tg3_nvram_unlock(tp);
- }
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC)
+ mac_offset = 0xcc;
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
mac_offset = 0x10;
/* First try to get it from MAC address mailbox. */
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 5994476..ea57a3a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1027,8 +1027,10 @@
#define TG3_CPMU_HST_ACC 0x0000361c
#define CPMU_HST_ACC_MACCLK_MASK 0x001f0000
#define CPMU_HST_ACC_MACCLK_6_25 0x00130000
-/* 0x3620 --> 0x3630 unused */
+/* 0x3620 --> 0x362c unused */
+#define TG3_CPMU_STATUS 0x0000362c
+#define TG3_CPMU_STATUS_PCIE_FUNC 0x20000000
#define TG3_CPMU_CLCK_STAT 0x00003630
#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
@@ -1692,6 +1694,25 @@
#define FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002
#define FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001
#define FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001
+#define FLASH_5717VENDOR_ATMEL_EEPROM 0x02000001
+#define FLASH_5717VENDOR_MICRO_EEPROM 0x02000003
+#define FLASH_5717VENDOR_ATMEL_MDB011D 0x01000001
+#define FLASH_5717VENDOR_ATMEL_MDB021D 0x01000003
+#define FLASH_5717VENDOR_ST_M_M25PE10 0x02000000
+#define FLASH_5717VENDOR_ST_M_M25PE20 0x02000002
+#define FLASH_5717VENDOR_ST_M_M45PE10 0x00000001
+#define FLASH_5717VENDOR_ST_M_M45PE20 0x00000003
+#define FLASH_5717VENDOR_ATMEL_ADB011B 0x01400000
+#define FLASH_5717VENDOR_ATMEL_ADB021B 0x01400002
+#define FLASH_5717VENDOR_ATMEL_ADB011D 0x01400001
+#define FLASH_5717VENDOR_ATMEL_ADB021D 0x01400003
+#define FLASH_5717VENDOR_ST_A_M25PE10 0x02400000
+#define FLASH_5717VENDOR_ST_A_M25PE20 0x02400002
+#define FLASH_5717VENDOR_ST_A_M45PE10 0x02400001
+#define FLASH_5717VENDOR_ST_A_M45PE20 0x02400003
+#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000
+#define FLASH_5717VENDOR_ST_25USPT 0x03400002
+#define FLASH_5717VENDOR_ST_45USPT 0x03400001
#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000
#define FLASH_5752PAGE_SIZE_256 0x00000000
#define FLASH_5752PAGE_SIZE_512 0x10000000
--
1.6.3.3
^ permalink raw reply related
* [PATCH 18/18] tg3: Update version to 3.102
From: Matt Carlson @ 2009-09-01 23:22 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
This patch updates the tg3 version to 3.102.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a7eb6a0..b669b6f 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "3.101"
-#define DRV_MODULE_RELDATE "August 28, 2009"
+#define DRV_MODULE_VERSION "3.102"
+#define DRV_MODULE_RELDATE "September 1, 2009"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
--
1.6.3.3
^ permalink raw reply related
* [PATCH 10/18] tg3: Enable NAPI instances for other int vectors
From: Matt Carlson @ 2009-09-01 23:10 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
This patch adds code to enable and disable the rest of the NAPI
instances.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2e0f4a5..ad0fc5d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -694,25 +694,39 @@ static void tg3_int_reenable(struct tg3_napi *tnapi)
HOSTCC_MODE_ENABLE | tnapi->coal_now);
}
+static void tg3_napi_disable(struct tg3 *tp)
+{
+ int i;
+
+ for (i = tp->irq_cnt - 1; i >= 0; i--)
+ napi_disable(&tp->napi[i].napi);
+}
+
+static void tg3_napi_enable(struct tg3 *tp)
+{
+ int i;
+
+ for (i = 0; i < tp->irq_cnt; i++)
+ napi_enable(&tp->napi[i].napi);
+}
+
static inline void tg3_netif_stop(struct tg3 *tp)
{
tp->dev->trans_start = jiffies; /* prevent tx timeout */
- napi_disable(&tp->napi[0].napi);
+ tg3_napi_disable(tp);
netif_tx_disable(tp->dev);
}
static inline void tg3_netif_start(struct tg3 *tp)
{
- struct tg3_napi *tnapi = &tp->napi[0];
-
/* NOTE: unconditional netif_tx_wake_all_queues is only
* appropriate so long as all callers are assured to
* have free tx slots (such as after tg3_init_hw)
*/
netif_tx_wake_all_queues(tp->dev);
- napi_enable(&tnapi->napi);
- tnapi->hw_status->status |= SD_STATUS_UPDATED;
+ tg3_napi_enable(tp);
+ tp->napi[0].hw_status->status |= SD_STATUS_UPDATED;
tg3_enable_ints(tp);
}
@@ -4958,7 +4972,7 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
tg3_full_unlock(tp);
del_timer_sync(&tp->timer);
tp->irq_sync = 0;
- napi_enable(&tp->napi[0].napi);
+ tg3_napi_enable(tp);
dev_close(tp->dev);
tg3_full_lock(tp, 0);
}
@@ -8153,7 +8167,7 @@ static int tg3_open(struct net_device *dev)
if (err)
goto err_out1;
- napi_enable(&tp->napi[0].napi);
+ tg3_napi_enable(tp);
for (i = 0; i < tp->irq_cnt; i++) {
struct tg3_napi *tnapi = &tp->napi[i];
@@ -8240,7 +8254,7 @@ err_out3:
}
err_out2:
- napi_disable(&tp->napi[0].napi);
+ tg3_napi_disable(tp);
tg3_free_consistent(tp);
err_out1:
@@ -8486,7 +8500,7 @@ static int tg3_close(struct net_device *dev)
int i;
struct tg3 *tp = netdev_priv(dev);
- napi_disable(&tp->napi[0].napi);
+ tg3_napi_disable(tp);
cancel_work_sync(&tp->reset_task);
netif_tx_stop_all_queues(dev);
--
1.6.3.3
^ permalink raw reply related
* [PATCH 17/18] tg3: Add MDIO bus address assignments
From: Matt Carlson @ 2009-09-01 23:21 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
The 5717 is a dual port chip that has a shared MDIO bus design. While
it is impossible for one function to interface with the wrong phy, that
function still needs to know which MDIO bus address to use when
interfacing with its own phy. This patch adds code to determine which
MDIO bus address to use.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 23 +++++++++++++++++++----
drivers/net/tg3.h | 3 +++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index bc9c13a..a7eb6a0 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -782,7 +782,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
*val = 0x0;
- frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) &
+ frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) &
MI_COM_PHY_ADDR_MASK);
frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) &
MI_COM_REG_ADDR_MASK);
@@ -833,7 +833,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
udelay(80);
}
- frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) &
+ frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) &
MI_COM_PHY_ADDR_MASK);
frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) &
MI_COM_REG_ADDR_MASK);
@@ -1021,6 +1021,21 @@ static void tg3_mdio_start(struct tg3 *tp)
tw32_f(MAC_MI_MODE, tp->mi_mode);
udelay(80);
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ u32 funcnum, is_serdes;
+
+ funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC;
+ if (funcnum)
+ tp->phy_addr = 2;
+ else
+ tp->phy_addr = 1;
+
+ is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
+ if (is_serdes)
+ tp->phy_addr += 7;
+ } else
+ tp->phy_addr = PHY_ADDR;
+
if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
tg3_mdio_config_5785(tp);
@@ -9266,7 +9281,7 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->speed = tp->link_config.active_speed;
cmd->duplex = tp->link_config.active_duplex;
}
- cmd->phy_address = PHY_ADDR;
+ cmd->phy_address = tp->phy_addr;
cmd->transceiver = XCVR_INTERNAL;
cmd->autoneg = tp->link_config.autoneg;
cmd->maxtxpkt = 0;
@@ -10570,7 +10585,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
switch(cmd) {
case SIOCGMIIPHY:
- data->phy_id = PHY_ADDR;
+ data->phy_id = tp->phy_addr;
/* fallthru */
case SIOCGMIIREG: {
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index ea57a3a..82b45d8 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -694,6 +694,7 @@
#define SG_DIG_PARTNER_FULL_DUPLEX 0x00020000 /* If !MRADV_CRC16_SELECT */
#define SG_DIG_PARTNER_NEXT_PAGE 0x00010000 /* If !MRADV_CRC16_SELECT */
#define SG_DIG_AUTONEG_STATE_MASK 0x00000ff0
+#define SG_DIG_IS_SERDES 0x00000100
#define SG_DIG_COMMA_DETECTOR 0x00000008
#define SG_DIG_MAC_ACK_STATUS 0x00000004
#define SG_DIG_AUTONEG_COMPLETE 0x00000002
@@ -2805,6 +2806,8 @@ struct tg3 {
struct mii_bus *mdio_bus;
int mdio_irq[PHY_MAX_ADDR];
+ u8 phy_addr;
+
/* PHY info */
u32 phy_id;
#define PHY_ID_MASK 0xfffffff0
--
1.6.3.3
^ permalink raw reply related
* [PATCH 14/18] tg3: Assign rx ret producer indexes by vector
From: Matt Carlson @ 2009-09-01 23:19 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
When RSS is enabled, the status block format changes slightly. The
"rx_jumbo_consumer", "reserved", and "rx_mini_consumer" members get
mapped to the other three rx return ring producer indexes. This patch
introduces a new per-interrupt member which identifies which location
in the status block a particular vector should look for return ring
updates.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 31 +++++++++++++++++++++++++++----
drivers/net/tg3.h | 1 +
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 930229b..a2ff202 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -667,7 +667,7 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi)
}
/* check for RX/TX work to do */
if (sblk->idx[0].tx_consumer != tnapi->tx_cons ||
- sblk->idx[0].rx_producer != tnapi->rx_rcb_ptr)
+ *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
work_exists = 1;
return work_exists;
@@ -4518,7 +4518,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
int received;
struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
- hw_idx = tnapi->hw_status->idx[0].rx_producer;
+ hw_idx = *(tnapi->rx_rcb_prod_idx);
/*
* We need to order the read of hw_idx and the read of
* the opaque cookie.
@@ -4649,7 +4649,7 @@ next_pkt_nopost:
/* Refresh hw_idx to see if there is new work */
if (sw_idx == hw_idx) {
- hw_idx = tnapi->hw_status->idx[0].rx_producer;
+ hw_idx = *(tnapi->rx_rcb_prod_idx);
rmb();
}
}
@@ -4711,7 +4711,7 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
* All RX "locking" is done by ensuring outside
* code synchronizes with tg3->napi.poll()
*/
- if (sblk->idx[0].rx_producer != tnapi->rx_rcb_ptr)
+ if (*(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
work_done += tg3_rx(tnapi, budget - work_done);
return work_done;
@@ -5896,6 +5896,7 @@ static int tg3_alloc_consistent(struct tg3 *tp)
for (i = 0; i < tp->irq_cnt; i++) {
struct tg3_napi *tnapi = &tp->napi[i];
+ struct tg3_hw_status *sblk;
tnapi->hw_status = pci_alloc_consistent(tp->pdev,
TG3_HW_STATUS_SIZE,
@@ -5904,6 +5905,28 @@ static int tg3_alloc_consistent(struct tg3 *tp)
goto err_out;
memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
+ sblk = tnapi->hw_status;
+
+ /*
+ * When RSS is enabled, the status block format changes
+ * slightly. The "rx_jumbo_consumer", "reserved",
+ * and "rx_mini_consumer" members get mapped to the
+ * other three rx return ring producer indexes.
+ */
+ switch (i) {
+ default:
+ tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
+ break;
+ case 2:
+ tnapi->rx_rcb_prod_idx = &sblk->rx_jumbo_consumer;
+ break;
+ case 3:
+ tnapi->rx_rcb_prod_idx = &sblk->reserved;
+ break;
+ case 4:
+ tnapi->rx_rcb_prod_idx = &sblk->rx_mini_consumer;
+ break;
+ }
/*
* If multivector RSS is enabled, vector 0 does not handle
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 348add2..685d971 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2538,6 +2538,7 @@ struct tg3_napi {
u32 consmbox;
u32 rx_rcb_ptr;
+ u16 *rx_rcb_prod_idx;
struct tg3_rx_buffer_desc *rx_rcb;
struct tg3_tx_buffer_desc *tx_ring;
--
1.6.3.3
^ permalink raw reply related
* [PATCH 13/18] tg3: Adjust RSS ring allocation strategies
From: Matt Carlson @ 2009-09-01 23:16 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
When multivector RSS is enabled, the first interrupt vector is only used
to report link interrupts and error conditions. This patch changes the
code so that rx and tx ring resources are not allocated for this vector.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 39a8ead..930229b 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4804,7 +4804,8 @@ static irqreturn_t tg3_msi_1shot(int irq, void *dev_id)
struct tg3 *tp = tnapi->tp;
prefetch(tnapi->hw_status);
- prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]);
+ if (tnapi->rx_rcb)
+ prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]);
if (likely(!tg3_irq_sync(tp)))
napi_schedule(&tnapi->napi);
@@ -4822,7 +4823,8 @@ static irqreturn_t tg3_msi(int irq, void *dev_id)
struct tg3 *tp = tnapi->tp;
prefetch(tnapi->hw_status);
- prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]);
+ if (tnapi->rx_rcb)
+ prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]);
/*
* Writing any value to intr-mbox-0 clears PCI INTA# and
* chip-internal interrupt pending events.
@@ -5765,6 +5767,9 @@ static void tg3_free_rings(struct tg3 *tp)
for (j = 0; j < tp->irq_cnt; j++) {
struct tg3_napi *tnapi = &tp->napi[j];
+ if (!tnapi->tx_buffers)
+ continue;
+
for (i = 0; i < TG3_TX_RING_SIZE; ) {
struct tx_ring_info *txp;
struct sk_buff *skb;
@@ -5815,10 +5820,12 @@ static int tg3_init_rings(struct tg3 *tp)
tnapi->tx_prod = 0;
tnapi->tx_cons = 0;
- memset(tnapi->tx_ring, 0, TG3_TX_RING_BYTES);
+ if (tnapi->tx_ring)
+ memset(tnapi->tx_ring, 0, TG3_TX_RING_BYTES);
tnapi->rx_rcb_ptr = 0;
- memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+ if (tnapi->rx_rcb)
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
}
return tg3_rx_prodring_alloc(tp, &tp->prodring[0]);
@@ -5898,6 +5905,13 @@ static int tg3_alloc_consistent(struct tg3 *tp)
memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
+ /*
+ * If multivector RSS is enabled, vector 0 does not handle
+ * rx or tx interrupts. Don't allocate any resources for it.
+ */
+ if (!i && (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS))
+ continue;
+
tnapi->rx_rcb = pci_alloc_consistent(tp->pdev,
TG3_RX_RCB_RING_BYTES(tp),
&tnapi->rx_rcb_mapping);
@@ -10166,8 +10180,13 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
struct tg3_napi *tnapi, *rnapi;
struct tg3_rx_prodring_set *tpr = &tp->prodring[0];
- tnapi = &tp->napi[0];
- rnapi = &tp->napi[0];
+ if (tp->irq_cnt > 1) {
+ tnapi = &tp->napi[1];
+ rnapi = &tp->napi[1];
+ } else {
+ tnapi = &tp->napi[0];
+ rnapi = &tp->napi[0];
+ }
coal_now = tnapi->coal_now | rnapi->coal_now;
if (loopback_mode == TG3_MAC_LOOPBACK) {
--
1.6.3.3
^ permalink raw reply related
* [PATCH 15/18] tg3: Add 5717 asic rev
From: Matt Carlson @ 2009-09-01 23:19 UTC (permalink / raw)
To: davem; +Cc: netdev, andy
This patch adds the 5717 asic rev.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 130 +++++++++++++++++++++++++++++++++++++++++------------
drivers/net/tg3.h | 25 +++++++---
2 files changed, 119 insertions(+), 36 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a2ff202..2310e56 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -111,7 +111,8 @@
* replace things like '% foo' with '& (foo - 1)'.
*/
#define TG3_RX_RCB_RING_SIZE(tp) \
- ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ? 512 : 1024)
+ (((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) && \
+ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) ? 512 : 1024)
#define TG3_TX_RING_SIZE 512
#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
@@ -733,13 +734,15 @@ static inline void tg3_netif_start(struct tg3 *tp)
static void tg3_switch_clocks(struct tg3 *tp)
{
- u32 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL);
+ u32 clock_ctrl;
u32 orig_clock_ctrl;
if ((tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) ||
(tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
return;
+ clock_ctrl = tr32(TG3PCI_CLOCK_CTRL);
+
orig_clock_ctrl = clock_ctrl;
clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN |
CLOCK_CTRL_CLKRUN_OENABLE |
@@ -1993,8 +1996,9 @@ static void tg3_frob_aux_power(struct tg3 *tp)
if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0)
return;
- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
struct net_device *dev_peer;
dev_peer = pci_get_drvdata(tp->pdev_peer);
@@ -5211,6 +5215,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
mss = 0;
if ((mss = skb_shinfo(skb)->gso_size) != 0) {
int tcp_opt_len, ip_tcp_len;
+ u32 hdrlen;
if (skb_header_cloned(skb) &&
pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -5219,7 +5224,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
}
if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
- mss |= (skb_headlen(skb) - ETH_HLEN) << 9;
+ hdrlen = skb_headlen(skb) - ETH_HLEN;
else {
struct iphdr *iph = ip_hdr(skb);
@@ -5228,9 +5233,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
iph->check = 0;
iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
- mss |= (ip_tcp_len + tcp_opt_len) << 9;
+ hdrlen = ip_tcp_len + tcp_opt_len;
}
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ mss |= (hdrlen & 0xc) << 12;
+ if (hdrlen & 0x10)
+ base_flags |= 0x00000010;
+ base_flags |= (hdrlen & 0x3e0) << 5;
+ } else
+ mss |= hdrlen << 9;
+
base_flags |= (TXD_FLAG_CPU_PRE_DMA |
TXD_FLAG_CPU_POST_DMA);
@@ -5258,6 +5271,10 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
len = skb_headlen(skb);
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ !mss && skb->len > ETH_DATA_LEN)
+ base_flags |= TXD_FLAG_JMB_PKT;
+
tg3_set_txd(tnapi, entry, mapping, len, base_flags,
(skb_shinfo(skb)->nr_frags == 0) | (mss << 1));
@@ -6564,7 +6581,9 @@ static int tg3_chip_reset(struct tg3 *tp)
tg3_mdio_start(tp);
if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
- tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
+ tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
val = tr32(0x7c00);
tw32(0x7c00, val | (1 << 25));
@@ -6993,7 +7012,9 @@ static void tg3_rings_reset(struct tg3 *tp)
/* Disable all receive return rings but the first. */
- if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17;
+ else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4;
@@ -7197,7 +7218,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
return err;
if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) {
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
/* This value is determined during the probe time DMA
* engine test, tg3_test_dma.
*/
@@ -7351,7 +7373,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
BDINFO_FLAGS_DISABLED);
}
- val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
+ (RX_STD_MAX_SIZE << 2);
+ else
+ val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT;
} else
val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT;
@@ -7366,6 +7392,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
tpr->rx_jmb_ptr);
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tw32(STD_REPLENISH_LWM, 32);
+ tw32(JMB_REPLENISH_LWM, 16);
+ }
+
tg3_rings_reset(tp);
/* Initialize MAC address and backoff seed. */
@@ -8021,6 +8052,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
struct tg3_napi *tnapi = &tp->napi[0];
struct net_device *dev = tp->dev;
int err, i, intr_ok = 0;
+ u32 val;
if (!netif_running(dev))
return -ENODEV;
@@ -8029,6 +8061,16 @@ static int tg3_test_interrupt(struct tg3 *tp)
free_irq(tnapi->irq_vec, tnapi);
+ /*
+ * Turn off MSI one shot mode. Otherwise this test has no
+ * observable way to know whether the interrupt was delivered.
+ */
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+ }
+
err = request_irq(tnapi->irq_vec, tg3_test_isr,
IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi);
if (err)
@@ -8064,8 +8106,15 @@ static int tg3_test_interrupt(struct tg3 *tp)
if (err)
return err;
- if (intr_ok)
+ if (intr_ok) {
+ /* Reenable MSI one shot mode. */
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
+ val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
+ tw32(MSGINT_MODE, val);
+ }
return 0;
+ }
return -EIO;
}
@@ -8350,13 +8399,13 @@ static int tg3_open(struct net_device *dev)
goto err_out2;
}
- if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {
- if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) {
- u32 val = tr32(PCIE_TRANSACTION_CFG);
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ (tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
+ (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
+ u32 val = tr32(PCIE_TRANSACTION_CFG);
- tw32(PCIE_TRANSACTION_CFG,
- val | PCIE_TRANS_CFG_1SHOT_MSI);
- }
+ tw32(PCIE_TRANSACTION_CFG,
+ val | PCIE_TRANS_CFG_1SHOT_MSI);
}
}
@@ -9392,7 +9441,8 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
dev->features |= NETIF_F_TSO_ECN;
} else
dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN);
@@ -12291,8 +12341,17 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) {
u32 prod_id_asic_rev;
- pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV,
- &prod_id_asic_rev);
+ if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717C ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717S ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718C ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718S)
+ pci_read_config_dword(tp->pdev,
+ TG3PCI_GEN2_PRODID_ASICREV,
+ &prod_id_asic_rev);
+ else
+ pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV,
+ &prod_id_asic_rev);
+
tp->pci_chip_rev_id = prod_id_asic_rev;
}
@@ -12430,8 +12489,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
tp->misc_host_ctrl);
- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714))
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
tp->pdev_peer = tg3_find_peer(tp);
/* Intentionally exclude ASIC_REV_5906 */
@@ -12440,7 +12500,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
@@ -12490,8 +12551,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp->irq_max = 1;
+#ifdef TG3_NAPI
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
+ tp->irq_max = TG3_IRQ_MAX_VECS;
+ }
+#endif
+
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
- (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
+ (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE;
pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
@@ -12625,7 +12694,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp->write32 = tg3_write_flush_reg32;
}
-
if ((tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) ||
(tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)) {
tp->write32_tx_mbox = tg3_write32_tx_mbox;
@@ -12684,7 +12752,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
/* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
@@ -12762,7 +12831,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
!(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
- GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780) {
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
@@ -13486,7 +13556,8 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
{
- if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
+ if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
tp->bufmgr_config.mbuf_read_dma_low_water =
DEFAULT_MB_RDMA_LOW_WATER_5705;
tp->bufmgr_config.mbuf_mac_rx_low_water =
@@ -13925,7 +13996,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
dev->features |= NETIF_F_TSO_ECN;
}
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 685d971..5994476 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -46,6 +46,10 @@
#define TG3PCI_DEVICE_TIGON3_57788 0x1691
#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */
#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
+#define TG3PCI_DEVICE_TIGON3_5717C 0x1655
+#define TG3PCI_DEVICE_TIGON3_5717S 0x1656
+#define TG3PCI_DEVICE_TIGON3_5718C 0x1665
+#define TG3PCI_DEVICE_TIGON3_5718S 0x1666
/* 0x04 --> 0x64 unused */
#define TG3PCI_MSI_DATA 0x00000064
/* 0x66 --> 0x68 unused */
@@ -117,6 +121,7 @@
#define ASIC_REV_5761 0x5761
#define ASIC_REV_5785 0x5785
#define ASIC_REV_57780 0x57780
+#define ASIC_REV_5717 0x5717
#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
#define CHIPREV_5700_AX 0x70
#define CHIPREV_5700_BX 0x71
@@ -203,20 +208,20 @@
#define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c
#define TG3PCI_REG_DATA 0x00000080
#define TG3PCI_MEM_WIN_DATA 0x00000084
-#define TG3PCI_MODE_CTRL 0x00000088
-#define TG3PCI_MISC_CFG 0x0000008c
#define TG3PCI_MISC_LOCAL_CTRL 0x00000090
/* 0x94 --> 0x98 unused */
#define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */
#define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */
-#define TG3PCI_SND_PROD_IDX 0x000000a8 /* 64-bit */
-/* 0xb0 --> 0xb8 unused */
+/* 0xa0 --> 0xb8 unused */
#define TG3PCI_DUAL_MAC_CTRL 0x000000b8
#define DUAL_MAC_CTRL_CH_MASK 0x00000003
#define DUAL_MAC_CTRL_ID 0x00000004
#define TG3PCI_PRODID_ASICREV 0x000000bc
#define PROD_ID_ASIC_REV_MASK 0x0fffffff
-/* 0xc0 --> 0x110 unused */
+/* 0xc0 --> 0xf4 unused */
+
+#define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4
+/* 0xf8 --> 0x200 unused */
#define TG3_CORR_ERR_STAT 0x00000110
#define TG3_CORR_ERR_STAT_CLEAR 0xffffffff
@@ -972,7 +977,11 @@
#define RCVBDI_MINI_THRESH 0x00002c14
#define RCVBDI_STD_THRESH 0x00002c18
#define RCVBDI_JUMBO_THRESH 0x00002c1c
-/* 0x2c20 --> 0x3000 unused */
+/* 0x2c20 --> 0x2d00 unused */
+
+#define STD_REPLENISH_LWM 0x00002d00
+#define JMB_REPLENISH_LWM 0x00002d04
+/* 0x2d08 --> 0x3000 unused */
/* Receive BD Completion Control Registers */
#define RCVCC_MODE 0x00003000
@@ -1486,6 +1495,7 @@
#define MSGINT_MODE 0x00006000
#define MSGINT_MODE_RESET 0x00000001
#define MSGINT_MODE_ENABLE 0x00000002
+#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020
#define MSGINT_MODE_MULTIVEC_EN 0x00000080
#define MSGINT_STATUS 0x00006004
#define MSGINT_FIFO 0x00006008
@@ -2124,6 +2134,7 @@ struct tg3_tx_buffer_desc {
#define TXD_FLAG_IP_CSUM 0x0002
#define TXD_FLAG_END 0x0004
#define TXD_FLAG_IP_FRAG 0x0008
+#define TXD_FLAG_JMB_PKT 0x0008
#define TXD_FLAG_IP_FRAG_END 0x0010
#define TXD_FLAG_VLAN 0x0040
#define TXD_FLAG_COAL_NOW 0x0080
@@ -2520,7 +2531,7 @@ struct tg3_rx_prodring_set {
dma_addr_t rx_jmb_mapping;
};
-#define TG3_IRQ_MAX_VECS 1
+#define TG3_IRQ_MAX_VECS 5
struct tg3_napi {
struct napi_struct napi ____cacheline_aligned;
--
1.6.3.3
^ permalink raw reply related
* Re: Receive side performance issue with multi-10-GigE and NUMA
From: Bill Fink @ 2009-09-02 5:11 UTC (permalink / raw)
To: Neil Horman; +Cc: Linux Network Developers, brice, gallatin
In-Reply-To: <20090827175151.GC4762@hmsreliant.think-freely.org>
On Thu, 27 Aug 2009, Neil Horman wrote:
> On Thu, Aug 27, 2009 at 01:44:29PM -0400, Bill Fink wrote:
> > On Wed, 26 Aug 2009, Neil Horman wrote:
> >
> > > On Wed, Aug 26, 2009 at 07:00:13AM -0400, Neil Horman wrote:
> > > > On Wed, Aug 26, 2009 at 03:10:57AM -0400, Bill Fink wrote:
> > > >
> > > > > Fortunately, in this specific case, the SuperMicro X8DAH+-F system
> > > > > does have a serial console, and after a fair amount of effort I was
> > > > > able to get it to work as desired, and was able to finally capture
> > > > > a backtrace of the kernel oops. BTW I believe the reason the
> > > > > kexec/kdump didn't work was probably because it couldn't find
> > > > > a /proc/vmcore file, although I don't know why that would be,
> > > > > and the Fedora 10 /etc/init.d/kdump script will then just boot
> > > > > up normally if it fails to find the /proc/vmcore file (or it's
> > > > > zero size).
> > > > >
> > > > I take care of kdump for fedora and RHEL. If you file a bug on this, I'd be
> > > > happy to look into it further.
> > > >
> > > > > The following shows a simple ping test usage of the skb_sources
> > > > > tracing feature:
> > > > >
> > > > > [root@xeontest1 tracing]# numactl --membind=1 taskset -c 4 ping -c 5 -s 1472 192.168.1.10
> > > > > PING 192.168.1.10 (192.168.1.10) 1472(1500) bytes of data.
> > > > > 1480 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.139 ms
> > > > > 1480 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.182 ms
> > > > > 1480 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=0.178 ms
> > > > > 1480 bytes from 192.168.1.10: icmp_seq=4 ttl=64 time=0.188 ms
> > > > > 1480 bytes from 192.168.1.10: icmp_seq=5 ttl=64 time=0.178 ms
> > > > >
> > > > > --- 192.168.1.10 ping statistics ---
> > > > > 5 packets transmitted, 5 received, 0% packet loss, time 3999ms
> > > > > rtt min/avg/max/mdev = 0.139/0.173/0.188/0.017 ms
> > > > >
> > > > > [root@xeontest1 tracing]# cat trace
> > > > > # tracer: skb_sources
> > > > > #
> > > > > # PID ANID CNID IFC RXQ CCPU LEN
> > > > > # | | | | | | |
> > > > > 4217 1 1 eth2 0 4 1500
> > > > > 4217 1 1 eth2 0 4 1500
> > > > > 4217 1 1 eth2 0 4 1500
> > > > > 4217 1 1 eth2 0 4 1500
> > > > > 4217 1 1 eth2 0 4 1500
> > > > >
> > > > > All is as was expected.
> > > > >
> > > > > But if I try an actual nuttcp performance test (even rate limited
> > > > > to 1 Mbps), I get the following kernel oops:
> > > > >
> > > > thank you, I think I see the problem, I'll have a patch for you in just a bit
> > > >
> > > > Thanks
> > > > Neil
> > > >
> > > > > [root@xeontest1 tracing]# numactl --membind=1 nuttcp -In2 -Ri1m -xc4/0 192.168.1.10
> > > > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
> > > > > IP: [<ffffffff810b01ab>] probe_skb_dequeue+0xf7/0x152
> > > > > PGD 337d12067 PUD 337d11067 PMD 0
> > > > > Oops: 0000 [#1] SMP
> > > > > last sysfs file: /sys/devices/pci0000:80/0000:80:07.0/0000:8b:00.0/0000:8c:04.0e
> > > > > CPU 4
> > > > > Modules linked in: w83627ehf hwmon_vid coretemp hwmon ipv6 dm_multipath uinput ]
> > > > > Pid: 4222, comm: nuttcp Not tainted 2.6.31-rc6-bf #3 X8DAH
> > > > > RIP: 0010:[<ffffffff810b01ab>] [<ffffffff810b01ab>] probe_skb_dequeue+0xf7/0x12
> > > > > RSP: 0018:ffff8801a5811a88 EFLAGS: 00010213
> > > > > RAX: 0000000000000000 RBX: ffff88033906d154 RCX: 000000000000000d
> > > > > RDX: 000000000000f88c RSI: 000000000000000b RDI: ffff8803383d3044
> > > > > RBP: ffff8801a5811ab8 R08: 0000000000000001 R09: ffff8801ab311a00
> > > > > R10: 0000000000000005 R11: ffffc9000080e2b0 R12: ffff880337c45400
> > > > > R13: ffff88033906d150 R14: 0000000000000014 R15: ffffffff818bb890
> > > > > FS: 00007fa976d326f0(0000) GS:ffffc90000800000(0000) knlGS:0000000000000000
> > > > > CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> > > > > CR2: 0000000000000038 CR3: 000000033801e000 CR4: 00000000000006e0
> > > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > > > DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> > > > > Process nuttcp (pid: 4222, threadinfo ffff8801a5810000, task ffff8801ab2e5d00)
> > > > > Stack:
> > > > > ffff8801a5811ab8 ffff8801b35d4ab0 0000000000000014 0000000000000000
> > > > > <0> 0000000000000014 0000000000000014 ffff8801a5811b18 ffffffff81366ae8
> > > > > <0> ffff8801a5811ed8 0000001439084000 ffff880337c45400 00000001001416ef
> > > > > Call Trace:
> > > > > [<ffffffff81366ae8>] skb_copy_datagram_iovec+0x50/0x1f5
> > > > > [<ffffffff813ac875>] tcp_rcv_established+0x278/0x6db
> > > > > [<ffffffff813b3ef5>] tcp_v4_do_rcv+0x1b8/0x366
> > > > > [<ffffffff8135f99e>] ? release_sock+0xab/0xb4
> > > > > [<ffffffff8136004d>] ? sk_wait_data+0xc8/0xd6
> > > > > [<ffffffff813a32d6>] tcp_prequeue_process+0x79/0x8f
> > > > > [<ffffffff813a455d>] tcp_recvmsg+0x4e8/0xaa0
> > > > > [<ffffffff8135ec90>] sock_common_recvmsg+0x37/0x4c
> > > > > [<ffffffff8135cb06>] __sock_recvmsg+0x72/0x7f
> > > > > [<ffffffff8135cbdd>] sock_aio_read+0xca/0xda
> > > > > [<ffffffff810d9536>] ? vma_merge+0x2a0/0x318
> > > > > [<ffffffff810f6d4f>] do_sync_read+0xec/0x132
> > > > > [<ffffffff81067ddc>] ? autoremove_wake_function+0x0/0x3d
> > > > > [<ffffffff811b646c>] ? security_file_permission+0x16/0x18
> > > > > [<ffffffff810f785c>] vfs_read+0xc0/0x107
> > > > > [<ffffffff810f7971>] sys_read+0x4c/0x75
> > > > > [<ffffffff81011c82>] system_call_fastpath+0x16/0x1b
> > > > > Code: 44 89 73 30 89 43 14 41 0f b7 84 24 ac 00 00 00 89 43 28 65 8b 04 25 98 e
> > > > > RIP [<ffffffff810b01ab>] probe_skb_dequeue+0xf7/0x152
> > > > > RSP <ffff8801a5811a88>
> > > > > CR2: 0000000000000038
> > >
> > >
> > >
> > > Here you go, I think this will fix your oops.
> > >
> > >
> > > Fix NULL pointer deref in skb sources ftracer
> > >
> > > Its possible that skb->sk will be null in this path, so we shouldn't just assume
> > > we can pass it to sock_net
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > >
> > > trace_skb_sources.c | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/kernel/trace/trace_skb_sources.c b/kernel/trace/trace_skb_sources.c
> > > index 40eb071..8bf518f 100644
> > > --- a/kernel/trace/trace_skb_sources.c
> > > +++ b/kernel/trace/trace_skb_sources.c
> > > @@ -29,7 +29,7 @@ static void probe_skb_dequeue(const struct sk_buff *skb, int len)
> > > struct ring_buffer_event *event;
> > > struct trace_skb_event *entry;
> > > struct trace_array *tr = skb_trace;
> > > - struct net_device *dev;
> > > + struct net_device *dev = NULL;
> > >
> > > if (!trace_skb_source_enabled)
> > > return;
> > > @@ -50,7 +50,9 @@ static void probe_skb_dequeue(const struct sk_buff *skb, int len)
> > > entry->event_data.rx_queue = skb->queue_mapping;
> > > entry->event_data.ccpu = smp_processor_id();
> > >
> > > - dev = dev_get_by_index(sock_net(skb->sk), skb->iif);
> > > + if (skb->sk)
> > > + dev = dev_get_by_index(sock_net(skb->sk), skb->iif);
> > > +
> > > if (dev) {
> > > memcpy(entry->event_data.ifname, dev->name, IFNAMSIZ);
> > > dev_put(dev);
> >
> >
> >
> > On the positive side, it did fix the oops. But the results of the
> > skb_sources tracing was not that useful.
> >
> > [root@xeontest1 tracing]# numactl --membind=1 nuttcp -In2 -xc4/0 192.168.1.10 & ps ax | grep nuttcp
> > 5521 ttyS0 S 0:00 nuttcp -In2 -xc4/0 192.168.1.10
> > n2: 11819.0786 MB / 10.01 sec = 9905.6427 Mbps 26 %TX 37 %RX 0 retrans 0.18 msRTT
> >
> > First off, only 10 trace entries were made:
> >
> > [root@xeontest1 tracing]# wc trace
> > 14 90 334 trace
> >
> > And here they are:
> >
> > [root@xeontest1 tracing]# cat trace
> > # tracer: skb_sources
> > #
> > # PID ANID CNID IFC RXQ CCPU LEN
> > # | | | | | | |
> > 5521 0 0 Unknown 0 3 888
> > 5521 0 0 Unknown 0 3 896
> > 5521 0 0 Unknown 0 3 20
> > 5521 0 0 Unknown 0 3 888
> > 5521 0 0 Unknown 0 3 896
> > 5521 0 0 Unknown 0 3 20
> > 5521 1 1 Unknown 0 4 20
> > 5521 1 1 Unknown 0 4 11
> > 5521 1 1 Unknown 0 4 540
> > 5521 1 1 Unknown 0 4 0
> >
> > Even for these 10 entries, why is the IFC Unknown, and the LENs
> > seem to be wrong too.
> >
> > -Bill
> >
> I'm not sure why you're getting Unknown Interface names. Nominally that
> indicates that the skb->iif value in the skb was incorrect or otherwise not set,
> which shouldn't be the case. As for the lengths that just seems wrong. That
> length value is taken directly from skb->len, so if its not right, it seems like
> its not getting set correctly someplace.
>
> As you may have seen we're removing the ftrace module, and replacing it with the
> use of raw trace events. When I have that working, I'll see if I get simmilar
> results. I never did in my local testing of the ftrace module, but perhaps its
> related to load or something.
IIUC I should keep the first of your original three ftrace patches,
revert all the rest, and then apply your very latest patch that
augments the skb_copy_datagram_iovec TRACE_EVENT. Do I have that
basically correct?
Then I just need to ask how do I use this new method?
-Thanks
-Bill
^ permalink raw reply
* Re: 100Mbit ethernet performance on embedded devices
From: Aras Vaichas @ 2009-09-02 5:09 UTC (permalink / raw)
To: Johannes Stezenbach; +Cc: linux-embedded, netdev
In-Reply-To: <20090819145057.GA25400@sig21.net>
On Thu, Aug 20, 2009 at 12:50 AM, Johannes Stezenbach <js@sig21.net> wrote:
>
> Hi,
>
> a while ago I was working on a SoC with 200MHz ARM926EJ-S CPU
> and integrated 100Mbit ethernet core, connected on internal
> (fast) memory bus, with DMA. With iperf I measured:
>
> TCP RX ~70Mbit/sec (iperf -s on SoC, iperf -c on destop PC)
> TCP TX ~56Mbit/sec (iperf -s on destop PC, iperf -c o SoC)
>
> What I'm interested in are some numbers for similar hardware,
> to find out if my hardware and/or ethernet driver can be improved,
> or if the CPU will always be the limiting factor.
> I'd also be interested to know if hardware checksumming
> support would improve throughput noticably in such a system,
> or if it is only useful for 1Gbit and above.
>
> Did anyone actually manage to get close to 100Mbit/sec
> with similar CPU resources?
No, but I can share results.
AT91RM9200 (ARM920T), 180MHz
Davicom 9161 PHY
Linux 2.6.26.3
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
# uptime; iperf -s; uptime
00:07:33 up 7 min, load average: 0.02, 0.10, 0.07
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 169.254.0.235 port 5001 connected with 169.254.0.2 port 50762
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.0 sec 58.6 MBytes 49.1 Mbits/sec
00:07:46 up 7 min, load average: 0.17, 0.13, 0.08
^ permalink raw reply
* [PATCH 5/5] net: file_operations should be const
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller, Samuel Ortiz
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20090902052500.808557262@vyatta.com>
[-- Attachment #1: const-file-ops.patch --]
[-- Type: text/plain, Size: 4787 bytes --]
All instances of file_operations should be const.
Signed-off-by: Stephen Hemminger <shemminger-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
---
net/ipv6/ip6mr.c | 4 ++--
net/irda/irnet/irnet_ppp.h | 2 +-
net/irda/irproc.c | 14 +++++++-------
net/key/af_key.c | 2 +-
net/mac80211/rc80211_minstrel_debugfs.c | 2 +-
net/mac80211/rc80211_pid_debugfs.c | 2 +-
net/xfrm/xfrm_proc.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)
--- a/net/ipv6/ip6mr.c 2009-09-01 22:06:18.049861877 -0700
+++ b/net/ipv6/ip6mr.c 2009-09-01 22:06:45.101130517 -0700
@@ -217,7 +217,7 @@ static int ip6mr_vif_open(struct inode *
sizeof(struct ipmr_vif_iter));
}
-static struct file_operations ip6mr_vif_fops = {
+static const struct file_operations ip6mr_vif_fops = {
.owner = THIS_MODULE,
.open = ip6mr_vif_open,
.read = seq_read,
@@ -341,7 +341,7 @@ static int ipmr_mfc_open(struct inode *i
sizeof(struct ipmr_mfc_iter));
}
-static struct file_operations ip6mr_mfc_fops = {
+static const struct file_operations ip6mr_mfc_fops = {
.owner = THIS_MODULE,
.open = ipmr_mfc_open,
.read = seq_read,
--- a/net/irda/irnet/irnet_ppp.h 2009-09-01 22:06:18.066775983 -0700
+++ b/net/irda/irnet/irnet_ppp.h 2009-09-01 22:07:01.768232028 -0700
@@ -95,7 +95,7 @@ static int
/**************************** VARIABLES ****************************/
/* Filesystem callbacks (to call us) */
-static struct file_operations irnet_device_fops =
+static const struct file_operations irnet_device_fops =
{
.owner = THIS_MODULE,
.read = dev_irnet_read,
--- a/net/irda/irproc.c 2009-09-01 22:06:18.083862409 -0700
+++ b/net/irda/irproc.c 2009-09-01 22:07:33.742884934 -0700
@@ -34,21 +34,21 @@
#include <net/irda/irlap.h>
#include <net/irda/irlmp.h>
-extern struct file_operations discovery_seq_fops;
-extern struct file_operations irlap_seq_fops;
-extern struct file_operations irlmp_seq_fops;
-extern struct file_operations irttp_seq_fops;
-extern struct file_operations irias_seq_fops;
+extern const struct file_operations discovery_seq_fops;
+extern const struct file_operations irlap_seq_fops;
+extern const struct file_operations irlmp_seq_fops;
+extern const struct file_operations irttp_seq_fops;
+extern const struct file_operations irias_seq_fops;
struct irda_entry {
const char *name;
- struct file_operations *fops;
+ const struct file_operations *fops;
};
struct proc_dir_entry *proc_irda;
EXPORT_SYMBOL(proc_irda);
-static struct irda_entry irda_dirs[] = {
+static const struct irda_entry irda_dirs[] = {
{"discovery", &discovery_seq_fops},
{"irttp", &irttp_seq_fops},
{"irlmp", &irlmp_seq_fops},
--- a/net/key/af_key.c 2009-09-01 22:06:18.103861872 -0700
+++ b/net/key/af_key.c 2009-09-01 22:07:53.008956985 -0700
@@ -3718,7 +3718,7 @@ static int pfkey_seq_open(struct inode *
sizeof(struct seq_net_private));
}
-static struct file_operations pfkey_proc_ops = {
+static const struct file_operations pfkey_proc_ops = {
.open = pfkey_seq_open,
.read = seq_read,
.llseek = seq_lseek,
--- a/net/mac80211/rc80211_minstrel_debugfs.c 2009-09-01 22:06:18.119862498 -0700
+++ b/net/mac80211/rc80211_minstrel_debugfs.c 2009-09-01 22:08:22.747241542 -0700
@@ -139,7 +139,7 @@ minstrel_stats_release(struct inode *ino
return 0;
}
-static struct file_operations minstrel_stat_fops = {
+static const struct file_operations minstrel_stat_fops = {
.owner = THIS_MODULE,
.open = minstrel_stats_open,
.read = minstrel_stats_read,
--- a/net/mac80211/rc80211_pid_debugfs.c 2009-09-01 22:06:18.135862300 -0700
+++ b/net/mac80211/rc80211_pid_debugfs.c 2009-09-01 22:08:28.843245757 -0700
@@ -198,7 +198,7 @@ static ssize_t rate_control_pid_events_r
#undef RC_PID_PRINT_BUF_SIZE
-static struct file_operations rc_pid_fop_events = {
+static const struct file_operations rc_pid_fop_events = {
.owner = THIS_MODULE,
.read = rate_control_pid_events_read,
.poll = rate_control_pid_events_poll,
--- a/net/xfrm/xfrm_proc.c 2009-09-01 22:06:18.169862213 -0700
+++ b/net/xfrm/xfrm_proc.c 2009-09-01 22:08:48.707830315 -0700
@@ -60,7 +60,7 @@ static int xfrm_statistics_seq_open(stru
return single_open_net(inode, file, xfrm_statistics_seq_show);
}
-static struct file_operations xfrm_statistics_seq_fops = {
+static const struct file_operations xfrm_statistics_seq_fops = {
.owner = THIS_MODULE,
.open = xfrm_statistics_seq_open,
.read = seq_read,
--
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Receive side performance issue with multi-10-GigE and NUMA
From: Bill Fink @ 2009-09-02 5:28 UTC (permalink / raw)
To: Bill Fink; +Cc: Neil Horman, Linux Network Developers, brice, gallatin
In-Reply-To: <20090827133242.d02acece.billfink@mindspring.com>
On Thu, 27 Aug 2009, Bill Fink wrote:
> On Wed, 26 Aug 2009, Neil Horman wrote:
>
> > On Wed, Aug 26, 2009 at 03:10:57AM -0400, Bill Fink wrote:
> > >
> > > Fortunately, in this specific case, the SuperMicro X8DAH+-F system
> > > does have a serial console, and after a fair amount of effort I was
> > > able to get it to work as desired, and was able to finally capture
> > > a backtrace of the kernel oops. BTW I believe the reason the
> > > kexec/kdump didn't work was probably because it couldn't find
> > > a /proc/vmcore file, although I don't know why that would be,
> > > and the Fedora 10 /etc/init.d/kdump script will then just boot
> > > up normally if it fails to find the /proc/vmcore file (or it's
> > > zero size).
> > >
> > I take care of kdump for fedora and RHEL. If you file a bug on this, I'd be
> > happy to look into it further.
>
> It's odd. kexec/kdump works fine with the 2.6.29.6-217.2.3.fc11.x86_64
> kernel from Fedora 11 (running on the Fedora 10 system). I will try
> again with the kernel-2.6.31-0.174.rc7.git2.fc12.src.rpm from Fedora 12,
> in case it has some secret sauce in one of the Fedora patches to make
> the Fedora /etc/init.d/kdump script happy. kexec/kdump is my preferred
> method of dealing with kernel oopses if I can get it to work.
The Fedora 12 kernel-2.6.31-0.174.rc7.git2 kernel didn't help with
the kexec/kdump issue, so I may file a bug if I can't figure anything
out.
Also that kernel had a huge performance hit on my tests. Where I
usually get ~100 Gbps of aggregate transmit performance, I was instead
getting a mere 3 Gbps, with individual streams only getting about
200 to 400 Mbps. If I get a chance, I'll have to try the vanilla
version to see if it has the same issue (a vanilla 2.6.31-rc6 is
fine).
-Thanks
-Bill
^ permalink raw reply
* [PATCH 0/5] More const ops cleanups
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Many places were not using const when defining/using structures
that only contain initialized values.
--
^ permalink raw reply
* [PATCH 2/5] net: seq_operations should be const
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20090902052500.808557262@vyatta.com>
[-- Attachment #1: const-seq-ops.patch --]
[-- Type: text/plain, Size: 978 bytes --]
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
net/ipv6/ip6mr.c | 2 +-
net/key/af_key.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/net/ipv6/ip6mr.c 2009-09-01 21:37:24.504215187 -0700
+++ b/net/ipv6/ip6mr.c 2009-09-01 22:22:22.223174601 -0700
@@ -204,7 +204,7 @@ static int ip6mr_vif_seq_show(struct seq
return 0;
}
-static struct seq_operations ip6mr_vif_seq_ops = {
+static const struct seq_operations ip6mr_vif_seq_ops = {
.start = ip6mr_vif_seq_start,
.next = ip6mr_vif_seq_next,
.stop = ip6mr_vif_seq_stop,
--- a/net/key/af_key.c 2009-09-01 21:37:24.520180026 -0700
+++ b/net/key/af_key.c 2009-09-01 22:22:22.230177877 -0700
@@ -3705,7 +3705,7 @@ static void pfkey_seq_stop(struct seq_fi
read_unlock(&pfkey_table_lock);
}
-static struct seq_operations pfkey_seq_ops = {
+static const struct seq_operations pfkey_seq_ops = {
.start = pfkey_seq_start,
.next = pfkey_seq_next,
.stop = pfkey_seq_stop,
--
^ permalink raw reply
* [PATCH 4/5] inet: inet_connection_sock_af_ops const
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20090902052500.808557262@vyatta.com>
[-- Attachment #1: const-inet-connect-sock-af-ops.patch --]
[-- Type: text/plain, Size: 4169 bytes --]
The function block inet_connect_sock_af_ops contains no data
make it constant.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
include/net/transp_v6.h | 2 +-
net/dccp/ipv4.c | 2 +-
net/dccp/ipv6.c | 8 ++++----
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv6/tcp_ipv6.c | 8 ++++----
5 files changed, 11 insertions(+), 11 deletions(-)
--- a/net/dccp/ipv4.c 2009-09-01 21:54:11.398740410 -0700
+++ b/net/dccp/ipv4.c 2009-09-01 21:55:22.254758800 -0700
@@ -880,7 +880,7 @@ discard_and_relse:
goto discard_it;
}
-static struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
+static const struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
.queue_xmit = ip_queue_xmit,
.send_check = dccp_v4_send_check,
.rebuild_header = inet_sk_rebuild_header,
--- a/net/dccp/ipv6.c 2009-09-01 21:54:11.414740438 -0700
+++ b/net/dccp/ipv6.c 2009-09-01 21:55:41.734738880 -0700
@@ -35,8 +35,8 @@
/* The per-net dccp.v6_ctl_sk is used for sending RSTs and ACKs */
-static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
-static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
+static const struct inet_connection_sock_af_ops dccp_ipv6_mapped;
+static const struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
static void dccp_v6_hash(struct sock *sk)
{
@@ -1055,7 +1055,7 @@ failure:
return err;
}
-static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = {
+static const struct inet_connection_sock_af_ops dccp_ipv6_af_ops = {
.queue_xmit = inet6_csk_xmit,
.send_check = dccp_v6_send_check,
.rebuild_header = inet6_sk_rebuild_header,
@@ -1076,7 +1076,7 @@ static struct inet_connection_sock_af_op
/*
* DCCP over IPv4 via INET6 API
*/
-static struct inet_connection_sock_af_ops dccp_ipv6_mapped = {
+static const struct inet_connection_sock_af_ops dccp_ipv6_mapped = {
.queue_xmit = ip_queue_xmit,
.send_check = dccp_v4_send_check,
.rebuild_header = inet_sk_rebuild_header,
--- a/net/ipv4/tcp_ipv4.c 2009-09-01 21:55:56.583740315 -0700
+++ b/net/ipv4/tcp_ipv4.c 2009-09-01 21:56:04.623737423 -0700
@@ -1754,7 +1754,7 @@ int tcp_v4_tw_remember_stamp(struct inet
return 0;
}
-struct inet_connection_sock_af_ops ipv4_specific = {
+const struct inet_connection_sock_af_ops ipv4_specific = {
.queue_xmit = ip_queue_xmit,
.send_check = tcp_v4_send_check,
.rebuild_header = inet_sk_rebuild_header,
--- a/net/ipv6/tcp_ipv6.c 2009-09-01 21:55:56.599803712 -0700
+++ b/net/ipv6/tcp_ipv6.c 2009-09-01 21:56:23.615764198 -0700
@@ -75,8 +75,8 @@ static void tcp_v6_reqsk_send_ack(struct
static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
-static struct inet_connection_sock_af_ops ipv6_mapped;
-static struct inet_connection_sock_af_ops ipv6_specific;
+static const struct inet_connection_sock_af_ops ipv6_mapped;
+static const struct inet_connection_sock_af_ops ipv6_specific;
#ifdef CONFIG_TCP_MD5SIG
static const struct tcp_sock_af_ops tcp_sock_ipv6_specific;
static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific;
@@ -1760,7 +1760,7 @@ static int tcp_v6_remember_stamp(struct
return 0;
}
-static struct inet_connection_sock_af_ops ipv6_specific = {
+static const struct inet_connection_sock_af_ops ipv6_specific = {
.queue_xmit = inet6_csk_xmit,
.send_check = tcp_v6_send_check,
.rebuild_header = inet6_sk_rebuild_header,
@@ -1792,7 +1792,7 @@ static const struct tcp_sock_af_ops tcp_
* TCP over IPv4 via INET6 API
*/
-static struct inet_connection_sock_af_ops ipv6_mapped = {
+static const struct inet_connection_sock_af_ops ipv6_mapped = {
.queue_xmit = ip_queue_xmit,
.send_check = tcp_v4_send_check,
.rebuild_header = inet_sk_rebuild_header,
--- a/include/net/transp_v6.h 2009-09-01 21:59:47.126112194 -0700
+++ b/include/net/transp_v6.h 2009-09-01 21:59:55.797799523 -0700
@@ -51,7 +51,7 @@ extern int datagram_send_ctl(struct ne
/*
* address family specific functions
*/
-extern struct inet_connection_sock_af_ops ipv4_specific;
+extern const struct inet_connection_sock_af_ops ipv4_specific;
extern void inet6_destroy_sock(struct sock *sk);
--
^ permalink raw reply
* [PATCH 3/5] tcp: MD5 operations should be const
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20090902052500.808557262@vyatta.com>
[-- Attachment #1: const-md5-ops.patch --]
[-- Type: text/plain, Size: 3439 bytes --]
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
include/linux/tcp.h | 6 +++---
net/ipv4/tcp_ipv4.c | 4 ++--
net/ipv6/tcp_ipv6.c | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
--- a/include/linux/tcp.h 2009-09-01 21:45:24.022174846 -0700
+++ b/include/linux/tcp.h 2009-09-01 21:52:18.131739158 -0700
@@ -233,7 +233,7 @@ struct tcp_request_sock {
struct inet_request_sock req;
#ifdef CONFIG_TCP_MD5SIG
/* Only used by TCP MD5 Signature so far. */
- struct tcp_request_sock_ops *af_specific;
+ const struct tcp_request_sock_ops *af_specific;
#endif
u32 rcv_isn;
u32 snt_isn;
@@ -401,9 +401,9 @@ struct tcp_sock {
#ifdef CONFIG_TCP_MD5SIG
/* TCP AF-Specific parts; only used by MD5 Signature support so far */
- struct tcp_sock_af_ops *af_specific;
+ const struct tcp_sock_af_ops *af_specific;
-/* TCP MD5 Signagure Option information */
+/* TCP MD5 Signature Option information */
struct tcp_md5sig_info *md5sig_info;
#endif
};
--- a/net/ipv4/tcp_ipv4.c 2009-09-01 21:45:24.039229254 -0700
+++ b/net/ipv4/tcp_ipv4.c 2009-09-01 22:22:23.997230300 -0700
@@ -1195,7 +1195,7 @@ struct request_sock_ops tcp_request_sock
};
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
+static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
.md5_lookup = tcp_v4_reqsk_md5_lookup,
.calc_md5_hash = tcp_v4_md5_hash_skb,
};
@@ -1774,7 +1774,7 @@ struct inet_connection_sock_af_ops ipv4_
};
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_sock_af_ops tcp_sock_ipv4_specific = {
+static const struct tcp_sock_af_ops tcp_sock_ipv4_specific = {
.md5_lookup = tcp_v4_md5_lookup,
.calc_md5_hash = tcp_v4_md5_hash_skb,
.md5_add = tcp_v4_md5_add_func,
--- a/net/ipv6/tcp_ipv6.c 2009-09-01 21:45:24.055740485 -0700
+++ b/net/ipv6/tcp_ipv6.c 2009-09-01 22:22:23.988774018 -0700
@@ -78,8 +78,8 @@ static int tcp_v6_do_rcv(struct sock *sk
static struct inet_connection_sock_af_ops ipv6_mapped;
static struct inet_connection_sock_af_ops ipv6_specific;
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_sock_af_ops tcp_sock_ipv6_specific;
-static struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific;
+static const struct tcp_sock_af_ops tcp_sock_ipv6_specific;
+static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific;
#else
static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk,
struct in6_addr *addr)
@@ -894,7 +894,7 @@ struct request_sock_ops tcp6_request_soc
};
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
+static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
.md5_lookup = tcp_v6_reqsk_md5_lookup,
.calc_md5_hash = tcp_v6_md5_hash_skb,
};
@@ -1780,7 +1780,7 @@ static struct inet_connection_sock_af_op
};
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_sock_af_ops tcp_sock_ipv6_specific = {
+static const struct tcp_sock_af_ops tcp_sock_ipv6_specific = {
.md5_lookup = tcp_v6_md5_lookup,
.calc_md5_hash = tcp_v6_md5_hash_skb,
.md5_add = tcp_v6_md5_add_func,
@@ -1812,7 +1812,7 @@ static struct inet_connection_sock_af_op
};
#ifdef CONFIG_TCP_MD5SIG
-static struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific = {
+static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific = {
.md5_lookup = tcp_v4_md5_lookup,
.calc_md5_hash = tcp_v4_md5_hash_skb,
.md5_add = tcp_v6_md5_add_func,
--
^ permalink raw reply
* [PATCH 1/5] netdev: drivers should make ethtool_ops const
From: Stephen Hemminger @ 2009-09-02 5:25 UTC (permalink / raw)
To: David Miller, Roland Dreier
Cc: netdev, linux-wireless, Dhananjay Phadke, David Brownell
In-Reply-To: <20090902052500.808557262@vyatta.com>
[-- Attachment #1: ethtool-ops-const --]
[-- Type: text/plain, Size: 25282 bytes --]
No need to put ethtool_ops in data, they should be const.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
arch/um/drivers/net_kern.c | 2 +-
drivers/firewire/net.c | 2 +-
drivers/ieee1394/eth1394.c | 2 +-
drivers/infiniband/hw/nes/nes_nic.c | 2 +-
drivers/net/arm/ep93xx_eth.c | 2 +-
drivers/net/arm/ixp4xx_eth.c | 2 +-
drivers/net/arm/ks8695net.c | 2 +-
drivers/net/atl1c/atl1c_ethtool.c | 2 +-
drivers/net/atl1e/atl1e_ethtool.c | 2 +-
drivers/net/atlx/atl2.c | 2 +-
drivers/net/benet/be.h | 2 +-
drivers/net/benet/be_ethtool.c | 2 +-
drivers/net/bfin_mac.c | 2 +-
drivers/net/bnx2x_main.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/igb/igb_ethtool.c | 2 +-
drivers/net/ipg.c | 2 +-
drivers/net/korina.c | 2 +-
drivers/net/ks8842.c | 2 +-
drivers/net/macb.c | 2 +-
drivers/net/netxen/netxen_nic.h | 2 +-
drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
drivers/net/ps3_gelic_net.c | 2 +-
drivers/net/ps3_gelic_wireless.c | 2 +-
drivers/net/sfc/ethtool.c | 2 +-
drivers/net/tehuti.c | 2 +-
drivers/net/usb/asix.c | 4 ++--
drivers/net/usb/catc.c | 2 +-
drivers/net/usb/dm9601.c | 2 +-
drivers/net/usb/hso.c | 2 +-
drivers/net/usb/kaweth.c | 2 +-
drivers/net/usb/mcs7830.c | 2 +-
drivers/net/usb/pegasus.c | 2 +-
drivers/net/usb/rtl8150.c | 2 +-
drivers/net/usb/smsc95xx.c | 2 +-
drivers/net/usb/usbnet.c | 2 +-
drivers/net/veth.c | 2 +-
drivers/net/virtio_net.c | 2 +-
drivers/net/wireless/libertas/dev.h | 2 +-
drivers/net/wireless/libertas/ethtool.c | 2 +-
drivers/net/xen-netfront.c | 4 ++--
drivers/s390/net/qeth_l2_main.c | 4 ++--
drivers/s390/net/qeth_l3_main.c | 2 +-
drivers/staging/at76_usb/at76_usb.c | 2 +-
drivers/staging/octeon/ethernet-mdio.c | 2 +-
drivers/staging/octeon/ethernet-mdio.h | 2 +-
drivers/staging/sxg/sxg.h | 2 +-
drivers/staging/sxg/sxg_ethtool.c | 2 +-
drivers/usb/gadget/u_ether.c | 2 +-
49 files changed, 52 insertions(+), 52 deletions(-)
--- a/arch/um/drivers/net_kern.c 2009-09-01 21:23:22.140759558 -0700
+++ b/arch/um/drivers/net_kern.c 2009-09-01 21:24:04.767783955 -0700
@@ -285,7 +285,7 @@ static void uml_net_get_drvinfo(struct n
strcpy(info->version, "42");
}
-static struct ethtool_ops uml_net_ethtool_ops = {
+static const struct ethtool_ops uml_net_ethtool_ops = {
.get_drvinfo = uml_net_get_drvinfo,
.get_link = ethtool_op_get_link,
};
--- a/drivers/firewire/net.c 2009-09-01 21:23:22.192204648 -0700
+++ b/drivers/firewire/net.c 2009-09-01 21:24:12.452795687 -0700
@@ -1342,7 +1342,7 @@ static void fwnet_get_drvinfo(struct net
strcpy(info->bus_info, "ieee1394");
}
-static struct ethtool_ops fwnet_ethtool_ops = {
+static const struct ethtool_ops fwnet_ethtool_ops = {
.get_drvinfo = fwnet_get_drvinfo,
};
--- a/drivers/ieee1394/eth1394.c 2009-09-01 21:23:22.225179879 -0700
+++ b/drivers/ieee1394/eth1394.c 2009-09-01 21:24:19.511858188 -0700
@@ -173,7 +173,7 @@ static netdev_tx_t ether1394_tx(struct s
struct net_device *dev);
static void ether1394_iso(struct hpsb_iso *iso);
-static struct ethtool_ops ethtool_ops;
+static const struct ethtool_ops ethtool_ops;
static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
quadlet_t *data, u64 addr, size_t len, u16 flags);
--- a/drivers/infiniband/hw/nes/nes_nic.c 2009-09-01 21:23:22.274178784 -0700
+++ b/drivers/infiniband/hw/nes/nes_nic.c 2009-09-01 21:24:33.351892895 -0700
@@ -1508,7 +1508,7 @@ static int nes_netdev_set_settings(struc
}
-static struct ethtool_ops nes_ethtool_ops = {
+static const struct ethtool_ops nes_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_settings = nes_netdev_get_settings,
.set_settings = nes_netdev_set_settings,
--- a/drivers/net/arm/ep93xx_eth.c 2009-09-01 21:23:22.305179810 -0700
+++ b/drivers/net/arm/ep93xx_eth.c 2009-09-01 21:24:39.380961916 -0700
@@ -762,7 +762,7 @@ static u32 ep93xx_get_link(struct net_de
return mii_link_ok(&ep->mii);
}
-static struct ethtool_ops ep93xx_ethtool_ops = {
+static const struct ethtool_ops ep93xx_ethtool_ops = {
.get_drvinfo = ep93xx_get_drvinfo,
.get_settings = ep93xx_get_settings,
.set_settings = ep93xx_set_settings,
--- a/drivers/net/arm/ixp4xx_eth.c 2009-09-01 21:23:22.336175120 -0700
+++ b/drivers/net/arm/ixp4xx_eth.c 2009-09-01 21:24:45.928279805 -0700
@@ -802,7 +802,7 @@ static int ixp4xx_nway_reset(struct net_
return phy_start_aneg(port->phydev);
}
-static struct ethtool_ops ixp4xx_ethtool_ops = {
+static const struct ethtool_ops ixp4xx_ethtool_ops = {
.get_drvinfo = ixp4xx_get_drvinfo,
.get_settings = ixp4xx_get_settings,
.set_settings = ixp4xx_set_settings,
--- a/drivers/net/arm/ks8695net.c 2009-09-01 21:23:22.367175272 -0700
+++ b/drivers/net/arm/ks8695net.c 2009-09-01 21:24:51.848932190 -0700
@@ -1063,7 +1063,7 @@ ks8695_get_drvinfo(struct net_device *nd
sizeof(info->bus_info));
}
-static struct ethtool_ops ks8695_ethtool_ops = {
+static const struct ethtool_ops ks8695_ethtool_ops = {
.get_msglevel = ks8695_get_msglevel,
.set_msglevel = ks8695_set_msglevel,
.get_settings = ks8695_get_settings,
--- a/drivers/net/atl1c/atl1c_ethtool.c 2009-09-01 21:23:22.398179343 -0700
+++ b/drivers/net/atl1c/atl1c_ethtool.c 2009-09-01 21:24:58.264953214 -0700
@@ -294,7 +294,7 @@ static int atl1c_nway_reset(struct net_d
return 0;
}
-static struct ethtool_ops atl1c_ethtool_ops = {
+static const struct ethtool_ops atl1c_ethtool_ops = {
.get_settings = atl1c_get_settings,
.set_settings = atl1c_set_settings,
.get_drvinfo = atl1c_get_drvinfo,
--- a/drivers/net/atl1e/atl1e_ethtool.c 2009-09-01 21:23:22.429737472 -0700
+++ b/drivers/net/atl1e/atl1e_ethtool.c 2009-09-01 21:25:06.161739683 -0700
@@ -378,7 +378,7 @@ static int atl1e_nway_reset(struct net_d
return 0;
}
-static struct ethtool_ops atl1e_ethtool_ops = {
+static const struct ethtool_ops atl1e_ethtool_ops = {
.get_settings = atl1e_get_settings,
.set_settings = atl1e_set_settings,
.get_drvinfo = atl1e_get_drvinfo,
--- a/drivers/net/atlx/atl2.c 2009-09-01 21:23:22.461737471 -0700
+++ b/drivers/net/atlx/atl2.c 2009-09-01 21:25:29.371737969 -0700
@@ -2094,7 +2094,7 @@ static int atl2_nway_reset(struct net_de
return 0;
}
-static struct ethtool_ops atl2_ethtool_ops = {
+static const struct ethtool_ops atl2_ethtool_ops = {
.get_settings = atl2_get_settings,
.set_settings = atl2_set_settings,
.get_drvinfo = atl2_get_drvinfo,
--- a/drivers/net/benet/be.h 2009-09-01 21:23:22.493739757 -0700
+++ b/drivers/net/benet/be.h 2009-09-01 21:25:44.899803221 -0700
@@ -259,7 +259,7 @@ struct be_adapter {
bool promiscuous;
};
-extern struct ethtool_ops be_ethtool_ops;
+extern const struct ethtool_ops be_ethtool_ops;
#define drvr_stats(adapter) (&adapter->stats.drvr_stats)
--- a/drivers/net/benet/be_ethtool.c 2009-09-01 21:23:22.524737107 -0700
+++ b/drivers/net/benet/be_ethtool.c 2009-09-01 21:25:53.630800706 -0700
@@ -332,7 +332,7 @@ be_set_pauseparam(struct net_device *net
return status;
}
-struct ethtool_ops be_ethtool_ops = {
+const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
.get_link = ethtool_op_get_link,
--- a/drivers/net/bfin_mac.c 2009-09-01 21:23:22.555737483 -0700
+++ b/drivers/net/bfin_mac.c 2009-09-01 21:26:00.102325056 -0700
@@ -491,7 +491,7 @@ static void bfin_mac_ethtool_getdrvinfo(
strcpy(info->bus_info, dev_name(&dev->dev));
}
-static struct ethtool_ops bfin_mac_ethtool_ops = {
+static const struct ethtool_ops bfin_mac_ethtool_ops = {
.get_settings = bfin_mac_ethtool_getsettings,
.set_settings = bfin_mac_ethtool_setsettings,
.get_link = ethtool_op_get_link,
--- a/drivers/net/bnx2x_main.c 2009-09-01 21:23:22.587737636 -0700
+++ b/drivers/net/bnx2x_main.c 2009-09-01 21:26:08.591759739 -0700
@@ -10606,7 +10606,7 @@ static int bnx2x_phys_id(struct net_devi
return 0;
}
-static struct ethtool_ops bnx2x_ethtool_ops = {
+static const struct ethtool_ops bnx2x_ethtool_ops = {
.get_settings = bnx2x_get_settings,
.set_settings = bnx2x_set_settings,
.get_drvinfo = bnx2x_get_drvinfo,
--- a/drivers/net/enic/enic_main.c 2009-09-01 21:23:22.618737189 -0700
+++ b/drivers/net/enic/enic_main.c 2009-09-01 21:26:14.917742055 -0700
@@ -256,7 +256,7 @@ static void enic_set_msglevel(struct net
enic->msg_enable = value;
}
-static struct ethtool_ops enic_ethtool_ops = {
+static const struct ethtool_ops enic_ethtool_ops = {
.get_settings = enic_get_settings,
.get_drvinfo = enic_get_drvinfo,
.get_msglevel = enic_get_msglevel,
--- a/drivers/net/igb/igb_ethtool.c 2009-09-01 21:23:22.650737465 -0700
+++ b/drivers/net/igb/igb_ethtool.c 2009-09-01 21:26:20.874754655 -0700
@@ -2016,7 +2016,7 @@ static void igb_get_strings(struct net_d
}
}
-static struct ethtool_ops igb_ethtool_ops = {
+static const struct ethtool_ops igb_ethtool_ops = {
.get_settings = igb_get_settings,
.set_settings = igb_set_settings,
.get_drvinfo = igb_get_drvinfo,
--- a/drivers/net/ipg.c 2009-09-01 21:23:22.713737071 -0700
+++ b/drivers/net/ipg.c 2009-09-01 21:26:30.551740998 -0700
@@ -2186,7 +2186,7 @@ static int ipg_nway_reset(struct net_dev
return rc;
}
-static struct ethtool_ops ipg_ethtool_ops = {
+static const struct ethtool_ops ipg_ethtool_ops = {
.get_settings = ipg_get_settings,
.set_settings = ipg_set_settings,
.nway_reset = ipg_nway_reset,
--- a/drivers/net/korina.c 2009-09-01 21:23:22.745739152 -0700
+++ b/drivers/net/korina.c 2009-09-01 21:26:36.337830745 -0700
@@ -743,7 +743,7 @@ static u32 netdev_get_link(struct net_de
return mii_link_ok(&lp->mii_if);
}
-static struct ethtool_ops netdev_ethtool_ops = {
+static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo,
.get_settings = netdev_get_settings,
.set_settings = netdev_set_settings,
--- a/drivers/net/ks8842.c 2009-09-01 21:23:22.776738076 -0700
+++ b/drivers/net/ks8842.c 2009-09-01 21:26:42.541748592 -0700
@@ -619,7 +619,7 @@ static const struct net_device_ops ks884
.ndo_validate_addr = eth_validate_addr
};
-static struct ethtool_ops ks8842_ethtool_ops = {
+static const struct ethtool_ops ks8842_ethtool_ops = {
.get_link = ethtool_op_get_link,
};
--- a/drivers/net/macb.c 2009-09-01 21:23:22.812112323 -0700
+++ b/drivers/net/macb.c 2009-09-01 21:26:47.647878323 -0700
@@ -1079,7 +1079,7 @@ static void macb_get_drvinfo(struct net_
strcpy(info->bus_info, dev_name(&bp->pdev->dev));
}
-static struct ethtool_ops macb_ethtool_ops = {
+static const struct ethtool_ops macb_ethtool_ops = {
.get_settings = macb_get_settings,
.set_settings = macb_set_settings,
.get_drvinfo = macb_get_drvinfo,
--- a/drivers/net/netxen/netxen_nic.h 2009-09-01 21:23:22.844098830 -0700
+++ b/drivers/net/netxen/netxen_nic.h 2009-09-01 21:26:54.259228132 -0700
@@ -1410,6 +1410,6 @@ extern void netxen_change_ringparam(stru
extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
int *valp);
-extern struct ethtool_ops netxen_nic_ethtool_ops;
+extern const struct ethtool_ops netxen_nic_ethtool_ops;
#endif /* __NETXEN_NIC_H_ */
--- a/drivers/net/netxen/netxen_nic_ethtool.c 2009-09-01 21:23:22.877777568 -0700
+++ b/drivers/net/netxen/netxen_nic_ethtool.c 2009-09-01 21:27:01.074946492 -0700
@@ -963,7 +963,7 @@ static int netxen_nic_set_flags(struct n
return 0;
}
-struct ethtool_ops netxen_nic_ethtool_ops = {
+const struct ethtool_ops netxen_nic_ethtool_ops = {
.get_settings = netxen_nic_get_settings,
.set_settings = netxen_nic_set_settings,
.get_drvinfo = netxen_nic_get_drvinfo,
--- a/drivers/net/ps3_gelic_net.c 2009-09-01 21:23:22.909740667 -0700
+++ b/drivers/net/ps3_gelic_net.c 2009-09-01 21:27:08.779740619 -0700
@@ -1346,7 +1346,7 @@ done:
return status;
}
-static struct ethtool_ops gelic_ether_ethtool_ops = {
+static const struct ethtool_ops gelic_ether_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_settings = gelic_ether_get_settings,
.get_link = ethtool_op_get_link,
--- a/drivers/net/ps3_gelic_wireless.c 2009-09-01 21:23:22.943207129 -0700
+++ b/drivers/net/ps3_gelic_wireless.c 2009-09-01 21:27:22.891080433 -0700
@@ -2714,7 +2714,7 @@ static const struct net_device_ops gelic
#endif
};
-static struct ethtool_ops gelic_wl_ethtool_ops = {
+static const struct ethtool_ops gelic_wl_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_link = gelic_wl_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
--- a/drivers/net/sfc/ethtool.c 2009-09-01 21:23:22.975775116 -0700
+++ b/drivers/net/sfc/ethtool.c 2009-09-01 21:27:31.123840332 -0700
@@ -731,7 +731,7 @@ static void efx_ethtool_get_pauseparam(s
}
-struct ethtool_ops efx_ethtool_ops = {
+const struct ethtool_ops efx_ethtool_ops = {
.get_settings = efx_ethtool_get_settings,
.set_settings = efx_ethtool_set_settings,
.get_drvinfo = efx_ethtool_get_drvinfo,
--- a/drivers/net/tehuti.c 2009-09-01 21:23:23.042174817 -0700
+++ b/drivers/net/tehuti.c 2009-09-01 21:27:52.563962512 -0700
@@ -2428,7 +2428,7 @@ static void bdx_get_ethtool_stats(struct
*/
static void bdx_ethtool_ops(struct net_device *netdev)
{
- static struct ethtool_ops bdx_ethtool_ops = {
+ static const struct ethtool_ops bdx_ethtool_ops = {
.get_settings = bdx_get_settings,
.get_drvinfo = bdx_get_drvinfo,
.get_link = ethtool_op_get_link,
--- a/drivers/net/usb/asix.c 2009-09-01 21:23:23.075778923 -0700
+++ b/drivers/net/usb/asix.c 2009-09-01 21:28:10.900360956 -0700
@@ -731,7 +731,7 @@ static int asix_ioctl (struct net_device
/* We need to override some ethtool_ops so we require our
own structure so we don't interfere with other usbnet
devices that may be connected at the same time. */
-static struct ethtool_ops ax88172_ethtool_ops = {
+static const struct ethtool_ops ax88172_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = asix_get_link,
.get_msglevel = usbnet_get_msglevel,
@@ -873,7 +873,7 @@ out:
return ret;
}
-static struct ethtool_ops ax88772_ethtool_ops = {
+static const struct ethtool_ops ax88772_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = asix_get_link,
.get_msglevel = usbnet_get_msglevel,
--- a/drivers/net/usb/catc.c 2009-09-01 21:23:23.142740822 -0700
+++ b/drivers/net/usb/catc.c 2009-09-01 21:28:23.187998866 -0700
@@ -698,7 +698,7 @@ static int catc_get_settings(struct net_
return 0;
}
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = catc_get_drvinfo,
.get_settings = catc_get_settings,
.get_link = ethtool_op_get_link
--- a/drivers/net/usb/dm9601.c 2009-09-01 21:23:23.174779035 -0700
+++ b/drivers/net/usb/dm9601.c 2009-09-01 21:28:27.970768780 -0700
@@ -356,7 +356,7 @@ static int dm9601_ioctl(struct net_devic
return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
}
-static struct ethtool_ops dm9601_ethtool_ops = {
+static const struct ethtool_ops dm9601_ethtool_ops = {
.get_drvinfo = dm9601_get_drvinfo,
.get_link = dm9601_get_link,
.get_msglevel = usbnet_get_msglevel,
--- a/drivers/net/usb/hso.c 2009-09-01 21:23:23.206924285 -0700
+++ b/drivers/net/usb/hso.c 2009-09-01 21:28:32.857738210 -0700
@@ -829,7 +829,7 @@ static void hso_get_drvinfo(struct net_d
usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
}
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = hso_get_drvinfo,
.get_link = ethtool_op_get_link
};
--- a/drivers/net/usb/kaweth.c 2009-09-01 21:23:23.240799685 -0700
+++ b/drivers/net/usb/kaweth.c 2009-09-01 21:28:37.504884609 -0700
@@ -778,7 +778,7 @@ static u32 kaweth_get_link(struct net_de
return kaweth->linkstate;
}
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = kaweth_get_drvinfo,
.get_link = kaweth_get_link
};
--- a/drivers/net/usb/mcs7830.c 2009-09-01 21:23:23.272740317 -0700
+++ b/drivers/net/usb/mcs7830.c 2009-09-01 21:28:42.591361634 -0700
@@ -449,7 +449,7 @@ static void mcs7830_get_regs(struct net_
mcs7830_get_reg(dev, 0, regs->len, data);
}
-static struct ethtool_ops mcs7830_ethtool_ops = {
+static const struct ethtool_ops mcs7830_ethtool_ops = {
.get_drvinfo = mcs7830_get_drvinfo,
.get_regs_len = mcs7830_get_regs_len,
.get_regs = mcs7830_get_regs,
--- a/drivers/net/usb/pegasus.c 2009-09-01 21:23:23.305799714 -0700
+++ b/drivers/net/usb/pegasus.c 2009-09-01 21:28:51.980749292 -0700
@@ -1174,7 +1174,7 @@ static void pegasus_set_msglevel(struct
pegasus->msg_enable = v;
}
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = pegasus_get_drvinfo,
.get_settings = pegasus_get_settings,
.set_settings = pegasus_set_settings,
--- a/drivers/net/usb/rtl8150.c 2009-09-01 21:23:23.337740661 -0700
+++ b/drivers/net/usb/rtl8150.c 2009-09-01 21:28:56.895273704 -0700
@@ -865,7 +865,7 @@ static int rtl8150_get_settings(struct n
return 0;
}
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = rtl8150_get_drvinfo,
.get_settings = rtl8150_get_settings,
.get_link = ethtool_op_get_link
--- a/drivers/net/usb/smsc95xx.c 2009-09-01 21:23:23.369801502 -0700
+++ b/drivers/net/usb/smsc95xx.c 2009-09-01 21:29:00.964124094 -0700
@@ -625,7 +625,7 @@ static int smsc95xx_ethtool_set_tx_csum(
return smsc95xx_set_csums(dev);
}
-static struct ethtool_ops smsc95xx_ethtool_ops = {
+static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
--- a/drivers/net/usb/usbnet.c 2009-09-01 21:23:23.401801199 -0700
+++ b/drivers/net/usb/usbnet.c 2009-09-01 21:29:08.106772310 -0700
@@ -854,7 +854,7 @@ void usbnet_set_msglevel (struct net_dev
EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
/* drivers may override default ethtool_ops in their bind() routine */
-static struct ethtool_ops usbnet_ethtool_ops = {
+static const struct ethtool_ops usbnet_ethtool_ops = {
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.get_link = usbnet_get_link,
--- a/drivers/net/veth.c 2009-09-01 21:23:23.433800886 -0700
+++ b/drivers/net/veth.c 2009-09-01 21:29:12.191020944 -0700
@@ -129,7 +129,7 @@ static int veth_set_tx_csum(struct net_d
return 0;
}
-static struct ethtool_ops veth_ethtool_ops = {
+static const struct ethtool_ops veth_ethtool_ops = {
.get_settings = veth_get_settings,
.get_drvinfo = veth_get_drvinfo,
.get_link = ethtool_op_get_link,
--- a/drivers/net/virtio_net.c 2009-09-01 21:23:23.465800230 -0700
+++ b/drivers/net/virtio_net.c 2009-09-01 21:29:16.754013613 -0700
@@ -798,7 +798,7 @@ static void virtnet_vlan_rx_kill_vid(str
dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
}
-static struct ethtool_ops virtnet_ethtool_ops = {
+static const struct ethtool_ops virtnet_ethtool_ops = {
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
--- a/drivers/net/wireless/libertas/dev.h 2009-09-01 21:23:23.499800950 -0700
+++ b/drivers/net/wireless/libertas/dev.h 2009-09-01 21:29:21.529757543 -0700
@@ -14,7 +14,7 @@
#include "defs.h"
#include "hostcmd.h"
-extern struct ethtool_ops lbs_ethtool_ops;
+extern const struct ethtool_ops lbs_ethtool_ops;
#define MAX_BSSID_PER_CHANNEL 16
--- a/drivers/net/wireless/libertas/ethtool.c 2009-09-01 21:23:23.532780220 -0700
+++ b/drivers/net/wireless/libertas/ethtool.c 2009-09-01 21:29:28.396212516 -0700
@@ -183,7 +183,7 @@ static int lbs_ethtool_set_wol(struct ne
return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
}
-struct ethtool_ops lbs_ethtool_ops = {
+const struct ethtool_ops lbs_ethtool_ops = {
.get_drvinfo = lbs_ethtool_get_drvinfo,
.get_eeprom = lbs_ethtool_get_eeprom,
.get_eeprom_len = lbs_ethtool_get_eeprom_len,
--- a/drivers/net/xen-netfront.c 2009-09-01 21:23:23.565740506 -0700
+++ b/drivers/net/xen-netfront.c 2009-09-01 21:29:39.899887569 -0700
@@ -51,7 +51,7 @@
#include <xen/interface/memory.h>
#include <xen/interface/grant_table.h>
-static struct ethtool_ops xennet_ethtool_ops;
+static const struct ethtool_ops xennet_ethtool_ops;
struct netfront_cb {
struct page *page;
@@ -1627,7 +1627,7 @@ static void backend_changed(struct xenbu
}
}
-static struct ethtool_ops xennet_ethtool_ops =
+static const struct ethtool_ops xennet_ethtool_ops =
{
.set_tx_csum = ethtool_op_set_tx_csum,
.set_sg = xennet_set_sg,
--- a/drivers/s390/net/qeth_l2_main.c 2009-09-01 21:23:23.614740730 -0700
+++ b/drivers/s390/net/qeth_l2_main.c 2009-09-01 21:29:48.813744958 -0700
@@ -863,7 +863,7 @@ static void qeth_l2_remove_device(struct
return;
}
-static struct ethtool_ops qeth_l2_ethtool_ops = {
+static const struct ethtool_ops qeth_l2_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_strings = qeth_core_get_strings,
.get_ethtool_stats = qeth_core_get_ethtool_stats,
@@ -872,7 +872,7 @@ static struct ethtool_ops qeth_l2_ethtoo
.get_settings = qeth_core_ethtool_get_settings,
};
-static struct ethtool_ops qeth_l2_osn_ops = {
+static const struct ethtool_ops qeth_l2_osn_ops = {
.get_strings = qeth_core_get_strings,
.get_ethtool_stats = qeth_core_get_ethtool_stats,
.get_stats_count = qeth_core_get_stats_count,
--- a/drivers/s390/net/qeth_l3_main.c 2009-09-01 21:23:23.665740346 -0700
+++ b/drivers/s390/net/qeth_l3_main.c 2009-09-01 21:29:58.282953727 -0700
@@ -2946,7 +2946,7 @@ static int qeth_l3_ethtool_set_tso(struc
return 0;
}
-static struct ethtool_ops qeth_l3_ethtool_ops = {
+static const struct ethtool_ops qeth_l3_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_hw_csum,
--- a/drivers/staging/at76_usb/at76_usb.c 2009-09-01 21:23:23.729799604 -0700
+++ b/drivers/staging/at76_usb/at76_usb.c 2009-09-01 21:30:08.712050545 -0700
@@ -3396,7 +3396,7 @@ static u32 at76_ethtool_get_link(struct
return priv->mac_state == MAC_CONNECTED;
}
-static struct ethtool_ops at76_ethtool_ops = {
+static const struct ethtool_ops at76_ethtool_ops = {
.get_drvinfo = at76_ethtool_get_drvinfo,
.get_link = at76_ethtool_get_link,
};
--- a/drivers/staging/octeon/ethernet-mdio.c 2009-09-01 21:23:23.762799959 -0700
+++ b/drivers/staging/octeon/ethernet-mdio.c 2009-09-01 21:30:12.140749658 -0700
@@ -170,7 +170,7 @@ static u32 cvm_oct_get_link(struct net_d
return ret;
}
-struct ethtool_ops cvm_oct_ethtool_ops = {
+struct const ethtool_ops cvm_oct_ethtool_ops = {
.get_drvinfo = cvm_oct_get_drvinfo,
.get_settings = cvm_oct_get_settings,
.set_settings = cvm_oct_set_settings,
--- a/drivers/staging/octeon/ethernet-mdio.h 2009-09-01 21:23:23.794740804 -0700
+++ b/drivers/staging/octeon/ethernet-mdio.h 2009-09-01 21:30:16.177000766 -0700
@@ -41,6 +41,6 @@
#include <net/xfrm.h>
#endif /* CONFIG_XFRM */
-extern struct ethtool_ops cvm_oct_ethtool_ops;
+extern const struct ethtool_ops cvm_oct_ethtool_ops;
int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int cvm_oct_mdio_setup_device(struct net_device *dev);
--- a/drivers/staging/sxg/sxg.h 2009-09-01 21:23:23.826800190 -0700
+++ b/drivers/staging/sxg/sxg.h 2009-09-01 21:30:21.450752540 -0700
@@ -782,6 +782,6 @@ struct slic_crash_info {
#define SIOCSLICSETINTAGG (SIOCDEVPRIVATE+10)
#define SIOCSLICTRACEDUMP (SIOCDEVPRIVATE+11)
-extern struct ethtool_ops sxg_nic_ethtool_ops;
+extern const struct ethtool_ops sxg_nic_ethtool_ops;
#define SXG_COMPLETE_SLOW_SEND_LIMIT 128
#endif /* __SXG_DRIVER_H__ */
--- a/drivers/staging/sxg/sxg_ethtool.c 2009-09-01 21:23:23.858740712 -0700
+++ b/drivers/staging/sxg/sxg_ethtool.c 2009-09-01 21:30:27.490902621 -0700
@@ -300,7 +300,7 @@ static int sxg_nic_get_eeprom(struct net
return 0;
}
-struct ethtool_ops sxg_nic_ethtool_ops = {
+const struct ethtool_ops sxg_nic_ethtool_ops = {
.get_settings = sxg_nic_get_settings,
.set_settings = sxg_nic_set_settings,
.get_drvinfo = sxg_nic_get_drvinfo,
--- a/drivers/usb/gadget/u_ether.c 2009-09-01 21:23:23.890775071 -0700
+++ b/drivers/usb/gadget/u_ether.c 2009-09-01 21:30:36.693948879 -0700
@@ -181,7 +181,7 @@ static void eth_get_drvinfo(struct net_d
* - ... probably more ethtool ops
*/
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
.get_drvinfo = eth_get_drvinfo,
.get_link = ethtool_op_get_link,
};
--
^ permalink raw reply
* Re: [PATCH 14/19] tulip: convert drivers to netdev_tx_t
From: Grant Grundler @ 2009-09-02 5:48 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev, Grant Grundler, Kyle McMartin
In-Reply-To: <20090901055129.814907029@vyatta.com>
On Mon, Aug 31, 2009 at 10:50:53PM -0700, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> drivers/net/tulip/de2104x.c | 3 ++-
> drivers/net/tulip/de4x5.c | 11 +++++------
> drivers/net/tulip/dmfe.c | 5 +++--
> drivers/net/tulip/tulip_core.c | 5 +++--
> drivers/net/tulip/uli526x.c | 6 ++++--
> drivers/net/tulip/winbond-840.c | 4 ++--
> drivers/net/tulip/xircom_cb.c | 6 ++++--
> 7 files changed, 23 insertions(+), 17 deletions(-)
>
> --- a/drivers/net/tulip/de2104x.c 2009-08-29 23:10:19.609527457 -0700
> +++ b/drivers/net/tulip/de2104x.c 2009-08-29 23:12:54.117527675 -0700
> @@ -599,7 +599,8 @@ next:
> netif_wake_queue(de->dev);
> }
>
> -static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
> +static netdev_tx_t de_start_xmit (struct sk_buff *skb,
> + struct net_device *dev)
Stephen,
The patches look harmless and I'm inclined to ACK them...but google can't find
any context or explanation for "netdev_tx_t". URL to email which proposed
netdev_tx_t?
thanks,
grant
> {
> struct de_private *de = netdev_priv(dev);
> unsigned int entry, tx_free;
> --- a/drivers/net/tulip/de4x5.c 2009-08-29 23:10:19.553491700 -0700
> +++ b/drivers/net/tulip/de4x5.c 2009-08-29 23:12:54.125526807 -0700
> @@ -895,7 +895,8 @@ static struct {
> ** Public Functions
> */
> static int de4x5_open(struct net_device *dev);
> -static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev);
> +static netdev_tx_t de4x5_queue_pkt(struct sk_buff *skb,
> + struct net_device *dev);
> static irqreturn_t de4x5_interrupt(int irq, void *dev_id);
> static int de4x5_close(struct net_device *dev);
> static struct net_device_stats *de4x5_get_stats(struct net_device *dev);
> @@ -1456,18 +1457,16 @@ de4x5_sw_reset(struct net_device *dev)
> /*
> ** Writes a socket buffer address to the next available transmit descriptor.
> */
> -static int
> +static netdev_tx_t
> de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
> {
> struct de4x5_private *lp = netdev_priv(dev);
> u_long iobase = dev->base_addr;
> - int status = NETDEV_TX_OK;
> u_long flags = 0;
>
> netif_stop_queue(dev);
> - if (!lp->tx_enable) { /* Cannot send for now */
> + if (!lp->tx_enable) /* Cannot send for now */
> return NETDEV_TX_LOCKED;
> - }
>
> /*
> ** Clean out the TX ring asynchronously to interrupts - sometimes the
> @@ -1521,7 +1520,7 @@ de4x5_queue_pkt(struct sk_buff *skb, str
>
> lp->cache.lock = 0;
>
> - return status;
> + return NETDEV_TX_OK;
> }
>
> /*
> --- a/drivers/net/tulip/dmfe.c 2009-08-29 23:10:19.521492310 -0700
> +++ b/drivers/net/tulip/dmfe.c 2009-08-29 23:12:54.129527736 -0700
> @@ -311,7 +311,7 @@ static u8 SF_mode; /* Special Function:
>
> /* function declaration ------------------------------------- */
> static int dmfe_open(struct DEVICE *);
> -static int dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
> +static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
> static int dmfe_stop(struct DEVICE *);
> static void dmfe_set_filter_mode(struct DEVICE *);
> static const struct ethtool_ops netdev_ethtool_ops;
> @@ -661,7 +661,8 @@ static void dmfe_init_dm910x(struct DEVI
> * Send a packet to media from the upper layer.
> */
>
> -static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
> +static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
> + struct DEVICE *dev)
> {
> struct dmfe_board_info *db = netdev_priv(dev);
> struct tx_desc *txptr;
> --- a/drivers/net/tulip/tulip_core.c 2009-08-29 23:10:19.589491808 -0700
> +++ b/drivers/net/tulip/tulip_core.c 2009-08-29 23:12:54.129527736 -0700
> @@ -256,7 +256,8 @@ const char tulip_media_cap[32] =
> static void tulip_tx_timeout(struct net_device *dev);
> static void tulip_init_ring(struct net_device *dev);
> static void tulip_free_ring(struct net_device *dev);
> -static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
> +static netdev_tx_t tulip_start_xmit(struct sk_buff *skb,
> + struct net_device *dev);
> static int tulip_open(struct net_device *dev);
> static int tulip_close(struct net_device *dev);
> static void tulip_up(struct net_device *dev);
> @@ -645,7 +646,7 @@ static void tulip_init_ring(struct net_d
> tp->tx_ring[i-1].buffer2 = cpu_to_le32(tp->tx_ring_dma);
> }
>
> -static int
> +static netdev_tx_t
> tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> struct tulip_private *tp = netdev_priv(dev);
> --- a/drivers/net/tulip/uli526x.c 2009-08-29 23:10:19.637530461 -0700
> +++ b/drivers/net/tulip/uli526x.c 2009-08-29 23:12:54.133492067 -0700
> @@ -215,7 +215,8 @@ static int mode = 8;
>
> /* function declaration ------------------------------------- */
> static int uli526x_open(struct net_device *);
> -static int uli526x_start_xmit(struct sk_buff *, struct net_device *);
> +static netdev_tx_t uli526x_start_xmit(struct sk_buff *,
> + struct net_device *);
> static int uli526x_stop(struct net_device *);
> static void uli526x_set_filter_mode(struct net_device *);
> static const struct ethtool_ops netdev_ethtool_ops;
> @@ -567,7 +568,8 @@ static void uli526x_init(struct net_devi
> * Send a packet to media from the upper layer.
> */
>
> -static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev)
> +static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb,
> + struct net_device *dev)
> {
> struct uli526x_board_info *db = netdev_priv(dev);
> struct tx_desc *txptr;
> --- a/drivers/net/tulip/winbond-840.c 2009-08-29 23:10:19.537492110 -0700
> +++ b/drivers/net/tulip/winbond-840.c 2009-08-29 23:12:54.133492067 -0700
> @@ -333,7 +333,7 @@ static void init_registers(struct net_de
> static void tx_timeout(struct net_device *dev);
> static int alloc_ringdesc(struct net_device *dev);
> static void free_ringdesc(struct netdev_private *np);
> -static int start_tx(struct sk_buff *skb, struct net_device *dev);
> +static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev);
> static irqreturn_t intr_handler(int irq, void *dev_instance);
> static void netdev_error(struct net_device *dev, int intr_status);
> static int netdev_rx(struct net_device *dev);
> @@ -997,7 +997,7 @@ static void free_ringdesc(struct netdev_
>
> }
>
> -static int start_tx(struct sk_buff *skb, struct net_device *dev)
> +static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
> {
> struct netdev_private *np = netdev_priv(dev);
> unsigned entry;
> --- a/drivers/net/tulip/xircom_cb.c 2009-08-29 23:10:19.505491812 -0700
> +++ b/drivers/net/tulip/xircom_cb.c 2009-08-29 23:12:54.137512691 -0700
> @@ -113,7 +113,8 @@ struct xircom_private {
> static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id);
> static void xircom_remove(struct pci_dev *pdev);
> static irqreturn_t xircom_interrupt(int irq, void *dev_instance);
> -static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
> +static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> + struct net_device *dev);
> static int xircom_open(struct net_device *dev);
> static int xircom_close(struct net_device *dev);
> static void xircom_up(struct xircom_private *card);
> @@ -384,7 +385,8 @@ static irqreturn_t xircom_interrupt(int
> return IRQ_HANDLED;
> }
>
> -static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
> +static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> + struct net_device *dev)
> {
> struct xircom_private *card;
> unsigned long flags;
>
> --
^ permalink raw reply
* Re: [PATCH 14/19] tulip: convert drivers to netdev_tx_t
From: Stephen Hemminger @ 2009-09-02 6:04 UTC (permalink / raw)
To: Grant Grundler; +Cc: David Miller, netdev, Grant Grundler, Kyle McMartin
In-Reply-To: <20090902054801.GB28972@lackof.org>
On Tue, 1 Sep 2009 23:48:01 -0600
Grant Grundler <grundler@parisc-linux.org> wrote:
> On Mon, Aug 31, 2009 at 10:50:53PM -0700, Stephen Hemminger wrote:
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > ---
> > drivers/net/tulip/de2104x.c | 3 ++-
> > drivers/net/tulip/de4x5.c | 11 +++++------
> > drivers/net/tulip/dmfe.c | 5 +++--
> > drivers/net/tulip/tulip_core.c | 5 +++--
> > drivers/net/tulip/uli526x.c | 6 ++++--
> > drivers/net/tulip/winbond-840.c | 4 ++--
> > drivers/net/tulip/xircom_cb.c | 6 ++++--
> > 7 files changed, 23 insertions(+), 17 deletions(-)
> >
> > --- a/drivers/net/tulip/de2104x.c 2009-08-29 23:10:19.609527457 -0700
> > +++ b/drivers/net/tulip/de2104x.c 2009-08-29 23:12:54.117527675 -0700
> > @@ -599,7 +599,8 @@ next:
> > netif_wake_queue(de->dev);
> > }
> >
> > -static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
> > +static netdev_tx_t de_start_xmit (struct sk_buff *skb,
> > + struct net_device *dev)
>
> Stephen,
> The patches look harmless and I'm inclined to ACK them...but google can't find
> any context or explanation for "netdev_tx_t". URL to email which proposed
> netdev_tx_t?
>
> thanks,
> grant
>From patch series intro:
> This is a little change over a lot of files. It changes the
> return value of network device transmit from an integer to
> an enum type (like irqreturn_t). This allows compiler to warn
> about stupid code that tries to return -ENOBUFS or other mistakes
> like that. All the code that did that is gone, but it would
> be better to try and do some decent type checking.
>
> This patch converts all the x86 drivers (except staging).
> Other drivers will work but produce a warning until converted.
^ permalink raw reply
* Re: [PATCH 14/19] tulip: convert drivers to netdev_tx_t
From: Grant Grundler @ 2009-09-02 6:08 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev, Kyle McMartin
In-Reply-To: <20090902054801.GB28972@lackof.org>
On Tue, Sep 01, 2009 at 11:48:01PM -0600, Grant Grundler wrote:
> On Mon, Aug 31, 2009 at 10:50:53PM -0700, Stephen Hemminger wrote:
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > ---
> > drivers/net/tulip/de2104x.c | 3 ++-
> > drivers/net/tulip/de4x5.c | 11 +++++------
> > drivers/net/tulip/dmfe.c | 5 +++--
> > drivers/net/tulip/tulip_core.c | 5 +++--
> > drivers/net/tulip/uli526x.c | 6 ++++--
> > drivers/net/tulip/winbond-840.c | 4 ++--
> > drivers/net/tulip/xircom_cb.c | 6 ++++--
> > 7 files changed, 23 insertions(+), 17 deletions(-)
> >
> > --- a/drivers/net/tulip/de2104x.c 2009-08-29 23:10:19.609527457 -0700
> > +++ b/drivers/net/tulip/de2104x.c 2009-08-29 23:12:54.117527675 -0700
> > @@ -599,7 +599,8 @@ next:
> > netif_wake_queue(de->dev);
> > }
> >
> > -static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
> > +static netdev_tx_t de_start_xmit (struct sk_buff *skb,
> > + struct net_device *dev)
>
> Stephen,
> The patches look harmless and I'm inclined to ACK them...but google can't find
> any context or explanation for "netdev_tx_t". URL to email which proposed
> netdev_tx_t?
Finally found it...archives just had to catch up:
http://thread.gmane.org/gmane.linux.network/136658/
ACKed-by: Grant Grundler <grundler@parisc-linux.org>
thanks,
grant
>
> thanks,
> grant
> > {
> > struct de_private *de = netdev_priv(dev);
> > unsigned int entry, tx_free;
> > --- a/drivers/net/tulip/de4x5.c 2009-08-29 23:10:19.553491700 -0700
> > +++ b/drivers/net/tulip/de4x5.c 2009-08-29 23:12:54.125526807 -0700
> > @@ -895,7 +895,8 @@ static struct {
> > ** Public Functions
> > */
> > static int de4x5_open(struct net_device *dev);
> > -static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev);
> > +static netdev_tx_t de4x5_queue_pkt(struct sk_buff *skb,
> > + struct net_device *dev);
> > static irqreturn_t de4x5_interrupt(int irq, void *dev_id);
> > static int de4x5_close(struct net_device *dev);
> > static struct net_device_stats *de4x5_get_stats(struct net_device *dev);
> > @@ -1456,18 +1457,16 @@ de4x5_sw_reset(struct net_device *dev)
> > /*
> > ** Writes a socket buffer address to the next available transmit descriptor.
> > */
> > -static int
> > +static netdev_tx_t
> > de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
> > {
> > struct de4x5_private *lp = netdev_priv(dev);
> > u_long iobase = dev->base_addr;
> > - int status = NETDEV_TX_OK;
> > u_long flags = 0;
> >
> > netif_stop_queue(dev);
> > - if (!lp->tx_enable) { /* Cannot send for now */
> > + if (!lp->tx_enable) /* Cannot send for now */
> > return NETDEV_TX_LOCKED;
> > - }
> >
> > /*
> > ** Clean out the TX ring asynchronously to interrupts - sometimes the
> > @@ -1521,7 +1520,7 @@ de4x5_queue_pkt(struct sk_buff *skb, str
> >
> > lp->cache.lock = 0;
> >
> > - return status;
> > + return NETDEV_TX_OK;
> > }
> >
> > /*
> > --- a/drivers/net/tulip/dmfe.c 2009-08-29 23:10:19.521492310 -0700
> > +++ b/drivers/net/tulip/dmfe.c 2009-08-29 23:12:54.129527736 -0700
> > @@ -311,7 +311,7 @@ static u8 SF_mode; /* Special Function:
> >
> > /* function declaration ------------------------------------- */
> > static int dmfe_open(struct DEVICE *);
> > -static int dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
> > +static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
> > static int dmfe_stop(struct DEVICE *);
> > static void dmfe_set_filter_mode(struct DEVICE *);
> > static const struct ethtool_ops netdev_ethtool_ops;
> > @@ -661,7 +661,8 @@ static void dmfe_init_dm910x(struct DEVI
> > * Send a packet to media from the upper layer.
> > */
> >
> > -static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
> > +static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
> > + struct DEVICE *dev)
> > {
> > struct dmfe_board_info *db = netdev_priv(dev);
> > struct tx_desc *txptr;
> > --- a/drivers/net/tulip/tulip_core.c 2009-08-29 23:10:19.589491808 -0700
> > +++ b/drivers/net/tulip/tulip_core.c 2009-08-29 23:12:54.129527736 -0700
> > @@ -256,7 +256,8 @@ const char tulip_media_cap[32] =
> > static void tulip_tx_timeout(struct net_device *dev);
> > static void tulip_init_ring(struct net_device *dev);
> > static void tulip_free_ring(struct net_device *dev);
> > -static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
> > +static netdev_tx_t tulip_start_xmit(struct sk_buff *skb,
> > + struct net_device *dev);
> > static int tulip_open(struct net_device *dev);
> > static int tulip_close(struct net_device *dev);
> > static void tulip_up(struct net_device *dev);
> > @@ -645,7 +646,7 @@ static void tulip_init_ring(struct net_d
> > tp->tx_ring[i-1].buffer2 = cpu_to_le32(tp->tx_ring_dma);
> > }
> >
> > -static int
> > +static netdev_tx_t
> > tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > {
> > struct tulip_private *tp = netdev_priv(dev);
> > --- a/drivers/net/tulip/uli526x.c 2009-08-29 23:10:19.637530461 -0700
> > +++ b/drivers/net/tulip/uli526x.c 2009-08-29 23:12:54.133492067 -0700
> > @@ -215,7 +215,8 @@ static int mode = 8;
> >
> > /* function declaration ------------------------------------- */
> > static int uli526x_open(struct net_device *);
> > -static int uli526x_start_xmit(struct sk_buff *, struct net_device *);
> > +static netdev_tx_t uli526x_start_xmit(struct sk_buff *,
> > + struct net_device *);
> > static int uli526x_stop(struct net_device *);
> > static void uli526x_set_filter_mode(struct net_device *);
> > static const struct ethtool_ops netdev_ethtool_ops;
> > @@ -567,7 +568,8 @@ static void uli526x_init(struct net_devi
> > * Send a packet to media from the upper layer.
> > */
> >
> > -static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > +static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb,
> > + struct net_device *dev)
> > {
> > struct uli526x_board_info *db = netdev_priv(dev);
> > struct tx_desc *txptr;
> > --- a/drivers/net/tulip/winbond-840.c 2009-08-29 23:10:19.537492110 -0700
> > +++ b/drivers/net/tulip/winbond-840.c 2009-08-29 23:12:54.133492067 -0700
> > @@ -333,7 +333,7 @@ static void init_registers(struct net_de
> > static void tx_timeout(struct net_device *dev);
> > static int alloc_ringdesc(struct net_device *dev);
> > static void free_ringdesc(struct netdev_private *np);
> > -static int start_tx(struct sk_buff *skb, struct net_device *dev);
> > +static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev);
> > static irqreturn_t intr_handler(int irq, void *dev_instance);
> > static void netdev_error(struct net_device *dev, int intr_status);
> > static int netdev_rx(struct net_device *dev);
> > @@ -997,7 +997,7 @@ static void free_ringdesc(struct netdev_
> >
> > }
> >
> > -static int start_tx(struct sk_buff *skb, struct net_device *dev)
> > +static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
> > {
> > struct netdev_private *np = netdev_priv(dev);
> > unsigned entry;
> > --- a/drivers/net/tulip/xircom_cb.c 2009-08-29 23:10:19.505491812 -0700
> > +++ b/drivers/net/tulip/xircom_cb.c 2009-08-29 23:12:54.137512691 -0700
> > @@ -113,7 +113,8 @@ struct xircom_private {
> > static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id);
> > static void xircom_remove(struct pci_dev *pdev);
> > static irqreturn_t xircom_interrupt(int irq, void *dev_instance);
> > -static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
> > +static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> > + struct net_device *dev);
> > static int xircom_open(struct net_device *dev);
> > static int xircom_close(struct net_device *dev);
> > static void xircom_up(struct xircom_private *card);
> > @@ -384,7 +385,8 @@ static irqreturn_t xircom_interrupt(int
> > return IRQ_HANDLED;
> > }
> >
> > -static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > +static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> > + struct net_device *dev)
> > {
> > struct xircom_private *card;
> > unsigned long flags;
> >
> > --
^ permalink raw reply
* RE: [RFC] Virtual Machine Device Queues(VMDq) support on KVM
From: Xin, Xiaohui @ 2009-09-02 6:45 UTC (permalink / raw)
To: Stephen Hemminger
Cc: mst@redhat.com, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@elte.hu, linux-mm@kvack.org,
akpm@linux-foundation.org, hpa@zytor.com,
gregory.haskins@gmail.com
In-Reply-To: <20090901090518.1193e412@nehalam>
>* Code is easier to review than bullet points.
Yes. We'd send the code soon.
>* Direct I/O has to be safe when page is shared by multiple threads,
> and has to be non-blocking since network I/O can take indeterminately
> long (think big queue's, tunneling, ...)
In the situation, one queue pair NIC is assigned to only one guest, the pages
are locked and a KVM guest will not swapped out.
>* In the past attempts at Direct I/O on network have always had SMP
> TLB issues. The page has to be flipped or marked as COW on all CPU's
> and the cost of the Inter Processor Interrupt to steal the page has
> been slower than copying
It may be, we have not thought about this more . Thanks.
Thanks
Xiaohui
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Wednesday, September 02, 2009 12:05 AM
To: Xin, Xiaohui
Cc: mst@redhat.com; netdev@vger.kernel.org; virtualization@lists.linux-foundation.org; kvm@vger.kernel.org; linux-kernel@vger.kernel.org; mingo@elte.hu; linux-mm@kvack.org; akpm@linux-foundation.org; hpa@zytor.com; gregory.haskins@gmail.com
Subject: Re: [RFC] Virtual Machine Device Queues(VMDq) support on KVM
On Tue, 1 Sep 2009 14:58:19 +0800
"Xin, Xiaohui" <xiaohui.xin@intel.com> wrote:
> [RFC] Virtual Machine Device Queues (VMDq) support on KVM
>
> Network adapter with VMDq technology presents multiple pairs of tx/rx queues,
> and renders network L2 sorting mechanism based on MAC addresses and VLAN tags
> for each tx/rx queue pair. Here we present a generic framework, in which network
> traffic to/from a tx/rx queue pair can be directed from/to a KVM guest without
> any software copy.
>
> Actually this framework can apply to traditional network adapters which have
> just one tx/rx queue pair. And applications using the same user/kernel interface
> can utilize this framework to send/receive network traffic directly thru a tx/rx
> queue pair in a network adapter.
>
> We use virtio-net architecture to illustrate the framework.
>
>
> |--------------------| pop add_buf |----------------|
> | Qemu process | <--------- TX <---------- | Guest Kernel |
> | | ---------> ----------> | |
> | Virtio-net | push get_buf | |
> | (Backend service) | ---------> RX ----------> | Virtio-net |
> | | <--------- <---------- | driver |
> | | push get_buf | |
> |--------------------| |----------------|
> |
> |
> | AIO (read & write) combined with Direct I/O
> | (which substitute synced file operations)
> |-----------------------------------------------------------------------|
> | Host kernel | read: copy-less with directly mapped user |
> | | space to kernel, payload directly DMAed |
> | | into user space |
> | | write: copy-less with directly mapped user |
> | | space to kernel, payload directly hooked |
> | | to a skb |
> | | |
> | (a likely | |
> | queue pair | |
> | instance) | |
> | | | |
> | NIC driver <--> TUN/TAP driver |
> |-----------------------------------------------------------------------|
> |
> |
> traditional adapter or a tx/rx queue pair
>
> The basic idea is to utilize the kernel Asynchronous I/O combined with Direct
> I/O to implements copy-less TUN/TAP device. AIO and Direct I/O is not new to
> kernel, we still can see it in SCSI tape driver.
>
> With traditional file operations, a copying of payload contents from/to the
> kernel DMA address to/from a user buffer is needed. That's what the copying we
> want to save.
>
> The proposed framework is like this:
> A TUN/TAP device is bound to a traditional NIC adapter or a tx/rx queue pair in
> host side. KVM virto-net Backend service, the user space program submits
> asynchronous read/write I/O requests to the host kernel through TUN/TAP device.
> The requests are corresponding to the vqueue elements include both transmission
> & receive. They can be queued in one AIO request and later, the completion will
> be notified through the underlying packets tx/rx processing of the rx/tx queue
> pair.
>
> Detailed path:
>
> To guest Virtio-net driver, packets receive corresponding to asynchronous read
> I/O requests of Backend service.
>
> 1) Guest Virtio-net driver provides header and payload address through the
> receive vqueue to Virtio-net backend service.
>
> 2) Virtio-net backend service encapsulates multiple vqueue elements into
> multiple AIO control blocks and composes them into one AIO read request.
>
> 3) Virtio-net backend service uses io_submit() syscall to pass the request to
> the TUN/TAP device.
>
> 4) Virtio-net backend service uses io_getevents() syscall to check the
> completion of the request.
>
> 5) The TUN/TAP driver receives packets from the queue pair of NIC, and prepares
> for Direct I/O.
> A modified NIC driver may render a skb which header is allocated in host
> kernel, but the payload buffer is directly mapped from user space buffer which
> are rendered through the AIO request by the Backend service. get_user_pages()
> may do this. For one AIO read request, the TUN/TAP driver maintains a list for
> the directly mapped buffers, and a NIC driver tries to get the buffers as
> payload buffer to compose the new skbs. Of course, if getting the buffers
> fails, then kernel allocated buffers are used.
>
> 6) Modern NIC cards now mostly have the header split feature. The NIC queue
> pair then may directly DMA the payload into the user spaces mapped payload
> buffers.
> Thus a zero-copy for payload is implemented in packet receiving.
>
> 7) The TUN/TAP driver manually copy the host header to space user mapped.
>
> 8) aio_complete() to notify the Virtio-net backend service for io_getevents().
>
>
> To guest Virtio-net driver, packets send corresponding to asynchronous write
> I/O requests of backend. The path is similar to packet receive.
>
> 1) Guest Virtio-net driver provides header and payload address filled with
> contents through the transmit vqueue to Virtio-net backed service.
>
> 2) Virtio-net backend service encapsulates the vqueue elements into multiple
> AIO control blocks and composes them into one AIO write request.
>
> 3) Virtio-net backend service uses the io_submit() syscall to pass the
> requests to the TUN/TAP device.
>
> 4) Virtio-net backend service uses io_getevents() syscall to check the request
> completion.
>
> 5) The TUN/TAP driver gets the write requests and allocates skbs for it. The
> header contents are copied into the skb header. The directly mapped user space
> buffer is easily hooked into skb. Thus a zero copy for payload is implemented
> in packet sending.
>
> 6) aio_complete() to notify the Virtio-net backend service for io_getevents().
>
> The proposed framework is described as above.
>
> Consider the modifications to the kernel and qemu:
>
> To kernel:
> 1) The TUN/TAP driver may be modified a lot to implement AIO device operations
> and to implement directly user space mapping into kernel. Code to maintain the
> directly mapped user buffers should be in. It's just a modification for driver.
>
> 2) The NIC driver may be modified to compose skb differently and slightly data
> structure change to add user directly mapped buffer pointer.
> Here, maybe it's better for a NIC driver to present an interface for an rx/tx
> queue pair instance which will also apply to traditional hardware, the kernel
> interface should not be changed to make the other components happy.
> The abstraction is useful, though it is not needed immediately here.
>
> 3) The skb shared info structure may be modified a little to contain the user
> directly mapped info.
>
> To Qemu:
> 1) The Virtio-net backend service may be modified to handle AIO read/write
> requests from the vqueues.
> 2) Maybe a separate pthread to handle the AIO request triggering is needed.
>
> Any comments are appreciated here.
* Code is easier to review than bullet points.
* Direct I/O has to be safe when page is shared by multiple threads,
and has to be non-blocking since network I/O can take indeterminately
long (think big queue's, tunneling, ...)
* In the past attempts at Direct I/O on network have always had SMP
TLB issues. The page has to be flipped or marked as COW on all CPU's
and the cost of the Inter Processor Interrupt to steal the page has
been slower than copying
--
^ permalink raw reply
* Re: [PATCH] sky2: fix management of driver LED
From: Rene Mayrhofer @ 2009-09-02 7:28 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, mikem, netdev, leitner, hofer
In-Reply-To: <20090901213325.69b3348b@nehalam>
[-- Attachment #1: Type: Text/Plain, Size: 1500 bytes --]
On Wednesday 02 September 2009 06:33:25 am Stephen Hemminger wrote:
> On Tue, 01 Sep 2009 17:44:37 -0700 (PDT)
>
> David Miller <davem@davemloft.net> wrote:
> > From: Stephen Hemminger <shemminger@linux-foundation.org>
> > Date: Mon, 31 Aug 2009 10:31:41 -0700
> >
> > > Observed by Mike McCormack.
> > >
> > > The LED bit here is just a software controlled value used to
> > > turn on one of the LED's on some boards. The register value was wrong,
> > > which could have been causing some power control issues.
> > > Get rid of problematic define use the correct mask.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > Applied.
>
> If these power management fixes do fix all the reported problems,
> then I will consider back porting (probably to 2.6.31.1).
They don't, unfortunately (nonetheless, they should be applied). The bug is
still reproducible with this patch applied to the latest net-next version of
sky2.[ch]. I am currently working on setting up a test environment to
reproduce the bug and access the system console (serial line) as well as hard
power reset. Both you and Mike (and David if it helps) will get the necessary
access so that you can debug more efficiently on the system itself (without me
being in the middle, slowing things down). I hope to have everything ready in
an hour.
best regards,
Rene
--
-------------------------------------------------
Gibraltar firewall http://www.gibraltar.at/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] sky2: fix management of driver LED
From: David Miller @ 2009-09-02 7:33 UTC (permalink / raw)
To: shemminger; +Cc: mikem, netdev, rene.mayrhofer, leitner
In-Reply-To: <20090901213325.69b3348b@nehalam>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Tue, 1 Sep 2009 21:33:25 -0700
> On Tue, 01 Sep 2009 17:44:37 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Stephen Hemminger <shemminger@linux-foundation.org>
>> Date: Mon, 31 Aug 2009 10:31:41 -0700
>>
>> > Observed by Mike McCormack.
>> >
>> > The LED bit here is just a software controlled value used to
>> > turn on one of the LED's on some boards. The register value was wrong,
>> > which could have been causing some power control issues.
>> > Get rid of problematic define use the correct mask.
>> >
>> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>
>> Applied.
>
> If these power management fixes do fix all the reported problems,
> then I will consider back porting (probably to 2.6.31.1).
Good idea.
^ permalink raw reply
* Re: [PATCH 00/18] tg3: 5717 support part 2
From: David Miller @ 2009-09-02 7:45 UTC (permalink / raw)
To: mcarlson; +Cc: netdev, andy
In-Reply-To: <1251867296.5911@xw6200>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Tue, 1 Sep 2009 15:47:49 -0700
> This patchset implements the bulk of the support for the 5717 asic rev.
> The only item left to address is rx producer ring handling, which I've left
> to the patchset following this one.
>
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
Looks great, all applied to net-next-2.6, thanks!
^ permalink raw reply
* Re: [PATCH 0/5] More const ops cleanups
From: David Miller @ 2009-09-02 7:46 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20090902052500.808557262@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 01 Sep 2009 22:25:00 -0700
> Many places were not using const when defining/using structures
> that only contain initialized values.
All applied to net-next-2.6
Nice work Stephen.
^ permalink raw reply
* Re: H.245v10+ support in nf_conntrack_h323?
From: Andreas Jaggi @ 2009-09-02 8:05 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Mark Brown, Jing Min Zhao, netdev
In-Reply-To: <4A9D11A3.5070809@trash.net>
On Tue, Sep 01, 2009 at 02:20:51PM +0200, Patrick McHardy wrote:
> Its unfortunately necessary to drop packets in some cases after parsing
> errors when the helper might have already (partially) mangled the
> packet.
Do the helpers also mangle packets when there is no NAT involved?
(in out setup we don't use NAT, btw)
If they don't, would it be reasonable to return NF_ACCEPT when there is
no NAT. For example like in the patch below?
> You could try this patch in combination with ulogd and the pcap output
> plugin to capture the packets which are dropped by the helper for
> analysis.
Unfortunately the videoconferencing system is currently not available
for testing (and might be so for while). But I can have some tcpdumps from
both sides of the Linux Gateway from which I can extract the packets that
were dropped by the H.323 helper.
Andreas
--- a/net/netfilter/nf_conntrack_h323_main.c 2009-05-19 01:52:34.000000000 +0200
+++ b/net/netfilter/nf_conntrack_h323_main.c 2009-09-01 17:36:08.000000000 +0200
@@ -596,8 +596,12 @@
}
/* Process H.245 signal */
- if (process_h245(skb, ct, ctinfo, &data, dataoff, &mscm) < 0)
- goto drop;
+ if (process_h245(skb, ct, ctinfo, &data, dataoff, &mscm) < 0) {
+ if (ct->status & IPS_NAT_MASK)
+ goto drop;
+ else
+ break;
+ }
}
spin_unlock_bh(&nf_h323_lock);
@@ -1141,8 +1145,12 @@
}
/* Process Q.931 signal */
- if (process_q931(skb, ct, ctinfo, &data, dataoff, &q931) < 0)
- goto drop;
+ if (process_q931(skb, ct, ctinfo, &data, dataoff, &q931) < 0) {
+ if (ct->status & IPS_NAT_MASK)
+ goto drop;
+ else
+ break;
+ }
}
spin_unlock_bh(&nf_h323_lock);
@@ -1716,7 +1724,8 @@
}
/* Process RAS message */
- if (process_ras(skb, ct, ctinfo, &data, &ras) < 0)
+ if ((process_ras(skb, ct, ctinfo, &data, &ras) < 0) &&
+ (ct->status & IPS_NAT_MASK))
goto drop;
accept:
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox