Skip to content

Commit 9836f40

Browse files
committed
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6
2 parents e364a34 + 6d84b98 commit 9836f40

30 files changed

Lines changed: 150 additions & 220 deletions

‎drivers/net/sfc/efx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2005-2009 Solarflare Communications Inc.
4+
* Copyright 2005-2011 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published

‎drivers/net/sfc/efx.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2006-2009 Solarflare Communications Inc.
4+
* Copyright 2006-2010 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published

‎drivers/net/sfc/ethtool.c‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2006-2009 Solarflare Communications Inc.
4+
* Copyright 2006-2010 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published
@@ -28,7 +28,8 @@ struct efx_ethtool_stat {
2828
enum {
2929
EFX_ETHTOOL_STAT_SOURCE_mac_stats,
3030
EFX_ETHTOOL_STAT_SOURCE_nic,
31-
EFX_ETHTOOL_STAT_SOURCE_channel
31+
EFX_ETHTOOL_STAT_SOURCE_channel,
32+
EFX_ETHTOOL_STAT_SOURCE_tx_queue
3233
} source;
3334
unsigned offset;
3435
u64(*get_stat) (void *field); /* Reader function */
@@ -86,6 +87,10 @@ static u64 efx_get_atomic_stat(void *field)
8687
EFX_ETHTOOL_STAT(field, channel, n_##field, \
8788
unsigned int, efx_get_uint_stat)
8889

90+
#define EFX_ETHTOOL_UINT_TXQ_STAT(field) \
91+
EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
92+
unsigned int, efx_get_uint_stat)
93+
8994
static struct efx_ethtool_stat efx_ethtool_stats[] = {
9095
EFX_ETHTOOL_U64_MAC_STAT(tx_bytes),
9196
EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes),
@@ -116,6 +121,10 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
116121
EFX_ETHTOOL_ULONG_MAC_STAT(tx_non_tcpudp),
117122
EFX_ETHTOOL_ULONG_MAC_STAT(tx_mac_src_error),
118123
EFX_ETHTOOL_ULONG_MAC_STAT(tx_ip_src_error),
124+
EFX_ETHTOOL_UINT_TXQ_STAT(tso_bursts),
125+
EFX_ETHTOOL_UINT_TXQ_STAT(tso_long_headers),
126+
EFX_ETHTOOL_UINT_TXQ_STAT(tso_packets),
127+
EFX_ETHTOOL_UINT_TXQ_STAT(pushes),
119128
EFX_ETHTOOL_U64_MAC_STAT(rx_bytes),
120129
EFX_ETHTOOL_U64_MAC_STAT(rx_good_bytes),
121130
EFX_ETHTOOL_U64_MAC_STAT(rx_bad_bytes),
@@ -237,8 +246,8 @@ static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
237246
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
238247
strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
239248
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
240-
siena_print_fwver(efx, info->fw_version,
241-
sizeof(info->fw_version));
249+
efx_mcdi_print_fwver(efx, info->fw_version,
250+
sizeof(info->fw_version));
242251
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
243252
}
244253

@@ -470,6 +479,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
470479
struct efx_mac_stats *mac_stats = &efx->mac_stats;
471480
struct efx_ethtool_stat *stat;
472481
struct efx_channel *channel;
482+
struct efx_tx_queue *tx_queue;
473483
struct rtnl_link_stats64 temp;
474484
int i;
475485

@@ -495,6 +505,15 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
495505
data[i] += stat->get_stat((void *)channel +
496506
stat->offset);
497507
break;
508+
case EFX_ETHTOOL_STAT_SOURCE_tx_queue:
509+
data[i] = 0;
510+
efx_for_each_channel(channel, efx) {
511+
efx_for_each_channel_tx_queue(tx_queue, channel)
512+
data[i] +=
513+
stat->get_stat((void *)tx_queue
514+
+ stat->offset);
515+
}
516+
break;
498517
}
499518
}
500519
}

‎drivers/net/sfc/falcon.c‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2006-2009 Solarflare Communications Inc.
4+
* Copyright 2006-2010 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published
@@ -1478,36 +1478,26 @@ static void falcon_init_rx_cfg(struct efx_nic *efx)
14781478
/* RX control FIFO thresholds (32 entries) */
14791479
const unsigned ctrl_xon_thr = 20;
14801480
const unsigned ctrl_xoff_thr = 25;
1481-
/* RX data FIFO thresholds (256-byte units; size varies) */
1482-
int data_xon_thr = efx_nic_rx_xon_thresh >> 8;
1483-
int data_xoff_thr = efx_nic_rx_xoff_thresh >> 8;
14841481
efx_oword_t reg;
14851482

