Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Fix stack corruption on some architectures
From: David Miller @ 2013-08-21  6:29 UTC (permalink / raw)
  To: daniel-R/FLGEdV95bo9U+Z1CfBt0SU0eOFXohjCypLqA8HKkk
  Cc: j.dumon-x9gZzRpC1QbQT0dZR+AlfA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1376944647.5082.12.camel@chimera>


Please submit this with a more appropriate subject line.

After '[PATCH] ' there should be a subsystem or driver name
prefix, followed up a semicolon.  Here it could be "hso: ",
so something like:

[PATCH] hso: Fix stack corruption on some architectures.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: [PATCH] Passing sk_buff metadata information to user space in TUNTAP driver.
From: David Miller @ 2013-08-21  6:28 UTC (permalink / raw)
  To: zenczykowski; +Cc: vytautas.valancius, valas, edumazet, netdev
In-Reply-To: <CAHo-Ooy4S8tzOBqZQJEEvkAqMJdYCf2XTYZpkFHk=PZJP7z-Ng@mail.gmail.com>

From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Mon, 19 Aug 2013 13:49:08 -0700

> Acked-by: Maciej Żenczykowski <maze@google.com>
> 
> I've already reviewed / commented on previous versions of this patch
> and am hoping for comments from a wider audience.
> 
> I'm hoping this relatively generic and easily extensible way of
> exposing additional per-packet metadata to userspace catches on.
> Something similar would also be useful for tcpdump (ie. raw packet sockets).

I'd rather people build generic infrastructure for this.

We already have a META match in the packet scheduler, and all sorts
of BPF extensions which provide SKB metadata too.  That's the right
approach, something more generic.

Therefore, putting a custom version of SKB metadata export into the
TUN driver makes absolutely no sense to me.

I'm not applying this, sorry.

^ permalink raw reply

* Re: [PATCH 1/4] tun: Add ability to create tun device with given index
From: David Miller @ 2013-08-21  6:26 UTC (permalink / raw)
  To: xemul; +Cc: netdev
In-Reply-To: <5212352C.4050904@parallels.com>

From: Pavel Emelyanov <xemul@parallels.com>
Date: Mon, 19 Aug 2013 19:09:32 +0400

> +		unsigned ifindex;

Please use explicitly "unsigned int"

> +	unsigned ifindex;

Likewise.

^ permalink raw reply

* Re: [PATCH 5/7] bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
From: David Miller @ 2013-08-21  6:22 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <1376911241-27720-6-git-send-email-Julia.Lawall@lip6.fr>

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon, 19 Aug 2013 13:20:39 +0200

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The relevant call to platform_get_resource was manually moved down to the
> call to devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH v2 2/2] net: netem: always adjust now/delay when not reordering
From: Eric Dumazet @ 2013-08-21  6:14 UTC (permalink / raw)
  To: Ferry Huberts; +Cc: netdev
In-Reply-To: <1377064785-12629-1-git-send-email-mailings@hupie.com>

On Wed, 2013-08-21 at 07:59 +0200, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts@pelagic.nl>
> 
> Not doing this (current behaviour) introduces reordering.
> 
> The packet_len_2_sched_time call is the only thing that logically
> depends on q->rate, so move the now/delay adjustment out of the if.
> 
> How to test:
> -----------

I ask again :

Did you test a config with both rate limiting and delay.

Netem primary use is to emulate say a 1Mbits link with a rtt of 50ms

netem rate 1Mbit delay 50ms


Because the "delay 10ms 500ms" is very strange : effective delay is in
the following range : -490 ms ... 510 ms

Its probably clamped to 0ms ... 510ms

I really doubt this is what you wanted.

^ permalink raw reply

* Re: [Patch net-next v3 0/9] net: introduce generic type and helpers for IP address
From: David Miller @ 2013-08-21  6:11 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1376907278-26377-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Mon, 19 Aug 2013 18:14:29 +0800

> From: Cong Wang <amwang@redhat.com>
> 
> As IPv6 becomes popular, more and more subsystems begin to support IPv6,
> therefore we need a generic IP address type, in case of duplicates.
> Also we will also need some helpers to compare, print, check the generic
> IP address.
> 
> This patchset introduce a new type union inet_addr as a union of IPv4
> and IPv6 address, and struct in_addr_gen for inetpeer and bridge mdb,
> plus some helper functions that will be used by existing code and
> in the future VXLAN module.
> 
> However, due to ABI limit, we still can't convert union nf_inet_addr
> to union inet_addr.
> 
> Signed-off-by: Cong Wang <amwang@redhat.com>

I still don't want to apply this patch series, and very honestly my
patience is running very thin.

Netconsole and netpoll do not need the family field, and they
absolutely do not need the port field that a sockaddr_in et
al. provide.

So you have to get rid of it, and do the same simplification
everywhere.  So I don't have to tell you to do it again when
you resubmit this stuff and the next patch I get to has the
same exact problem.

If this patch series doesn't converge upon adding absolutely zero
overhead where it isn't needed I'm just going to auto-reject these
patches when you post them, that's how frustrated I am with this
stuff.

If in the process of commonizing you add stuff where it isn't needed
then you're doing it wrong.

That's why all these places use a different data structure!  They have
different needs.  Can you see that?

^ permalink raw reply

* [PATCH v2 2/2] net: netem: always adjust now/delay when not reordering
From: Ferry Huberts @ 2013-08-21  5:59 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1377030800.4226.89.camel@edumazet-glaptop>

From: Ferry Huberts <ferry.huberts@pelagic.nl>

Not doing this (current behaviour) introduces reordering.

The packet_len_2_sched_time call is the only thing that logically
depends on q->rate, so move the now/delay adjustment out of the if.

How to test:
------------
- Create a script to ping the default gateway using a queueing discipline:
cat > ./netemreordering << "EOF"
fields=( $(route -n | grep -E '^0.0.0.0\b' | awk '{ print $2 " " $NF; }') )
tc qdisc del dev "${fields[1]}" root
tc qdisc add dev "${fields[1]}" handle 1 root netem delay 10ms 500ms
ping -c 10 -i 0.1 -W 18 "${fields[0]}"
tc qdisc del dev "${fields[1]}" root
EOF
chmod 755 ./netemreordering
- Run the script:
sudo ./netemreordering


Current Behaviour:
------------------
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=111 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=311 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=201 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=412 ms
64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=58.1 ms
64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=168 ms
64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=379 ms
64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=171 ms
64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=62.0 ms
64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=491 ms

--- 10.0.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 961ms
rtt min/avg/max/mdev = 58.105/236.707/491.683/144.911 ms, pipe 5


Fixed Behaviour:
----------------
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=244 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=135 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=188 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=87.7 ms
64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=207 ms
64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=107 ms
64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=199 ms
64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=98.4 ms
64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=61.0 ms
64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=295 ms

--- 10.0.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 912ms
rtt min/avg/max/mdev = 61.002/162.580/295.638/72.336 ms, pipe 3


v2:
- fix checkpatch 'braces' warning
- add more comments on how to test

Reported-by: Teco Boot <teco@inf-net.nl>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
 net/sched/sch_netem.c | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index abe5fa6..64e0653 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -457,6 +457,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	if (q->gap == 0 || q->reorder == 0 || /* not doing reordering */
 	    q->counter < q->gap - 1 ||	/* inside last reordering gap */
 	    q->reorder < get_crandom(&q->reorder_cor)) {
+		struct sk_buff *last;
+
 		psched_time_t now;
 		psched_tdiff_t delay;
 
@@ -465,26 +467,23 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
 		now = psched_get_time();
 
-		if (q->rate) {
-			struct sk_buff *last;
-
-			if (!skb_queue_empty(&sch->q))
-				last = skb_peek_tail(&sch->q);
-			else
-				last = netem_rb_to_skb(rb_last(&q->t_root));
-			if (last) {
-				/*
-				 * Last packet in queue is reference point (now),
-				 * calculate this time bonus and subtract
-				 * from delay.
-				 */
-				delay -= netem_skb_cb(last)->time_to_send - now;
-				delay = max_t(psched_tdiff_t, 0, delay);
-				now = netem_skb_cb(last)->time_to_send;
-			}
+		if (!skb_queue_empty(&sch->q))
+			last = skb_peek_tail(&sch->q);
+		else
+			last = netem_rb_to_skb(rb_last(&q->t_root));
+		if (last) {
+			/*
+			 * Last packet in queue is reference point (now),
+			 * calculate this time bonus and subtract
+			 * from delay.
+			 */
+			delay -= netem_skb_cb(last)->time_to_send - now;
+			delay = max_t(psched_tdiff_t, 0, delay);
+			now = netem_skb_cb(last)->time_to_send;
+		}
 
+		if (q->rate)
 			delay += packet_len_2_sched_time(skb->len, q);
-		}
 
 		cb->time_to_send = now + delay;
 		cb->tstamp_save = skb->tstamp;
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH (net.git) 2/2] stmmac: remove useless csum flag
From: Giuseppe CAVALLARO @ 2013-08-21  5:28 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro, Sonic Zhang
In-Reply-To: <1377062908-16543-1-git-send-email-peppe.cavallaro@st.com>

This patch removes the no_csum_insertion private parameter that is not used anymore
and, also,  the "likely" annotation from the condition that is not in a critical path.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      |    1 -
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    3 +--
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index c922fde..f16a9bd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -70,7 +70,6 @@ struct stmmac_priv {
 	struct net_device *dev;
 	struct device *device;
 	struct mac_device_info *hw;
-	int no_csum_insertion;
 	spinlock_t lock;
 
 	struct phy_device *phydev ____cacheline_aligned_in_smp;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 45ca081..dbba2c2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1239,8 +1239,7 @@ static void free_dma_desc_resources(struct stmmac_priv *priv)
  */
 static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
 {
-	if (likely(priv->plat->force_sf_dma_mode ||
-		   ((priv->plat->tx_coe) && (!priv->no_csum_insertion)))) {
+	if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) {
 		/*
 		 * In case of GMAC, SF mode can be enabled
 		 * to perform the TX COE in HW. This depends on:
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH (net.git) 1/2 (v2)] stmmac: disable at run-time the EEE if not supported
From: Giuseppe CAVALLARO @ 2013-08-21  5:28 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

This patch is to disable the EEE (so HW and timers)
for example when the phy communicates that the EEE
can be supported nomore.

v2: clean the patch removing an useless change

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   23 +++++++++++++++++---
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0a9bb9d..45ca081 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -285,10 +285,25 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
 
 	/* MAC core supports the EEE feature. */
 	if (priv->dma_cap.eee) {
+		int tx_lpi_timer = priv->tx_lpi_timer;
+
 		/* Check if the PHY supports EEE */
-		if (phy_init_eee(priv->phydev, 1))
+		if (phy_init_eee(priv->phydev, 1)) {
+			/* To manage at run-time if the EEE cannot be supported
+			 * anymore (for example becasue the lp caps have been
+			 * changed).
+			 * In that case the driver disable own timers.
+			 */
+			if (priv->eee_active) {
+				pr_debug("stmmac: disable EEE\n");
+				del_timer_sync(&priv->eee_ctrl_timer);
+				priv->hw->mac->set_eee_timer(priv->ioaddr, 0,
+							     tx_lpi_timer);
+			}
+			priv->eee_active = 0;
 			goto out;
-
+		}
+		/* Activate the EEE and start timers */
 		if (!priv->eee_active) {
 			priv->eee_active = 1;
 			init_timer(&priv->eee_ctrl_timer);
@@ -299,13 +314,13 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
 
 			priv->hw->mac->set_eee_timer(priv->ioaddr,
 						     STMMAC_DEFAULT_LIT_LS,
-						     priv->tx_lpi_timer);
+						     tx_lpi_timer);
 		} else
 			/* Set HW EEE according to the speed */
 			priv->hw->mac->set_eee_pls(priv->ioaddr,
 						   priv->phydev->link);
 
-		pr_info("stmmac: Energy-Efficient Ethernet initialized\n");
+		pr_debug("stmmac: Energy-Efficient Ethernet initialized\n");
 
 		ret = true;
 	}
-- 
1.7.4.4

^ permalink raw reply related

* Re: [PATCH] netns: unix: only allow to find out unix socket in same net namespace
From: Eric W. Biederman @ 2013-08-21  5:30 UTC (permalink / raw)
  To: Gao feng
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Linux Containers,
	systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	lxc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1377059473-25526-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>

Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> writes:

> Unix sockets are private resources of net namespace,
> allowing one net namespace to access to other netns's unix
> sockets is meaningless.

Allowing one net namespace to access another netns's unix socket is
deliberate behavior.  This is a desired and useful feature, and
only a misconfiguration of visible files would allow this to be a
problem.

> I'm researching a problem about shutdown from container,
> if the cotainer shares the same file /run/systemd/private
> with host, when we run shutdown -h xxx in container, the
> shutdown message will be send to the systemd-shutdownd
> through unix socket /run/systemd/private, and because
> systemd-shutdownd is running in host, so finally, the host
> will become shutdown.

The simple answer is don't do that then.  I can see no reason
to share /run outside of the container unless you want this kind of
behavior.

Quite frankly I want this behavior if I am using network namespaces
to support multiple routing contexts. That is if I am using scripts
like:

ip netns add other
ip netns exec other script

I don't want to have to remember to say 
ip netns orig exec shutdown -h now

There are more compelling uses and there is no cost in supporting this
in the kernel.

What kind of misconfiguration caused someone to complain about this?


> We should make sure unix sockets are per net namespace to
> avoid this problem.

Nacked-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>


> Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> ---
>  net/unix/af_unix.c |  8 ++++++--
>  net/unix/diag.c    | 11 ++++++++---
>  2 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index c4ce243..98e3689 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -295,7 +295,8 @@ static inline struct sock *unix_find_socket_byname(struct net *net,
>  	return s;
>  }
>  
> -static struct sock *unix_find_socket_byinode(struct inode *i)
> +static struct sock *unix_find_socket_byinode(struct net *net,
> +					     struct inode *i)
>  {
>  	struct sock *s;
>  
> @@ -304,6 +305,9 @@ static struct sock *unix_find_socket_byinode(struct inode *i)
>  		    &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
>  		struct dentry *dentry = unix_sk(s)->path.dentry;
>  
> +		if (!net_eq(sock_net(s), net))
> +			continue;
> +
>  		if (dentry && dentry->d_inode == i) {
>  			sock_hold(s);
>  			goto found;
> @@ -784,7 +788,7 @@ static struct sock *unix_find_other(struct net *net,
>  		err = -ECONNREFUSED;
>  		if (!S_ISSOCK(inode->i_mode))
>  			goto put_fail;
> -		u = unix_find_socket_byinode(inode);
> +		u = unix_find_socket_byinode(net, inode);
>  		if (!u)
>  			goto put_fail;
>  
> diff --git a/net/unix/diag.c b/net/unix/diag.c
> index d591091..80ada12 100644
> --- a/net/unix/diag.c
> +++ b/net/unix/diag.c
> @@ -218,20 +218,25 @@ done:
>  	return skb->len;
>  }
>  
> -static struct sock *unix_lookup_by_ino(int ino)
> +static struct sock *unix_lookup_by_ino(struct net *net, int ino)
>  {
>  	int i;
>  	struct sock *sk;
>  
>  	spin_lock(&unix_table_lock);
>  	for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) {
> -		sk_for_each(sk, &unix_socket_table[i])
> +		sk_for_each(sk, &unix_socket_table[i]) {
> +
> +			if (!net_eq(sock_net(sk), net))
> +				continue;
> +
>  			if (ino == sock_i_ino(sk)) {
>  				sock_hold(sk);
>  				spin_unlock(&unix_table_lock);
>  
>  				return sk;
>  			}
> +		}
>  	}
>  
>  	spin_unlock(&unix_table_lock);
> @@ -251,7 +256,7 @@ static int unix_diag_get_exact(struct sk_buff *in_skb,
>  	if (req->udiag_ino == 0)
>  		goto out_nosk;
>  
> -	sk = unix_lookup_by_ino(req->udiag_ino);
> +	sk = unix_lookup_by_ino(net, req->udiag_ino);
>  	err = -ENOENT;
>  	if (sk == NULL)
>  		goto out_nosk;

^ permalink raw reply

* Re: [PATCH] netns: unix: only allow to find out unix socket in same net namespace
From: Gao feng @ 2013-08-21  4:58 UTC (permalink / raw)
  To: Gao feng
  Cc: systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	netdev-u79uwXL29TY76Z2rM5mHXA, Linux Containers,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w,
	lxc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <1377059473-25526-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>

cc containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org

On 08/21/2013 12:31 PM, Gao feng wrote:
> Unix sockets are private resources of net namespace,
> allowing one net namespace to access to other netns's unix
> sockets is meaningless.
> 
> I'm researching a problem about shutdown from container,
> if the cotainer shares the same file /run/systemd/private
> with host, when we run shutdown -h xxx in container, the
> shutdown message will be send to the systemd-shutdownd
> through unix socket /run/systemd/private, and because
> systemd-shutdownd is running in host, so finally, the host
> will become shutdown.
> 
> We should make sure unix sockets are per net namespace to
> avoid this problem.
> 
> Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> ---
>  net/unix/af_unix.c |  8 ++++++--
>  net/unix/diag.c    | 11 ++++++++---
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index c4ce243..98e3689 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -295,7 +295,8 @@ static inline struct sock *unix_find_socket_byname(struct net *net,
>  	return s;
>  }
>  
> -static struct sock *unix_find_socket_byinode(struct inode *i)
> +static struct sock *unix_find_socket_byinode(struct net *net,
> +					     struct inode *i)
>  {
>  	struct sock *s;
>  
> @@ -304,6 +305,9 @@ static struct sock *unix_find_socket_byinode(struct inode *i)
>  		    &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
>  		struct dentry *dentry = unix_sk(s)->path.dentry;
>  
> +		if (!net_eq(sock_net(s), net))
> +			continue;
> +
>  		if (dentry && dentry->d_inode == i) {
>  			sock_hold(s);
>  			goto found;
> @@ -784,7 +788,7 @@ static struct sock *unix_find_other(struct net *net,
>  		err = -ECONNREFUSED;
>  		if (!S_ISSOCK(inode->i_mode))
>  			goto put_fail;
> -		u = unix_find_socket_byinode(inode);
> +		u = unix_find_socket_byinode(net, inode);
>  		if (!u)
>  			goto put_fail;
>  
> diff --git a/net/unix/diag.c b/net/unix/diag.c
> index d591091..80ada12 100644
> --- a/net/unix/diag.c
> +++ b/net/unix/diag.c
> @@ -218,20 +218,25 @@ done:
>  	return skb->len;
>  }
>  
> -static struct sock *unix_lookup_by_ino(int ino)
> +static struct sock *unix_lookup_by_ino(struct net *net, int ino)
>  {
>  	int i;
>  	struct sock *sk;
>  
>  	spin_lock(&unix_table_lock);
>  	for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) {
> -		sk_for_each(sk, &unix_socket_table[i])
> +		sk_for_each(sk, &unix_socket_table[i]) {
> +
> +			if (!net_eq(sock_net(sk), net))
> +				continue;
> +
>  			if (ino == sock_i_ino(sk)) {
>  				sock_hold(sk);
>  				spin_unlock(&unix_table_lock);
>  
>  				return sk;
>  			}
> +		}
>  	}
>  
>  	spin_unlock(&unix_table_lock);
> @@ -251,7 +256,7 @@ static int unix_diag_get_exact(struct sk_buff *in_skb,
>  	if (req->udiag_ino == 0)
>  		goto out_nosk;
>  
> -	sk = unix_lookup_by_ino(req->udiag_ino);
> +	sk = unix_lookup_by_ino(net, req->udiag_ino);
>  	err = -ENOENT;
>  	if (sk == NULL)
>  		goto out_nosk;
> 

^ permalink raw reply

* [PATCH] netns: unix: only allow to find out unix socket in same net namespace
From: Gao feng @ 2013-08-21  4:31 UTC (permalink / raw)
  To: netdev; +Cc: systemd-devel, lxc-devel, ebiederm, davem, Gao feng

Unix sockets are private resources of net namespace,
allowing one net namespace to access to other netns's unix
sockets is meaningless.

I'm researching a problem about shutdown from container,
if the cotainer shares the same file /run/systemd/private
with host, when we run shutdown -h xxx in container, the
shutdown message will be send to the systemd-shutdownd
through unix socket /run/systemd/private, and because
systemd-shutdownd is running in host, so finally, the host
will become shutdown.

We should make sure unix sockets are per net namespace to
avoid this problem.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/unix/af_unix.c |  8 ++++++--
 net/unix/diag.c    | 11 ++++++++---
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c4ce243..98e3689 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -295,7 +295,8 @@ static inline struct sock *unix_find_socket_byname(struct net *net,
 	return s;
 }
 
-static struct sock *unix_find_socket_byinode(struct inode *i)
+static struct sock *unix_find_socket_byinode(struct net *net,
+					     struct inode *i)
 {
 	struct sock *s;
 
@@ -304,6 +305,9 @@ static struct sock *unix_find_socket_byinode(struct inode *i)
 		    &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
 		struct dentry *dentry = unix_sk(s)->path.dentry;
 
+		if (!net_eq(sock_net(s), net))
+			continue;
+
 		if (dentry && dentry->d_inode == i) {
 			sock_hold(s);
 			goto found;
@@ -784,7 +788,7 @@ static struct sock *unix_find_other(struct net *net,
 		err = -ECONNREFUSED;
 		if (!S_ISSOCK(inode->i_mode))
 			goto put_fail;
-		u = unix_find_socket_byinode(inode);
+		u = unix_find_socket_byinode(net, inode);
 		if (!u)
 			goto put_fail;
 
diff --git a/net/unix/diag.c b/net/unix/diag.c
index d591091..80ada12 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -218,20 +218,25 @@ done:
 	return skb->len;
 }
 
-static struct sock *unix_lookup_by_ino(int ino)
+static struct sock *unix_lookup_by_ino(struct net *net, int ino)
 {
 	int i;
 	struct sock *sk;
 
 	spin_lock(&unix_table_lock);
 	for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) {
-		sk_for_each(sk, &unix_socket_table[i])
+		sk_for_each(sk, &unix_socket_table[i]) {
+
+			if (!net_eq(sock_net(sk), net))
+				continue;
+
 			if (ino == sock_i_ino(sk)) {
 				sock_hold(sk);
 				spin_unlock(&unix_table_lock);
 
 				return sk;
 			}
+		}
 	}
 
 	spin_unlock(&unix_table_lock);
@@ -251,7 +256,7 @@ static int unix_diag_get_exact(struct sk_buff *in_skb,
 	if (req->udiag_ino == 0)
 		goto out_nosk;
 
-	sk = unix_lookup_by_ino(req->udiag_ino);
+	sk = unix_lookup_by_ino(net, req->udiag_ino);
 	err = -ENOENT;
 	if (sk == NULL)
 		goto out_nosk;
-- 
1.8.3.1

^ permalink raw reply related

* linux-next: manual merge of the trivial tree with the net-next tree
From: Stephen Rothwell @ 2013-08-21  4:17 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-next, linux-kernel, Masanari Iida, Manish Chopra,
	David Miller, netdev

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

Hi Jiri,

Today's linux-next merge of the trivial tree got a conflict in
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c between commit
068a8d197e00 ("qlcnic: Replace poll mode mailbox interface with interrupt
based mailbox interface") from the  tree and commit 0b1587b18bfe
("treewide: Fix typo in printk") from the trivial tree.

I fixed it up (the former removed the line fixed by the latter, so I used
that) and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

^ permalink raw reply

* Re: [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option
From: Hannes Frederic Sowa @ 2013-08-21  3:04 UTC (permalink / raw)
  To: Duan Jiong; +Cc: davem, netdev
In-Reply-To: <52142209.6030406@cn.fujitsu.com>

On Wed, Aug 21, 2013 at 10:12:25AM +0800, Duan Jiong wrote:
> > Introducing a new function here is the right thing. Maybe you could have
> > a look how these redirects could be fed to raw sockets, too?
> > 
> Because of no Redirected Header option, so we don't have enough
> information to find out the related raw socket. So, there is no need
> to deal with that condition.

Ah, of course. I thought we could look up the socket solely by src and
dst address. I forgot about the protocol.

^ permalink raw reply

* Re: [PATCH net-next] myri10ge: Add support for ndo_busy_poll
From: Hyong-Youb Kim @ 2013-08-21  2:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20130820.150905.44199510198057625.davem@davemloft.net>


On Tue, 20 Aug 2013, David Miller wrote:

> From: Hyong-Youb Kim <hykim@myri.com>
> Date: Mon, 19 Aug 2013 02:02:19 -0700
>
> > Add the ndo_busy_poll handler. Use skb_mark_napi_id to mark receive
[...]
> > Signed-off-by: Hyong-Youb Kim <hykim@myri.com>
>
> Applied, but this patch had a ton of trailing whitespace which I had
> to fix up.
>

Thanks.  About whitespace on empty lines, it is my bad.  Did not run
checkpatch.  Will do a better job next time.

^ permalink raw reply

* Re: [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option
From: Duan Jiong @ 2013-08-21  2:12 UTC (permalink / raw)
  To: hannes; +Cc: davem, netdev
In-Reply-To: <20130820115020.GB3938@order.stressinduktion.org>

于 2013年08月20日 19:50, Hannes Frederic Sowa 写道:
> On Tue, Aug 20, 2013 at 03:13:41PM +0800, Duan Jiong wrote:
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -1178,6 +1178,28 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
>>  }
>>  EXPORT_SYMBOL_GPL(ip6_redirect);
>>  
>> +void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
>> +			    u32 mark)
>> +{
>> +	const struct ipv6hdr *iph = (struct ipv6hdr *)skb_network_header(skb);
> 
> Was there a problem with ipv6_hdr?
> 
Actually ipv6_hdr is better, and i will modify it.
>> +	const struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
>> +	struct dst_entry *dst;
>> +	struct flowi6 fl6;
>> +
>> +	memset(&fl6, 0, sizeof(fl6));
>> +	fl6.flowi6_oif = oif;
>> +	fl6.flowi6_mark = mark;
>> +	fl6.flowi6_flags = 0;
>> +	fl6.daddr = msg->dest;
>> +	fl6.saddr = iph->daddr;
>> +
>> +	dst = ip6_route_output(net, NULL, &fl6);
>> +	if (!dst->error)
>> +		rt6_do_redirect(dst, NULL, skb);
>> +	dst_release(dst);
>> +}
>> +EXPORT_SYMBOL_GPL(ip6_redirect_no_header);
>> +
>>  void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
>>  {
>>  	ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
> 
> Introducing a new function here is the right thing. Maybe you could have
> a look how these redirects could be fed to raw sockets, too?
> 
Because of no Redirected Header option, so we don't have enough
information to find out the related raw socket. So, there is no need
to deal with that condition.

Thanks,
  Duan 

^ permalink raw reply

* [PATCH v6] net/phy: micrel: Add OF configuration support for ksz9021
From: Sean Cross @ 2013-08-21  1:46 UTC (permalink / raw)
  To: Sascha Hauer, Duan Fugang-B38611, netdev@vger.kernel.org,
	devicetree@vger.kernel.org
  Cc: David Miller, stephen@networkplumber.org, Steven Rostedt,
	Sean Cross
In-Reply-To: <1377049572-30752-1-git-send-email-xobs@kosagi.com>

Some boards require custom PHY configuration, for example due to trace
length differences.  Add the ability to configure these registers in
order to get the PHY to function on boards that need it.

Because PHYs are auto-detected based on MDIO device IDs, allow PHY
configuration to be specified in the parent Ethernet device node if no
PHY device node is present.

Signed-off-by: Sean Cross <xobs@kosagi.com>
---
 .../devicetree/bindings/net/micrel-ksz9021.txt     |   49 ++++++++++
 drivers/net/phy/micrel.c                           |  103 +++++++++++++++++++-
 2 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/micrel-ksz9021.txt

diff --git a/Documentation/devicetree/bindings/net/micrel-ksz9021.txt b/Documentation/devicetree/bindings/net/micrel-ksz9021.txt
new file mode 100644
index 0000000..997a63f
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/micrel-ksz9021.txt
@@ -0,0 +1,49 @@
+Micrel KSZ9021 Gigabit Ethernet PHY
+
+Some boards require special tuning values, particularly when it comes to
+clock delays.  You can specify clock delay values by adding
+micrel-specific properties to an Ethernet OF device node.
+
+All skew control options are specified in picoseconds.  The minimum
+value is 0, and the maximum value is 3000.
+
+Optional properties:
+ - rxc-skew-ps : Skew control of RXC pad
+ - rxdv-skew-ps : Skew control of RX CTL pad
+ - txc-skew-ps : Skew control of TXC pad
+ - txen-skew-ps : Skew control of TX_CTL pad
+ - rxd0-skew-ps : Skew control of RX data 0 pad
+ - rxd1-skew-ps : Skew control of RX data 1 pad
+ - rxd2-skew-ps : Skew control of RX data 2 pad
+ - rxd3-skew-ps : Skew control of RX data 3 pad
+ - txd0-skew-ps : Skew control of TX data 0 pad
+ - txd1-skew-ps : Skew control of TX data 1 pad
+ - txd2-skew-ps : Skew control of TX data 2 pad
+ - txd3-skew-ps : Skew control of TX data 3 pad
+
+Examples:
+
+	/* Attach to an Ethernet device with autodetected PHY */
+	&enet {
+		rxc-skew-ps = <3000>;
+		rxdv-skew-ps = <0>;
+		txc-skew-ps = <3000>;
+		txen-skew-ps = <0>;
+		status = "okay";
+	};
+
+	/* Attach to an explicitly-specified PHY */
+	mdio {
+		phy0: ethernet-phy@0 {
+			rxc-skew-ps = <3000>;
+			rxdv-skew-ps = <0>;
+			txc-skew-ps = <3000>;
+			txen-skew-ps = <0>;
+			reg = <0>;
+		};
+	};
+	ethernet@70000 {
+		status = "okay";
+		phy = <&phy0>;
+		phy-mode = "rgmii-id";
+	};
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 2510435..7c32dcb 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/micrel_phy.h>
+#include <linux/of.h>
 
 /* Operation Mode Strap Override */
 #define MII_KSZPHY_OMSO				0x16
@@ -53,6 +54,20 @@
 #define KS8737_CTRL_INT_ACTIVE_HIGH		(1 << 14)
 #define KSZ8051_RMII_50MHZ_CLK			(1 << 7)
 
+/* Write/read to/from extended registers */
+#define MII_KSZPHY_EXTREG                       0x0b
+#define KSZPHY_EXTREG_WRITE                     0x8000
+
+#define MII_KSZPHY_EXTREG_WRITE                 0x0c
+#define MII_KSZPHY_EXTREG_READ                  0x0d
+
+/* Extended registers */
+#define MII_KSZPHY_CLK_CONTROL_PAD_SKEW         0x104
+#define MII_KSZPHY_RX_DATA_PAD_SKEW             0x105
+#define MII_KSZPHY_TX_DATA_PAD_SKEW             0x106
+
+#define PS_TO_REG				200
+
 static int ksz_config_flags(struct phy_device *phydev)
 {
 	int regval;
@@ -65,6 +80,20 @@ static int ksz_config_flags(struct phy_device *phydev)
 	return 0;
 }
 
+static int kszphy_extended_write(struct phy_device *phydev,
+                                 u32 regnum, u16 val)
+{
+	phy_write(phydev, MII_KSZPHY_EXTREG, KSZPHY_EXTREG_WRITE | regnum);
+	return phy_write(phydev, MII_KSZPHY_EXTREG_WRITE, val);
+}
+
+static int kszphy_extended_read(struct phy_device *phydev,
+                                 u32 regnum)
+{
+	phy_write(phydev, MII_KSZPHY_EXTREG, regnum);
+	return phy_read(phydev, MII_KSZPHY_EXTREG_READ);
+}
+
 static int kszphy_ack_interrupt(struct phy_device *phydev)
 {
 	/* bit[7..0] int status, which is a read and clear register. */
@@ -141,6 +170,78 @@ static int ks8051_config_init(struct phy_device *phydev)
 	return rc < 0 ? rc : 0;
 }
 
+static int ksz9021_load_values_from_of(struct phy_device *phydev,
+				       struct device_node *of_node, u16 reg,
+				       char *field1, char *field2,
+				       char *field3, char *field4)
+{
+	int val1 = -1;
+	int val2 = -2;
+	int val3 = -3;
+	int val4 = -4;
+	int newval;
+	int matches = 0;
+
+	if (!of_property_read_u32(of_node, field1, &val1))
+		matches++;
+
+	if (!of_property_read_u32(of_node, field2, &val2))
+		matches++;
+
+	if (!of_property_read_u32(of_node, field3, &val3))
+		matches++;
+
+	if (!of_property_read_u32(of_node, field4, &val4))
+		matches++;
+
+	if (!matches)
+		return 0;
+
+	if (matches < 4)
+		newval = kszphy_extended_read(phydev, reg);
+	else
+		newval = 0;
+
+	if (val1 != -1)
+		newval = ((newval & 0xfff0) | ((val1 / PS_TO_REG) & 0xf) << 0);
+
+	if (val2 != -1)
+		newval = ((newval & 0xff0f) | ((val2 / PS_TO_REG) & 0xf) << 4);
+
+	if (val3 != -1)
+		newval = ((newval & 0xf0ff) | ((val3 / PS_TO_REG) & 0xf) << 8);
+
+	if (val4 != -1)
+		newval = ((newval & 0x0fff) | ((val4 / PS_TO_REG) & 0xf) << 12);
+
+	return kszphy_extended_write(phydev, reg, newval);
+}
+
+static int ksz9021_config_init(struct phy_device *phydev)
+{
+	struct device *dev = &phydev->dev;
+	struct device_node *of_node = dev->of_node;
+
+	if (!of_node && dev->parent->of_node)
+		of_node = dev->parent->of_node;
+
+	if (of_node) {
+		ksz9021_load_values_from_of(phydev, of_node,
+				    MII_KSZPHY_CLK_CONTROL_PAD_SKEW,
+				    "txen-skew-ps", "txc-skew-ps",
+				    "rxdv-skew-ps", "rxc-skew-ps");
+		ksz9021_load_values_from_of(phydev, of_node,
+				    MII_KSZPHY_RX_DATA_PAD_SKEW,
+				    "rxd0-skew-ps", "rxd1-skew-ps",
+				    "rxd2-skew-ps", "rxd3-skew-ps");
+		ksz9021_load_values_from_of(phydev, of_node,
+				    MII_KSZPHY_TX_DATA_PAD_SKEW,
+				    "txd0-skew-ps", "txd1-skew-ps",
+				    "txd2-skew-ps", "txd3-skew-ps");
+	}
+	return 0;
+}
+
 #define KSZ8873MLL_GLOBAL_CONTROL_4	0x06
 #define KSZ8873MLL_GLOBAL_CONTROL_4_DUPLEX	(1 << 6)
 #define KSZ8873MLL_GLOBAL_CONTROL_4_SPEED	(1 << 4)
@@ -281,7 +382,7 @@ static struct phy_driver ksphy_driver[] = {
 	.name		= "Micrel KSZ9021 Gigabit PHY",
 	.features	= (PHY_GBIT_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
+	.config_init	= ksz9021_config_init,
 	.config_aneg	= genphy_config_aneg,
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v6] Add OF bindings to Micrel ksz9021 PHY
From: Sean Cross @ 2013-08-21  1:46 UTC (permalink / raw)
  To: Sascha Hauer, Duan Fugang-B38611, netdev@vger.kernel.org,
	devicetree@vger.kernel.org
  Cc: David Miller, stephen@networkplumber.org, Steven Rostedt,
	Sean Cross

Some boards require custom parameters be passed to the Micrel PHY.
Allow these boards to specify custom timing parameters in the device
tree node.

Changes since v5:
 - Add -ps suffix to OF keys, indicating picoseconds
 - Minor formatting changes to bring in line with coding style

Changes since v4:
 - Add an example of parameters on an mdio bus
 - Specify values in picoseconds rather than as register values

v4 was accidentally unchanged from v3

Changes since v2:
 - limited the scope to just ksz9021 rather than all PHYs

Changes since v1:
 - removed redefinition of registers and addresses 

Sean Cross (1):
  net/phy: micrel: Add OF configuration support for ksz9021

 .../devicetree/bindings/net/micrel-ksz9021.txt     |   49 ++++++++++
 drivers/net/phy/micrel.c                           |  103 +++++++++++++++++++-
 2 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/micrel-ksz9021.txt

-- 
1.7.9.5

^ permalink raw reply

* Re: [PATCH RESEND] can: mcp251x: Replace power callbacks with regulator API
From: Haojian Zhuang @ 2013-08-21  0:46 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Alexander Shiyan, Eric Miao, netdev, linux-can,
	Wolfgang Grandegger, Russell King,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <52132CD7.50100@pengutronix.de>

On Tue, Aug 20, 2013 at 4:46 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 08/17/2013 06:37 AM, Haojian Zhuang wrote:
>> On Sat, Aug 17, 2013 at 12:30 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
>>> On Sat, 17 Aug 2013 10:19:20 +0800
>>> Haojian Zhuang <haojian.zhuang@gmail.com> wrote:
>>>
>>>> On 08/09/2013 03:37 PM, Marc Kleine-Budde wrote:
>>>>> On 08/08/2013 02:00 PM, Alexander Shiyan wrote:
>>>>>> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>>>>>> ---
>>>>>>   arch/arm/mach-pxa/icontrol.c         |  3 --
>>>>>>   arch/arm/mach-pxa/zeus.c             | 46 ++++++++++----------
>>>>>
>>>>> What's pxa's status of DT conversion? Do you (still) accept patches to
>>>>> board files?
>>>>>
>>>>> Marc
>>>>>
>>>>
>>>> Since DT conversion isn't finished, I still accept the board files.
>>>> But this patch should be split into two parts. One is for pxa, and the
>>>> other one is for net.
>>>
>>> Patch cannot be splitted because this can create hole which break git-bisect.
>>>
>>> In any case, I want to create a v2 with a more detailed description, and I
>>> have a supplementary question for the CAN subsystem maintainers.
>>> "Transciever power" is not used by any of the boards, can we remove it
>>> completely? This will greatly simplify driver.
>>> Thanks.
>>>
>>> --
>>> Alexander Shiyan <shc_work@mail.ru>
>>
>> If you want to make the patch go through pxa tree, you need to get the Ack
>> from CAN maintainer.
>
> The current series consists of 3 patches, only the first one touches
> "arch/arm/mach-pxa", so I'd like the patches to go via linux-can. Can I
> have your Acked-by for the first patch "[PATCH v2 1/3] can: mcp251x:
> Replace power callbacks with regulator AP"
>
> Marc
> --
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
>

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

^ permalink raw reply

* Re: [PATCH 2/2] sh_eth: remove 'register_type' field from 'struct sh_eth_plat_data'
From: Laurent Pinchart @ 2013-08-21  0:39 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: netdev, davem, lethal, linux-sh
In-Reply-To: <5213F548.5040103@cogentembedded.com>

Hi Sergei,

On Wednesday 21 August 2013 03:01:28 Sergei Shtylyov wrote:
> On 08/21/2013 02:50 AM, Laurent Pinchart wrote:
> >>>>> Now that the 'register_type' field of the 'sh_eth' driver's platform
> >>>>> data is not used by the driver anymore, it's time to remove it and 
> >>>>> its initializers from the SH platform code. Also  move *enum*
> >>>>> declaring values for this  field from <linux/sh_eth.h>  to  the  local
> >>>>> driver's header file as they're only needed by the driver itself 
> >>>>> now...
> >>>>> 
> >>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >> 
> >> [...]
> >> 
> >>>>>    /* Driver's parameters */
> >>>>>    #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
> >>>>>    #define SH4_SKB_RX_ALIGN    32
> >>>>> 
> >>>>> Index: net-next/include/linux/sh_eth.h
> >>>>> ===================================================================
> >>>>> --- net-next.orig/include/linux/sh_eth.h
> >>>>> +++ net-next/include/linux/sh_eth.h
> >>>>> @@ -5,17 +5,10 @@
> >>>>> 
> >>>>>    #include <linux/if_ether.h>
> >>>>>    
> >>>>>    enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
> >>>>> 
> >>>>> -enum {
> >>>>> -    SH_ETH_REG_GIGABIT,
> >>>>> -    SH_ETH_REG_FAST_RCAR,
> >>>>> -    SH_ETH_REG_FAST_SH4,
> >>>>> -    SH_ETH_REG_FAST_SH3_SH2
> >>>>> -};
> >>>>> 
> >>>>>    struct sh_eth_plat_data {
> >>>>>    
> >>>>>        int phy;
> >>>>>        int edmac_endian;
> >>>> 
> >>>> Wouldn't it make sense to move the edmac_endian field to
> >>>> sh_eth_cpu_data as well ?
> >>> 
> >>> No, it depends on the SoC endianness which is determined by power-on pin
> >>> strapping -- which is board specific.
> > 
> > Does SoC endianness affect the ARM core endianness, the ethernet registers
> > endianness, or both ?
>
> Both, AFAIK.
>
> > If it affects the ARM core endianness only, the kernel needs to be
> > compiled in little-endian or big-endian mode anyway, and the sh_eth driver
> > should use cpu_to_le32() unconditionally. If it affects both the ARM core
> > and the ethernet controller there's not need to care about the endianness,
> > as it will always be good.
> 
> No, it won't unless you're using __raw_{readl|writel}() accessors. The
> driver doesn't do it. {readl|writel}() and io{read|write}32() that use them
> always assume LE ordering of memory.
> 
> > We only need to care about it if it affects the ethernet controller
> > registers only, which would seem weird to me.
>
> Unfortunately, you are wrong.

Care to explain *why* ? There might be bugs in the driver (such as using the 
wrong I/O accessors), but I don't see why we need to configure the endianness 
through platform data.

> >> BTW, I don't think the driver works correctly in the BE case since it
> >> uses io{read|write}32() to access the registers and those functions
> >> assume LE ordering on MMIO.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply

* Re: [PATCH RFC 0/2] Add IPsec virtual tunnel interfaces to IPv6
From: David Miller @ 2013-08-21  0:28 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev
In-Reply-To: <20130819062623.GN26773@secunet.com>

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Mon, 19 Aug 2013 08:26:23 +0200

> This patchset adds support for IPsec virtual tunnel interfaces to IPv6.
> 
> IPsec virtual tunnel interfaces provide a routable interface for IPsec
> tunnel endpoints. This does not add any tunnel headers, it uses the
> generic xfrm tunneling. It just provides an interface for xfrm IPv6
> tunnels, like the IPv4 side does.
> 
> It has not much testing yet, I can setup the interface and ping through it.
> Review and further testing is very wellcome.
> 
> I'll send the necessary iproute2 patches in a separate thread.

These changes seem well formed to me.

^ permalink raw reply

* Re: pull request: wireless 2013-08-19
From: David Miller @ 2013-08-21  0:26 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20130819185940.GE30753@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 19 Aug 2013 14:59:40 -0400

> This is a batch of fixes intended for the 3.11 stream...
> 
> Regarding the iwlwifi bits, Johannes says:
> 
> "We revert an rfkill bugfix that unfortunately caused more bugs, shuffle
> some code to avoid touching the PCIe device before it's enabled and
> disconnect if firmware fails to do our bidding. I also have Stanislaw's
> fix to not crash in some channel switch scenarios."
> 
> As for the mac80211 bits, Johannes says:
> 
> "This time, I have one fix from Dan Carpenter for users of
> nl80211hdr_put(), and one fix from myself fixing a regression with the
> libertas driver."
> 
> Along with the above...
> 
> Dan Carpenter fixes some incorrectly placed "address of" operators
> in hostap that caused copying of junk data.
> 
> Jussi Kivilinna corrects zd1201 to use an allocated buffer rather
> than the stack for a URB operation.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* Re: [PATCH net] packet: restore packet statistics tp_packets to include drops
From: David Miller @ 2013-08-21  0:24 UTC (permalink / raw)
  To: dborkman; +Cc: willemb, netdev, sergei.shtylyov
In-Reply-To: <521289EC.40703@redhat.com>

From: Daniel Borkmann <dborkman@redhat.com>
Date: Mon, 19 Aug 2013 23:11:08 +0200

> On 08/19/2013 10:40 PM, Willem de Bruijn wrote:
>> getsockopt PACKET_STATISTICS returns tp_packets + tp_drops. Commit
>> ee80fbf301 ("packet: account statistics only in tpacket_stats_u")
>> cleaned up the getsockopt PACKET_STATISTICS code.
>> This also changed semantics. Historically, tp_packets included
>> tp_drops on return. The commit removed the line that adds tp_drops
>> into tp_packets.
>>
>> This patch reinstates the old semantics.
>>
>> Signed-off-by: Willem de Bruijn <willemb@google.com>
> 
> Acked-by: Daniel Borkmann <dborkman@redhat.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v4 0/7] net: use platform_{get,set}_drvdata()
From: David Miller @ 2013-08-21  0:19 UTC (permalink / raw)
  To: clbchenlibo.chen
  Cc: netdev, lizefan, leoli, linuxppc-dev, pantelis.antoniou, vbordug,
	gregkh, jg1.han, sergei.shtylyov
In-Reply-To: <52120859.7060200@huawei.com>

From: Libo Chen <clbchenlibo.chen@huawei.com>
Date: Mon, 19 Aug 2013 19:58:17 +0800

> 
> Use the wrapper functions for getting and setting the driver data using
> platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
> so we can directly pass a struct platform_device.
> 
> changelog v4:
> 	remove modify about happy_meal_pci_probe && happy_meal_pci_remove
> changelog v3:
> 	remove modify about dev_set_drvdata()
> changelog v2:
> 	this version add modify record about dev_set_drvdata().

Series applied.

^ permalink raw reply

* Re: [PATCH (net.git)] net: phy: rtl8211: fix interrupt on status link change
From: David Miller @ 2013-08-21  0:11 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1376894914-11174-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 19 Aug 2013 08:48:34 +0200

> This is to fix a problem in the rtl8211 where the driver
> wasn't properly enabled the interrupt on link change status.
> it has to enable the ineterrupt on the bit 10 in the register 18
> (INER).
> 
> Reported-by: Sharma Bhupesh <B45370@freescale.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied, thanks.

^ 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