Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] net: phy: remove flags argument from phy_{attach,connect,connect_direct}
From: David Miller @ 2013-01-14 20:12 UTC (permalink / raw)
  To: florian; +Cc: netdev, konszert, afleming, linux-kernel
In-Reply-To: <1358160772-29631-1-git-send-email-florian@openwrt.org>

From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 14 Jan 2013 11:52:52 +0100

> The flags argument of the phy_{attach,connect,connect_direct} functions
> is then used to assign a struct phy_device dev_flags with its value.
> All callers but the tg3 driver pass the flag 0, which results in the
> underlying PHY drivers in drivers/net/phy/ not being able to actually
> use any of the flags they would set in dev_flags. This patch gets rid of
> the flags argument, and passes phydev->dev_flags to the internal PHY
> library call phy_attach_direct() such that drivers which actually modify
> a phy device dev_flags get the value preserved for use by the underlying
> phy driver.
> 
> Acked-by: Kosta Zertsekel <konszert@marvell.com>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] ifb: dont hard code inet_net use
From: David Miller @ 2013-01-14 20:13 UTC (permalink / raw)
  To: jhs; +Cc: eric.dumazet, bcrl, netdev
In-Reply-To: <50F40489.70105@mojatatu.com>

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Mon, 14 Jan 2013 08:13:45 -0500

> On 13-01-13 12:46 PM, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> ifb should lookup devices in the appropriate namespace.
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
> 
> 
>  Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Jamal, please don't put leading whitespace in your
signoffs and acks, the automated tools that look for
these tags in email threads looks for them to start in
the first column.

I've applied this patch, thanks.

Thanks.

^ permalink raw reply

* Re: [PATCH 2/5] soreuseport: TCP/IPv4 implementation
From: YOSHIFUJI Hideaki @ 2013-01-14 20:20 UTC (permalink / raw)
  To: Tom Herbert; +Cc: netdev, davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301141140330.3472@pokey.mtv.corp.google.com>

Tom Herbert wrote:
>  static inline struct sock *inet_lookup_listener(struct net *net,
>  		struct inet_hashinfo *hashinfo,
> +		__be32 saddr, __be16 sport,
>  		__be32 daddr, __be16 dport, int dif)
>  {
> -	return __inet_lookup_listener(net, hashinfo, daddr, ntohs(dport), dif);
> +	return __inet_lookup_listener(net, hashinfo, saddr, sport,
> +	    daddr, ntohs(dport), dif);
>  }
>  
>  /* Socket demux engine toys. */
> @@ -358,7 +364,8 @@ static inline struct sock *__inet_lookup(struct net *net,
>  	struct sock *sk = __inet_lookup_established(net, hashinfo,
>  				saddr, sport, daddr, hnum, dif);
>  
> -	return sk ? : __inet_lookup_listener(net, hashinfo, daddr, hnum, dif);
> +	return sk ? : __inet_lookup_listener(net, hashinfo, saddr, sport,
> +	    daddr, hnum, dif);
>  }
>  

Please fix indent.

--yoshfuji

^ permalink raw reply

* [PATCH 4/5] soreuseport: TCP/IPv6 implementation
From: Tom Herbert @ 2013-01-14 20:00 UTC (permalink / raw)
  To: netdev, davem; +Cc: netdev, eric.dumazet

Allow multiple listener sockets to bind to the same port.

Motivation for soreuseport would be something like a web server
binding to port 80 running with multiple threads, where each thread
might have it's own listener socket.  This could be done as an
alternative to other models: 1) have one listener thread which
dispatches completed connections to workers. 2) accept on a single
listener socket from multiple threads.  In case #1 the listener thread
can easily become the bottleneck with high connection turn-over rate.
In case #2, the proportion of connections accepted per thread tends
to be uneven under high connection load (assuming simple event loop:
while (1) { accept(); process() }, wakeup does not promote fairness
among the sockets.  We have seen the  disproportion to be as high
as 3:1 ratio between thread accepting most connections and the one
accepting the fewest.  With so_reusport the distribution is
uniform.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 include/net/inet6_hashtables.h   |    5 ++++-
 net/ipv6/inet6_connection_sock.c |   18 +++++++++++++-----
 net/ipv6/inet6_hashtables.c      |   19 ++++++++++++++++---
 net/ipv6/tcp_ipv6.c              |    4 +++-
 4 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 9e34c87..7ca75cb 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -71,6 +71,8 @@ extern struct sock *__inet6_lookup_established(struct net *net,
 
 extern struct sock *inet6_lookup_listener(struct net *net,
 					  struct inet_hashinfo *hashinfo,
+					  const struct in6_addr *saddr,
+					  const __be16 sport,
 					  const struct in6_addr *daddr,
 					  const unsigned short hnum,
 					  const int dif);
@@ -88,7 +90,8 @@ static inline struct sock *__inet6_lookup(struct net *net,
 	if (sk)
 		return sk;
 
-	return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif);
+	return inet6_lookup_listener(net, hashinfo, saddr, sport,
+				     daddr, hnum, dif);
 }
 
 static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo,
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 3064785..3ed48ce 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -32,6 +32,9 @@ int inet6_csk_bind_conflict(const struct sock *sk,
 {
 	const struct sock *sk2;
 	const struct hlist_node *node;
+	int reuse = sk->sk_reuse;
+	int reuseport = sk->sk_reuseport;
+	int sk_uid = sock_i_uid((struct sock *)sk);
 
 	/* We must walk the whole port owner list in this case. -DaveM */
 	/*
@@ -42,11 +45,16 @@ int inet6_csk_bind_conflict(const struct sock *sk,
 		if (sk != sk2 &&
 		    (!sk->sk_bound_dev_if ||
 		     !sk2->sk_bound_dev_if ||
-		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
-		    (!sk->sk_reuse || !sk2->sk_reuse ||
-		     sk2->sk_state == TCP_LISTEN) &&
-		     ipv6_rcv_saddr_equal(sk, sk2))
-			break;
+		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
+			if ((!reuse || !sk2->sk_reuse ||
+			     sk2->sk_state == TCP_LISTEN) &&
+			    (!reuseport || !sk2->sk_reuseport ||
+			     (sk2->sk_state != TCP_TIME_WAIT &&
+			      sk_uid != sock_i_uid((struct sock *)sk2)))) {
+				if (ipv6_rcv_saddr_equal(sk, sk2))
+					break;
+			}
+		}
 	}
 
 	return node != NULL;
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index dea17fd..cdce916 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -158,25 +158,38 @@ static inline int compute_score(struct sock *sk, struct net *net,
 }
 
 struct sock *inet6_lookup_listener(struct net *net,
-		struct inet_hashinfo *hashinfo, const struct in6_addr *daddr,
+		struct inet_hashinfo *hashinfo, const struct in6_addr *saddr,
+		const __be16 sport, const struct in6_addr *daddr,
 		const unsigned short hnum, const int dif)
 {
 	struct sock *sk;
 	const struct hlist_nulls_node *node;
 	struct sock *result;
-	int score, hiscore;
+	int score, hiscore, matches = 0, reuseport = 0;
+	u32 phash = 0;
 	unsigned int hash = inet_lhashfn(net, hnum);
 	struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash];
 
 	rcu_read_lock();
 begin:
 	result = NULL;
-	hiscore = -1;
+	hiscore = 0;
 	sk_nulls_for_each(sk, node, &ilb->head) {
 		score = compute_score(sk, net, hnum, daddr, dif);
 		if (score > hiscore) {
 			hiscore = score;
 			result = sk;
+			reuseport = sk->sk_reuseport;
+			if (reuseport) {
+				phash = inet6_ehashfn(net, daddr, hnum,
+				   saddr, sport);
+				matches = 1;
+			}
+		} else if (score == hiscore && reuseport) {
+			matches++;
+			if (((u64)phash * matches) >> 32 == 0)
+				result = sk;
+			phash = next_pseudo_random32(phash);
 		}
 	}
 	/*
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3701c3c..06087e5 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -834,7 +834,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
 		 * no RST generated if md5 hash doesn't match.
 		 */
 		sk1 = inet6_lookup_listener(dev_net(skb_dst(skb)->dev),
-					   &tcp_hashinfo, &ipv6h->daddr,
+					   &tcp_hashinfo, &ipv6h->saddr,
+					   th->source, &ipv6h->daddr,
 					   ntohs(th->source), inet6_iif(skb));
 		if (!sk1)
 			return;
@@ -1598,6 +1599,7 @@ do_time_wait:
 		struct sock *sk2;
 
 		sk2 = inet6_lookup_listener(dev_net(skb->dev), &tcp_hashinfo,
+					    &ipv6_hdr(skb)->saddr, th->source,
 					    &ipv6_hdr(skb)->daddr,
 					    ntohs(th->dest), inet6_iif(skb));
 		if (sk2 != NULL) {
-- 
1.7.7.3

^ permalink raw reply related

* Re: [PATCH] cpsw: Add support to read cpu MAC address
From: Grant Likely @ 2013-01-14 20:26 UTC (permalink / raw)
  To: Michal Bachraty, rob.herring, rob, linux
  Cc: devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
	netdev, Michal Bachraty
In-Reply-To: <1357917302-32550-1-git-send-email-michal.bachraty@streamunlimited.com>

On Fri, 11 Jan 2013 16:15:02 +0100, Michal Bachraty <michal.bachraty@streamunlimited.com> wrote:
> Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com>
> ---
>  Documentation/devicetree/bindings/net/cpsw.txt |   10 +-
>  arch/arm/boot/dts/am33xx.dtsi                  |    5 +-
>  drivers/net/ethernet/ti/cpsw.c                 |  121 +++++++++++++++++++++---
>  include/linux/platform_data/cpsw.h             |    8 ++
>  4 files changed, 128 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
> index dcaabe9..432122c 100644
> --- a/Documentation/devicetree/bindings/net/cpsw.txt
> +++ b/Documentation/devicetree/bindings/net/cpsw.txt
> @@ -4,7 +4,7 @@ TI SoC Ethernet Switch Controller Device Tree Bindings
>  Required properties:
>  - compatible		: Should be "ti,cpsw"
>  - reg			: physical base address and size of the cpsw
> -			  registers map
> +			  registers map and mac-address cpu config registers
>  - interrupts		: property with a value describing the interrupt
>  			  number
>  - interrupt-parent	: The parent interrupt controller
> @@ -25,17 +25,23 @@ Required properties:
>  - slave_reg_ofs		: Specifies slave register offset
>  - sliver_reg_ofs	: Specifies slave sliver register offset
>  - phy_id		: Specifies slave phy id
> -- mac-address		: Specifies slave MAC address
>  
>  Optional properties:
>  - ti,hwmods		: Must be "cpgmac0"
>  - no_bd_ram		: Must be 0 or 1
> +- mac-address-source 	: Specifies source of MAC address ("user-defined-mac",
> +			  "cpu-id0-mac", "cpu-id01-mac", "random-mac"). If not
> +			  specified, "cpu-id0-mac" is selected

Drop the '-mac' suffix on the values. The property is already named
"mac-address-source", so I think it is already unambiguious from the
context.  :-)

Otherwise the patch looks good to me, but I haven't gone over the code
in fine detail.

Acked-by: Grant Likely <grant.likely@secretlab.ca>


^ permalink raw reply

* Re: [PATCH 5/5] soreuseport: UDP/IPv6 implementation
From: YOSHIFUJI Hideaki @ 2013-01-14 20:27 UTC (permalink / raw)
  To: Tom Herbert; +Cc: netdev, davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301141139190.1968@pokey.mtv.corp.google.com>

Tom Herbert wrote:
> +				hash = inet6_ehashfn(net, daddr, hnum,
> +				    saddr, sport);
:
> +				hash = inet6_ehashfn(net, daddr, hnum,
> +				    saddr, sport);

Ditto.

--yoshfuji

^ permalink raw reply

* Re: [PATCH 0/5]: soreuseport: Bind multiple sockets to the same port
From: David Miller @ 2013-01-14 20:29 UTC (permalink / raw)
  To: therbert; +Cc: netdev, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301141138440.959@pokey.mtv.corp.google.com>

From: Tom Herbert <therbert@google.com>
Date: Mon, 14 Jan 2013 12:00:16 -0800 (PST)

> Rebasing the soreuseport patches to 3.8.  No material changes since
> first posted.

FWIW I'm fine with the basic premise of these changes, and will
happily apply them once all the details are worked out.

Thanks Tom.

^ permalink raw reply

* [ 3.5.y.z extended stable ] Patch "epoll: prevent missed events on EPOLL_CTL_MOD" has been added to staging queue
From: Herton Ronaldo Krzesinski @ 2013-01-14 20:57 UTC (permalink / raw)
  To: Eric Wong
  Cc: Hans Verkuil, Jiri Olsa, Jonathan Corbet, Al Viro, Davide Libenzi,
	Hans de Goede, Mauro Carvalho Chehab, David Miller, Eric Dumazet,
	Andrew Morton, Andreas Voellmy, netdev, linux-fsdevel,
	Linus Torvalds, Herton Ronaldo Krzesinski, kernel-team

This is a note to let you know that I have just added a patch titled

    epoll: prevent missed events on EPOLL_CTL_MOD

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

>From 318ea9d60ee27838448a04a898ef67249f2e79bb Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Tue, 1 Jan 2013 21:20:27 +0000
Subject: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

commit 128dd1759d96ad36c379240f8b9463e8acfd37a1 upstream.

EPOLL_CTL_MOD sets the interest mask before calling f_op->poll() to
ensure events are not missed.  Since the modifications to the interest
mask are not protected by the same lock as ep_poll_callback, we need to
ensure the change is visible to other CPUs calling ep_poll_callback.

We also need to ensure f_op->poll() has an up-to-date view of past
events which occured before we modified the interest mask.  So this
barrier also pairs with the barrier in wq_has_sleeper().

This should guarantee either ep_poll_callback or f_op->poll() (or both)
will notice the readiness of a recently-ready/modified item.

This issue was encountered by Andreas Voellmy and Junchang(Jason) Wang in:
http://thread.gmane.org/gmane.linux.kernel/1408782/

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Voellmy <andreas.voellmy@yale.edu>
Tested-by: "Junchang(Jason) Wang" <junchang.wang@yale.edu>
Cc: netdev@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 fs/eventpoll.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1c8b556..dd1a55d 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1285,7 +1285,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
 	 * otherwise we might miss an event that happens between the
 	 * f_op->poll() call and the new event set registering.
 	 */
-	epi->event.events = event->events;
+	epi->event.events = event->events; /* need barrier below */
 	pt._key = event->events;
 	epi->event.data = event->data; /* protected by mtx */
 	if (epi->event.events & EPOLLWAKEUP) {
@@ -1296,6 +1296,26 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
 	}

 	/*
+	 * The following barrier has two effects:
+	 *
+	 * 1) Flush epi changes above to other CPUs.  This ensures
+	 *    we do not miss events from ep_poll_callback if an
+	 *    event occurs immediately after we call f_op->poll().
+	 *    We need this because we did not take ep->lock while
+	 *    changing epi above (but ep_poll_callback does take
+	 *    ep->lock).
+	 *
+	 * 2) We also need to ensure we do not miss _past_ events
+	 *    when calling f_op->poll().  This barrier also
+	 *    pairs with the barrier in wq_has_sleeper (see
+	 *    comments for wq_has_sleeper).
+	 *
+	 * This barrier will now guarantee ep_poll_callback or f_op->poll
+	 * (or both) will notice the readiness of an item.
+	 */
+	smp_mb();
+
+	/*
 	 * Get current event bits. We can safely use the file* here because
 	 * its usage count has been increased by the caller of this function.
 	 */
--
1.7.9.5

^ permalink raw reply related

* [ 3.5.y.z extended stable ] Patch "batman-adv: fix random jitter calculation" has been added to staging queue
From: Herton Ronaldo Krzesinski @ 2013-01-14 20:58 UTC (permalink / raw)
  To: Akinobu Mita
  Cc: Antonio Quartulli, Marek Lindner, Simon Wunderlich, b.a.t.m.a.n,
	David S. Miller, netdev, Herton Ronaldo Krzesinski, kernel-team

This is a note to let you know that I have just added a patch titled

    batman-adv: fix random jitter calculation

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

>From 12a62234843bc692176f3dc51492cfe84156f1c4 Mon Sep 17 00:00:00 2001
From: Akinobu Mita <akinobu.mita@gmail.com>
Date: Wed, 26 Dec 2012 02:32:10 +0000
Subject: [PATCH] batman-adv: fix random jitter calculation

commit 143cdd8f33909ff5a153e3f02048738c5964ba26 upstream.

batadv_iv_ogm_emit_send_time() attempts to calculates a random integer
in the range of 'orig_interval +- BATADV_JITTER' by the below lines.

        msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
        msecs += (random32() % 2 * BATADV_JITTER);

But it actually gets 'orig_interval' or 'orig_interval - BATADV_JITTER'
because '%' and '*' have same precedence and associativity is
left-to-right.

This adds the parentheses at the appropriate position so that it matches
original intension.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: Antonio Quartulli <ordex@autistici.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 net/batman-adv/bat_iv_ogm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index dc53798..bcf3760 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -117,7 +117,7 @@ static unsigned long bat_iv_ogm_emit_send_time(const struct bat_priv *bat_priv)
 {
 	return jiffies + msecs_to_jiffies(
 		   atomic_read(&bat_priv->orig_interval) -
-		   JITTER + (random32() % 2*JITTER));
+		   JITTER + (random32() % (2*JITTER)));
 }

 /* when do we schedule a ogm packet to be sent */
--
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 3.0.y 0/3] rtnetlink: Fix problem with buffer allocation
From: Greg Kroah-Hartman @ 2013-01-14 21:04 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: David Miller, Greg Rose, stable, e1000-devel, netdev,
	linux-net-drivers
In-Reply-To: <1357259449.2685.60.camel@bwh-desktop.uk.solarflarecom.com>

On Fri, Jan 04, 2013 at 12:30:49AM +0000, Ben Hutchings wrote:
> These patches fix the problem that interface information including many
> VFs is too large for the 4K buffers used by glibc and other clients.
> This breaks many network services.
> 
> The first of these ('rtnetlink: Compute and store minimum ifinfo dump
> size') went into 3.1 and has also been included in SLE11 SP2.  The
> second and third were acked by David Miller and included in 3.2.34.
> 
> I've applied and briefly tested these changes in conjunction with a
> backport of the sfc driver to SLE11 SP3.

All now applied, thanks.

greg k-h

^ permalink raw reply

* Re: [E1000-devel] [PATCH net-next] igbvf: fix setting addr_assign_type if PF is up
From: Andy Gospodarek @ 2013-01-14 22:25 UTC (permalink / raw)
  To: Greg Rose
  Cc: Williams, Mitch A, Stefan Assmann, netdev@vger.kernel.org,
	e1000-devel@lists.sourceforge.net
In-Reply-To: <20130109133745.00004627@unknown>

On Wed, Jan 09, 2013 at 01:37:45PM -0800, Greg Rose wrote:
> On Wed, 9 Jan 2013 18:56:36 +0000
> "Williams, Mitch A" <mitch.a.williams@intel.com> wrote:
> 
> > > >> When the PF is up and igbvf is loaded the MAC address is not
> > > >> generated using eth_hw_addr_random(). This results in
> > > >> addr_assign_type not to be set.
> > > >> Make sure it gets set.
> > > >>
> > > >
> > > > NAK - In this case, the address may or may not be random. The
> > > > user may have (and should have!) explicitly set this address from
> > > > the host to ensure that the VF device receives the same address
> > > > each time it
> > > boots.
> > > 
> > > Maybe you can give me some advice on this then. Why is there
> > > different behaviour depending on the PF being up or down? The
> > > problem I'm facing is that if the user did not set a MAC address
> > > for the VF manually and the PF is up during igbvf_probe it will not
> > > be labelled as random although it is.
> > > What about checking IGB_VF_FLAG_PF_SET_MAC and only set
> > > NET_ADDR_RANDOM if the flag is cleared?
> > > 
> > 
> > The difference in behavior is because we cannot get any MAC address
> > at all if the PF is down. The interface won't operate at all in this
> > case, but if the PF comes up sometime later, we can start working.
> > The other alternative is to leave the MAC address as all zeros and
> > forcing the user to assign an address manually. We chose to use a
> > random address to at least give it a chance of working once the PF
> > woke up.
> 
> Having been around at the inception of SR-IOV in Linux I recall that
> the primary reason we used a random ethernet address was so
> that the VF could at least work because there was no infrastructure
> to allow the host administrator to set the MAC address of the VF.  This
> hobbled testing and validation because the user would have to go to
> each VM and use a command local to the VM to set the VF MAC address to
> some LAA via ifconfig or ip.  When testing large numbers of VFs this was
> a definite pain.
> 
> Now that has changed and I wonder if maybe we shouldn't back out the
> random ethernet address assignment and go ahead with all zeros, leaving
> the device non-functional until the user has intentionally set either
> an LAA through the VF itself, or an administratively assigned MAC
> through the ip tool via the PF.
> 
> Use of the random MAC address is not recommended by Intel's own best
> known methods literature, it was used mostly so that we could get the
> technology working and it should probably be at least considered for
> deprecation or out right elimination.
> 

It would be great to remove the bits that created random MAC addresses
for VFs, but wouldn't that break Linus' rule to "not break userspace" if
it was removed?

There are 2 options that immediately come to mind when looking to
resolve this: 

1.  Use some of the left-over bits in the mailbox messages to pass along
a flag with the E1000_VF_RESET messages to indicate whether the MAC was
randomly generated.  This would be pretty easy, but there could be
compatibility issues for a while.

2.  Default to a MAC address of all zeros, and as a device with
all-zeros for a MAC is brought up, randomly create one with
eth_hw_addr_random.  This may not immediately help cases where device
assignment are a problem, but it would ensure that any device with a
random MAC as assigned by the kernel, would have NET_ADDR_RANDOM set in
addr_assign_type.

^ permalink raw reply

* Re: [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove
From: David Miller @ 2013-01-14 23:10 UTC (permalink / raw)
  To: hkchu; +Cc: eric.dumazet, netdev, ketkulka, ycheng
In-Reply-To: <CAPshTCiNcSPbC7uCzo5MV2tGuZyoCwyE_XKcGb9smknZ8Rqb2w@mail.gmail.com>

From: Jerry Chu <hkchu@google.com>
Date: Mon, 14 Jan 2013 00:26:26 -0800

> On Sun, Jan 13, 2013 at 8:21 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> spin_is_locked() on a non !SMP build is kind of useless.
>>
>> BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.
>>
>> Just remove this check in reqsk_fastopen_remove() as
>> the callers do hold the socket lock.
>>
>> Reported-by: Ketan Kulkarni <ketkulka@gmail.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
 ...
> Thanks, Eric. (I thought the assertion would be transparent to UP...)
> 
> Acked-by: H.K. Jerry Chu <hkchu@google.com>
> 

Applied, thanks.

^ permalink raw reply

* Re: [RFC PATCH v3] cgroup: net_cls: traffic counter based on classification control cgroup
From: David Miller @ 2013-01-14 23:12 UTC (permalink / raw)
  To: a.perevalov-Sze3O3UU22JBDgjK7y7TUQ
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	glommer-bzQdu9zFT3WakBO8gow8eQ, wagi-kQCPcA+X3s7YtjvyW6yDsg,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ
In-Reply-To: <50F3B63B.6050104-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>


Your email client has corrupted this patch.  Amongst other things, it
turned tab characters into spaces.

You need to correct this and submit your patch cleanly before people
are likely to review it.

I would advise that you email the patch to yourself, and only once
you are able to send yourself a patch that does not get corrupted
should you try to resubmit it here.

Thank you.

^ permalink raw reply

* Re: [Patch net-next v3] netpoll: fix a rtnl lock assertion failure
From: David Miller @ 2013-01-14 23:13 UTC (permalink / raw)
  To: eric.dumazet; +Cc: amwang, netdev, jiri
In-Reply-To: <1358183396.8744.3100.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 14 Jan 2013 09:09:56 -0800

> On Mon, 2013-01-14 at 09:07 -0800, Eric Dumazet wrote:
> 
>> Strange, why dont we call netdev_master_upper_dev_get() instead ?
>> 
>> 
> 
> What I meant is : the result of this check might be of little use, if we
> don't hold any lock preventing another thread to change things behind
> us.

Agreed, this test is going to be racey.

^ permalink raw reply

* Re: [PATCH 0/2] Fix some multiqueue TUN problems
From: David Miller @ 2013-01-14 23:17 UTC (permalink / raw)
  To: pmoore; +Cc: netdev, linux-security-module, selinux
In-Reply-To: <20130114170837.31874.78897.stgit@localhost>

From: Paul Moore <pmoore@redhat.com>
Date: Mon, 14 Jan 2013 12:12:06 -0500

> No significant changes to this patchset since the last posting, just a
> slight merge with the recent changes in tun_set_queue() and some
> Acked-by and Tested-by additions.  I believe all the concerns have been
> addressed and this patch is ready for merging.
> 
> Dave, I think it makes the most sense for this to get pulled in via the
> netdev tree but if you think otherwise let me know and I'll go bug
> James and Eric.

Series applied, thanks Paul.

^ permalink raw reply

* [PATCH 3/3] netfilter: x_tables: print correct hook names for ARP
From: pablo @ 2013-01-14 23:24 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1358205845-8522-1-git-send-email-pablo@netfilter.org>

From: Jan Engelhardt <jengelh@inai.de>

arptables 0.0.4 (released on 10th Jan 2013) supports calling the
CLASSIFY target, but on adding a rule to the wrong chain, the
diagnostic is as follows:

	# arptables -A INPUT -j CLASSIFY --set-class 0:0
	arptables: Invalid argument
	# dmesg | tail -n1
	x_tables: arp_tables: CLASSIFY target: used from hooks
	PREROUTING, but only usable from INPUT/FORWARD

This is incorrect, since xt_CLASSIFY.c does specify
(1 << NF_ARP_OUT) | (1 << NF_ARP_FORWARD).

This patch corrects the x_tables diagnostic message to print the
proper hook names for the NFPROTO_ARP case.

Affects all kernels down to and including v2.6.31.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/x_tables.c |   28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 8d987c3..7b3a9e5 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -345,19 +345,27 @@ int xt_find_revision(u8 af, const char *name, u8 revision, int target,
 }
 EXPORT_SYMBOL_GPL(xt_find_revision);
 
-static char *textify_hooks(char *buf, size_t size, unsigned int mask)
+static char *
+textify_hooks(char *buf, size_t size, unsigned int mask, uint8_t nfproto)
 {
-	static const char *const names[] = {
+	static const char *const inetbr_names[] = {
 		"PREROUTING", "INPUT", "FORWARD",
 		"OUTPUT", "POSTROUTING", "BROUTING",
 	};
-	unsigned int i;
+	static const char *const arp_names[] = {
+		"INPUT", "FORWARD", "OUTPUT",
+	};
+	const char *const *names;
+	unsigned int i, max;
 	char *p = buf;
 	bool np = false;
 	int res;
 
+	names = (nfproto == NFPROTO_ARP) ? arp_names : inetbr_names;
+	max   = (nfproto == NFPROTO_ARP) ? ARRAY_SIZE(arp_names) :
+	                                   ARRAY_SIZE(inetbr_names);
 	*p = '\0';
-	for (i = 0; i < ARRAY_SIZE(names); ++i) {
+	for (i = 0; i < max; ++i) {
 		if (!(mask & (1 << i)))
 			continue;
 		res = snprintf(p, size, "%s%s", np ? "/" : "", names[i]);
@@ -402,8 +410,10 @@ int xt_check_match(struct xt_mtchk_param *par,
 		pr_err("%s_tables: %s match: used from hooks %s, but only "
 		       "valid from %s\n",
 		       xt_prefix[par->family], par->match->name,
-		       textify_hooks(used, sizeof(used), par->hook_mask),
-		       textify_hooks(allow, sizeof(allow), par->match->hooks));
+		       textify_hooks(used, sizeof(used), par->hook_mask,
+		                     par->family),
+		       textify_hooks(allow, sizeof(allow), par->match->hooks,
+		                     par->family));
 		return -EINVAL;
 	}
 	if (par->match->proto && (par->match->proto != proto || inv_proto)) {
@@ -575,8 +585,10 @@ int xt_check_target(struct xt_tgchk_param *par,
 		pr_err("%s_tables: %s target: used from hooks %s, but only "
 		       "usable from %s\n",
 		       xt_prefix[par->family], par->target->name,
-		       textify_hooks(used, sizeof(used), par->hook_mask),
-		       textify_hooks(allow, sizeof(allow), par->target->hooks));
+		       textify_hooks(used, sizeof(used), par->hook_mask,
+		                     par->family),
+		       textify_hooks(allow, sizeof(allow), par->target->hooks,
+		                     par->family));
 		return -EINVAL;
 	}
 	if (par->target->proto && (par->target->proto != proto || inv_proto)) {
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH 0/3] netfilter fixes for 3.8-rc3
From: pablo @ 2013-01-14 23:24 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev

From: Pablo Neira Ayuso <pablo@netfilter.org>

Hi David,

The following patchset contains netfilter fixes for 3.8-rc3,
they are:

* fix possible BUG_ON if several netns are in use and the nf_conntrack
  module is removed, initial patch from Gao feng, final patch from myself.

* fix unset return value if conntrack zone are disabled at
  compile-time, reported by Borislav Petkov, fix from myself.

* fix display error message via dmesg for arp_tables, from Jan Engelhardt.

You can pull these changes from:

git://1984.lsi.us.es/nf master

Thanks!

Jan Engelhardt (1):
  netfilter: x_tables: print correct hook names for ARP

Pablo Neira Ayuso (2):
  netfilter: xt_CT: fix unset return value if conntrack zone are disabled
  netfilter: nf_conntrack: fix BUG_ON while removing nf_conntrack with netns

 include/net/netfilter/nf_conntrack_core.h |    2 ++
 net/netfilter/nf_conntrack_core.c         |    9 +++++----
 net/netfilter/nf_conntrack_standalone.c   |    1 +
 net/netfilter/x_tables.c                  |   28 ++++++++++++++++++++--------
 net/netfilter/xt_CT.c                     |    4 ++--
 5 files changed, 30 insertions(+), 14 deletions(-)

-- 
1.7.10.4

^ permalink raw reply

* [PATCH 1/3] netfilter: xt_CT: fix unset return value if conntrack zone are disabled
From: pablo @ 2013-01-14 23:24 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1358205845-8522-1-git-send-email-pablo@netfilter.org>

From: Pablo Neira Ayuso <pablo@netfilter.org>

net/netfilter/xt_CT.c: In function ‘xt_ct_tg_check_v1’:
net/netfilter/xt_CT.c:250:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
net/netfilter/xt_CT.c: In function ‘xt_ct_tg_check_v0’:
net/netfilter/xt_CT.c:112:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Reported-by: Borislav Petkov <bp@alien8.de>
Acked-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/xt_CT.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 2a08430..bde009e 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -109,7 +109,7 @@ static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
 	struct xt_ct_target_info *info = par->targinfo;
 	struct nf_conntrack_tuple t;
 	struct nf_conn *ct;
-	int ret;
+	int ret = -EOPNOTSUPP;
 
 	if (info->flags & ~XT_CT_NOTRACK)
 		return -EINVAL;
@@ -247,7 +247,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
 	struct xt_ct_target_info_v1 *info = par->targinfo;
 	struct nf_conntrack_tuple t;
 	struct nf_conn *ct;
-	int ret;
+	int ret = -EOPNOTSUPP;
 
 	if (info->flags & ~XT_CT_NOTRACK)
 		return -EINVAL;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/3] netfilter: nf_conntrack: fix BUG_ON while removing nf_conntrack with netns
From: pablo @ 2013-01-14 23:24 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1358205845-8522-1-git-send-email-pablo@netfilter.org>

From: Pablo Neira Ayuso <pablo@netfilter.org>

canqun zhang reported that we're hitting BUG_ON in the
nf_conntrack_destroy path when calling kfree_skb while
rmmod'ing the nf_conntrack module.

Currently, the nf_ct_destroy hook is being set to NULL in the
destroy path of conntrack.init_net. However, this is a problem
since init_net may be destroyed before any other existing netns
(we cannot assume any specific ordering while releasing existing
netns according to what I read in recent emails).

Thanks to Gao feng for initial patch to address this issue.

Reported-by: canqun zhang <canqunzhang@gmail.com>
Acked-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/net/netfilter/nf_conntrack_core.h |    2 ++
 net/netfilter/nf_conntrack_core.c         |    9 +++++----
 net/netfilter/nf_conntrack_standalone.c   |    1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index d8f5b9f..e98aeb3 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -31,6 +31,8 @@ extern void nf_conntrack_cleanup(struct net *net);
 extern int nf_conntrack_proto_init(struct net *net);
 extern void nf_conntrack_proto_fini(struct net *net);
 
+extern void nf_conntrack_cleanup_end(void);
+
 extern bool
 nf_ct_get_tuple(const struct sk_buff *skb,
 		unsigned int nhoff,
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 016d95e..e4a0c4f 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1376,11 +1376,12 @@ void nf_conntrack_cleanup(struct net *net)
 	synchronize_net();
 	nf_conntrack_proto_fini(net);
 	nf_conntrack_cleanup_net(net);
+}
 
-	if (net_eq(net, &init_net)) {
-		RCU_INIT_POINTER(nf_ct_destroy, NULL);
-		nf_conntrack_cleanup_init_net();
-	}
+void nf_conntrack_cleanup_end(void)
+{
+	RCU_INIT_POINTER(nf_ct_destroy, NULL);
+	nf_conntrack_cleanup_init_net();
 }
 
 void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 363285d..e7185c6 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -575,6 +575,7 @@ static int __init nf_conntrack_standalone_init(void)
 static void __exit nf_conntrack_standalone_fini(void)
 {
 	unregister_pernet_subsys(&nf_conntrack_net_ops);
+	nf_conntrack_cleanup_end();
 }
 
 module_init(nf_conntrack_standalone_init);
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH 0/3] netfilter fixes for 3.8-rc3
From: David Miller @ 2013-01-14 23:27 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1358205845-8522-1-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Tue, 15 Jan 2013 00:24:02 +0100

> From: Pablo Neira Ayuso <pablo@netfilter.org>
> 
> Hi David,
> 
> The following patchset contains netfilter fixes for 3.8-rc3,
> they are:
> 
> * fix possible BUG_ON if several netns are in use and the nf_conntrack
>   module is removed, initial patch from Gao feng, final patch from myself.
> 
> * fix unset return value if conntrack zone are disabled at
>   compile-time, reported by Borislav Petkov, fix from myself.
> 
> * fix display error message via dmesg for arp_tables, from Jan Engelhardt.
> 
> You can pull these changes from:
> 
> git://1984.lsi.us.es/nf master

Pulled, thanks Pablo.

^ permalink raw reply

* Re: [PATCH] atm: fore200e.c: fix uninitialized variable
From: David Miller @ 2013-01-14 23:30 UTC (permalink / raw)
  To: dinggnu; +Cc: chas, linux-atm-general, netdev, linux-kernel
In-Reply-To: <1358189864-28735-1-git-send-email-dinggnu@gmail.com>

From: Cong Ding <dinggnu@gmail.com>
Date: Mon, 14 Jan 2013 18:57:43 +0000

> the variable err is uninitialized if all the macros in the function are
> disabled.

Which is never possible because of the Kconfig dependencies.

This is what happens when you focus to narrowly on a piece of
code, you take no context whatsoever into consideration.

^ permalink raw reply

* Re: [PATCH 0/5]: soreuseport: Bind multiple sockets to the same port
From: Vijay Subramanian @ 2013-01-14 23:35 UTC (permalink / raw)
  To: David Miller; +Cc: therbert, netdev, netdev, eric.dumazet
In-Reply-To: <20130114.152906.967716859913059764.davem@davemloft.net>

On 14 January 2013 12:29, David Miller <davem@davemloft.net> wrote:
> From: Tom Herbert <therbert@google.com>
> Date: Mon, 14 Jan 2013 12:00:16 -0800 (PST)
>
>> Rebasing the soreuseport patches to 3.8.  No material changes since
>> first posted.

Tom,
I am not sure if this series was just RFC or you already are aware of
this but  I got the following errors when compiling with
CONFIG_NETFILTER_TPROXY=m

This is because the definitions of inet_lookup_listener  and
inet6_lookup_listener have changed with your patch.

In file included from net/netfilter/nf_tproxy_core.c:19:
include/net/netfilter/nf_tproxy_core.h: In function ‘nf_tproxy_get_sock_v4’:
include/net/netfilter/nf_tproxy_core.h:86: error: too few arguments to
function ‘inet_lookup_listener’
include/net/netfilter/nf_tproxy_core.h: In function ‘nf_tproxy_get_sock_v6’:
include/net/netfilter/nf_tproxy_core.h:155: warning: passing argument
5 of ‘inet6_lookup_listener’ makes pointer from integer without a cast
include/net/inet6_hashtables.h:72: note: expected ‘const struct
in6_addr *’ but argument is of type ‘int’
include/net/netfilter/nf_tproxy_core.h:155: error: too few arguments
to function ‘inet6_lookup_listener’
make[1]: *** [net/netfilter/nf_tproxy_core.o] Error 1
make[1]: *** Waiting for unfinished jobs....


Thanks,
Vijay

^ permalink raw reply

* Re: [libvirt] if_bridge.h: include in6.h for struct in6_addr use
From: Eric Blake @ 2013-01-14 23:57 UTC (permalink / raw)
  To: Thomas Backlund; +Cc: netdev, linux-kernel, libvirt-list
In-Reply-To: <50F313A5.3020707@mageia.org>

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

On 01/13/2013 01:05 PM, Thomas Backlund wrote:
> Thomas Backlund skrev 13.1.2013 20:38:
>> patch both inline and attached as thunderbird tends to mess up ...
> 
>> -----
>>
>> if_bridge.h uses struct in6_addr ip6; but does not include the in6.h
>> header.
>>
>> Found by trying to build libvirt and connman against 3.8-rc3 headers.
>>
> 
> Ok,
> ignore this patch, it's not the correct fix as it introduces
> redefinitions...
> 
> Btw, the error that I hit that made me suggest this fix was libvirt
> config check bailing out:
> 
> config.log:/usr/include/linux/if_bridge.h:173:20: error: field 'ip6' has
> incomplete type

Hmm, just now noticing this thread, after independently hitting and and
having to work around the same problem in libvirt:
https://www.redhat.com/archives/libvir-list/2013-January/msg00930.html
https://bugzilla.redhat.com/show_bug.cgi?id=895141

>> --- linux-3.8-rc3/include/uapi/linux/if_bridge.h        2013-01-13
>> 20:09:54.257271755 +0200
>> +++ linux-3.8-rc3.fix/include/uapi/linux/if_bridge.h    2013-01-13
>> 20:15:04.153676151 +0200
>> @@ -14,6 +14,7 @@
>>   #define _UAPI_LINUX_IF_BRIDGE_H
>>
>>   #include <linux/types.h>
>> +#include <linux/in6.h>
>>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply

* Re: [PATCH] CDC_NCM adding support IFF_NOARP for infineon modem platform
From: Peter Stuge @ 2013-01-15  0:41 UTC (permalink / raw)
  To: David Miller
  Cc: dcbw, cpuwolf, gregkh, alexey.orishko, bjorn, linux-usb, netdev
In-Reply-To: <20130114.133412.479351928049237212.davem@davemloft.net>

David Miller wrote:
> > should all WWAN drivers be moved to only POINTTOPOINT?
> 
> I can't answer any of your questions unless you tell me what the
> real limitation of these devices is.

It's rather about the network than any given devices, right?


//Peter

^ permalink raw reply

* Re: [PATCH 1/2] usbnet: allow status interrupt URB to always be active
From: Ming Lei @ 2013-01-15  1:13 UTC (permalink / raw)
  To: Dan Williams
  Cc: Oliver Neukum, Elina Pasheva, netdev, linux-usb, Rory Filer,
	Phil Sutter
In-Reply-To: <1358184201.1713.30.camel@dcbw.foobar.com>

On Tue, Jan 15, 2013 at 1:23 AM, Dan Williams <dcbw@redhat.com> wrote:
> On Fri, 2013-01-11 at 11:06 +0800, Ming Lei wrote:
>> I am curious who are interested in the 'custom Restart indication'
>> information after the interface is closed.
>
> It's actually before the interface is even opened.  It's really just a
> sync signal that's part of the driver's setup/initialization of the
> device.

OK, got it.

Considered that it is only required by Sierra, could you submit
the status URB in driver->bind and cancel it in driver->reset so
we can avoid touching usbnet core code(one simple change
might be to move init_status() before calling driver->info()
inside usbnet_probe())?

>
>> If sierra_net provides ways(such as read registers) to query the
>> indication event, you can just query the information and setup
>> the device in driver_info->reset() during device open, so you can
>> avoid submitting interrupt URB always.
>
> As far as I know, it does not, or at least Sierra hasn't released such
> information about the firmware API of their devices.

You are unlucky, :-)

In fact, many usbnet devices provide read command to query this kind of
information.


Thanks,
--
Ming Lei

^ 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