14861483
efx_reado(efx, &reg, FR_AZ_RX_CFG);
14871484
if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) {
14881485
/* Data FIFO size is 5.5K */
1489-
if (data_xon_thr < 0)
1490-
data_xon_thr = 512 >> 8;
1491-
if (data_xoff_thr < 0)
1492-
data_xoff_thr = 2048 >> 8;
14931486
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0);
14941487
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE,
14951488
huge_buf_size);
1496-
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, data_xon_thr);
1497-
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, data_xoff_thr);
1489+
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8);
1490+
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8);
14981491
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr);
14991492
EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr);
15001493
} else {
15011494
/* Data FIFO size is 80K; register fields moved */
1502-
if (data_xon_thr < 0)
1503-
data_xon_thr = 27648 >> 8; /* ~3*max MTU */
1504-
if (data_xoff_thr < 0)
1505-
data_xoff_thr = 54272 >> 8; /* ~80Kb - 3*max MTU */
15061495
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0);
15071496
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE,
15081497
huge_buf_size);
1509-
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, data_xon_thr);
1510-
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, data_xoff_thr);
1498+
/* Send XON and XOFF at ~3 * max MTU away from empty/full */
1499+
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8);
1500+
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8);
15111501
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr);
15121502
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr);
15131503
EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1);

‎drivers/net/sfc/falcon_boards.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
3-
* Copyright 2007-2009 Solarflare Communications Inc.
3+
* Copyright 2007-2010 Solarflare Communications Inc.
44
*
55
* This program is free software; you can redistribute it and/or modify it
66
* under the terms of the GNU General Public License version 2 as published

‎drivers/net/sfc/falcon_xmac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2006-2009 Solarflare Communications Inc.
4+
* Copyright 2006-2010 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published

‎drivers/net/sfc/io.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
33
* Copyright 2005-2006 Fen Systems Ltd.
4-
* Copyright 2006-2009 Solarflare Communications Inc.
4+
* Copyright 2006-2010 Solarflare Communications Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License version 2 as published

‎drivers/net/sfc/mcdi.c‎

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
3-
* Copyright 2008-2009 Solarflare Communications Inc.
3+
* Copyright 2008-2011 Solarflare Communications Inc.
44
*
55
* This program is free software; you can redistribute it and/or modify it
66
* under the terms of the GNU General Public License version 2 as published
@@ -602,7 +602,7 @@ void efx_mcdi_process_event(struct efx_channel *channel,
602602
**************************************************************************
603603
*/
604604

605-
int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build)
605+
void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len)
606606
{
607607
u8 outbuf[ALIGN(MC_CMD_GET_VERSION_V1_OUT_LEN, 4)];
608608
size_t outlength;
@@ -616,29 +616,20 @@ int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build)
616616
if (rc)
617617
goto fail;
618618

619-
if (outlength == MC_CMD_GET_VERSION_V0_OUT_LEN) {
620-
*version = 0;
621-
*build = MCDI_DWORD(outbuf, GET_VERSION_OUT_FIRMWARE);
622-
return 0;
623-
}
624-
625619
if (outlength < MC_CMD_GET_VERSION_V1_OUT_LEN) {
626620
rc = -EIO;
627621
goto fail;
628622
}
629623

630624
ver_words = (__le16 *)MCDI_PTR(outbuf, GET_VERSION_OUT_VERSION);
631-
*version = (((u64)le16_to_cpu(ver_words[0]) << 48) |
632-
((u64)le16_to_cpu(ver_words[1]) << 32) |
633-
((u64)le16_to_cpu(ver_words[2]) << 16) |
634-
le16_to_cpu(ver_words[3]));
635-
*build = MCDI_DWORD(outbuf, GET_VERSION_OUT_FIRMWARE);
636-
637-
return 0;
625+
snprintf(buf, len, "%u.%u.%u.%u",
626+
le16_to_cpu(ver_words[0]), le16_to_cpu(ver_words[1]),
627+
le16_to_cpu(ver_words[2]), le16_to_cpu(ver_words[3]));
628+
return;
638629

639630
fail:
640631
netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
641-
return rc;
632+
buf[0] = 0;
642633
}
643634

644635
int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,

‎drivers/net/sfc/mcdi.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
3-
* Copyright 2008-2009 Solarflare Communications Inc.
3+
* Copyright 2008-2010 Solarflare Communications Inc.
44
*
55
* This program is free software; you can redistribute it and/or modify it
66
* under the terms of the GNU General Public License version 2 as published
@@ -93,7 +93,7 @@ extern void efx_mcdi_process_event(struct efx_channel *channel,
9393
#define MCDI_EVENT_FIELD(_ev, _field) \
9494
EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
9595

96-
extern int efx_mcdi_fwver(struct efx_nic *efx, u64 *version, u32 *build);
96+
extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
9797
extern int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
9898
bool *was_attached_out);
9999
extern int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,

‎drivers/net/sfc/mcdi_mac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Driver for Solarflare Solarstorm network controllers and boards
3-
* Copyright 2009 Solarflare Communications Inc.
3+
* Copyright 2009-2010 Solarflare Communications Inc.
44
*
55
* This program is free software; you can redistribute it and/or modify it
66
* under the terms of the GNU General Public License version 2 as published

0 commit comments

Comments
 (0)