Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] netns: net_identifiers should be read_mostly
From: Eric Dumazet @ 2009-11-17 20:42 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 drivers/net/bonding/bond_main.c         |    2 +-
 drivers/net/ppp_generic.c               |    2 +-
 drivers/net/pppoe.c                     |    2 +-
 drivers/net/pppol2tp.c                  |    2 +-
 net/8021q/vlan.c                        |    2 +-
 net/ipv4/ip_gre.c                       |    2 +-
 net/ipv4/ipip.c                         |    2 +-
 net/ipv6/ip6_tunnel.c                   |    2 +-
 net/ipv6/sit.c                          |    2 +-
 net/key/af_key.c                        |    2 +-
 net/netfilter/nf_conntrack_proto_dccp.c |    2 +-
 net/netfilter/nf_conntrack_proto_gre.c  |    2 +-
 net/phonet/pn_dev.c                     |    2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ecea6c2..726bd75 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -158,7 +158,7 @@ MODULE_PARM_DESC(fail_over_mac, "For active-backup, do not set all slaves to the
 static const char * const version =
 	DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n";
 
-int bond_net_id;
+int bond_net_id __read_mostly;
 
 static __be32 arp_target[BOND_MAX_ARP_TARGETS];
 static int arp_ip_count;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 9bf2a6b..de64f64 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -184,7 +184,7 @@ static atomic_t ppp_unit_count = ATOMIC_INIT(0);
 static atomic_t channel_count = ATOMIC_INIT(0);
 
 /* per-net private data for this module */
-static int ppp_net_id;
+static int ppp_net_id __read_mostly;
 struct ppp_net {
 	/* units to ppp mapping */
 	struct idr units_idr;
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 60c8d23..a1dcba2 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -97,7 +97,7 @@ static const struct proto_ops pppoe_ops;
 static struct ppp_channel_ops pppoe_chan_ops;
 
 /* per-net private data for this module */
-static int pppoe_net_id;
+static int pppoe_net_id __read_mostly;
 struct pppoe_net {
 	/*
 	 * we could use _single_ hash table for all
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 849cc9c..442c382 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -232,7 +232,7 @@ static struct ppp_channel_ops pppol2tp_chan_ops = { pppol2tp_xmit , NULL };
 static const struct proto_ops pppol2tp_ops;
 
 /* per-net private data for this module */
-static int pppol2tp_net_id;
+static int pppol2tp_net_id __read_mostly;
 struct pppol2tp_net {
 	struct list_head pppol2tp_tunnel_list;
 	rwlock_t pppol2tp_tunnel_list_lock;
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 39f8d01..d9cb020 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -41,7 +41,7 @@
 
 /* Global VLAN variables */
 
-int vlan_net_id;
+int vlan_net_id __read_mostly;
 
 /* Our listing of VLAN group(s) */
 static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE];
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index a7de9e3..c5f6af5 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -125,7 +125,7 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev);
 
 #define HASH_SIZE  16
 
-static int ipgre_net_id;
+static int ipgre_net_id __read_mostly;
 struct ipgre_net {
 	struct ip_tunnel *tunnels[4][HASH_SIZE];
 
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index c5b1f71..7242ffc 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -119,7 +119,7 @@
 #define HASH_SIZE  16
 #define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF)
 
-static int ipip_net_id;
+static int ipip_net_id __read_mostly;
 struct ipip_net {
 	struct ip_tunnel *tunnels_r_l[HASH_SIZE];
 	struct ip_tunnel *tunnels_r[HASH_SIZE];
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 1d61411..e5c0f6b 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -78,7 +78,7 @@ static void ip6_fb_tnl_dev_init(struct net_device *dev);
 static void ip6_tnl_dev_init(struct net_device *dev);
 static void ip6_tnl_dev_setup(struct net_device *dev);
 
-static int ip6_tnl_net_id;
+static int ip6_tnl_net_id __read_mostly;
 struct ip6_tnl_net {
 	/* the IPv6 tunnel fallback device */
 	struct net_device *fb_tnl_dev;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index b6e145a..d9deaa7 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -66,7 +66,7 @@ static void ipip6_fb_tunnel_init(struct net_device *dev);
 static void ipip6_tunnel_init(struct net_device *dev);
 static void ipip6_tunnel_setup(struct net_device *dev);
 
-static int sit_net_id;
+static int sit_net_id __read_mostly;
 struct sit_net {
 	struct ip_tunnel *tunnels_r_l[HASH_SIZE];
 	struct ip_tunnel *tunnels_r[HASH_SIZE];
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 86b2c22..478c8b3 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -35,7 +35,7 @@
 #define _X2KEY(x) ((x) == XFRM_INF ? 0 : (x))
 #define _KEY2X(x) ((x) == 0 ? XFRM_INF : (x))
 
-static int pfkey_net_id;
+static int pfkey_net_id __read_mostly;
 struct netns_pfkey {
 	/* List of all pfkey sockets. */
 	struct hlist_head table;
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
index 1b816a2..80abdf2 100644
--- a/net/netfilter/nf_conntrack_proto_dccp.c
+++ b/net/netfilter/nf_conntrack_proto_dccp.c
@@ -384,7 +384,7 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][DCCP_PKT_SYNCACK + 1][CT_DCCP_MAX + 1] =
 };
 
 /* this module per-net specifics */
-static int dccp_net_id;
+static int dccp_net_id __read_mostly;
 struct dccp_net {
 	int dccp_loose;
 	unsigned int dccp_timeout[CT_DCCP_MAX + 1];
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
index a54a0af..91d0e71 100644
--- a/net/netfilter/nf_conntrack_proto_gre.c
+++ b/net/netfilter/nf_conntrack_proto_gre.c
@@ -43,7 +43,7 @@
 #define GRE_TIMEOUT		(30 * HZ)
 #define GRE_STREAM_TIMEOUT	(180 * HZ)
 
-static int proto_gre_net_id;
+static int proto_gre_net_id __read_mostly;
 struct netns_proto_gre {
 	rwlock_t		keymap_lock;
 	struct list_head	keymap_list;
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 3287f8f..d5ad794 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -43,7 +43,7 @@ struct phonet_net {
 	struct phonet_routes routes;
 };
 
-int phonet_net_id;
+int phonet_net_id __read_mostly;
 
 struct phonet_device_list *phonet_device_list(struct net *net)
 {

^ permalink raw reply related

* Re: [RFC] mac80211: disallow bridging managed/adhoc interfaces
From: Dan Williams @ 2009-11-17 20:41 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Johannes Berg, Michael Buesch, netdev, linux-wireless,
	Felix Fietkau
In-Reply-To: <20091117090420.0434edc3@nehalam>

On Tue, 2009-11-17 at 09:04 -0800, Stephen Hemminger wrote:
> On Tue, 17 Nov 2009 17:43:43 +0100
> Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
> 
> > On Tue, 2009-11-17 at 08:37 -0800, Stephen Hemminger wrote:
> > 
> > > But there are people bridging wireless, and hostap even has a mode for
> > > that. 
> > 
> > But that's the AP side, which this patch doesn't attempt to prevent. It
> > just makes no sense to bridge when connected to an AP or part of an
> > IBSS.
> > 
> 
> Then how does this work now? And will your change break it?
> 
>                              kvm1
>                             /
>      ====> wlan0  --- bridge-- kvm2
>                             \
>                              kvm3

Are you sure 'bridge' isn't NAT-ed to wlan0 like libvirt/etc do by
default?  That's about the only way it can possibly work correctly with
wifi.

Dan


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net: device name allocation cleanups
From: Octavian Purdila @ 2009-11-17 20:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20091117090157.2a07bed5@nehalam>

On Tuesday 17 November 2009 19:01:57 you wrote:
 
> You have merged the dev_alloc_name into all the registration paths.
> Before it was possible for device to call register_netdevice with a name
> with a % in it. Only if it did dev_alloc_name or register_netdev would
> the %d be interpreted.
> 
> So this patch causes a change which may be visible in user space.

Oops, didn't saw that coming :) How about this one?

(tested all code paths except the dev_change_net_namespace)

[net-next-2.6 PATCH] net: device name allocation cleanups

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
---
 net/core/dev.c |   73 +++++++++++++++++++++----------------------------------
 1 files changed, 28 insertions(+), 45 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 4b24d79..eec13de 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -893,7 +893,8 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 		free_page((unsigned long) inuse);
 	}
 
-	snprintf(buf, IFNAMSIZ, name, i);
+	if (buf != name)
+		snprintf(buf, IFNAMSIZ, name, i);
 	if (!__dev_get_by_name(net, buf))
 		return i;
 
@@ -933,6 +934,25 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 }
 EXPORT_SYMBOL(dev_alloc_name);
 
+static int dev_get_valid_name(struct net *net, const char *name, char *buf,
+			      int fmt)
+{
+	if (!dev_valid_name(name))
+		return -EINVAL;
+
+	if (fmt) {
+		if (strchr(name, '%'))
+			return __dev_alloc_name(net, name, buf);
+	}
+
+	if (__dev_get_by_name(net, name))
+		return -EEXIST;
+	else
+		if (buf != name)
+			strlcpy(buf, name, IFNAMSIZ);
+
+	return 0;
+}
 
 /**
  *	dev_change_name - change name of a device
@@ -956,22 +976,14 @@ int dev_change_name(struct net_device *dev, const char *newname)
 	if (dev->flags & IFF_UP)
 		return -EBUSY;
 
-	if (!dev_valid_name(newname))
-		return -EINVAL;
-
 	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
 		return 0;
 
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
-	if (strchr(newname, '%')) {
-		err = dev_alloc_name(dev, newname);
-		if (err < 0)
-			return err;
-	} else if (__dev_get_by_name(net, newname))
-		return -EEXIST;
-	else
-		strlcpy(dev->name, newname, IFNAMSIZ);
+	err = dev_get_valid_name(net, newname, dev->name, 1);
+	if (err < 0)
+		return err;
 
 rollback:
 	/* For now only devices in the initial network namespace
@@ -4864,8 +4876,6 @@ EXPORT_SYMBOL(netdev_fix_features);
 
 int register_netdevice(struct net_device *dev)
 {
-	struct hlist_head *head;
-	struct hlist_node *p;
 	int ret;
 	struct net *net = dev_net(dev);
 
@@ -4894,26 +4904,14 @@ int register_netdevice(struct net_device *dev)
 		}
 	}
 
-	if (!dev_valid_name(dev->name)) {
-		ret = -EINVAL;
+	ret = dev_get_valid_name(net, dev->name, dev->name, 0);
+	if (ret)
 		goto err_uninit;
-	}
 
 	dev->ifindex = dev_new_index(net);
 	if (dev->iflink == -1)
 		dev->iflink = dev->ifindex;
 
-	/* Check for existence of name */
-	head = dev_name_hash(net, dev->name);
-	hlist_for_each(p, head) {
-		struct net_device *d
-			= hlist_entry(p, struct net_device, name_hlist);
-		if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
-			ret = -EEXIST;
-			goto err_uninit;
-		}
-	}
-
 	/* Fix illegal checksum combinations */
 	if ((dev->features & NETIF_F_HW_CSUM) &&
 	    (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
@@ -5422,8 +5420,6 @@ EXPORT_SYMBOL(unregister_netdev);
 
 int dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat)
 {
-	char buf[IFNAMSIZ];
-	const char *destname;
 	int err;
 
 	ASSERT_RTNL();
@@ -5456,20 +5452,11 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	 * we can use it in the destination network namespace.
 	 */
 	err = -EEXIST;
-	destname = dev->name;
-	if (__dev_get_by_name(net, destname)) {
+	if (__dev_get_by_name(net, dev->name)) {
 		/* We get here if we can't use the current device name */
 		if (!pat)
 			goto out;
-		if (!dev_valid_name(pat))
-			goto out;
-		if (strchr(pat, '%')) {
-			if (__dev_alloc_name(net, pat, buf) < 0)
-				goto out;
-			destname = buf;
-		} else
-			destname = pat;
-		if (__dev_get_by_name(net, destname))
+		if (dev_get_valid_name(net, pat, dev->name, 1))
 			goto out;
 	}
 
@@ -5505,10 +5492,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	/* Actually switch the network namespace */
 	dev_net_set(dev, net);
 
-	/* Assign the new device name */
-	if (destname != dev->name)
-		strcpy(dev->name, destname);
-
 	/* If there is an ifindex conflict assign a new one */
 	if (__dev_get_by_index(net, dev->ifindex)) {
 		int iflink = (dev->iflink == dev->ifindex);
-- 
1.5.6.5


^ permalink raw reply related

* Re: [PATCH 1/5]net: PPP buffer too small for higher speed connections
From: Dan Williams @ 2009-11-17 20:35 UTC (permalink / raw)
  To: Lennart Sorensen
  Cc: fangxiaozhi 00110321, davem, netdev, linux-kernel,
	william.allen.simpson, jarkao2
In-Reply-To: <20091117172102.GH15159@caffeine.csclub.uwaterloo.ca>

On Tue, 2009-11-17 at 12:21 -0500, Lennart Sorensen wrote:
> On Tue, Nov 17, 2009 at 07:59:05PM +0800, fangxiaozhi 00110321 wrote:
> > From: fangxiaozhi <huananhu@huawei.com>
> > 1. This patch is based on the kernel of 2.6.32-rc7 
> > 2. In this patch, we enlarge the out buffer size to optimize the upload speed for the ppp connection. Then it can support the upload of HSUPA data cards.
> > Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> > -----------------------------------------------------------------------------------------
> > --- a/drivers/net/ppp_async.c	2009-10-12 05:43:56.000000000 +0800
> > +++ b/drivers/net/ppp_async.c	2009-10-15 16:29:56.000000000 +0800
> > @@ -36,7 +36,7 @@
> >  
> >  #define PPP_VERSION	"2.4.2"
> >  
> > -#define OBUFSIZE	256
> > +#define OBUFSIZE	4096
> >  
> >  /* Structure for storing local state. */
> >  struct asyncppp {
> 
> I don't know what an HSUPA connection is, so what kind of speed is that?

(Google and Wikipedia know everything and are only a click away...)

High-Speed Uplink Packet Access is a enhancement for around 5.7Mbps
uplinks on mobile broadband networks based on GSM/UMTS standards.

In the end, what all the mobile manufacturers like Huawei should already
be doing is converting their devices to use an AT-based control port and
a netdev-based data port like Option (hso) and Ericsson (cdc-acm and
cdc-ether) already have.  Then we don't need to do the useless PPP
session between the host and the card.  With GSM/UMTS/HSPA, PPP never
goes over the air, it's purely between the card and the host.  And thus
is pointless and a netdev-type architecture would work a lot better.

Dan

> I am just wondering if this would affect ppp on other connections that
> are async (in a positive manner that is).
> 

^ permalink raw reply

* Re: [net-next-2.6 PATCH 1/2] ethtool: Add PHY type to ethtool get_drvinfo
From: Waskiewicz Jr, Peter P @ 2009-11-17 19:56 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Kirsher, Jeffrey T, davem@davemloft.net, netdev@vger.kernel.org,
	gospo@redhat.com, Waskiewicz Jr, Peter P
In-Reply-To: <20091117090719.7d83492a@nehalam>

On Tue, 17 Nov 2009, Stephen Hemminger wrote:

> On Tue, 17 Nov 2009 08:13:24 -0800
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> 
> > From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
> > 
> > Allow the PHY type to be passed from a driver to ethtool when
> > ethtool -i ethX is called.  With newer network cards having SFP
> > and SFP+ PHY cages, this information can be useful, especially
> > if the NIC supports hot-swapping of the PHY modules.
> > 
> > Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> 
> Maybe revive usage of connector port in ethtool rather than adding new API?
> It is already there but values are out of date with current hardware.

You're referring to the MODE_GSET port settings?  If so, I like this 
approach, and will update my patches accordingly.

Thanks Stephen,
-PJ

^ permalink raw reply

* Re: [PATCH] net/can: add driver for mscan family & mpc52xx_mscan
From: Wolfgang Grandegger @ 2009-11-17 19:17 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Grant Likely, socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, David Miller,
	linuxppc-dev-mnsaURCQ41sdnm+yROfE0A
In-Reply-To: <4B02EABA.3060905-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

Wolfgang Grandegger wrote:
> Wolfram Sang wrote:
>> Hi Grant,
>>
>> Wolfgang commented on some points already, I will pick up the other remarks,
>> just one question:
>>
>>>> +       clk_src = of_get_property(np, "fsl,mscan-clk-src", NULL);
>>>> +       if (clk_src && strcmp(clk_src, "ip") == 0)
>>> Should protect against non-null.  strncmp() maybe?
>> "ip" is null-terminated, or what do you mean?
> 
> Imagine somebody defines:
> 
>   fsl,mscan-clk-src = <0xbaeee>;

Forget my comment. I will not harm in the above case. I was just worried
about non-null-teminated strings.

Wolfgang.

^ permalink raw reply

* Re: [RFC] dev->refcnt long term holder
From: David Miller @ 2009-11-17 19:18 UTC (permalink / raw)
  To: shemminger; +Cc: eric.dumazet, herbert, netdev
In-Reply-To: <20091117095846.6ef8b4f6@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 17 Nov 2009 09:58:46 -0800

> I thought it was to handle:
>  1) carrier on old devices would bounce, so it provides ratelimiting
>     of state changes. Modern hardware and CPU's probably makes this a non-issue.
>  2) wasn't there some code path with device changes, hotplug, uevent and
>     udev that meant that we couldn't do notifiers immediately.

I did a lot of code review in this area last night and it seems to be
#1 above and simply being able to do sleeping things to send the
events even though the carrier state changes happen in interrupt
context.

Even for what it's designed to do, it's overengineered.

So what I propose is that we simplify the design and also allow direct
invocation for cases where we're already in a sleepable context and/or
holding RTNL.  Similar to how Eric is doing in his latest linkwatch
patch for VLANs.

Note also that linkwatch's current implementation is the sole reason
we do the real work of netdevice destruction after dropping RTNL :-)
Linkwatch and unregister_netdevice() used to deadlock on RTNL.

>From history-2.6 GIT:

commit ff936f4e8148e75b20595eda5de6d3a4bb55b631
Author: David S. Miller <davem@nuts.ninka.net>
Date:   Mon May 19 04:30:48 2003 -0700

    [NET]: Fix netdevice unregister races.
    
    We had two major issues when unregistering networking devices.
    1) Even trying to run hotplug asynchronously could deadlock
       if keventd was currently trying to get the RTNL semaphore
       in order to process linkwatch events.
    2) Unregister needs to wait for the last reference to go away
       before the finalization of the unregister can execute.  This
       cannot occur under the RTNL semaphore as this is deadlock
       prone as well.
    
    The solution is to do all of this stuff after dropping the
    RTNL semaphore.  rtnl_lock, if it is about to protect a region
    of code that could unregister network devices, registers a list
    to which unregistered netdevs are attached.  At rtnl_unlock time
    this list is processed to wait for refcounts to drop to zero and
    then finalize the unregister.




^ permalink raw reply

* [PATCH net-next-2.6] macvlan: Precise RX stats accounting
From: Eric Dumazet @ 2009-11-17 18:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List, Patrick McHardy

David, here is the macvlan part as well, it also depends on 
dev_txq_stats_fold() being added first.

Thanks

[PATCH net-next-2.6] macvlan: Precise RX stats accounting

With multi queue devices, its possible that several cpus call
macvlan RX routines simultaneously for the same macvlan device.

We update RX stats counter without any locking, so we can
get slightly wrong counters.

One possible fix is to use percpu counters, to get precise
accounting and also get guarantee of no cache line ping pongs
between cpus.

Note: this adds 16 bytes (32 bytes on 64bit arches) of percpu
data per macvlan device.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 drivers/net/macvlan.c |   76 ++++++++++++++++++++++++++++++++++------
 1 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 271aa7e..f2389a2 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -38,12 +38,27 @@ struct macvlan_port {
 	struct list_head	vlans;
 };
 
+/**
+ *	struct macvlan_rx_stats - MACVLAN percpu rx stats
+ *	@rx_packets: number of received packets
+ *	@rx_bytes: number of received bytes
+ *	@multicast: number of received multicast packets
+ *	@rx_errors: number of errors
+ */
+struct macvlan_rx_stats {
+	unsigned long rx_packets;
+	unsigned long rx_bytes;
+	unsigned long multicast;
+	unsigned long rx_errors;
+};
+
 struct macvlan_dev {
 	struct net_device	*dev;
 	struct list_head	list;
 	struct hlist_node	hlist;
 	struct macvlan_port	*port;
 	struct net_device	*lowerdev;
+	struct macvlan_rx_stats *rx_stats;
 };
 
 
@@ -110,6 +125,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
 	struct net_device *dev;
 	struct sk_buff *nskb;
 	unsigned int i;
+	struct macvlan_rx_stats *rx_stats;
 
 	if (skb->protocol == htons(ETH_P_PAUSE))
 		return;
@@ -117,17 +133,17 @@ static void macvlan_broadcast(struct sk_buff *skb,
 	for (i = 0; i < MACVLAN_HASH_SIZE; i++) {
 		hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[i], hlist) {
 			dev = vlan->dev;
+			rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
 
 			nskb = skb_clone(skb, GFP_ATOMIC);
 			if (nskb == NULL) {
-				dev->stats.rx_errors++;
-				dev->stats.rx_dropped++;
+				rx_stats->rx_errors++;
 				continue;
 			}
 
-			dev->stats.rx_bytes += skb->len + ETH_HLEN;
-			dev->stats.rx_packets++;
-			dev->stats.multicast++;
+			rx_stats->rx_bytes += skb->len + ETH_HLEN;
+			rx_stats->rx_packets++;
+			rx_stats->multicast++;
 
 			nskb->dev = dev;
 			if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast))
@@ -147,6 +163,7 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
 	const struct macvlan_port *port;
 	const struct macvlan_dev *vlan;
 	struct net_device *dev;
+	struct macvlan_rx_stats *rx_stats;
 
 	port = rcu_dereference(skb->dev->macvlan_port);
 	if (port == NULL)
@@ -166,16 +183,15 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
 		kfree_skb(skb);
 		return NULL;
 	}
-
+	rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
 	skb = skb_share_check(skb, GFP_ATOMIC);
 	if (skb == NULL) {
-		dev->stats.rx_errors++;
-		dev->stats.rx_dropped++;
+		rx_stats->rx_errors++;
 		return NULL;
 	}
 
-	dev->stats.rx_bytes += skb->len + ETH_HLEN;
-	dev->stats.rx_packets++;
+	rx_stats->rx_bytes += skb->len + ETH_HLEN;
+	rx_stats->rx_packets++;
 
 	skb->dev = dev;
 	skb->pkt_type = PACKET_HOST;
@@ -365,9 +381,47 @@ static int macvlan_init(struct net_device *dev)
 
 	macvlan_set_lockdep_class(dev);
 
+	vlan->rx_stats = alloc_percpu(struct macvlan_rx_stats);
+	if (!vlan->rx_stats)
+		return -ENOMEM;
+
 	return 0;
 }
 
+static void macvlan_uninit(struct net_device *dev)
+{
+	struct macvlan_dev *vlan = netdev_priv(dev);
+
+	free_percpu(vlan->rx_stats);
+}
+
+static struct net_device_stats *macvlan_dev_get_stats(struct net_device *dev)
+{
+	struct net_device_stats *stats = &dev->stats;
+	struct macvlan_dev *vlan = netdev_priv(dev);
+
+	dev_txq_stats_fold(dev, stats);
+
+	if (vlan->rx_stats) {
+		struct macvlan_rx_stats *p, rx = {0};
+		int i;
+
+		for_each_possible_cpu(i) {
+			p = per_cpu_ptr(vlan->rx_stats, i);
+			rx.rx_packets += p->rx_packets;
+			rx.rx_bytes   += p->rx_bytes;
+			rx.rx_errors  += p->rx_errors;
+			rx.multicast  += p->multicast;
+		}
+		stats->rx_packets = rx.rx_packets;
+		stats->rx_bytes   = rx.rx_bytes;
+		stats->rx_errors  = rx.rx_errors;
+		stats->rx_dropped = rx.rx_errors;
+		stats->multicast  = rx.multicast;
+	}
+	return stats;
+}
+
 static void macvlan_ethtool_get_drvinfo(struct net_device *dev,
 					struct ethtool_drvinfo *drvinfo)
 {
@@ -404,6 +458,7 @@ static const struct ethtool_ops macvlan_ethtool_ops = {
 
 static const struct net_device_ops macvlan_netdev_ops = {
 	.ndo_init		= macvlan_init,
+	.ndo_uninit		= macvlan_uninit,
 	.ndo_open		= macvlan_open,
 	.ndo_stop		= macvlan_stop,
 	.ndo_start_xmit		= macvlan_start_xmit,
@@ -411,6 +466,7 @@ static const struct net_device_ops macvlan_netdev_ops = {
 	.ndo_change_rx_flags	= macvlan_change_rx_flags,
 	.ndo_set_mac_address	= macvlan_set_mac_address,
 	.ndo_set_multicast_list	= macvlan_set_multicast_list,
+	.ndo_get_stats		= macvlan_dev_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
 };
 

^ permalink raw reply related

* Re: [PATCH 17/11]Optimize the upload speed for PPP connection.
From: Valdis.Kletnieks @ 2009-11-17 18:49 UTC (permalink / raw)
  To: William Allen Simpson; +Cc: huananhu, David Miller, netdev, linux-kernel
In-Reply-To: <4B0278D9.6030806@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

On Tue, 17 Nov 2009 05:20:09 EST, William Allen Simpson said:

> And your trailer boilerplate badly breaks the system, because it's
> missing the SMTP email standard "--" line in front of it.

Ahem.

It's not an 'SMTP standard' - in fact, SMTP doesn't even care diddly about the
user-visible *headers* in the mail, much less what the convention for a
signature block is.  If you get EHLO, MAIL FROM, RCPT TO, DATA, '.', and QUIT,
that's 95% of SMTP right there.  And none of it where normal users can even see
it (though the MAIL FROM can show up as Return-Path: sometimes).

The '-- ' *convention* isn't even at the next layer up, MIME.  If anything,
it's out at the liveware level (though some MUAs provide code to make it
a bit easier to deal with...)

(Feel free to cite RFC chapter-and-verse if you disagree, and note that
'Informational' RFCs are never standards. ;)


[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply

* Re: [PATCH] net/can: add driver for mscan family & mpc52xx_mscan
From: Wolfgang Grandegger @ 2009-11-17 18:26 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Grant Likely, socketcan-core-0fE9KPoRgkgATYTw5x5z8w, David Miller,
	linuxppc-dev-mnsaURCQ41sdnm+yROfE0A,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20091116184416.GA21491-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Wolfram Sang wrote:
> Hi Grant,
> 
> Wolfgang commented on some points already, I will pick up the other remarks,
> just one question:
> 
>>> +       clk_src = of_get_property(np, "fsl,mscan-clk-src", NULL);
>>> +       if (clk_src && strcmp(clk_src, "ip") == 0)
>> Should protect against non-null.  strncmp() maybe?
> 
> "ip" is null-terminated, or what do you mean?

Imagine somebody defines:

  fsl,mscan-clk-src = <0xbaeee>;

Wolfgang.

^ permalink raw reply

* Re: [RFC] dev->refcnt long term holder
From: Stephen Hemminger @ 2009-11-17 17:58 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, herbert, netdev
In-Reply-To: <20091117.003019.196504832.davem@davemloft.net>

On Tue, 17 Nov 2009 00:30:19 -0800 (PST)
David Miller <davem@davemloft.net> wrote:

> I'm trying to remember why we added this asynchronous link state event
> processing monster.  It probably has something to do with needing a
> sleepable context.  What's amusing is that linkwatch has repeatably
> caused RTNL deadlock issues over the years. :-)

I thought it was to handle:
 1) carrier on old devices would bounce, so it provides ratelimiting
    of state changes. Modern hardware and CPU's probably makes this a non-issue.
 2) wasn't there some code path with device changes, hotplug, uevent and
    udev that meant that we couldn't do notifiers immediately.

-- 

^ permalink raw reply

* Re: [PATCH 17/11]Optimize the upload speed for PPP connection.
From: Alexander Clouter @ 2009-11-17 17:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev
In-Reply-To: <4B0278D9.6030806@gmail.com>

William Allen Simpson <william.allen.simpson@gmail.com> wrote:
>
> And your trailer boilerplate badly breaks the system, because it's
> missing the SMTP email standard "--" line in front of it.
> 
*ahem* s/^--$/^-- $/ *ahem*

Two hyphens followed by a space.

Cheers

-- 
Alexander Clouter
.sigmonster says: Everything you know is wrong!

^ permalink raw reply

* Re: [PATCH 1/5]net: PPP buffer too small for higher speed connections
From: Lennart Sorensen @ 2009-11-17 17:21 UTC (permalink / raw)
  To: fangxiaozhi 00110321
  Cc: davem, netdev, linux-kernel, william.allen.simpson, jarkao2
In-Reply-To: <fb8cc3511cffa.1cffafb8cc351@huawei.com>

On Tue, Nov 17, 2009 at 07:59:05PM +0800, fangxiaozhi 00110321 wrote:
> From: fangxiaozhi <huananhu@huawei.com>
> 1. This patch is based on the kernel of 2.6.32-rc7 
> 2. In this patch, we enlarge the out buffer size to optimize the upload speed for the ppp connection. Then it can support the upload of HSUPA data cards.
> Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> -----------------------------------------------------------------------------------------
> --- a/drivers/net/ppp_async.c	2009-10-12 05:43:56.000000000 +0800
> +++ b/drivers/net/ppp_async.c	2009-10-15 16:29:56.000000000 +0800
> @@ -36,7 +36,7 @@
>  
>  #define PPP_VERSION	"2.4.2"
>  
> -#define OBUFSIZE	256
> +#define OBUFSIZE	4096
>  
>  /* Structure for storing local state. */
>  struct asyncppp {

I don't know what an HSUPA connection is, so what kind of speed is that?
I am just wondering if this would affect ppp on other connections that
are async (in a positive manner that is).

-- 
Len Sorensen

^ permalink raw reply

* Re: [net-next-2.6 PATCH 1/2] ethtool: Add PHY type to ethtool get_drvinfo
From: Stephen Hemminger @ 2009-11-17 17:07 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, netdev, gospo, Peter P Waskiewicz Jr, Jeff Kirsher
In-Reply-To: <20091117161309.11341.9165.stgit@localhost.localdomain>

On Tue, 17 Nov 2009 08:13:24 -0800
Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:

> From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
> 
> Allow the PHY type to be passed from a driver to ethtool when
> ethtool -i ethX is called.  With newer network cards having SFP
> and SFP+ PHY cages, this information can be useful, especially
> if the NIC supports hot-swapping of the PHY modules.
> 
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---

Maybe revive usage of connector port in ethtool rather than adding new API?
It is already there but values are out of date with current hardware.

^ permalink raw reply

* Re: [RFC] mac80211: disallow bridging managed/adhoc interfaces
From: Johannes Berg @ 2009-11-17 17:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Michael Buesch, netdev, linux-wireless, Felix Fietkau
In-Reply-To: <20091117090420.0434edc3@nehalam>

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On Tue, 2009-11-17 at 09:04 -0800, Stephen Hemminger wrote:

> Then how does this work now? And will your change break it?
> 
>                              kvm1
>                             /
>      ====> wlan0  --- bridge-- kvm2
>                             \
>                              kvm3

What's the type of wlan0? If it's managed, i.e. connected to an AP,
it /doesn't/ actually work now, which is my point.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [RFC] mac80211: disallow bridging managed/adhoc interfaces
From: Stephen Hemminger @ 2009-11-17 17:04 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Michael Buesch, netdev, linux-wireless, Felix Fietkau
In-Reply-To: <1258476223.21197.0.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>

On Tue, 17 Nov 2009 17:43:43 +0100
Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:

> On Tue, 2009-11-17 at 08:37 -0800, Stephen Hemminger wrote:
> 
> > But there are people bridging wireless, and hostap even has a mode for
> > that. 
> 
> But that's the AP side, which this patch doesn't attempt to prevent. It
> just makes no sense to bridge when connected to an AP or part of an
> IBSS.
> 

Then how does this work now? And will your change break it?

                             kvm1
                            /
     ====> wlan0  --- bridge-- kvm2
                            \
                             kvm3
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net: device name allocation cleanups
From: Stephen Hemminger @ 2009-11-17 17:01 UTC (permalink / raw)
  To: Octavian Purdila; +Cc: netdev
In-Reply-To: <200911171849.03870.opurdila@ixiacom.com>

On Tue, 17 Nov 2009 18:49:03 +0200
Octavian Purdila <opurdila@ixiacom.com> wrote:

> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
> ---

You have merged the dev_alloc_name into all the registration paths.
Before it was possible for device to call register_netdevice with a name
with a % in it. Only if it did dev_alloc_name or register_netdev would
the %d be interpreted.

So this patch causes a change which may be visible in user space.

-- 

^ permalink raw reply

* [net-next-2.6 PATCH] net: device name allocation cleanups
From: Octavian Purdila @ 2009-11-17 16:49 UTC (permalink / raw)
  To: netdev

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
---
 net/core/dev.c |   58 +++++++++++++------------------------------------------
 1 files changed, 14 insertions(+), 44 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 4b24d79..6226960 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -862,6 +862,9 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 	unsigned long *inuse;
 	struct net_device *d;
 
+	if (!dev_valid_name(name))
+		return -EINVAL;
+
 	p = strnchr(name, IFNAMSIZ-1, '%');
 	if (p) {
 		/*
@@ -901,7 +904,9 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 	 * when the name is long and there isn't enough space left
 	 * for the digits, or if all bits are used.
 	 */
-	return -ENFILE;
+	if (p)
+		return -ENFILE;
+	return -EEXIST;
 }
 
 /**
@@ -956,22 +961,14 @@ int dev_change_name(struct net_device *dev, const char *newname)
 	if (dev->flags & IFF_UP)
 		return -EBUSY;
 
-	if (!dev_valid_name(newname))
-		return -EINVAL;
-
 	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
 		return 0;
 
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
-	if (strchr(newname, '%')) {
-		err = dev_alloc_name(dev, newname);
-		if (err < 0)
-			return err;
-	} else if (__dev_get_by_name(net, newname))
-		return -EEXIST;
-	else
-		strlcpy(dev->name, newname, IFNAMSIZ);
+	err = dev_alloc_name(dev, newname);
+	if (err < 0)
+		return err;
 
 rollback:
 	/* For now only devices in the initial network namespace
@@ -4864,8 +4861,6 @@ EXPORT_SYMBOL(netdev_fix_features);
 
 int register_netdevice(struct net_device *dev)
 {
-	struct hlist_head *head;
-	struct hlist_node *p;
 	int ret;
 	struct net *net = dev_net(dev);
 
@@ -4894,26 +4889,10 @@ int register_netdevice(struct net_device *dev)
 		}
 	}
 
-	if (!dev_valid_name(dev->name)) {
-		ret = -EINVAL;
-		goto err_uninit;
-	}
-
 	dev->ifindex = dev_new_index(net);
 	if (dev->iflink == -1)
 		dev->iflink = dev->ifindex;
 
-	/* Check for existence of name */
-	head = dev_name_hash(net, dev->name);
-	hlist_for_each(p, head) {
-		struct net_device *d
-			= hlist_entry(p, struct net_device, name_hlist);
-		if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
-			ret = -EEXIST;
-			goto err_uninit;
-		}
-	}
-
 	/* Fix illegal checksum combinations */
 	if ((dev->features & NETIF_F_HW_CSUM) &&
 	    (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
@@ -5038,11 +5017,9 @@ int register_netdev(struct net_device *dev)
 	 * If the name is a format string the caller wants us to do a
 	 * name allocation.
 	 */
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			goto out;
-	}
+	err = dev_alloc_name(dev, dev->name);
+	if (err < 0)
+		goto out;
 
 	err = register_netdevice(dev);
 out:
@@ -5461,16 +5438,9 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 		/* We get here if we can't use the current device name */
 		if (!pat)
 			goto out;
-		if (!dev_valid_name(pat))
-			goto out;
-		if (strchr(pat, '%')) {
-			if (__dev_alloc_name(net, pat, buf) < 0)
-				goto out;
-			destname = buf;
-		} else
-			destname = pat;
-		if (__dev_get_by_name(net, destname))
+		if (__dev_alloc_name(net, pat, buf) < 0)
 			goto out;
+		destname = buf;
 	}
 
 	/*
-- 
1.5.6.5


^ permalink raw reply related

* Re: [RFC] mac80211: disallow bridging managed/adhoc interfaces
From: Johannes Berg @ 2009-11-17 16:43 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Michael Buesch, netdev, linux-wireless, Felix Fietkau
In-Reply-To: <20091117083741.1b165274@nehalam>

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

On Tue, 2009-11-17 at 08:37 -0800, Stephen Hemminger wrote:

> But there are people bridging wireless, and hostap even has a mode for
> that. 

But that's the AP side, which this patch doesn't attempt to prevent. It
just makes no sense to bridge when connected to an AP or part of an
IBSS.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [RFC] mac80211: disallow bridging managed/adhoc interfaces
From: Stephen Hemminger @ 2009-11-17 16:37 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Michael Buesch, netdev, linux-wireless, Felix Fietkau
In-Reply-To: <1258466868.3682.13.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>

On Tue, 17 Nov 2009 15:07:48 +0100
Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:

> On Tue, 2009-11-17 at 15:04 +0100, Michael Buesch wrote:
> > On Tuesday 17 November 2009 14:46:25 Johannes Berg wrote:
> > > --- wireless-testing.orig/net/bridge/br_if.c	2009-11-17 14:19:17.000000000 +0100
> > > +++ wireless-testing/net/bridge/br_if.c	2009-11-17 14:20:03.000000000 +0100
> > > @@ -390,6 +390,10 @@ int br_add_if(struct net_bridge *br, str
> > >  	if (dev->br_port != NULL)
> > >  		return -EBUSY;
> > >  
> > > +	/* No bridging devices that dislike that (e.g. wireless) */
> > > +	if (dev->priv_flags & IFF_DONT_BRIDGE)
> > > +		return -EINVAL;
> > 
> > -EOPNOTSUPP?
> > That would probably produce a better error message in userspace.

But there are people bridging wireless, and hostap even has a mode for
that. Especially people are bridging to wireless when the other interfaces
are VMs.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: Subject: [PATCH 5/6] bna: Brocade 10Gb Ethernet device driver
From: Stephen Hemminger @ 2009-11-17 16:35 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: netdev@vger.kernel.org, Adapter Linux Open SRC Team
In-Reply-To: <CBE1CC7A31453F4CA63C13EFCE6A0F6C05BAD1DD1B@HQ-EXCH-7.corp.brocade.com>

On Tue, 17 Nov 2009 00:32:45 -0800
Rasesh Mody <rmody@brocade.com> wrote:

> > +
> > +#define wwn_t u64
> > +#define lun_t u64
> 
> "No need for obfuscation, at least use a typedef."
> 
> Hi Stephen,
> 
> When using a typedef in place of #define for wwn_t we are getting check-patch warning. Is it advisable to use a typedef?
> 
> - Rasesh

People disagree but my opinion on typedef's is they are ok as long as:
  * a structure or integral type (ie not a pointer)
  * encapsulates some semantic meaning (be32, spin_lock, irq_return)
  * used in several places
  * not just a data structure

The other option is just do a global replace.

What you were doing with #define is a weaker form of typedef. Which
is worse.

-- 

^ permalink raw reply

* Re: [net-next-2.6 PATCH 1/2] ethtool: Add PHY type to ethtool get_drvinfo
From: Ben Hutchings @ 2009-11-17 16:33 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, netdev, gospo, Peter P Waskiewicz Jr
In-Reply-To: <20091117161309.11341.9165.stgit@localhost.localdomain>

On Tue, 2009-11-17 at 08:13 -0800, Jeff Kirsher wrote:
> From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
> 
> Allow the PHY type to be passed from a driver to ethtool when
> ethtool -i ethX is called.  With newer network cards having SFP
> and SFP+ PHY cages, this information can be useful, especially
> if the NIC supports hot-swapping of the PHY modules.
[...]

I think this information belongs in ethtool_cmd, in the port and/or
transceiver fields.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* [net-next] bnx2x: Don't set netdev->trans_start
From: Vladislav Zolotarov @ 2009-11-17 16:16 UTC (permalink / raw)
  To: davem; +Cc: netdev

Setting dev->trans_start caused spurious watchdog warnings.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x_main.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index bdecd42..77ba135 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -2557,7 +2557,6 @@ static void bnx2x_e1h_disable(struct bnx2x *bp)
 	int port = BP_PORT(bp);
 
 	netif_tx_disable(bp->dev);
-	bp->dev->trans_start = jiffies;	/* prevent tx timeout */
 
 	REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0);
 
@@ -7098,7 +7097,6 @@ static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw)
 	bnx2x_int_disable_sync(bp, disable_hw);
 	bnx2x_napi_disable(bp);
 	netif_tx_disable(bp->dev);
-	bp->dev->trans_start = jiffies;	/* prevent tx timeout */
 }
 
 /*
@@ -10282,7 +10280,6 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
 
 	num_pkts++;
 	fp_tx->tx_bd_prod += 2; /* start + pbd */
-	bp->dev->trans_start = jiffies;
 
 	udelay(100);
 
-- 
1.6.3.3





^ permalink raw reply related

* Re: [PATCH net-next-2.6] can: fix setting mcp251x bit timing on open
From: Wolfgang Grandegger @ 2009-11-17 16:23 UTC (permalink / raw)
  To: Christian Pellegrin
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1258474844-10239-1-git-send-email-chripell-VaTbYqLCNhc@public.gmane.org>

Christian Pellegrin wrote:
> Signed-off-by: Christian Pellegrin <chripell-VaTbYqLCNhc@public.gmane.org>

Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

^ permalink raw reply

* Re: [net-next-2.6 PATCH v2] allow access to sysfs_groups member
From: Kurt Van Dijck @ 2009-11-17 16:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20091116084612.3654bdd1@nehalam>

On Mon, Nov 16, 2009 at 08:46:12AM -0800, Stephen Hemminger wrote:
> 
[...]
> 

Stephen,
Thanks for your review.

Kurt

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox