* Re: e1000 driver and samba
From: L F @ 2007-09-16 4:07 UTC (permalink / raw)
To: James Chapman; +Cc: netdev
In-Reply-To: <46EC1A00.2000304@katalix.com>
On 9/15/07, James Chapman <jchapman@katalix.com> wrote:
> Are these long frames expected in your network? What is the MTU of the
> transmitting clients? Perhaps this might explain why reads work (because
> data is coming from the Linux box so the packets have smaller MTU) while
> writes cause delays or packet loss because the clients are sending long
> frames which are getting fragmented?
I doublechecked in any case. All machines on the network have the
default XP MTU of 1500. So does the linux machine. I therefore foresee
no problem there.
> James Chapman
LF
^ permalink raw reply
* Re: [PATCH] CIPSO: remove duplicated code in the cipso_v4_*_getattr() functions
From: David Miller @ 2007-09-16 4:45 UTC (permalink / raw)
To: paul.moore; +Cc: netdev, selinux
In-Reply-To: <20070912192938.18318.22897.stgit@flek.americas.hpqcorp.net>
From: Paul Moore <paul.moore@hp.com>
Date: Wed, 12 Sep 2007 15:29:38 -0400
> The bulk of the CIPSO option parsing/processing in the cipso_v4_sock_getattr()
> and cipso_v4_skb_getattr() functions are identical, the only real difference
> being where the functions obtain the CIPSO option itself. This patch creates
> a new function, cipso_v4_getattr(), which contains the common CIPSO option
> parsing/processing code and modifies the existing functions to call this new
> helper function.
>
> Signed-off-by: Paul Moore <paul.moore@hp.com>
Applied to net-2.6.24, thanks Paul.
^ permalink raw reply
* Re: Please pull 'adm8211' branch of wireless-2.6
From: Michael Wu @ 2007-09-16 4:47 UTC (permalink / raw)
To: Jeff Garzik; +Cc: David Miller, John W. Linville, netdev, linux-wireless
In-Reply-To: <46EC7F33.2050206@garzik.org>
[-- Attachment #1: Type: text/plain, Size: 2237 bytes --]
On Saturday 15 September 2007 20:56, Jeff Garzik wrote:
> >>> + if (flags & IFF_PROMISC)
> >>> + dev->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
> >>> + else
> >>> + dev->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
> >>
> >> why does promisc dictate inclusion of FCS?
> >
> > Because that's the way the hardware works.
>
> Why not always include it, regardless of promisc?
>
I really do mean that's how the hardware works. If you turn on the promisc bit
in the hardware (which IFF_PROMISC causes), it starts including the FCS, but
if the bit is not set, the FCS is not included in frames.
> >>> + } while (count++ < 20);
> >>
> >> NAK -- talk about back to the past.
> >>
> >> It's bogus to loop in the interrupt handler, then loop again in both RX
> >> and TX paths. You are getting close to reinventing the wheel here.
> >>
> >> Use NAPI rather than doing such a loop.
> >
> > This is old interrupt handler code from Jouni's original driver. I never
> > bothered to replace it with the simpler designs used in newer drivers
> > I've worked on.
> >
> > Also - mac80211 drivers have no access to NAPI.
>
> Not true as of net-2.6.24.
>
Huh? How does a driver use NAPI if it can't pass a struct net_device?
> >>> +/* CSR (Host Control and Status Registers) */
> >>> +struct adm8211_csr {
> >>
> >> [snip]
> >>
> >>> +} __attribute__ ((packed));
> >>
> >> attributed(packed) is unneccesary here, and its use results in
> >> sub-optimal code
> >
> > How? Doesn't this just turn into a bunch of offsets?
>
> It depends on how its used in the code.
>
I don't think I'm using it in a way that would make a difference.
> >> enums are preferred. they do not disappear at the cpp stage, and confer
> >> type information.
> >
> > I'd rather not.
>
> Elaboration?
>
What form of debugging are you talking about? I don't see how it makes a
difference for debugging. The type checking provided by enums won't make a
difference for my code - any problems with using the wrong register bits in
the wrong place is obvious due to the prefixes. I don't really see how enum
type checking is even effective at all without annotations and casts all over
the place.
Thanks,
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1] ipv6: remove redundant RTM_DELLINK message
From: David Miller @ 2007-09-16 4:48 UTC (permalink / raw)
To: milon; +Cc: tgraf, netdev
In-Reply-To: <20070913095738.GA4168@wq.cz>
From: Milan Kocian <milon@wq.cz>
Date: Thu, 13 Sep 2007 11:57:38 +0200
> remove useless message. We get right message from other subsystem.
...
> Signed-off-by: Milan Kocian <milon@wq.cz>
Applied, thanks Milan.
^ permalink raw reply
* Re: Please pull 'adm8211' branch of wireless-2.6
From: David Miller @ 2007-09-16 4:50 UTC (permalink / raw)
To: flamingice; +Cc: jeff, linville, netdev, linux-wireless
In-Reply-To: <200709160047.45128.flamingice@sourmilk.net>
From: Michael Wu <flamingice@sourmilk.net>
Date: Sun, 16 Sep 2007 00:47:40 -0400
> Huh? How does a driver use NAPI if it can't pass a struct net_device?
It is now managed by a struct napi_struct which you can embed into any
object you like.
NAPI is now totally disconnected from the network device structure.
This was necessary for proper support of multi-queue cards.
^ permalink raw reply
* Re: Please pull 'adm8211' branch of wireless-2.6
From: Michael Wu @ 2007-09-16 5:00 UTC (permalink / raw)
To: David Miller
Cc: jeff-o2qLIJkoznsdnm+yROfE0A, linville-2XuSBdqkA4R54TAoqtyWWQ,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20070915.215053.74746915.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
On Sunday 16 September 2007 00:50, David Miller wrote:
> From: Michael Wu <flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>
> Date: Sun, 16 Sep 2007 00:47:40 -0400
>
> > Huh? How does a driver use NAPI if it can't pass a struct net_device?
>
> It is now managed by a struct napi_struct which you can embed into any
> object you like.
>
> NAPI is now totally disconnected from the network device structure.
> This was necessary for proper support of multi-queue cards.
Ah, very nice.
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: e1000 driver and samba
From: Kok, Auke @ 2007-09-16 5:04 UTC (permalink / raw)
To: L F; +Cc: James Chapman, netdev
In-Reply-To: <780b6f780709152106q3d7f1042t72126c1be16ed1fd@mail.gmail.com>
L F wrote:
>>>>> tx_deferred_ok: 486
>> this one I wonder about, and might cause delays, I'll have to look
>> up what it exactly could implicate though.
> Please do and let me know. samba 3.0.26 helped, but the issue is
> still there.
ok, from the spec: tx_deferred_ok is what is in the DC stats register. DC stands
for "Deferred Count". This initially is meant to track how often the TX unit cannot
send because the medium is busy in a Half-Duplex link state.
To me it suggests that your speed is not full-duplex. Check `ethtool eth0` output
and see if your link is full duplex or not. also check previous kernel messages
and see what the e1000 driver posted there for link speed messages (as in "e1000:
Link is UP speed XXX duplex YYY")
Cheers,
Auke
^ permalink raw reply
* [PATCH] jumbo all-NICs ethtool count cleanup
From: Jeff Garzik @ 2007-09-16 6:10 UTC (permalink / raw)
To: netdev; +Cc: LKML
Just checked this in locally...
The hooks ->self_test_count() and ->get_stats_count() are now unused
in the main tree.
(based off of latest davem/net-2.6.24.git)
drivers/net/3c59x.c | 11 +++-
drivers/net/8139cp.c | 11 +++-
drivers/net/8139too.c | 11 +++-
drivers/net/atl1/atl1_ethtool.c | 11 +++-
drivers/net/b44.c | 11 +++-
drivers/net/bnx2.c | 20 ++++----
drivers/net/cassini.c | 11 +++-
drivers/net/chelsio/cxgb2.c | 11 +++-
drivers/net/cxgb3/cxgb3_main.c | 11 +++-
drivers/net/e100.c | 19 ++++----
drivers/net/e1000/e1000_ethtool.c | 22 ++++-----
drivers/net/e1000e/ethtool.c | 21 ++++-----
drivers/net/ehea/ehea_ethtool.c | 13 ++++-
drivers/net/forcedeth.c | 45 +++++++++-----------
drivers/net/gianfar_ethtool.c | 20 ++++----
drivers/net/ibm_emac/ibm_emac_core.c | 12 +++--
drivers/net/ibmveth.c | 11 +++-
drivers/net/ixgb/ixgb_ethtool.c | 11 +++-
drivers/net/ixgbe/ixgbe_ethtool.c | 11 +++-
drivers/net/mv643xx_eth.c | 12 +++--
drivers/net/myri10ge/myri10ge.c | 11 +++-
drivers/net/netxen/netxen_nic_ethtool.c | 21 ++++-----
drivers/net/pcnet32.c | 11 +++-
drivers/net/qla3xxx.c | 2
drivers/net/r8169.c | 11 +++-
drivers/net/s2io.c | 47 ++++++++------------
drivers/net/sc92031.c | 11 +++-
drivers/net/skge.c | 11 +++-
drivers/net/sky2.c | 11 +++-
drivers/net/spider_net_ethtool.c | 11 +++-
drivers/net/tc35815.c | 12 ++++-
drivers/net/tg3.c | 19 ++++----
drivers/net/ucc_geth_ethtool.c | 26 ++++++-----
drivers/net/veth.c | 11 +++-
drivers/net/wireless/libertas/ethtool.c | 72 ++++++++++++++------------------
35 files changed, 346 insertions(+), 246 deletions(-)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index ad0f6a7..6295e94 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -2834,9 +2834,14 @@ static void vortex_set_msglevel(struct net_device *dev, u32 dbg)
vortex_debug = dbg;
}
-static int vortex_get_stats_count(struct net_device *dev)
+static int vortex_get_sset_count(struct net_device *dev, int sset)
{
- return VORTEX_NUM_STATS;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return VORTEX_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void vortex_get_ethtool_stats(struct net_device *dev,
@@ -2893,7 +2898,7 @@ static const struct ethtool_ops vortex_ethtool_ops = {
.get_msglevel = vortex_get_msglevel,
.set_msglevel = vortex_set_msglevel,
.get_ethtool_stats = vortex_get_ethtool_stats,
- .get_stats_count = vortex_get_stats_count,
+ .get_sset_count = vortex_get_sset_count,
.get_settings = vortex_get_settings,
.set_settings = vortex_set_settings,
.get_link = ethtool_op_get_link,
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 58fad1b..eccaa16 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1383,9 +1383,14 @@ static int cp_get_regs_len(struct net_device *dev)
return CP_REGS_SIZE;
}
-static int cp_get_stats_count (struct net_device *dev)
+static int cp_get_sset_count (struct net_device *dev, int sset)
{
- return CP_NUM_STATS;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return CP_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static int cp_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -1563,7 +1568,7 @@ static void cp_get_ethtool_stats (struct net_device *dev,
static const struct ethtool_ops cp_ethtool_ops = {
.get_drvinfo = cp_get_drvinfo,
.get_regs_len = cp_get_regs_len,
- .get_stats_count = cp_get_stats_count,
+ .get_sset_count = cp_get_sset_count,
.get_settings = cp_get_settings,
.set_settings = cp_set_settings,
.nway_reset = cp_nway_reset,
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 16b9196..565fbdb 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -2400,9 +2400,14 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
}
#endif /* CONFIG_8139TOO_MMIO */
-static int rtl8139_get_stats_count(struct net_device *dev)
+static int rtl8139_get_sset_count(struct net_device *dev, int sset)
{
- return RTL_NUM_STATS;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return RTL_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data)
@@ -2433,7 +2438,7 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
.get_wol = rtl8139_get_wol,
.set_wol = rtl8139_set_wol,
.get_strings = rtl8139_get_strings,
- .get_stats_count = rtl8139_get_stats_count,
+ .get_sset_count = rtl8139_get_sset_count,
.get_ethtool_stats = rtl8139_get_ethtool_stats,
};
diff --git a/drivers/net/atl1/atl1_ethtool.c b/drivers/net/atl1/atl1_ethtool.c
index 53353b6..68a83be 100644
--- a/drivers/net/atl1/atl1_ethtool.c
+++ b/drivers/net/atl1/atl1_ethtool.c
@@ -88,9 +88,14 @@ static void atl1_get_ethtool_stats(struct net_device *netdev,
}
-static int atl1_get_stats_count(struct net_device *netdev)
+static int atl1_get_sset_count(struct net_device *netdev, int sset)
{
- return ARRAY_SIZE(atl1_gstrings_stats);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(atl1_gstrings_stats);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static int atl1_get_settings(struct net_device *netdev,
@@ -495,6 +500,6 @@ const struct ethtool_ops atl1_ethtool_ops = {
.get_strings = atl1_get_strings,
.nway_reset = atl1_nway_reset,
.get_ethtool_stats = atl1_get_ethtool_stats,
- .get_stats_count = atl1_get_stats_count,
+ .get_sset_count = atl1_get_sset_count,
.set_tso = ethtool_op_set_tso,
};
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 6d19370..e604b67 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -1957,9 +1957,14 @@ static void b44_get_strings(struct net_device *dev, u32 stringset, u8 *data)
}
}
-static int b44_get_stats_count(struct net_device *dev)
+static int b44_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(b44_gstrings);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(b44_gstrings);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void b44_get_ethtool_stats(struct net_device *dev,
@@ -2020,7 +2025,7 @@ static const struct ethtool_ops b44_ethtool_ops = {
.get_msglevel = b44_get_msglevel,
.set_msglevel = b44_set_msglevel,
.get_strings = b44_get_strings,
- .get_stats_count = b44_get_stats_count,
+ .get_sset_count = b44_get_sset_count,
.get_ethtool_stats = b44_get_ethtool_stats,
};
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index e39dd92..a97e7b9 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -6068,9 +6068,16 @@ static struct {
};
static int
-bnx2_self_test_count(struct net_device *dev)
+bnx2_get_sset_count(struct net_device *dev, int sset)
{
- return BNX2_NUM_TESTS;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return BNX2_NUM_TESTS;
+ case ETH_SS_STATS:
+ return BNX2_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void
@@ -6144,12 +6151,6 @@ bnx2_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
}
}
-static int
-bnx2_get_stats_count(struct net_device *dev)
-{
- return BNX2_NUM_STATS;
-}
-
static void
bnx2_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *buf)
@@ -6260,12 +6261,11 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
.set_tx_csum = bnx2_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = bnx2_set_tso,
- .self_test_count = bnx2_self_test_count,
.self_test = bnx2_self_test,
.get_strings = bnx2_get_strings,
.phys_id = bnx2_phys_id,
- .get_stats_count = bnx2_get_stats_count,
.get_ethtool_stats = bnx2_get_ethtool_stats,
+ .get_sset_count = bnx2_get_sset_count,
};
/* Called with rtnl_lock */
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index f44f3d2..7b34f67 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4772,9 +4772,14 @@ static void cas_get_regs(struct net_device *dev, struct ethtool_regs *regs,
cas_read_regs(cp, p, regs->len / sizeof(u32));
}
-static int cas_get_stats_count(struct net_device *dev)
+static int cas_get_sset_count(struct net_device *dev, int sset)
{
- return CAS_NUM_STAT_KEYS;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return CAS_NUM_STAT_KEYS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void cas_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -4818,7 +4823,7 @@ static const struct ethtool_ops cas_ethtool_ops = {
.set_msglevel = cas_set_msglevel,
.get_regs_len = cas_get_regs_len,
.get_regs = cas_get_regs,
- .get_stats_count = cas_get_stats_count,
+ .get_sset_count = cas_get_sset_count,
.get_strings = cas_get_strings,
.get_ethtool_stats = cas_get_ethtool_stats,
};
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 7029f13..2dbf8dc 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -439,9 +439,14 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
strcpy(info->bus_info, pci_name(adapter->pdev));
}
-static int get_stats_count(struct net_device *dev)
+static int get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(stats_strings);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(stats_strings);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -798,7 +803,7 @@ static const struct ethtool_ops t1_ethtool_ops = {
.set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link,
.get_strings = get_strings,
- .get_stats_count = get_stats_count,
+ .get_sset_count = get_sset_count,
.get_ethtool_stats = get_stats,
.get_regs_len = get_regs_len,
.get_regs = get_regs,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 04633ea..e22d065 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1131,9 +1131,14 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
};
-static int get_stats_count(struct net_device *dev)
+static int get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(stats_strings);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(stats_strings);
+ default:
+ return -EOPNOTSUPP;
+ }
}
#define T3_REGMAP_SIZE (3 * 1024)
@@ -1640,7 +1645,7 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_strings = get_strings,
.phys_id = cxgb3_phys_id,
.nway_reset = restart_autoneg,
- .get_stats_count = get_stats_count,
+ .get_sset_count = get_sset_count,
.get_ethtool_stats = get_stats,
.get_regs_len = get_regs_len,
.get_regs = get_regs,
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 9912656..1c0187c 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2374,11 +2374,6 @@ static const char e100_gstrings_test[][ETH_GSTRING_LEN] = {
};
#define E100_TEST_LEN sizeof(e100_gstrings_test) / ETH_GSTRING_LEN
-static int e100_diag_test_count(struct net_device *netdev)
-{
- return E100_TEST_LEN;
-}
-
static void e100_diag_test(struct net_device *netdev,
struct ethtool_test *test, u64 *data)
{
@@ -2441,9 +2436,16 @@ static const char e100_gstrings_stats[][ETH_GSTRING_LEN] = {
#define E100_NET_STATS_LEN 21
#define E100_STATS_LEN sizeof(e100_gstrings_stats) / ETH_GSTRING_LEN
-static int e100_get_stats_count(struct net_device *netdev)
+static int e100_get_sset_count(struct net_device *netdev, int sset)
{
- return E100_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return E100_TEST_LEN;
+ case ETH_SS_STATS:
+ return E100_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void e100_get_ethtool_stats(struct net_device *netdev,
@@ -2494,12 +2496,11 @@ static const struct ethtool_ops e100_ethtool_ops = {
.set_eeprom = e100_set_eeprom,
.get_ringparam = e100_get_ringparam,
.set_ringparam = e100_set_ringparam,
- .self_test_count = e100_diag_test_count,
.self_test = e100_diag_test,
.get_strings = e100_get_strings,
.phys_id = e100_phys_id,
- .get_stats_count = e100_get_stats_count,
.get_ethtool_stats = e100_get_ethtool_stats,
+ .get_sset_count = e100_get_sset_count,
};
static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index f44d0a1..954afe1 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -618,8 +618,6 @@ e1000_get_drvinfo(struct net_device *netdev,
strncpy(drvinfo->fw_version, firmware_version, 32);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
- drvinfo->n_stats = E1000_STATS_LEN;
- drvinfo->testinfo_len = E1000_TEST_LEN;
drvinfo->regdump_len = e1000_get_regs_len(netdev);
drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
}
@@ -1611,9 +1609,16 @@ e1000_link_test(struct e1000_adapter *adapter, uint64_t *data)
}
static int
-e1000_diag_test_count(struct net_device *netdev)
+e1000_get_sset_count(struct net_device *netdev, int sset)
{
- return E1000_TEST_LEN;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return E1000_TEST_LEN;
+ case ETH_SS_STATS:
+ return E1000_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
extern void e1000_power_up_phy(struct e1000_adapter *);
@@ -1897,12 +1902,6 @@ e1000_nway_reset(struct net_device *netdev)
return 0;
}
-static int
-e1000_get_stats_count(struct net_device *netdev)
-{
- return E1000_STATS_LEN;
-}
-
static void
e1000_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data)
@@ -1966,12 +1965,11 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.set_tx_csum = e1000_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = e1000_set_tso,
- .self_test_count = e1000_diag_test_count,
.self_test = e1000_diag_test,
.get_strings = e1000_get_strings,
.phys_id = e1000_phys_id,
- .get_stats_count = e1000_get_stats_count,
.get_ethtool_stats = e1000_get_ethtool_stats,
+ .get_sset_count = e1000_get_sset_count,
};
void e1000_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 0e80406..3423f33 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -577,8 +577,6 @@ static void e1000_get_drvinfo(struct net_device *netdev,
strncpy(drvinfo->fw_version, firmware_version, 32);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
- drvinfo->n_stats = E1000_STATS_LEN;
- drvinfo->testinfo_len = E1000_TEST_LEN;
drvinfo->regdump_len = e1000_get_regs_len(netdev);
drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
}
@@ -1493,9 +1491,16 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
return *data;
}
-static int e1000_diag_test_count(struct net_device *netdev)
+static int e1000e_get_sset_count(struct net_device *netdev, int sset)
{
- return E1000_TEST_LEN;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return E1000_TEST_LEN;
+ case ETH_SS_STATS:
+ return E1000_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void e1000_diag_test(struct net_device *netdev,
@@ -1692,11 +1697,6 @@ static int e1000_nway_reset(struct net_device *netdev)
return 0;
}
-static int e1000_get_stats_count(struct net_device *netdev)
-{
- return E1000_STATS_LEN;
-}
-
static void e1000_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats,
u64 *data)
@@ -1760,12 +1760,11 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = e1000_set_tso,
- .self_test_count = e1000_diag_test_count,
.self_test = e1000_diag_test,
.get_strings = e1000_get_strings,
.phys_id = e1000_phys_id,
- .get_stats_count = e1000_get_stats_count,
.get_ethtool_stats = e1000_get_ethtool_stats,
+ .get_sset_count = e1000e_get_sset_count,
};
void e1000e_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 6498455..679f40e 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -196,9 +196,14 @@ static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
}
}
-static int ehea_get_stats_count(struct net_device *dev)
+static int ehea_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(ehea_ethtool_stats_keys);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(ehea_ethtool_stats_keys);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void ehea_get_ethtool_stats(struct net_device *dev,
@@ -207,7 +212,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
int i, k, tmp;
struct ehea_port *port = netdev_priv(dev);
- for (i = 0; i < ehea_get_stats_count(dev); i++)
+ for (i = 0; i < ehea_get_sset_count(dev, ETH_SS_STATS); i++)
data[i] = 0;
i = 0;
@@ -264,7 +269,7 @@ const struct ethtool_ops ehea_ethtool_ops = {
.get_link = ethtool_op_get_link,
.set_tso = ethtool_op_set_tso,
.get_strings = ehea_get_strings,
- .get_stats_count = ehea_get_stats_count,
+ .get_sset_count = ehea_get_sset_count,
.get_ethtool_stats = ehea_get_ethtool_stats,
.get_rx_csum = ehea_get_rx_csum,
.set_settings = ehea_set_settings,
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index be74457..cacb290 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -4333,16 +4333,26 @@ static int nv_set_sg(struct net_device *dev, u32 data)
return -EOPNOTSUPP;
}
-static int nv_get_stats_count(struct net_device *dev)
+static int nv_get_sset_count(struct net_device *dev, int sset)
{
struct fe_priv *np = netdev_priv(dev);
- if (np->driver_data & DEV_HAS_STATISTICS_V1)
- return NV_DEV_STATISTICS_V1_COUNT;
- else if (np->driver_data & DEV_HAS_STATISTICS_V2)
- return NV_DEV_STATISTICS_V2_COUNT;
- else
- return 0;
+ switch (sset) {
+ case ETH_SS_TEST:
+ if (np->driver_data & DEV_HAS_TEST_EXTENDED)
+ return NV_TEST_COUNT_EXTENDED;
+ else
+ return NV_TEST_COUNT_BASE;
+ case ETH_SS_STATS:
+ if (np->driver_data & DEV_HAS_STATISTICS_V1)
+ return NV_DEV_STATISTICS_V1_COUNT;
+ else if (np->driver_data & DEV_HAS_STATISTICS_V2)
+ return NV_DEV_STATISTICS_V2_COUNT;
+ else
+ return 0;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *buffer)
@@ -4352,17 +4362,7 @@ static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *e
/* update stats */
nv_do_stats_poll((unsigned long)dev);
- memcpy(buffer, &np->estats, nv_get_stats_count(dev)*sizeof(u64));
-}
-
-static int nv_self_test_count(struct net_device *dev)
-{
- struct fe_priv *np = netdev_priv(dev);
-
- if (np->driver_data & DEV_HAS_TEST_EXTENDED)
- return NV_TEST_COUNT_EXTENDED;
- else
- return NV_TEST_COUNT_BASE;
+ memcpy(buffer, &np->estats, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(u64));
}
static int nv_link_test(struct net_device *dev)
@@ -4609,7 +4609,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
int result;
- memset(buffer, 0, nv_self_test_count(dev)*sizeof(u64));
+ memset(buffer, 0, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(u64));
if (!nv_link_test(dev)) {
test->flags |= ETH_TEST_FL_FAILED;
@@ -4692,10 +4692,10 @@ static void nv_get_strings(struct net_device *dev, u32 stringset, u8 *buffer)
{
switch (stringset) {
case ETH_SS_STATS:
- memcpy(buffer, &nv_estats_str, nv_get_stats_count(dev)*sizeof(struct nv_ethtool_str));
+ memcpy(buffer, &nv_estats_str, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(struct nv_ethtool_str));
break;
case ETH_SS_TEST:
- memcpy(buffer, &nv_etests_str, nv_self_test_count(dev)*sizeof(struct nv_ethtool_str));
+ memcpy(buffer, &nv_etests_str, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(struct nv_ethtool_str));
break;
}
}
@@ -4720,9 +4720,8 @@ static const struct ethtool_ops ops = {
.set_tx_csum = nv_set_tx_csum,
.set_sg = nv_set_sg,
.get_strings = nv_get_strings,
- .get_stats_count = nv_get_stats_count,
.get_ethtool_stats = nv_get_ethtool_stats,
- .self_test_count = nv_self_test_count,
+ .get_sset_count = nv_get_sset_count,
.self_test = nv_self_test,
};
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index 2470903..6007147 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -152,15 +152,19 @@ static void gfar_fill_stats(struct net_device *dev, struct ethtool_stats *dummy,
buf[i] = extra[i];
}
-/* Returns the number of stats (and their corresponding strings) */
-static int gfar_stats_count(struct net_device *dev)
+static int gfar_sset_count(struct net_device *dev, int sset)
{
struct gfar_private *priv = netdev_priv(dev);
- if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON)
- return GFAR_STATS_LEN;
- else
- return GFAR_EXTRA_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON)
+ return GFAR_STATS_LEN;
+ else
+ return GFAR_EXTRA_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
/* Fills in the drvinfo structure with some basic info */
@@ -171,8 +175,6 @@ static void gfar_gdrvinfo(struct net_device *dev, struct
strncpy(drvinfo->version, gfar_driver_version, GFAR_INFOSTR_LEN);
strncpy(drvinfo->fw_version, "N/A", GFAR_INFOSTR_LEN);
strncpy(drvinfo->bus_info, "N/A", GFAR_INFOSTR_LEN);
- drvinfo->n_stats = GFAR_STATS_LEN;
- drvinfo->testinfo_len = 0;
drvinfo->regdump_len = 0;
drvinfo->eedump_len = 0;
}
@@ -575,7 +577,7 @@ const struct ethtool_ops gfar_ethtool_ops = {
.get_ringparam = gfar_gringparam,
.set_ringparam = gfar_sringparam,
.get_strings = gfar_gstrings,
- .get_stats_count = gfar_stats_count,
+ .get_sset_count = gfar_sset_count,
.get_ethtool_stats = gfar_fill_stats,
.get_rx_csum = gfar_get_rx_csum,
.get_tx_csum = gfar_get_tx_csum,
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index d7da56b..4db765a 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -1843,9 +1843,14 @@ static int emac_ethtool_nway_reset(struct net_device *ndev)
return res;
}
-static int emac_ethtool_get_stats_count(struct net_device *ndev)
+static int emac_get_sset_count(struct net_device *ndev, int sset)
{
- return EMAC_ETHTOOL_STATS_COUNT;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return EMAC_ETHTOOL_STATS_COUNT;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void emac_ethtool_get_strings(struct net_device *ndev, u32 stringset,
@@ -1876,7 +1881,6 @@ static void emac_ethtool_get_drvinfo(struct net_device *ndev,
strcpy(info->version, DRV_VERSION);
info->fw_version[0] = '\0';
sprintf(info->bus_info, "PPC 4xx EMAC %d", dev->def->index);
- info->n_stats = emac_ethtool_get_stats_count(ndev);
info->regdump_len = emac_ethtool_get_regs_len(ndev);
}
@@ -1896,7 +1900,7 @@ static const struct ethtool_ops emac_ethtool_ops = {
.get_rx_csum = emac_ethtool_get_rx_csum,
.get_strings = emac_ethtool_get_strings,
- .get_stats_count = emac_ethtool_get_stats_count,
+ .get_sset_count = emac_get_sset_count,
.get_ethtool_stats = emac_ethtool_get_ethtool_stats,
.get_link = ethtool_op_get_link,
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index b8d7cec..cc838bf 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -802,9 +802,14 @@ static void ibmveth_get_strings(struct net_device *dev, u32 stringset, u8 *data)
memcpy(data, ibmveth_stats[i].name, ETH_GSTRING_LEN);
}
-static int ibmveth_get_stats_count(struct net_device *dev)
+static int ibmveth_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(ibmveth_stats);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(ibmveth_stats);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void ibmveth_get_ethtool_stats(struct net_device *dev,
@@ -825,7 +830,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_rx_csum = ibmveth_get_rx_csum,
.set_rx_csum = ibmveth_set_rx_csum,
.get_strings = ibmveth_get_strings,
- .get_stats_count = ibmveth_get_stats_count,
+ .get_sset_count = ibmveth_get_sset_count,
.get_ethtool_stats = ibmveth_get_ethtool_stats,
};
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 181b59d..ddad26b 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -659,9 +659,14 @@ ixgb_phys_id(struct net_device *netdev, uint32_t data)
}
static int
-ixgb_get_stats_count(struct net_device *netdev)
+ixgb_get_sset_count(struct net_device *netdev, int sset)
{
- return IXGB_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return IXGB_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void
@@ -719,7 +724,7 @@ static const struct ethtool_ops ixgb_ethtool_ops = {
.set_tso = ixgb_set_tso,
.get_strings = ixgb_get_strings,
.phys_id = ixgb_phys_id,
- .get_stats_count = ixgb_get_stats_count,
+ .get_sset_count = ixgb_get_sset_count,
.get_ethtool_stats = ixgb_get_ethtool_stats,
};
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 43a2a46..a4e576a 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -737,9 +737,14 @@ err_setup:
return err;
}
-static int ixgbe_get_stats_count(struct net_device *netdev)
+static int ixgbe_get_sset_count(struct net_device *netdev, int sset)
{
- return IXGBE_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return IXGBE_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void ixgbe_get_ethtool_stats(struct net_device *netdev,
@@ -931,7 +936,7 @@ static struct ethtool_ops ixgbe_ethtool_ops = {
.set_tso = ixgbe_set_tso,
.get_strings = ixgbe_get_strings,
.phys_id = ixgbe_phys_id,
- .get_stats_count = ixgbe_get_stats_count,
+ .get_sset_count = ixgbe_get_sset_count,
.get_ethtool_stats = ixgbe_get_ethtool_stats,
.get_coalesce = ixgbe_get_coalesce,
.set_coalesce = ixgbe_set_coalesce,
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index a827bca..76585d7 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2674,9 +2674,14 @@ static void mv643xx_get_drvinfo(struct net_device *netdev,
drvinfo->n_stats = MV643XX_STATS_LEN;
}
-static int mv643xx_get_stats_count(struct net_device *netdev)
+static int mv643xx_get_sset_count(struct net_device *netdev, int sset)
{
- return MV643XX_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return MV643XX_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void mv643xx_get_ethtool_stats(struct net_device *netdev,
@@ -2737,10 +2742,9 @@ static const struct ethtool_ops mv643xx_ethtool_ops = {
.get_drvinfo = mv643xx_get_drvinfo,
.get_link = mv643xx_eth_get_link,
.set_sg = ethtool_op_set_sg,
- .get_stats_count = mv643xx_get_stats_count,
+ .get_sset_count = mv643xx_get_sset_count,
.get_ethtool_stats = mv643xx_get_ethtool_stats,
.get_strings = mv643xx_get_strings,
- .get_stats_count = mv643xx_get_stats_count,
.get_ethtool_stats = mv643xx_get_ethtool_stats,
.nway_reset = mv643xx_eth_nway_restart,
};
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 7fa1609..a7e5bda 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1418,9 +1418,14 @@ myri10ge_get_strings(struct net_device *netdev, u32 stringset, u8 * data)
}
}
-static int myri10ge_get_stats_count(struct net_device *netdev)
+static int myri10ge_get_sset_count(struct net_device *netdev, int sset)
{
- return MYRI10GE_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return MYRI10GE_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void
@@ -1504,7 +1509,7 @@ static const struct ethtool_ops myri10ge_ethtool_ops = {
.set_tso = ethtool_op_set_tso,
.get_link = ethtool_op_get_link,
.get_strings = myri10ge_get_strings,
- .get_stats_count = myri10ge_get_stats_count,
+ .get_sset_count = myri10ge_get_sset_count,
.get_ethtool_stats = myri10ge_get_ethtool_stats,
.set_msglevel = myri10ge_set_msglevel,
.get_msglevel = myri10ge_get_msglevel
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 08c76b3..78e4231 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -115,8 +115,6 @@ netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
sprintf(drvinfo->fw_version, "%d.%d.%d", fw_major, fw_minor, fw_build);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
- drvinfo->n_stats = NETXEN_NIC_STATS_LEN;
- drvinfo->testinfo_len = NETXEN_NIC_TEST_LEN;
drvinfo->regdump_len = NETXEN_NIC_REGS_LEN;
drvinfo->eedump_len = netxen_nic_get_eeprom_len(dev);
}
@@ -672,9 +670,16 @@ static int netxen_nic_reg_test(struct net_device *dev)
return 0;
}
-static int netxen_nic_diag_test_count(struct net_device *dev)
+static int netxen_get_sset_count(struct net_device *dev, int sset)
{
- return NETXEN_NIC_TEST_LEN;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return NETXEN_NIC_TEST_LEN;
+ case ETH_SS_STATS:
+ return NETXEN_NIC_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void
@@ -709,11 +714,6 @@ netxen_nic_get_strings(struct net_device *dev, u32 stringset, u8 * data)
}
}
-static int netxen_nic_get_stats_count(struct net_device *dev)
-{
- return NETXEN_NIC_STATS_LEN;
-}
-
static void
netxen_nic_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 * data)
@@ -747,9 +747,8 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
.set_tx_csum = ethtool_op_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
- .self_test_count = netxen_nic_diag_test_count,
.self_test = netxen_nic_diag_test,
.get_strings = netxen_nic_get_strings,
- .get_stats_count = netxen_nic_get_stats_count,
.get_ethtool_stats = netxen_nic_get_ethtool_stats,
+ .get_sset_count = netxen_get_sset_count,
};
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 4840dde..36f92dd 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -847,9 +847,14 @@ static void pcnet32_get_strings(struct net_device *dev, u32 stringset,
memcpy(data, pcnet32_gstrings_test, sizeof(pcnet32_gstrings_test));
}
-static int pcnet32_self_test_count(struct net_device *dev)
+static int pcnet32_get_sset_count(struct net_device *dev, int sset)
{
- return PCNET32_TEST_LEN;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return PCNET32_TEST_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void pcnet32_ethtool_test(struct net_device *dev,
@@ -1510,11 +1515,11 @@ static const struct ethtool_ops pcnet32_ethtool_ops = {
.get_ringparam = pcnet32_get_ringparam,
.set_ringparam = pcnet32_set_ringparam,
.get_strings = pcnet32_get_strings,
- .self_test_count = pcnet32_self_test_count,
.self_test = pcnet32_ethtool_test,
.phys_id = pcnet32_phys_id,
.get_regs_len = pcnet32_get_regs_len,
.get_regs = pcnet32_get_regs,
+ .get_sset_count = pcnet32_get_sset_count,
};
/* only probes for non-PCI devices, the rest are handled by
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 9052b1b..4824fe2 100755
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -1865,8 +1865,6 @@ static void ql_get_drvinfo(struct net_device *ndev,
strncpy(drvinfo->version, ql3xxx_driver_version, 32);
strncpy(drvinfo->fw_version, "N/A", 32);
strncpy(drvinfo->bus_info, pci_name(qdev->pdev), 32);
- drvinfo->n_stats = 0;
- drvinfo->testinfo_len = 0;
drvinfo->regdump_len = 0;
drvinfo->eedump_len = 0;
}
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 2ec8724..2dbecd5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -992,9 +992,14 @@ struct rtl8169_counters {
u16 tx_underun;
};
-static int rtl8169_get_stats_count(struct net_device *dev)
+static int rtl8169_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(rtl8169_gstrings);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(rtl8169_gstrings);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void rtl8169_get_ethtool_stats(struct net_device *dev,
@@ -1068,7 +1073,7 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
.get_wol = rtl8169_get_wol,
.set_wol = rtl8169_set_wol,
.get_strings = rtl8169_get_strings,
- .get_stats_count = rtl8169_get_stats_count,
+ .get_sset_count = rtl8169_get_sset_count,
.get_ethtool_stats = rtl8169_get_ethtool_stats,
};
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index a285dd7..2de8319 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5040,12 +5040,6 @@ static void s2io_ethtool_gdrvinfo(struct net_device *dev,
strncpy(info->bus_info, pci_name(sp->pdev), sizeof(info->bus_info));
info->regdump_len = XENA_REG_SPACE;
info->eedump_len = XENA_EEPROM_SPACE;
- info->testinfo_len = S2IO_TEST_LEN;
-
- if (sp->device_type == XFRAME_I_DEVICE)
- info->n_stats = XFRAME_I_STAT_LEN;
- else
- info->n_stats = XFRAME_II_STAT_LEN;
}
/**
@@ -6241,9 +6235,25 @@ static int s2io_get_eeprom_len(struct net_device *dev)
return (XENA_EEPROM_SPACE);
}
-static int s2io_ethtool_self_test_count(struct net_device *dev)
+static int s2io_get_sset_count(struct net_device *dev, int sset)
{
- return (S2IO_TEST_LEN);
+ struct s2io_nic *sp = dev->priv;
+
+ switch (sset) {
+ case ETH_SS_TEST:
+ return S2IO_TEST_LEN;
+ case ETH_SS_STATS:
+ switch(sp->device_type) {
+ case XFRAME_I_DEVICE:
+ return XFRAME_I_STAT_LEN;
+ case XFRAME_II_DEVICE:
+ return XFRAME_II_STAT_LEN;
+ default:
+ return 0;
+ }
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void s2io_ethtool_get_strings(struct net_device *dev,
@@ -6270,22 +6280,6 @@ static void s2io_ethtool_get_strings(struct net_device *dev,
sizeof(ethtool_driver_stats_keys));
}
}
-static int s2io_ethtool_get_stats_count(struct net_device *dev)
-{
- struct s2io_nic *sp = dev->priv;
- int stat_count = 0;
- switch(sp->device_type) {
- case XFRAME_I_DEVICE:
- stat_count = XFRAME_I_STAT_LEN;
- break;
-
- case XFRAME_II_DEVICE:
- stat_count = XFRAME_II_STAT_LEN;
- break;
- }
-
- return stat_count;
-}
static int s2io_ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
{
@@ -6331,12 +6325,11 @@ static const struct ethtool_ops netdev_ethtool_ops = {
.get_tso = s2io_ethtool_op_get_tso,
.set_tso = s2io_ethtool_op_set_tso,
.set_ufo = ethtool_op_set_ufo,
- .self_test_count = s2io_ethtool_self_test_count,
.self_test = s2io_ethtool_test,
.get_strings = s2io_ethtool_get_strings,
.phys_id = s2io_ethtool_idnic,
- .get_stats_count = s2io_ethtool_get_stats_count,
- .get_ethtool_stats = s2io_get_ethtool_stats
+ .get_ethtool_stats = s2io_get_ethtool_stats,
+ .get_sset_count = s2io_get_sset_count,
};
/**
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 02c472e..37b4239 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1372,9 +1372,14 @@ static void sc92031_ethtool_get_strings(struct net_device *dev,
SILAN_STATS_NUM * ETH_GSTRING_LEN);
}
-static int sc92031_ethtool_get_stats_count(struct net_device *dev)
+static int sc92031_ethtool_get_sset_count(struct net_device *dev, int sset)
{
- return SILAN_STATS_NUM;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return SILAN_STATS_NUM;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void sc92031_ethtool_get_ethtool_stats(struct net_device *dev,
@@ -1397,7 +1402,7 @@ static struct ethtool_ops sc92031_ethtool_ops = {
.nway_reset = sc92031_ethtool_nway_reset,
.get_link = ethtool_op_get_link,
.get_strings = sc92031_ethtool_get_strings,
- .get_stats_count = sc92031_ethtool_get_stats_count,
+ .get_sset_count = sc92031_ethtool_get_sset_count,
.get_ethtool_stats = sc92031_ethtool_get_ethtool_stats,
};
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index cac499f..d482ab9 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -410,9 +410,14 @@ static const struct skge_stat {
{ "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR },
};
-static int skge_get_stats_count(struct net_device *dev)
+static int skge_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(skge_stats);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(skge_stats);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void skge_get_ethtool_stats(struct net_device *dev,
@@ -817,7 +822,7 @@ static const struct ethtool_ops skge_ethtool_ops = {
.set_rx_csum = skge_set_rx_csum,
.get_strings = skge_get_strings,
.phys_id = skge_phys_id,
- .get_stats_count = skge_get_stats_count,
+ .get_sset_count = skge_get_sset_count,
.get_ethtool_stats = skge_get_ethtool_stats,
};
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3f6ee98..800ab5c 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3063,9 +3063,14 @@ static void sky2_set_msglevel(struct net_device *netdev, u32 value)
sky2->msg_enable = value;
}
-static int sky2_get_stats_count(struct net_device *dev)
+static int sky2_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(sky2_stats);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(sky2_stats);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void sky2_get_ethtool_stats(struct net_device *dev,
@@ -3596,7 +3601,7 @@ static const struct ethtool_ops sky2_ethtool_ops = {
.get_pauseparam = sky2_get_pauseparam,
.set_pauseparam = sky2_set_pauseparam,
.phys_id = sky2_phys_id,
- .get_stats_count = sky2_get_stats_count,
+ .get_sset_count = sky2_get_sset_count,
.get_ethtool_stats = sky2_get_ethtool_stats,
};
diff --git a/drivers/net/spider_net_ethtool.c b/drivers/net/spider_net_ethtool.c
index 1460d50..9427303 100644
--- a/drivers/net/spider_net_ethtool.c
+++ b/drivers/net/spider_net_ethtool.c
@@ -147,9 +147,14 @@ spider_net_ethtool_get_ringparam(struct net_device *netdev,
ering->rx_pending = card->rx_chain.num_desc;
}
-static int spider_net_get_stats_count(struct net_device *netdev)
+static int spider_net_get_sset_count(struct net_device *netdev, int sset)
{
- return SPIDER_NET_NUM_STATS;
+ switch (sset) {
+ case ETH_SS_STATS:
+ return SPIDER_NET_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void spider_net_get_ethtool_stats(struct net_device *netdev,
@@ -191,7 +196,7 @@ const struct ethtool_ops spider_net_ethtool_ops = {
.set_tx_csum = ethtool_op_set_tx_csum,
.get_ringparam = spider_net_ethtool_get_ringparam,
.get_strings = spider_net_get_strings,
- .get_stats_count = spider_net_get_stats_count,
+ .get_sset_count = spider_net_get_sset_count,
.get_ethtool_stats = spider_net_get_ethtool_stats,
};
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index df82373..a679f43 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -2162,10 +2162,16 @@ static void tc35815_set_msglevel(struct net_device *dev, u32 datum)
lp->msg_enable = datum;
}
-static int tc35815_get_stats_count(struct net_device *dev)
+static int tc35815_get_sset_count(struct net_device *dev, int sset)
{
struct tc35815_local *lp = dev->priv;
- return sizeof(lp->lstats) / sizeof(int);
+
+ switch (sset) {
+ case ETH_SS_STATS:
+ return sizeof(lp->lstats) / sizeof(int);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void tc35815_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data)
@@ -2200,7 +2206,7 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
.get_msglevel = tc35815_get_msglevel,
.set_msglevel = tc35815_set_msglevel,
.get_strings = tc35815_get_strings,
- .get_stats_count = tc35815_get_stats_count,
+ .get_sset_count = tc35815_get_sset_count,
.get_ethtool_stats = tc35815_get_ethtool_stats,
};
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 1b860e0..d4ac6e9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8347,14 +8347,16 @@ static int tg3_set_tx_csum(struct net_device *dev, u32 data)
return 0;
}
-static int tg3_get_stats_count (struct net_device *dev)
+static int tg3_get_sset_count (struct net_device *dev, int sset)
{
- return TG3_NUM_STATS;
-}
-
-static int tg3_get_test_count (struct net_device *dev)
-{
- return TG3_NUM_TEST;
+ switch (sset) {
+ case ETH_SS_TEST:
+ return TG3_NUM_TEST;
+ case ETH_SS_STATS:
+ return TG3_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
@@ -9281,14 +9283,13 @@ static const struct ethtool_ops tg3_ethtool_ops = {
.set_tx_csum = tg3_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = tg3_set_tso,
- .self_test_count = tg3_get_test_count,
.self_test = tg3_self_test,
.get_strings = tg3_get_strings,
.phys_id = tg3_phys_id,
- .get_stats_count = tg3_get_stats_count,
.get_ethtool_stats = tg3_get_ethtool_stats,
.get_coalesce = tg3_get_coalesce,
.set_coalesce = tg3_set_coalesce,
+ .get_sset_count = tg3_get_sset_count,
};
static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index 73aa677..9a9622c 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -276,20 +276,26 @@ uec_set_ringparam(struct net_device *netdev,
return ret;
}
-static int uec_get_stats_count(struct net_device *netdev)
+static int uec_get_sset_count(struct net_device *netdev, int sset)
{
struct ucc_geth_private *ugeth = netdev_priv(netdev);
u32 stats_mode = ugeth->ug_info->statisticsMode;
int len = 0;
- if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE)
- len += UEC_HW_STATS_LEN;
- if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX)
- len += UEC_TX_FW_STATS_LEN;
- if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
- len += UEC_RX_FW_STATS_LEN;
+ switch (sset) {
+ case ETH_SS_STATS:
+ if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE)
+ len += UEC_HW_STATS_LEN;
+ if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX)
+ len += UEC_TX_FW_STATS_LEN;
+ if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
+ len += UEC_RX_FW_STATS_LEN;
+
+ return len;
- return len;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
@@ -353,8 +359,6 @@ uec_get_drvinfo(struct net_device *netdev,
strncpy(drvinfo->version, DRV_VERSION, 32);
strncpy(drvinfo->fw_version, "N/A", 32);
strncpy(drvinfo->bus_info, "QUICC ENGINE", 32);
- drvinfo->n_stats = uec_get_stats_count(netdev);
- drvinfo->testinfo_len = 0;
drvinfo->eedump_len = 0;
drvinfo->regdump_len = uec_get_regs_len(netdev);
}
@@ -374,7 +378,7 @@ static const struct ethtool_ops uec_ethtool_ops = {
.get_pauseparam = uec_get_pauseparam,
.set_pauseparam = uec_set_pauseparam,
.set_sg = ethtool_op_set_sg,
- .get_stats_count = uec_get_stats_count,
+ .get_sset_count = uec_get_sset_count,
.get_strings = uec_get_strings,
.get_ethtool_stats = uec_get_ethtool_stats,
};
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 9e6a746..9407130 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -79,9 +79,14 @@ static void veth_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
}
}
-static int veth_get_stats_count(struct net_device *dev)
+static int veth_get_sset_count(struct net_device *dev, int sset)
{
- return ARRAY_SIZE(ethtool_stats_keys);
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(ethtool_stats_keys);
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void veth_get_ethtool_stats(struct net_device *dev,
@@ -135,7 +140,7 @@ static struct ethtool_ops veth_ethtool_ops = {
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg,
.get_strings = veth_get_strings,
- .get_stats_count = veth_get_stats_count,
+ .get_sset_count = veth_get_sset_count,
.get_ethtool_stats = veth_get_ethtool_stats,
};
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index d793d84..3dae152 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -109,29 +109,8 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
struct ethtool_stats * stats, u64 * data)
{
wlan_private *priv = dev->priv;
-
- lbs_deb_enter(LBS_DEB_ETHTOOL);
-
- stats->cmd = ETHTOOL_GSTATS;
- BUG_ON(stats->n_stats != MESH_STATS_NUM);
-
- data[0] = priv->mstats.fwd_drop_rbt;
- data[1] = priv->mstats.fwd_drop_ttl;
- data[2] = priv->mstats.fwd_drop_noroute;
- data[3] = priv->mstats.fwd_drop_nobuf;
- data[4] = priv->mstats.fwd_unicast_cnt;
- data[5] = priv->mstats.fwd_bcast_cnt;
- data[6] = priv->mstats.drop_blind;
- data[7] = priv->mstats.tx_failed_cnt;
-
- lbs_deb_enter(LBS_DEB_ETHTOOL);
-}
-
-static int libertas_ethtool_get_stats_count(struct net_device * dev)
-{
- int ret;
- wlan_private *priv = dev->priv;
struct cmd_ds_mesh_access mesh_access;
+ int ret;
lbs_deb_enter(LBS_DEB_ETHTOOL);
@@ -140,25 +119,38 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
CMD_OPTION_WAITFORRSP, 0, &mesh_access);
- if (ret) {
- ret = 0;
- goto done;
- }
-
- priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
- priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
- priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]);
- priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]);
- priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]);
- priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]);
- priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]);
- priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]);
+ if (ret)
+ return;
+
+ priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
+ priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
+ priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]);
+ priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]);
+ priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]);
+ priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]);
+ priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]);
+ priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]);
+
+ data[0] = priv->mstats.fwd_drop_rbt;
+ data[1] = priv->mstats.fwd_drop_ttl;
+ data[2] = priv->mstats.fwd_drop_noroute;
+ data[3] = priv->mstats.fwd_drop_nobuf;
+ data[4] = priv->mstats.fwd_unicast_cnt;
+ data[5] = priv->mstats.fwd_bcast_cnt;
+ data[6] = priv->mstats.drop_blind;
+ data[7] = priv->mstats.tx_failed_cnt;
- ret = MESH_STATS_NUM;
+ lbs_deb_enter(LBS_DEB_ETHTOOL);
+}
-done:
- lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
- return ret;
+static int libertas_ethtool_get_sset_count(struct net_device * dev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return MESH_STATS_NUM;
+ default:
+ return -EOPNOTSUPP;
+ }
}
static void libertas_ethtool_get_strings (struct net_device * dev,
@@ -185,7 +177,7 @@ struct ethtool_ops libertas_ethtool_ops = {
.get_drvinfo = libertas_ethtool_get_drvinfo,
.get_eeprom = libertas_ethtool_get_eeprom,
.get_eeprom_len = libertas_ethtool_get_eeprom_len,
- .get_stats_count = libertas_ethtool_get_stats_count,
+ .get_sset_count = libertas_ethtool_get_sset_count,
.get_ethtool_stats = libertas_ethtool_get_stats,
.get_strings = libertas_ethtool_get_strings,
};
^ permalink raw reply related
* Re: [PATCH] jumbo all-NICs ethtool count cleanup
From: Sam Ravnborg @ 2007-09-16 6:27 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, LKML
In-Reply-To: <20070916061015.GA11373@havoc.gtf.org>
Hi Jeff.
You wrote:
> The hooks ->self_test_count() and ->get_stats_count() are now unused
> in the main tree.
So I'm suprised to see more lines added than deleted:
> 35 files changed, 346 insertions(+), 246 deletions(-)
Puzzled - may need a bit more coffee (morning here)..
Sam
^ permalink raw reply
* Re: Distributed storage. Move away from char device ioctls.
From: Kyle Moffett @ 2007-09-16 7:07 UTC (permalink / raw)
To: Andreas Dilger
Cc: Evgeniy Polyakov, Jeff Garzik, netdev, linux-kernel,
linux-fsdevel
In-Reply-To: <20070915172446.GC2990@schatzie.adilger.int>
On Sep 15, 2007, at 13:24:46, Andreas Dilger wrote:
> On Sep 15, 2007 16:29 +0400, Evgeniy Polyakov wrote:
>> Yes, block device itself is not able to scale well, but it is the
>> place for redundancy, since filesystem will just fail if
>> underlying device does not work correctly and FS actually does not
>> know about where it should place redundancy bits - it might happen
>> to be the same broken disk, so I created a low-level device which
>> distribute requests itself.
>
> I actually think there is a place for this - and improvements are
> definitely welcome. Even Lustre needs block-device level
> redundancy currently, though we will be working to make Lustre-
> level redundancy available in the future (the problem is WAY harder
> than it seems at first glance, if you allow writeback caches at the
> clients and servers).
I really think that to get proper non-block-device-level filesystem
redundancy you need to base it on something similar to the GIT
model. Data replication is done in specific-sized chunks indexed by
SHA-1 sum and you actually have a sort of "merge algorithm" for when
local and remote changes differ. The OS would only implement a very
limited list of merge algorithms, IE one of:
(A) Don't merge, each client gets its own branch and merges are manual
(B) Most recent changed version is made the master every X-seconds/
open/close/write/other-event.
(C) The tree at X (usually a particular client/server) is always
used as the master when there are conflicts.
This lets you implement whatever replication policy you want: You
can require that some files are replicated (cached) on *EVERY*
system, you can require that other files are cached on at least X
systems. You can say "this needs to be replicated on at least X% of
the online systems, or at most Y". Moreover, the replication could
be done pretty easily from userspace via a couple syscalls. You also
automatically keep track of history with some default purge policy.
The main point is that for efficiency and speed things are *not*
always replicated; this also allows for offline operation. You would
of course have "userspace" merge drivers which notice that the tree
on your laptop is not a subset/superset of the tree on your desktop
and do various merges based on per-file metadata. My address-book,
for example, would have a custom little merge program which knows
about how to merge changes between two address book files, asking me
useful questions along the way. Since a lot of this merging is
mechanical, some of the code from GIT could easily be made into a
"merge library" which knows how to do such things.
Moreover, this would allow me to have a "shared" root filesystem on
my laptop and desktop. It would have 'sub-project'-type trees, so
that "/" would be an independent branch on each system. "/etc" would
be separate branches but manually merged git-style as I make
changes. "/home/*" folders would be auto-created as separate
subtrees so each user can version their own individually. Specific
subfolders (like address-book, email, etc) would be adjusted by the
GUI programs that manage them to be separate subtrees with manual-
merging controlled by that GUI program.
Backups/dumps/archival of such a system would be easy. You would
just need to clone the significant commits/trees/etc to a DVD and
replace the old SHA-1-indexed objects to tiny "object-deleted" stubs;
to rollback to an archived version you insert the DVD, "mount" it
into the existing kernel SHA-1 index, and then mount the appropriate
commit as a read-only volume somewhere to access. The same procedure
would also work for wide-area-network backups and such.
The effective result would be the ability to do things like the
following:
(A) Have my homedir synced between both systems mostly-
automatically as I make changes to different files on both systems
(B) Easily have 2 copies of all my files, so if one system's disk
goes kaput I can just re-clone from the other.
(C) Keep archived copies of the last 5 years worth of work,
including change history, on a stack of DVDs.
(D) Synchronize work between locations over a relatively slow
link without much work.
As long as files were indirectly indexed by sub-block SHA1 (with the
index depth based on the size of the file), and each individually-
SHA1-ed object could have references, you could trivially have a 4TB-
sized file where you modify 4 bytes at a thousand random locations
throughout the file and only have to update about 5MB worth of on-
disk data. The actual overhead for that kind of operation under any
existing filesystem would be 100% seek-dominated regardless whereas
with this mechanism you would not directly be overwriting data and so
you could append all the updates as a single 5MB chunk. Data reads
would be much more seek-y, but you could trivially have an on-line
defragmenter tool which notices fragmented commonly-accessed inode
objects and creates non-fragmented copies before deleting the old ones.
There's a lot of other technical details which would need resolution
in an actual implementation, but this is enough of a summary to give
you the gist of the concept. Most likely there will be some major
flaw which makes it impossible to produce reliably, but the concept
contains the things I would be interested in for a real "networked
filesystem".
Cheers,
Kyle Moffett
^ permalink raw reply
* Re: [ofa-general] [PATCH] RDMA/CMA: Use neigh_event_send() to initiate neighbour discovery.
From: Or Gerlitz @ 2007-09-16 7:34 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: netdev, rdreier, linux-kernel, general
In-Reply-To: <20070912100025.3190.89259.stgit@dell3.ogc.int>
Steve Wise wrote:
> RDMA/CMA: Use neigh_event_send() to initiate neighbour discovery.
>
> Calling arp_send() to initiate neighbour discovery (ND) doesn't do the
> full ND protocol. Namely, it doesn't handle retransmitting the arp
> request if it is dropped. The function neigh_event_send() does all this.
> Without doing full ND, rdma address resolution fails in the presence of
> dropped arp bcast packets.
Jay,
Is there a way to deploy something similar for the gratuitous arp being
sent by the bonding driver at bond_arp_send()?
We have seen rare situations where the skb was dropped by the stack and
hence bonding fail-over was detected by the remote peer only when its
neighboring subsystem probe failures dictated that a new arp must be issued.
Or.
>
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>
> drivers/infiniband/core/addr.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> index c5c33d3..5381c80 100644
> --- a/drivers/infiniband/core/addr.c
> +++ b/drivers/infiniband/core/addr.c
> @@ -161,8 +161,7 @@ static void addr_send_arp(struct sockadd
> if (ip_route_output_key(&rt, &fl))
> return;
>
> - arp_send(ARPOP_REQUEST, ETH_P_ARP, rt->rt_gateway, rt->idev->dev,
> - rt->rt_src, NULL, rt->idev->dev->dev_addr, NULL);
> + neigh_event_send(rt->u.dst.neighbour, NULL);
> ip_rt_put(rt);
> }
^ permalink raw reply
* Re: [PATCH] jumbo all-NICs ethtool count cleanup
From: Jeff Garzik @ 2007-09-16 7:39 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: netdev, LKML
In-Reply-To: <20070916062722.GA5498@uranus.ravnborg.org>
Sam Ravnborg wrote:
> Hi Jeff.
>
> You wrote:
>> The hooks ->self_test_count() and ->get_stats_count() are now unused
>> in the main tree.
>
> So I'm suprised to see more lines added than deleted:
>> 35 files changed, 346 insertions(+), 246 deletions(-)
>
> Puzzled - may need a bit more coffee (morning here)..
The new interface that supercedes these is ->get_sset_count(), which was
added to provide additional functionality without having to add a new
hook each time we want to return a new integer value. This new
interface also (intentionally) aligns with the existing ->get_strings()
interface. ("sset" in get_sset_count stands for "string set")
Jeff
^ permalink raw reply
* Re: Please pull 'adm8211' branch of wireless-2.6
From: Jeff Garzik @ 2007-09-16 7:50 UTC (permalink / raw)
To: Michael Wu
Cc: David Miller, John W. Linville, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <200709160047.45128.flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>
Michael Wu wrote:
> On Saturday 15 September 2007 20:56, Jeff Garzik wrote:
>>>>> + if (flags & IFF_PROMISC)
>>>>> + dev->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
>>>>> + else
>>>>> + dev->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
>>>> why does promisc dictate inclusion of FCS?
>>> Because that's the way the hardware works.
>> Why not always include it, regardless of promisc?
>>
> I really do mean that's how the hardware works. If you turn on the promisc bit
> in the hardware (which IFF_PROMISC causes), it starts including the FCS, but
> if the bit is not set, the FCS is not included in frames.
OK, I was confused by the name. Based on the constant's name, I was
assuming that you could unconditionally enable it, promisc or not.
Nevermind. I thought that was a hardware rather than software bit.
> What form of debugging are you talking about? I don't see how it makes a
> difference for debugging. The type checking provided by enums won't make a
When you are tracing through with kgdb, the code is actually readable.
You see
dev->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
rather than the far more obtuse
dev->flags |= 8;
Ditto for any time you have to read pre-processed source code. I do so
at least once a month, since post-cpp code shows you precisely what the
compiler is munching, after all the macro magic goes away.
Jeff
^ permalink raw reply
* Re: - revert-8139too-clean-up-i-o-remapping.patch removed from -mm tree
From: Jeff Garzik @ 2007-09-16 9:46 UTC (permalink / raw)
To: akpm, David Miller; +Cc: michal.k.k.piotrowski, netdev
In-Reply-To: <200709160927.l8G9R6cq009235@imap1.linux-foundation.org>
akpm@linux-foundation.org wrote:
> The patch titled
> revert "8139too: clean up I/O remapping"
> has been removed from the -mm tree. Its filename was
> revert-8139too-clean-up-i-o-remapping.patch
>
> This patch was dropped because it was merged into mainline or a subsystem tree
>
> ------------------------------------------------------
> Subject: revert "8139too: clean up I/O remapping"
> From: Andrew Morton <akpm@linux-foundation.org>
>
> Revert git-netdev-all's 9ee6b32a47b9abc565466a9c3b127a5246b452e5. Michal was
> getting oopses.
>
> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
> Cc: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Shit!
Thanks for reminding me that I need to fix that up before it goes
upstream with the rest of net-2.6.24.
Jeff
^ permalink raw reply
* Re: [ofa-general] InfiniBand/RDMA merge plans for 2.6.24
From: Or Gerlitz @ 2007-09-16 8:50 UTC (permalink / raw)
To: Roland Dreier
Cc: general, linux-kernel, netdev, Jay Vosburgh, Michael S. Tsirkin
In-Reply-To: <adahclymos8.fsf@cisco.com>
Roland Dreier wrote:
> With 2.6.24 probably opening in the not-too-distant future, it's
> probably a good time to review what my plans are for when the merge
> window opens.
> Core:
> - Sean's QoS changes. These look fine at first glance, and I just
> plan to understand the backwards compatibility story (ie how this
> works with an old SM) and merge. Anyone who objects let me know.
Hi Roland,
I have reviewed the qos patches and provided comments which were
deployed in v2 of the series. I also tested it (ipoib and iser which is
rdma-cm based) against the Voltaire SM/SA to see that nothing was
broken. I will send you a "reviewed by:" signature.
> ULPs:
> [ofa-general] [PATCH RFC] IB/ipoib: enable IGMP for userpsace multicast IB apps
The IGMP enabling patch posted by me on September 2nd isn't on your list
http://lists.openfabrics.org/pipermail/general/2007-September/040250.html
can you add it?
> - Moni's IPoIB bonding support. This seems mostly an issue of
> getting the core bonding maintainer's attention. However getting a
> Reviewed-by: for the IPoIB changes wouldn't hurt too.
Jay Vosburgh, the bonding driver maintainer just sent an ack on all
patch series. As for the IPoIB changes, there are three patches, where
two of them, namely
> [PATCH 02/11] IB/ipoib: Notify the world before doing unregister
> [PATCH 04/11] IB/ipoib: Verify address handle validity on send
are handling a corner-case problems pointed by Michael Tsirkin.
Michael, will you be able to look on it and provide a reviewed-by
signature? the third patch
> [PATCH 03/11] IB/ipoib: Bound the net device to the ipoib_neigh structue
is somehow much more simple, I don't think more review is needed for it.
> - Eli and Michael's IPoIB stateless offload (checksum offload, LSO,
> LRO, etc). It's a big series that makes quite a few core changes.
> I think it needs some careful review and is probably at risk of
> missing this merge window. Sorting in order of invasiveness so we
> can merge at least some of it (if splitting it makes sense) might
> be a good idea.
Just for the record, the 'etc' above relates to the interrupt moderation
support (mlx4, core, ipoib {config through ethertool, usage). Among
other things, what is not clear to me here is if/how this goes
hand-in-hand with NAPI.
As you saw the patch adding checksum offload support had a long thread,
and I think the discussion has reached the point where Michael is
waiting for your take on it.
As for the LSO, LRO patches, I did not see any review comment.
I will see that I can review from the series, to begin with, will send
Eli some comments and questions.
> HW specific:
> - Jack and Michael's mlx4 FMR support. Will merge I guess, although
> I do hope to have time to address the DMA API abuse that is being
> copied from mthca, so that mlx4 and mthca work in Xen domU.
This patch series is somehow important as without them iser is useless
over connectx. Can be nice if you merge this and at max fix the abuse later.
Or.
^ permalink raw reply
* (unknown),
From: Martin Hofmann @ 2007-09-16 9:09 UTC (permalink / raw)
To: netdev
subscribe netdev
Mit freundlichen Grüßen
Martin Hofmann
###############################
# Martin Hofmann #
# Quellenweg 3 #
# 91459 Markt Erlbach #
#-----------------------------#
# Telefon: 09106 / 92 54 52 #
# Mobil: 0170 / 96 03 765 #
# Mail: hofmann.martin@odn.de #
###############################
^ permalink raw reply
* Re: Distributed storage. Move away from char device ioctls.
From: Evgeniy Polyakov @ 2007-09-16 13:43 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Jeff Garzik, netdev, linux-kernel, linux-fsdevel
In-Reply-To: <20070915172446.GC2990@schatzie.adilger.int>
On Sat, Sep 15, 2007 at 11:24:46AM -0600, Andreas Dilger (adilger@clusterfs.com) wrote:
> > When Chris Mason announced btrfs, I found that quite a few new ideas
> > are already implemented there, so I postponed project (although
> > direction of the developement of the btrfs seems to move to the zfs side
> > with some questionable imho points, so I think I can jump to the wagon
> > of new filesystems right now).
>
> This is an area I'm always a bit sad about in OSS development - the need
> everyone has to make a new {fs, editor, gui, etc} themselves instead of
> spending more time improving the work we already have. Imagine where the
If that would be true, we would be still in the stone age.
Or not, actually I think the first cell in the universe would not bother
itself dividing into the two just because it could spent infinite time
trying to make itself better.
> internet would be (or not) if there were 50 different network protocols
> instead of TCP/IP? If you don't like some things about btrfs, maybe you
> can fix them?
When some idea is implemented it is virtually impossible to change it,
only recreate new one with fixed issues. So, we have multiple ext,
reiser and many others. I do not say btrfs is broken or has design
problems, it is really interesting filesystem, but all we have our own
opinions about how things should be done, that's it.
Btw, we do have so many network protocols for different purposes, that
number of (storage) filesystems is negligebly small compared to it.
Internet as is popular today is just a subset of where network is used.
And we do invent new protocols each time we need something new, which
does not fit into existing models (for example TCP by design can not
work with very long-distance links with tooo long RTT). We have sctp to
fix some tcp issues. Number of IP layer 'neighbours' is even more.
Physical media layer has many different protocols too.
And that is just what exists in the linux tree...
> To be honest, developing a new filesystem that is actually widely useful
> and used is a very time consuming task (see Reiserfs and Reiser4). It
> takes many years before the code is reliable enough for people to trust it,
> so most likely any effort you put into this would be wasted unless you can
> come up with something that is dramatically better than something existing.
Yep, I know.
Wasting my time is one of the most pleasant things I ever tried in my life.
> The part that bothers me is that this same effort could have been used to
> improve something that more people would use (btrfs in this case). Of
> course, sometimes the new code is substantially better than what currently
> exists, and I think btrfs may have laid claim to the current generation of
> filesystems.
Call me greedy bastard, but I do not care about world happiness, it is
just impossible to achieve. So I like what I do right now.
If it will be rest under the layer of dust I do not care, I like the
process of creating, so if it will fail, I just will get new knowledge.
:)
> Cheers, Andreas
> --
> Andreas Dilger
> Principal Software Engineer
> Cluster File Systems, Inc.
--
Evgeniy Polyakov
^ permalink raw reply
* [ofa-general] Re: [PATCH v2] iw_cxgb3: Support "iwarp-only" interfaces to avoid 4-tuple conflicts.
From: Evgeniy Polyakov @ 2007-09-16 14:22 UTC (permalink / raw)
To: Steve Wise; +Cc: netdev, rdreier, general, linux-kernel
In-Reply-To: <46EC00BE.3020801@opengridcomputing.com>
Hi Steve.
On Sat, Sep 15, 2007 at 10:56:46AM -0500, Steve Wise (swise@opengridcomputing.com) wrote:
> >>The iWARP driver must translate all listens on address 0.0.0.0 to the
> >>set of rdma-only ip addresses for the device in question. This prevents
> >>incoming connect requests to the TCP ipaddresses from going up the
> >>rdma stack.
> >
> >If the only solutions to solve a problem with hardware are to steal
> >packets or became a real device, then real device is much more
> >appropriate. Is that correct?
> >
>
> This is a real device. I don't understand your question? Packets
> aren't being stolen.
I meant port from main network stack. Sorry for confusion.
> >>+static void insert_ifa(struct iwch_dev *rnicp, struct in_ifaddr *ifa)
> >>+{
> >>+ struct iwch_addrlist *addr;
> >>+
> >>+ addr = kmalloc(sizeof *addr, GFP_KERNEL);
> >
> >As a small nitpick: this wants to be sizeof(struct in_ifaddr)
> >
>
> No, insert_ifa() allocates a struct iwch_addrlist, which has 2 fields: a
> list_head for linking, and a struct in_ifaddr pointer.
sizeof(struct iwch_addrlist) of course, not (*addr).
To simplify grep.
> >>+ if (!addr) {
> >>+ printk(KERN_ERR MOD "%s - failed to alloc memory!\n",
> >>+ __FUNCTION__);
> >>+ return;
> >>+ }
> >>+ addr->ifa = ifa;
> >>+ mutex_lock(&rnicp->mutex);
> >>+ list_add_tail(&addr->entry, &rnicp->addrlist);
> >>+ mutex_unlock(&rnicp->mutex);
> >>+}
> >
> >What about providing error back to caller and fail to register?
> >
>
> There are two causes where this is called: 1) during module init to
> populate the list of iwarp addresses. If we failed in that case then, I
> _could_ then not register. 2) we get called via the notifier mechanism
> when an address is added. If that fails, the caller doesn't care (since
> we're on the notifier callout thread). But the code could perhaps
> unregister the device. I prefer just logging an error in case 2. I'll
> look into not registering if we cannot get any address due to lack of
> memory. But there's another case: we load the module and the admin
> hasn't yet created the ethX:iw interface.
>
> Perhaps I should change the code to only register as a working rdma
> device _when_ we get at least one ethX:iwY interface created? Whatchathink?
Does second case ends up with problem you described in the initial
e-mail not being fixed?
> >>+static inline int is_iwarp_label(char *label)
> >>+{
> >>+ char *colon;
> >>+
> >>+ colon = strchr(label, ':');
> >>+ if (colon && !strncmp(colon+1, "iw", 2))
> >>+ return 1;
> >>+ return 0;
> >>+}
> >
> >I.e. it is not allowed to create ':iw' alias for anyone else?
> >Well, looks crappy, but if it is the only solution...
> >
>
> It is kinda crappy. But I don't see a better solution. Any ideas?
Does creating the whole new netdevice is a too big overhead, or is it
considered bad idea?
> >>+static struct iwch_listen_entry *alloc_listener(struct iwch_listen_ep
> >>*ep,
> >>+ __be32 addr)
> >
> >Do you know, that cxgb3 function names suck? :)
> >Especially get_skb().
> >
> >>+{
> >>+ struct iwch_dev *h = to_iwch_dev(ep->com.cm_id->device);
> >>+ struct iwch_listen_entry *le;
> >>+
> >>+ le = kmalloc(sizeof *le, GFP_KERNEL);
> >
> >Wants to be sizeof(struct iwch_listen_entry) and in other places too.
> >
>
> Do you mean I shouldn't use sizeof *le, but rather sizeof(struct
> iwch_listen_entry)? Is that the preferred coding style?
Yes, exactly.
> >I skipped rdma internals of the patch, since I do not know it enough
> >to judge, but your approach looks good from core network point of view.
> >Maybe you should automatically create an alias each time new interface
> >is added so that admin would not care about proper aliases?
> >
>
> That would be much better IMO, but the problem is that I cannot create
> an alias without an actual ip address. Unless we change the core
> services to allow it.
>
> Thanks for reviewing!
>
> Steve.
>
--
Evgeniy Polyakov
^ permalink raw reply
* Re: Statement by SFLC (was Re: Wasting our Freedom)
From: Constantine A. Murenin @ 2007-09-16 14:42 UTC (permalink / raw)
To: espie, Eben Moglen, jcroberts, jeff, mrmacman_g4, jason, misc,
lessig_from_web
In-Reply-To: <20070916140034.GA238@lain.home>
On 16/09/2007, Marc Espie <espie@nerim.net> wrote:
> On Sun, Sep 16, 2007 at 09:17:41AM -0400, Eben Moglen wrote:
> > We will make no more public statements until the work is complete, and
> > we will be neither hurried nor intimidated by people who shout at us
> > instead of helping.
>
> http://www.softwarefreedom.org/news/2007/jul/31/openhal/
>
> As I said in a former email, this has several glaring problems.
>
> As far as I understand, this is a public statement, even if it predates
> the issue at hand.
>
> Please fix it in a timely manner, or take it down for now.
Most noticeably, I fail to see any credits to Reyk Floeter in the
above press release.
Moreover, back when the release was first posted at the above address,
there was no credit even to the OpenBSD project, which I found simply
outrageous! Only after I (and possibly others) have complained to
SFLC did they append the release to give some really vague mention
that OpenHAL is based on OpenBSD's ath(4) HAL.
Eben, is this the work that you are doing in bringing the communities
together, by omitting such vital information as giving credit to the
people and projects who performed most of the work? After all of
these mistakes, after ignoring the ethical side of the relicensing,
after failing to inform when relicensing is even legally an option,
are you seriously even surprised about the negative attention that
SFLC is getting now? Taking a step aside, don't you agree it is
well-deserved?
http://bsd.slashdot.org/article.pl?sid=07/09/13/156258
C.
^ permalink raw reply
* [PATCH|[NET]: migrate HARD_TX_LOCK to header file
From: jamal @ 2007-09-16 15:48 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 290 bytes --]
I wanted to get rid of the extrenous cpu arguement and ended moving this
to the header files since it looks common enough an operation that could
be used elsewhere.
It is a trivial change - i could resend with leaving it in dev.c and
just getting rid of the cpu arguement.
cheers,
jamal
[-- Attachment #2: htxp1 --]
[-- Type: text/plain, Size: 2050 bytes --]
[NET]: migrate HARD_TX_LOCK to header file
HARD_TX_LOCK micro is a nice aggregation that could be used
in other spots. move it to netdevice.h
Also get rid of superflous cpu arguement while doing this ..
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
commit 1bc3a7393737ab1f5239bd8dc2f2953dcee5391e
tree 83a7f39b61fe45282eee825286996ba4bf72c0f6
parent 1f08657fc9b0b56039a9378ca030c2c8ed7bd8ac
author Jamal Hadi Salim <hadi@cyberus.ca> Sun, 16 Sep 2007 11:29:48 -0400
committer Jamal Hadi Salim <hadi@cyberus.ca> Sun, 16 Sep 2007 11:29:48 -0400
include/linux/netdevice.h | 12 ++++++++++++
net/core/dev.c | 14 +-------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dc5e35f..c83e667 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1297,6 +1297,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
spin_unlock_bh(&dev->_xmit_lock);
}
+#define HARD_TX_LOCK(dev) { \
+ if ((dev->features & NETIF_F_LLTX) == 0) { \
+ netif_tx_lock(dev); \
+ } \
+}
+
+#define HARD_TX_UNLOCK(dev) { \
+ if ((dev->features & NETIF_F_LLTX) == 0) { \
+ netif_tx_unlock(dev); \
+ } \
+}
+
static inline void netif_tx_disable(struct net_device *dev)
{
netif_tx_lock_bh(dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index 2897352..7934d28 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1574,18 +1574,6 @@ out_kfree_skb:
return 0;
}
-#define HARD_TX_LOCK(dev, cpu) { \
- if ((dev->features & NETIF_F_LLTX) == 0) { \
- netif_tx_lock(dev); \
- } \
-}
-
-#define HARD_TX_UNLOCK(dev) { \
- if ((dev->features & NETIF_F_LLTX) == 0) { \
- netif_tx_unlock(dev); \
- } \
-}
-
/**
* dev_queue_xmit - transmit a buffer
* @skb: buffer to transmit
@@ -1710,7 +1698,7 @@ gso:
if (dev->xmit_lock_owner != cpu) {
- HARD_TX_LOCK(dev, cpu);
+ HARD_TX_LOCK(dev);
if (!netif_queue_stopped(dev) &&
!netif_subqueue_stopped(dev, skb->queue_mapping)) {
^ permalink raw reply related
* [RFC][NET_SCHED] explict hold dev tx lock
From: jamal @ 2007-09-16 16:14 UTC (permalink / raw)
To: Herbert Xu
Cc: David Miller, netdev, Patrick McHardy, Eric Dumazet,
Evgeniy Polyakov
[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]
While trying to port my batching changes to net-2.6.24 from this morning
i realized this is something i had wanted to probe people on....
Challenge:
For N Cpus, with full throttle traffic on all N CPUs, funneling traffic
to the same ethernet device, the devices queue lock is contended by all
N CPUs constantly. The TX lock is only contended by a max of 2 CPUS.
In the current mode of operation, after all the work of entering the
dequeue region, we may endup aborting the path if we are unable to get
the tx lock and go back to contend for the queue lock. As N goes up,
this gets worse.
Testing:
I did some testing with a 4 cpu (2xdual core) with no irq binding. I run
about 10 runs of 30M packets each from the stack with a udp app i wrote
which is intended to run keep all 4 cpus busy - and to my suprise i
found that we only bail out less than 0.1%. I may need a better test
case.
Changes:
I made changes to the code path as defined in the patch included to
and noticed a slight increase (2-3%) in performance with both e1000 and
tg3; which was a relief because i thought the spinlock_irq (which is
needed because some drivers grab tx lock in interupts) may have negative
effects. The fact it didnt reduce performance was a good thing.
Note: This is the highest end machine ive ever laid hands on, so this
may be misleading.
So - what side effects do people see in doing this? If none, i will
clean it up and submit.
cheers,
jamal
[-- Attachment #2: nsqr1 --]
[-- Type: text/x-patch, Size: 2161 bytes --]
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dc5e35f..ab9966f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1271,6 +1271,12 @@ static inline void netif_tx_lock(struct net_device *dev)
dev->xmit_lock_owner = smp_processor_id();
}
+static inline void netif_tx_lock_irq(struct net_device *dev)
+{
+ spin_lock_irq(&dev->_xmit_lock);
+ dev->xmit_lock_owner = smp_processor_id();
+}
+
static inline void netif_tx_lock_bh(struct net_device *dev)
{
spin_lock_bh(&dev->_xmit_lock);
@@ -1291,6 +1297,12 @@ static inline void netif_tx_unlock(struct net_device *dev)
spin_unlock(&dev->_xmit_lock);
}
+static inline void netif_tx_unlock_irq(struct net_device *dev)
+{
+ dev->xmit_lock_owner = -1;
+ spin_unlock_irq(&dev->_xmit_lock);
+}
+
static inline void netif_tx_unlock_bh(struct net_device *dev)
{
dev->xmit_lock_owner = -1;
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index e970e8e..f75a924 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -134,34 +134,23 @@ static inline int qdisc_restart(struct net_device *dev)
{
struct Qdisc *q = dev->qdisc;
struct sk_buff *skb;
- unsigned lockless;
+ unsigned lockless = (dev->features & NETIF_F_LLTX);
int ret;
/* Dequeue packet */
if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL))
return 0;
- /*
- * When the driver has LLTX set, it does its own locking in
- * start_xmit. These checks are worth it because even uncongested
- * locks can be quite expensive. The driver can do a trylock, as
- * is being done here; in case of lock contention it should return
- * NETDEV_TX_LOCKED and the packet will be requeued.
- */
- lockless = (dev->features & NETIF_F_LLTX);
-
- if (!lockless && !netif_tx_trylock(dev)) {
- /* Another CPU grabbed the driver tx lock */
- return handle_dev_cpu_collision(skb, dev, q);
- }
-
/* And release queue */
spin_unlock(&dev->queue_lock);
+ if (!lockless)
+ netif_tx_lock_irq(dev);
+
ret = dev_hard_start_xmit(skb, dev);
if (!lockless)
- netif_tx_unlock(dev);
+ netif_tx_unlock_irq(dev);
spin_lock(&dev->queue_lock);
q = dev->qdisc;
^ permalink raw reply related
* Re: e1000 driver and samba
From: James Chapman @ 2007-09-16 16:24 UTC (permalink / raw)
To: Kok, Auke; +Cc: L F, netdev
In-Reply-To: <46EC2D5A.7080504@intel.com>
Kok, Auke wrote:
> James Chapman wrote:
>> Kok, Auke wrote:
>>>> rx_long_byte_count: 34124849453
>>
>> Are these long frames expected in your network? What is the MTU of the
>> transmitting clients? Perhaps this might explain why reads work
>> (because data is coming from the Linux box so the packets have smaller
>> MTU) while writes cause delays or packet loss because the clients are
>> sending long frames which are getting fragmented?
>
> those are not "long frames" but the number of bytes the hardware counted
> in its "long" data type based byte counter.
Thanks for correcting me, Auke.
Should this counter be renamed to avoid someone else making this mistake
in the future? Just a thought.
--
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
^ permalink raw reply
* Re: [PATCH] Configurable tap interface MTU
From: David Miller @ 2007-09-16 19:22 UTC (permalink / raw)
To: eswierk; +Cc: herbert, netdev, maxk, linux-kernel
In-Reply-To: <e6c711510709120954i29a8f86bg9ea7bb337a039b5a@mail.gmail.com>
From: "Ed Swierk" <eswierk@arastra.com>
Date: Wed, 12 Sep 2007 09:54:35 -0700
> On 9/11/07, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> > Please make it 65535 without an Ethernet header and 65521
> > with an Ethernet header.
>
> Here is a revised patch that allows MTUs up to 65535 for tap
> interfaces and up to 65521 for tun interfaces.
>
> (If I set the MTU to 65521 on a tun interface, ping complains "message
> too long" when I send a 65521-byte packet; 65520 works okay, though.)
Applied to net-2.6.24
Please provide a proper Signed-off-by: line and a full
changelog with every patch submission and revision in
the future.
Thanks.
^ permalink raw reply
* 2.6.23-rc regression: bcm43xx does not work after commit 4cf92a3c
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-09-16 19:24 UTC (permalink / raw)
To: davem, jeff, Jean Tourrilhes; +Cc: yoshfuji, netdev
Hello.
With latest git tree, bcm43xx driver does not work.
By bisect, I've found the commit 4cf92a3c is the first "bad" commit.
[PATCH] softmac: Fix ESSID problem
Victor Porton reported that the SoftMAC layer had random problem when setting the ESSID :
http://bugzilla.kernel.org/show_bug.cgi?id=8686 After investigation, it turned out to be
worse, the SoftMAC layer is left in an inconsistent state. The fix is pretty trivial.
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Acked-by: Michael Buesch <mb@bu3sch.df>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
After reverting this commit, the driver starts working again.
Regards,
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply
* Re: [PATCH|[NET]: migrate HARD_TX_LOCK to header file
From: David Miller @ 2007-09-16 19:28 UTC (permalink / raw)
To: hadi; +Cc: netdev
In-Reply-To: <1189957725.4241.4.camel@localhost>
From: jamal <hadi@cyberus.ca>
Date: Sun, 16 Sep 2007 11:48:45 -0400
> I wanted to get rid of the extrenous cpu arguement and ended moving this
> to the header files since it looks common enough an operation that could
> be used elsewhere.
> It is a trivial change - i could resend with leaving it in dev.c and
> just getting rid of the cpu arguement.
The only reason the cpu argument is superfluous is because
we don't provide a way to pass it on down to netif_tx_lock().
So instead netif_tx_lock() recomputes that value in this case which is
extra unnecessary work.
I would instead suggest, in netdevice.h:
static inline void __netif_tx_lock(struct net_device *dev, int cpu)
{
spin_lock(&dev->_xmit_lock);
dev->xmit_lock_owner = cpu;
}
static inline void netif_tx_lock(struct net_device *dev)
{
__netif_tx_lock(dev, smp_processor_id());
}
And make the HARD_TX_LOCK() call __netif_tx_lock() and pass in
the already computed 'cpu' parameter.
Thanks.
^ 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