Netdev List
 help / color / mirror / Atom feed
* Re: [RFC PATCH 1/2] unix sockets: add ability for search for peer from passed root
From: J. Bruce Fields @ 2012-08-10 18:10 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: Trond.Myklebust, davem, linux-nfs, eric.dumazet, xemul, netdev,
	linux-kernel, viro, tim.c.chen, devel
In-Reply-To: <20120810125730.7115.96005.stgit@localhost.localdomain>

On Fri, Aug 10, 2012 at 04:57:30PM +0400, Stanislav Kinsbursky wrote:
> This helper is used stream sockets yet.
> All is simple: if non-NULL struct path was passed to unix_find_other(), then
> vfs_path_lookup() is called instead of kern_path().

I'm having some trouble parsing the changelog.  Maybe something like?:

	unix sockets: add ability to look up using passed-in root

	Export a unix_stream_connect_root() helper that allows a caller
	to optionally pass in a root path, in which case the lookup will
	be done relative to the given path instead of the current
	working directory.

I guess this is a question for the networking people, but: will it cause
problems to have sunrpc calling directly into the unix socket code?

(And if so, what would be the alternative: define some variant of
sockaddr_un that includes the root path?  Something better?)

--b.

> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> ---
>  include/net/af_unix.h |    2 ++
>  net/unix/af_unix.c    |   25 ++++++++++++++++++-------
>  2 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/include/net/af_unix.h b/include/net/af_unix.h
> index 2ee33da..559467e 100644
> --- a/include/net/af_unix.h
> +++ b/include/net/af_unix.h
> @@ -67,6 +67,8 @@ struct unix_sock {
>  
>  long unix_inq_len(struct sock *sk);
>  long unix_outq_len(struct sock *sk);
> +int unix_stream_connect_root(struct path *root, struct socket *sock,
> +			     struct sockaddr *uaddr, int addr_len, int flags);
>  
>  #ifdef CONFIG_SYSCTL
>  extern int unix_sysctl_register(struct net *net);
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 641f2e4..a790ebc 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -759,7 +759,7 @@ out:	mutex_unlock(&u->readlock);
>  	return err;
>  }
>  
> -static struct sock *unix_find_other(struct net *net,
> +static struct sock *unix_find_other(struct net *net, struct path *root,
>  				    struct sockaddr_un *sunname, int len,
>  				    int type, unsigned int hash, int *error)
>  {
> @@ -769,7 +769,11 @@ static struct sock *unix_find_other(struct net *net,
>  
>  	if (sunname->sun_path[0]) {
>  		struct inode *inode;
> -		err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
> +
> +		if (root)
> +			err = vfs_path_lookup(root->dentry, root->mnt, sunname->sun_path, LOOKUP_FOLLOW, &path);
> +		else
> +			err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
>  		if (err)
>  			goto fail;
>  		inode = path.dentry->d_inode;
> @@ -979,7 +983,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
>  			goto out;
>  
>  restart:
> -		other = unix_find_other(net, sunaddr, alen, sock->type, hash, &err);
> +		other = unix_find_other(net, NULL, sunaddr, alen, sock->type, hash, &err);
>  		if (!other)
>  			goto out;
>  
> @@ -1053,8 +1057,8 @@ static long unix_wait_for_peer(struct sock *other, long timeo)
>  	return timeo;
>  }
>  
> -static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
> -			       int addr_len, int flags)
> +int unix_stream_connect_root(struct path *root, struct socket *sock,
> +			     struct sockaddr *uaddr, int addr_len, int flags)
>  {
>  	struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
>  	struct sock *sk = sock->sk;
> @@ -1098,7 +1102,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>  
>  restart:
>  	/*  Find listening sock. */
> -	other = unix_find_other(net, sunaddr, addr_len, sk->sk_type, hash, &err);
> +	other = unix_find_other(net, root, sunaddr, addr_len, sk->sk_type, hash, &err);
>  	if (!other)
>  		goto out;
>  
> @@ -1227,6 +1231,13 @@ out:
>  		sock_put(other);
>  	return err;
>  }
> +EXPORT_SYMBOL_GPL(unix_stream_connect_root);
> +
> +static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
> +				    int addr_len, int flags)
> +{
> +	return unix_stream_connect_root(NULL, sock, uaddr, addr_len, flags);
> +}
>  
>  static int unix_socketpair(struct socket *socka, struct socket *sockb)
>  {
> @@ -1508,7 +1519,7 @@ restart:
>  		if (sunaddr == NULL)
>  			goto out_free;
>  
> -		other = unix_find_other(net, sunaddr, namelen, sk->sk_type,
> +		other = unix_find_other(net, NULL, sunaddr, namelen, sk->sk_type,
>  					hash, &err);
>  		if (other == NULL)
>  			goto out_free;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: H. Peter Anvin @ 2012-08-10 18:15 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w, xemul-bzQdu9zFT3WakBO8gow8eQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	bfields-uC3wQj2KruNg9hUCZPvPmw,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	tim.c.chen-VuQAYsv1563Yd54FQh9/CA, devel-GEFAQzZX7r8dnm+yROfE0A
In-Reply-To: <20120810125701.7115.71612.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

On 08/10/2012 05:57 AM, Stanislav Kinsbursky wrote:
> Today, there is a problem in connecting of local SUNRPC thansports. These
> transports uses UNIX sockets and connection itself is done by rpciod
> workqueue.
> But UNIX sockets lookup is done in context of process file system root. I.e.
> all local thunsports are connecting in rpciod context.
> This works nice until we will try to mount NFS from process with other root -
> for example in container. This container can have it's own (nested) root and
> rcpbind process, listening on it's own unix sockets. But NFS mount attempt in
> this container will register new service (Lockd for example) in global rpcbind
> - not containers's one.
> 
> This patch set introduces kernel connect helper for UNIX stream sockets and
> modifies unix_find_other() to be able to search from specified root.
> It also replaces generic socket connect call for local transports by new
> helper in SUNRPC layer.
> 
> The following series implements...

On that whole subject...

Do we need a Unix domain socket equivalent to openat()?

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: Alan Cox @ 2012-08-10 18:26 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Stanislav Kinsbursky, Trond.Myklebust, davem, linux-nfs,
	eric.dumazet, xemul, netdev, linux-kernel, bfields, viro,
	tim.c.chen, devel
In-Reply-To: <50254FA6.3060806@zytor.com>

> On that whole subject...
> 
> Do we need a Unix domain socket equivalent to openat()?

I don't think so. The name is just a file system indexing trick, it's not
really the socket proper. It's little more than "ascii string with
permissions attached" - indeed we also support an abstract name space
which for a lot of uses is actually more convenient.

AF_UNIX between roots raises some interesting semantic questions when you
begin passing file descriptors down them as well.

Alan

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: H. Peter Anvin @ 2012-08-10 18:31 UTC (permalink / raw)
  To: Alan Cox
  Cc: Stanislav Kinsbursky, Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w, xemul-bzQdu9zFT3WakBO8gow8eQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	bfields-uC3wQj2KruNg9hUCZPvPmw,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	tim.c.chen-VuQAYsv1563Yd54FQh9/CA, devel-GEFAQzZX7r8dnm+yROfE0A
In-Reply-To: <20120810192628.79a34d28-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>

On 08/10/2012 11:26 AM, Alan Cox wrote:
>> On that whole subject...
>>
>> Do we need a Unix domain socket equivalent to openat()?
> 
> I don't think so. The name is just a file system indexing trick, it's not
> really the socket proper. It's little more than "ascii string with
> permissions attached" - indeed we also support an abstract name space
> which for a lot of uses is actually more convenient.
> 

I don't really understand why Unix domain sockets is different than any
other pathname users in this sense.  (Actually, I have never understood
why open() on a Unix domain socket doesn't give the equivalent of a
socket() + connect() -- it would make logical sense and would provide
additional functionality).

It would be different if the Unix domain sockets simply required an
absolute pathname (it is not just about the root, it is also about the
cwd, which is where the -at() functions come into play), but that is not
the case.

The abstract namespace is irrelevant for this, obviously.

> AF_UNIX between roots raises some interesting semantic questions when
> you begin passing file descriptors down them as well.

Why is that?  A file descriptor carries all that information with it...

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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

* pull request: wireless 2012-08-10
From: John W. Linville @ 2012-08-10 18:33 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

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

commit 039aafba1b57ed39acb3abc290c11be37402feb2

Dave,

Here is a handful of fixes intended for 3.6.

Daniel Drake offers a cfg80211 fix to consume pending events before
taking a wireless device down.  This prevents a resource leak.

Stanislaw Gruszka gives us a fix for a NULL pointer dereference in
rt61pci.

Johannes Berg provides an iwlwifi patch to disable "greenfield" mode.
Use of that mode was causing a rate scaling problem in for iwlwifi.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 63d02d157ec4124990258d66517b6c11fd6df0cf:

  net: tcp: ipv6_mapped needs sk_rx_dst_set method (2012-08-09 20:56:09 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem

for you to fetch changes up to 039aafba1b57ed39acb3abc290c11be37402feb2:

  Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem (2012-08-10 14:05:38 -0400)

----------------------------------------------------------------

Daniel Drake (1):
      cfg80211: process pending events when unregistering net device

Johannes Berg (1):
      iwlwifi: disable greenfield transmissions as a workaround

John W. Linville (1):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Stanislaw Gruszka (1):
      rt61pci: fix NULL pointer dereference in config_lna_gain

 drivers/net/wireless/iwlwifi/dvm/rs.c |   13 ++++++++-----
 drivers/net/wireless/rt2x00/rt61pci.c |    3 +--
 net/wireless/core.c                   |    5 +++++
 net/wireless/core.h                   |    1 +
 net/wireless/util.c                   |    2 +-
 5 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c
index 6fddd27..a82f46c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rs.c
@@ -707,11 +707,14 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
  */
 static bool rs_use_green(struct ieee80211_sta *sta)
 {
-	struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
-	struct iwl_rxon_context *ctx = sta_priv->ctx;
-
-	return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
-		!(ctx->ht.non_gf_sta_present);
+	/*
+	 * There's a bug somewhere in this code that causes the
+	 * scaling to get stuck because GF+SGI can't be combined
+	 * in SISO rates. Until we find that bug, disable GF, it
+	 * has only limited benefit and we still interoperate with
+	 * GF APs since we can always receive GF transmissions.
+	 */
+	return false;
 }
 
 /**
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index f322596..3f7bc5c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2243,8 +2243,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
 
 static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev)
 {
-	struct ieee80211_conf conf = { .flags = 0 };
-	struct rt2x00lib_conf libconf = { .conf = &conf };
+	struct rt2x00lib_conf libconf = { .conf = &rt2x00dev->hw->conf };
 
 	rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
 }
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 31b40cc..dcd64d5 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -952,6 +952,11 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
 		 */
 		synchronize_rcu();
 		INIT_LIST_HEAD(&wdev->list);
+		/*
+		 * Ensure that all events have been processed and
+		 * freed.
+		 */
+		cfg80211_process_wdev_events(wdev);
 		break;
 	case NETDEV_PRE_UP:
 		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 5206c68..bc7430b 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -426,6 +426,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
 			  struct net_device *dev, enum nl80211_iftype ntype,
 			  u32 *flags, struct vif_params *params);
 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
+void cfg80211_process_wdev_events(struct wireless_dev *wdev);
 
 int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
 				 struct wireless_dev *wdev,
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 26f8cd3..994e2f0 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -735,7 +735,7 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
 	wdev->connect_keys = NULL;
 }
 
-static void cfg80211_process_wdev_events(struct wireless_dev *wdev)
+void cfg80211_process_wdev_events(struct wireless_dev *wdev)
 {
 	struct cfg80211_event *ev;
 	unsigned long flags;
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

^ permalink raw reply related

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: Alan Cox @ 2012-08-10 18:40 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Stanislav Kinsbursky, Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w, xemul-bzQdu9zFT3WakBO8gow8eQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	bfields-uC3wQj2KruNg9hUCZPvPmw,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	tim.c.chen-VuQAYsv1563Yd54FQh9/CA, devel-GEFAQzZX7r8dnm+yROfE0A
In-Reply-To: <5025537D.9060300-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>

> > AF_UNIX between roots raises some interesting semantic questions when
> > you begin passing file descriptors down them as well.
> 
> Why is that?  A file descriptor carries all that information with it...

Things like fchdir(). It's not a machine breaking problem but for
containers as opposed to chroot we need to be clear what the expected
isolation sematics are.

Agreed on open() for sockets.. the lack of open is a Berklix derived
pecularity of the interface. It would equally be useful to be able to
open "/dev/socket/ipv4/1.2.3.4/1135" and the like for scripts and stuff

That needs VFS changes however so you can pass the remainder of a path to
a device node. It also lets you do a lot of other sane stuff like

	open /dev/ttyS0/9600/8n1


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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: [E1000-devel] discussion questions: SR-IOV, virtualization, and bonding
From: Chris Friesen @ 2012-08-10 18:41 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: John Fastabend, Jay Vosburgh, e1000-devel@lists.sourceforge.net,
	netdev
In-Reply-To: <1344016163.2610.9.camel@bwh-desktop.uk.solarflarecom.com>

On 08/03/2012 11:49 AM, Ben Hutchings wrote:
> On Thu, 2012-08-02 at 21:50 -0700, John Fastabend wrote:

>> Perhaps one argument against this is if the hardware supports loopback
>> modes or the edge relay in the hardware is acting like a VEB it may
>> still be possible to support VF to VF traffic even if the external link
>> is down. Not sure how useful this is though or if any existing hardware
>> even supports it.
> [...]
>
> It seems to me that VF to VF traffic ought to still work.  If it doesn't
> then that's an unfortunate regression when moving from software bridging
> and virtio to hardware-supported network virtualisation.  (But hybrid
> network virtualisation may help to solve that.)

I would have thought this to be desirable as well.  Apparently the Intel 
engineers disagreed.  The 82599 datasheet has the following:

"Loopback is disabled when the network link is disconnected. It is 
expected (but not required) that system software (including VMs) does 
not post packets for transmission when the link is disconnected. Note 
that packets posted by system software for transmission when the link is 
down are buffered."

Chris

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: H. Peter Anvin @ 2012-08-10 18:42 UTC (permalink / raw)
  To: Alan Cox
  Cc: Stanislav Kinsbursky, Trond.Myklebust, davem, linux-nfs,
	eric.dumazet, xemul, netdev, linux-kernel, bfields, viro,
	tim.c.chen, devel
In-Reply-To: <20120810194028.792f29f1@pyramind.ukuu.org.uk>

On 08/10/2012 11:40 AM, Alan Cox wrote:
> 
> Agreed on open() for sockets.. the lack of open is a Berklix derived
> pecularity of the interface. It would equally be useful to be able to
> open "/dev/socket/ipv4/1.2.3.4/1135" and the like for scripts and stuff
> 
> That needs VFS changes however so you can pass the remainder of a path to
> a device node. It also lets you do a lot of other sane stuff like
> 
> 	open /dev/ttyS0/9600/8n1
> 

Well, supporting device node subpaths would be nice, but I don't think
that that is a requirement either for being able to open() a socket (as
a Linux extension) nor for supporting something like your above
/dev/socket/... since that could be done with a filesystem rather than
just a device node.

	-hpa

^ permalink raw reply

* Re: [RFC PATCH 1/2] unix sockets: add ability for search for peer from passed root
From: Stanislav Kinsbursky @ 2012-08-10 18:43 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Pavel Emelianov, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org
In-Reply-To: <20120810181002.GB17404-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>

10.08.2012 22:10, J. Bruce Fields пишет:
> On Fri, Aug 10, 2012 at 04:57:30PM +0400, Stanislav Kinsbursky wrote:
>> This helper is used stream sockets yet.
>> All is simple: if non-NULL struct path was passed to unix_find_other(), then
>> vfs_path_lookup() is called instead of kern_path().
> I'm having some trouble parsing the changelog.  Maybe something like?:
>
> 	unix sockets: add ability to look up using passed-in root
>
> 	Export a unix_stream_connect_root() helper that allows a caller
> 	to optionally pass in a root path, in which case the lookup will
> 	be done relative to the given path instead of the current
> 	working directory.

Yep, your variant is much better. Thanks.

>
> I guess this is a question for the networking people, but: will it cause
> problems to have sunrpc calling directly into the unix socket code?
>
> (And if so, what would be the alternative: define some variant of
> sockaddr_un that includes the root path?  Something better?)

That was my first idea. But there are problems with this solution (add 
root path to sockaddr_un) :
1) sockaddr_un size will change. I don't know, how this will affect 
user-space. Of course, we can introduce something like:

struct sockaddr_un_kern {
struct sockaddr_un un;
struct path *path;
}

But even in this case we need to color this structure somehow (for 
example, set path to NULL for simple connect or bind call) . And to add 
this color, we have to separate sys_connect () from our 
sock->ops->connect() call. And I don't really know how to do it since we 
don't have any info about socket type in sys_connect () in hands. I.e. 
we have it, but then we have to add some specific UNIX socket logic to 
completely generic sys_connect () and sys_bind () .

> --b.
>
>> Signed-off-by: Stanislav Kinsbursky <skinsbursky-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
>> ---
>>   include/net/af_unix.h |    2 ++
>>   net/unix/af_unix.c    |   25 ++++++++++++++++++-------
>>   2 files changed, 20 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/net/af_unix.h b/include/net/af_unix.h
>> index 2ee33da..559467e 100644
>> --- a/include/net/af_unix.h
>> +++ b/include/net/af_unix.h
>> @@ -67,6 +67,8 @@ struct unix_sock {
>>   
>>   long unix_inq_len(struct sock *sk);
>>   long unix_outq_len(struct sock *sk);
>> +int unix_stream_connect_root(struct path *root, struct socket *sock,
>> +			     struct sockaddr *uaddr, int addr_len, int flags);
>>   
>>   #ifdef CONFIG_SYSCTL
>>   extern int unix_sysctl_register(struct net *net);
>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>> index 641f2e4..a790ebc 100644
>> --- a/net/unix/af_unix.c
>> +++ b/net/unix/af_unix.c
>> @@ -759,7 +759,7 @@ out:	mutex_unlock(&u->readlock);
>>   	return err;
>>   }
>>   
>> -static struct sock *unix_find_other(struct net *net,
>> +static struct sock *unix_find_other(struct net *net, struct path *root,
>>   				    struct sockaddr_un *sunname, int len,
>>   				    int type, unsigned int hash, int *error)
>>   {
>> @@ -769,7 +769,11 @@ static struct sock *unix_find_other(struct net *net,
>>   
>>   	if (sunname->sun_path[0]) {
>>   		struct inode *inode;
>> -		err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
>> +
>> +		if (root)
>> +			err = vfs_path_lookup(root->dentry, root->mnt, sunname->sun_path, LOOKUP_FOLLOW, &path);
>> +		else
>> +			err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
>>   		if (err)
>>   			goto fail;
>>   		inode = path.dentry->d_inode;
>> @@ -979,7 +983,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
>>   			goto out;
>>   
>>   restart:
>> -		other = unix_find_other(net, sunaddr, alen, sock->type, hash, &err);
>> +		other = unix_find_other(net, NULL, sunaddr, alen, sock->type, hash, &err);
>>   		if (!other)
>>   			goto out;
>>   
>> @@ -1053,8 +1057,8 @@ static long unix_wait_for_peer(struct sock *other, long timeo)
>>   	return timeo;
>>   }
>>   
>> -static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>> -			       int addr_len, int flags)
>> +int unix_stream_connect_root(struct path *root, struct socket *sock,
>> +			     struct sockaddr *uaddr, int addr_len, int flags)
>>   {
>>   	struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
>>   	struct sock *sk = sock->sk;
>> @@ -1098,7 +1102,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>>   
>>   restart:
>>   	/*  Find listening sock. */
>> -	other = unix_find_other(net, sunaddr, addr_len, sk->sk_type, hash, &err);
>> +	other = unix_find_other(net, root, sunaddr, addr_len, sk->sk_type, hash, &err);
>>   	if (!other)
>>   		goto out;
>>   
>> @@ -1227,6 +1231,13 @@ out:
>>   		sock_put(other);
>>   	return err;
>>   }
>> +EXPORT_SYMBOL_GPL(unix_stream_connect_root);
>> +
>> +static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>> +				    int addr_len, int flags)
>> +{
>> +	return unix_stream_connect_root(NULL, sock, uaddr, addr_len, flags);
>> +}
>>   
>>   static int unix_socketpair(struct socket *socka, struct socket *sockb)
>>   {
>> @@ -1508,7 +1519,7 @@ restart:
>>   		if (sunaddr == NULL)
>>   			goto out_free;
>>   
>> -		other = unix_find_other(net, sunaddr, namelen, sk->sk_type,
>> +		other = unix_find_other(net, NULL, sunaddr, namelen, sk->sk_type,
>>   					hash, &err);
>>   		if (other == NULL)
>>   			goto out_free;
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: Stanislav Kinsbursky @ 2012-08-10 18:50 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Trond.Myklebust@netapp.com, davem@davemloft.net,
	linux-nfs@vger.kernel.org, eric.dumazet@gmail.com,
	Pavel Emelianov, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, bfields@fieldses.org,
	viro@zeniv.linux.org.uk, tim.c.chen@linux.intel.com,
	devel@openvz.org
In-Reply-To: <50254FA6.3060806@zytor.com>

10.08.2012 22:15, H. Peter Anvin пишет:
> On 08/10/2012 05:57 AM, Stanislav Kinsbursky wrote:
>> Today, there is a problem in connecting of local SUNRPC thansports. These
>> transports uses UNIX sockets and connection itself is done by rpciod
>> workqueue.
>> But UNIX sockets lookup is done in context of process file system root. I.e.
>> all local thunsports are connecting in rpciod context.
>> This works nice until we will try to mount NFS from process with other root -
>> for example in container. This container can have it's own (nested) root and
>> rcpbind process, listening on it's own unix sockets. But NFS mount attempt in
>> this container will register new service (Lockd for example) in global rpcbind
>> - not containers's one.
>>
>> This patch set introduces kernel connect helper for UNIX stream sockets and
>> modifies unix_find_other() to be able to search from specified root.
>> It also replaces generic socket connect call for local transports by new
>> helper in SUNRPC layer.
>>
>> The following series implements...
> On that whole subject...
>
> Do we need a Unix domain socket equivalent to openat()?

It looks like sys_connectat () and sys_bindat () could be an organic 
part on openat () and friends family.
But currently I don't have any usage example for them in hands.  And the 
main problem here, that this syscalls can be used only for unix sockets.

^ permalink raw reply

* Re: [PATCH 1/2] net: move and rename netif_notify_peers()
From: Ben Hutchings @ 2012-08-10 19:01 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, David S. Miller, Ian Campbell
In-Reply-To: <1344586497-2702-1-git-send-email-amwang@redhat.com>

On Fri, 2012-08-10 at 16:14 +0800, Cong Wang wrote:
> I believe net/core/dev.c is a better place for netif_notify_peers(),
> because other net event notify functions also stay in this file.
> 
> And rename it to netdev_notify_peers().
[...]

Is there a convention for using the 'netdev' vs 'netif' prefixes?
If not, I don't see the point in renaming just this one function.

Ben.

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

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: J. Bruce Fields @ 2012-08-10 19:11 UTC (permalink / raw)
  To: Alan Cox
  Cc: H. Peter Anvin, Stanislav Kinsbursky, Trond.Myklebust, davem,
	linux-nfs, eric.dumazet, xemul, netdev, linux-kernel, viro,
	tim.c.chen, devel
In-Reply-To: <20120810192628.79a34d28@pyramind.ukuu.org.uk>

On Fri, Aug 10, 2012 at 07:26:28PM +0100, Alan Cox wrote:
> > On that whole subject...
> > 
> > Do we need a Unix domain socket equivalent to openat()?
> 
> I don't think so. The name is just a file system indexing trick, it's not
> really the socket proper. It's little more than "ascii string with
> permissions attached"

That's overstating the case.  As I understand it the address is resolved
by a pathname lookup like any other--it can follow symlinks, is relative
to the current working directory and filesystem namespace, etc.  So a
unix-domain socket equivalent to openat() would at least be
well-defined--whether it's needed or not, I don't know.

--b.

^ permalink raw reply

* Re: Bug with IPv6-UDP address binding
From: Jesper Dangaard Brouer @ 2012-08-10 19:15 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Thomas Graf
In-Reply-To: <1344512634.28967.732.camel@edumazet-glaptop>

On Thu, 2012-08-09 at 13:43 +0200, Eric Dumazet wrote:
> On Thu, 2012-08-09 at 11:40 +0200, Jesper Dangaard Brouer wrote:
> > On Wed, 2012-08-08 at 22:59 +0200, Eric Dumazet wrote:
> > > On Wed, 2012-08-08 at 22:37 +0200, Jesper Dangaard Brouer wrote:
> 
> > > Then nc should bind a new socket on this address, then do the connect()
> > 
> > Yes, after the difficult extraction of the dest IP of the UDP packet.
> > 
> 
> Thats 10 lines of code. 

Really like your example below.  Didn't know about sendmsg(), it sort of
solves the problem, as it provides a method of specifying the source IP.


> The hard part is in kernel actually ;)

Yes, I know.  I was just hoping that we, might have (dst) cached the
info, when the incoming connection was created.  Something like the
sk->sk_dst_cache (without checking... its probably don't make sense)

Its does require a lookup, and I see now, that only having the dest IP
and port, can make this lookup ambiguous.  (and of cause
performance/locking issues... etc.)



> > Now I better understand, why the DNS server named/bind is so annoying,
> > that is requires a restart after adding IPs.  I guess they didn't
> > implement this recvmsg(), and instead chooses to bind to all avail IPs
> > on init/start.
> 
> Thats an implementation choice, no more no less.
> 
> Here is an IPv4 sample UDP application, able to echo packets with the IP
> source set to original DST address of the ping packet.
> 
> Doing the same on IPv6 is probably trivial as well
> 
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <linux/udp.h>
> #include <string.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <arpa/inet.h>
> 
> #define PORT 4040
> 
> int pktinfo_get(struct msghdr *my_hdr, struct in_pktinfo *pktinfo)
> {
> 	int res = -1;
> 
> 	if (my_hdr->msg_controllen > 0) {
> 		struct cmsghdr *get_cmsg;
> 		for (get_cmsg = CMSG_FIRSTHDR(my_hdr); get_cmsg;
> 			get_cmsg = CMSG_NXTHDR(my_hdr, get_cmsg)) {
> 			if (get_cmsg->cmsg_type == IP_PKTINFO) {
> 				struct in_pktinfo *get_pktinfo = (struct in_pktinfo *)CMSG_DATA(get_cmsg);
> 				memcpy(pktinfo, get_pktinfo, sizeof(*pktinfo));
> 				res = 0;
> 			}
> 		}
> 	}
> 	return res;
> }
> 
> int main(int argc, char *argv[])
> {
> 	int fd = socket(AF_INET, SOCK_DGRAM, 0);
> 	struct sockaddr_in addr, rem_addr;
> 	int res, on = 1;
> 	struct msghdr msghdr;
> 	struct iovec vec[1];
> 	char cbuf[512];
> 	char frame[4096];
> 	struct in_pktinfo pktinfo;
> 	int c, count = 1000000;
> 
> 	while ((c = getopt(argc, argv, "c:")) != -1) {
> 		if (c == 'c') count = atoi(optarg);
> 		}
> 	memset(&addr, 0, sizeof(addr));
> 	addr.sin_family = AF_INET;
> 	addr.sin_port = htons(PORT);
> 	if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
> 		perror("bind");
> 		return 1;
> 	}
> 	setsockopt(fd, SOL_IP, IP_PKTINFO, &on, sizeof(on));
> 
> 	while (1) {
> 		memset(&msghdr, 0, sizeof(msghdr));
> 		msghdr.msg_control = cbuf;
> 		msghdr.msg_controllen = sizeof(cbuf);
> 		msghdr.msg_iov = vec;
> 		msghdr.msg_iovlen = 1;
> 		vec[0].iov_base = frame;
> 		vec[0].iov_len = sizeof(frame);
> 		msghdr.msg_name = &rem_addr;
> 		msghdr.msg_namelen = sizeof(rem_addr);
> 		res = recvmsg(fd, &msghdr, 0);
> 		if (res == -1)
> 			break;
> 		if (pktinfo_get(&msghdr, &pktinfo) == 0)
> 			printf("Got IP_PKTINFO dst addr=%s\n", inet_ntoa(pktinfo.ipi_spec_dst));
> 
> 		/* ok, just echo reply this frame.
> 		 * Using sendmsg() will provide IP_PKTINFO back to kernel
> 		 * to let it use the 'right' source address
> 		 * (destination address of the incoming packet)
> 		 */
> 		vec[0].iov_len = res;
> 		sendmsg(fd, &msghdr, 0);
> 		if (--count == 0)
> 			break;
> 	}
> 	return 0;
> }
> 

Thanks for your input, I value it highly :-)

^ permalink raw reply

* Re: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) 1.0.0.7 md5 corrupted using NFS
From: Rebelyouth @ 2012-08-10 19:26 UTC (permalink / raw)
  To: netdev
In-Reply-To: <157393863283F442885425D2C454285623E19289@NASANEXD02A.na.qualcomm.com>


Hi Xiong,

Thank you for your replay,

I am in a middle of reinstall all my machines f, so for now I can send you my 
lspci and try to recreate the MD5 /SHA1 problem

I will send you another email when I get the result
Thanks in advance

 

00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge
        Subsystem: Advanced Micro Devices [AMD] RS780 Host Bridge
        Flags: bus master, 66MHz, medium devsel, latency 0
        Capabilities: <access denied>

00:02.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (ext 
gfx port 0) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 0000c000-0000cfff
        Memory behind bridge: fbd00000-fbdfffff
        Prefetchable memory behind bridge: 00000000d0000000-00000000dfffffff
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:06.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE 
port 2) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
        I/O behind bridge: 0000d000-0000dfff
        Memory behind bridge: fbe00000-fbefffff
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:07.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE 
port 3) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
        I/O behind bridge: 0000e000-0000efff
        Memory behind bridge: fbf00000-fbffffff
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI 
SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (prog-if 01 [AHCI 1.0])
        Subsystem: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA 
Controller [AHCI mode]
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 43
        I/O ports at b000 [size=8]
        I/O ports at a000 [size=4]
        I/O ports at 9000 [size=8]
        I/O ports at 8000 [size=4]
        I/O ports at 7000 [size=16]
        Memory at fbcffc00 (32-bit, non-prefetchable) [size=1K]
        Capabilities: <access denied>
        Kernel driver in use: ahci

00:12.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
USB OHCI0 Controller (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB 
OHCI0 Controller
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16
        Memory at fbcfd000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: ohci_hcd

00:12.1 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 
Controller (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 
Controller
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16
        Memory at fbcfe000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: ohci_hcd

00:12.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
USB EHCI Controller (prog-if 20 [EHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI Device 4397
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 17
        Memory at fbcff800 (32-bit, non-prefetchable) [size=256]
        Capabilities: <access denied>
        Kernel driver in use: ehci_hcd

00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
USB OHCI0 Controller (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI Device 4398
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18
        Memory at fbcfb000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: ohci_hcd

00:13.1 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 
Controller (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI Device 4399
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18
        Memory at fbcfc000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: ohci_hcd

00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
USB EHCI Controller (prog-if 20 [EHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB 
EHCI Controller
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 19
        Memory at fbcff400 (32-bit, non-prefetchable) [size=256]
        Capabilities: <access denied>
        Kernel driver in use: ehci_hcd

00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller 
(rev 3c)
        Subsystem: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller
        Flags: 66MHz, medium devsel
        Capabilities: <access denied>

00:14.1 IDE interface: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
IDE Controller (prog-if 8a [Master SecP PriP])
        Subsystem: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 IDE 
Controller
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16
        I/O ports at 01f0 [size=8]
        I/O ports at 03f4 [size=1]
        I/O ports at 0170 [size=8]
        I/O ports at 0374 [size=1]
        I/O ports at ff00 [size=16]
        Capabilities: <access denied>
        Kernel driver in use: pata_atiixp

00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel 
HDA)
        Subsystem: ASUSTeK Computer Inc. Device 8357
        Flags: bus master, slow devsel, latency 64, IRQ 16
        Memory at fbcf4000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel

00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 LPC 
host controller
        Subsystem: Advanced Micro Devices [AMD] nee ATI Device 4383
        Flags: bus master, 66MHz, medium devsel, latency 0

00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI SBx00 PCI to PCI 
Bridge (prog-if 01 [Subtractive decode])
        Flags: bus master, 66MHz, medium devsel, latency 64
        Bus: primary=00, secondary=04, subordinate=04, sec-latency=64

00:14.5 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 
USB OHCI2 Controller (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] nee ATI Device 4396
        Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18
        Memory at fbcfa000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: ohci_hcd

00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor 
HyperTransport Configuration
        Flags: fast devsel
        Capabilities: <access denied>

00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address 
Map
        Flags: fast devsel

00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM 
Controller
        Flags: fast devsel

00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor 
Miscellaneous Control
        Flags: fast devsel
        Capabilities: <access denied>
        Kernel driver in use: k10temp

00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link 
Control
        Flags: fast devsel

01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI 
Juniper [Radeon HD 5700 Series] (prog-if 00 [VGA controller])
        Subsystem: Micro-Star International Co., Ltd. Device 2140
        Flags: bus master, fast devsel, latency 0, IRQ 44
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at fbdc0000 (64-bit, non-prefetchable) [size=128K]
        I/O ports at c000 [size=256]
        Expansion ROM at fbda0000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: radeon

01:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI Juniper HDMI Audio 
[Radeon HD 5700 Series]
        Subsystem: Micro-Star International Co., Ltd. Device aa58
        Flags: bus master, fast devsel, latency 0, IRQ 45
        Memory at fbdfc000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel

02:00.0 Ethernet controller: Atheros Communications Inc. AR8121/AR8113/AR8114 
Gigabit or Fast Ethernet (rev b0)
        Subsystem: ASUSTeK Computer Inc. Device 831c
        Flags: bus master, fast devsel, latency 0, IRQ 46
        Memory at fbec0000 (64-bit, non-prefetchable) [size=256K]
        I/O ports at dc00 [size=128]
        Capabilities: <access denied>
        Kernel driver in use: ATL1E

03:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6315 Series Firewire 
Controller (prog-if 10 [OHCI])
        Subsystem: ASUSTeK Computer Inc. P8P67 Deluxe Motherboard
        Flags: bus master, fast devsel, latency 0, IRQ 19
        Memory at fbfff800 (64-bit, non-prefetchable) [size=2K]
        I/O ports at e800 [size=256]
        Capabilities: <access denied>
        Kernel driver in use: firewire_ohci

> Marco
>     Could you run lspci, and list the kernel oops ?
>     we could duplicate it using the same NIC.
> 
> 
> PS.     The driver of 1.0.1.14 is not for your NIC.
> 
> Thanks
> Xiong
> 
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> > On Behalf Of Marco Castiglione
> > Sent: Tuesday, August 07, 2012 1:03
> > To: netdev@vger.kernel.org
> > Subject: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or
> > Fast Ethernet (rev b0) 1.0.0.7 md5 corrupted using NFS
> > 
> > Hi,
> > 
> > I have a problem with :
> > 
> > Ethernet controller: Atheros Communications Inc. AR8121/AR8113/AR8114
> > Gigabit or Fast Ethernet (rev b0)
> > 
> >         Subsystem: ASUSTeK Computer Inc. Device 831c
> >         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> > 
> > ParErr-
> > Stepping- SERR+ FastB2B- DisINTx+
> > 
> >         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> > 
> > <TAbort- <MAbort- >SERR- <PERR- INTx-
> > 
> >         Latency: 0, Cache Line Size: 64 bytes
> >         Interrupt: pin A routed to IRQ 46
> >         Region 0: Memory at fbec0000 (64-bit, non-prefetchable)
> >         [size=256K] Region 2: I/O ports at dc00 [size=128]
> >         Capabilities: <access denied>
> >         Kernel driver in use: ATL1E
> > 
> > The driver working fine except for nfs3 and nfs4
> > 
> > If I try to copy a file bigger of 400 mb the file get corrupted, If I try
> > with multiple files I have a kernel oops
> > 
> > I tried different system and service (Ftp,samba) and they working fine.
> > 
> > I also tried to set nfs to use udp, it kinda fix the problem but only in
> > part (I get 1 on 3 big file with md5 mismatch).
> > 
> > I notice in almost every kernel from 2.6 to now 3.2.15 the driver is the
> > same version
> > 
> > Filename:       /lib/modules/3.2.0-2-amd64/
> > kernel/drivers/net/ethernet/atheros/atl1e/atl1e.ko
> > version:        1.0.0.7-NAPI
> > license:        GPL
> > description:    Atheros 1000M Ethernet Network Driver
> > author:         Atheros Corporation, <xiong.huang@atheros.com>, Jie Yang
> > < jie.yang@atheros.com>
> > srcversion:     6E5949327D7FDF32D5F4A5B
> > alias:          pci:v00001969d00001066sv*sd*bc*sc*i*
> > alias:          pci:v00001969d00001026sv*sd*bc*sc*i*
> > depends:
> > intree:         Y
> > vermagic:       3.2.0-2-amd64 SMP mod_unload modversions
> > parm:           tx_desc_cnt:Transmit description count (array of int)
> > parm:           rx_mem_size:memory size of rx buffer(KB) (array of int)
> > parm:           media_type:MediaType Select (array of int)
> > parm:           int_mod_timer:Interrupt Moderator Timer (array of int)
> > 
> > I found on ubuntu website the last version of the driver is 1.0.1.14 with
> > this change log :
> > 
> > 1.0.1.14
> > 
> >     1. don't define napi_struct in kcompat.h when GRO isn't supported.
> > 
> > 1.0.1.13
> > 
> >     1. fix AR8151-A hang when plug in LAN cable by cleaning bit1 of
> > 
> > REG(0x1114).
> > 
> > 1.0.1.12
> > 
> >     1. fix tpd, rfd, rrs, configure error for powerpc
> > 
> > 1.0.1.11
> > 
> >     1. only save power when WOL enable.
> > 
> > 1.0.1.10
> > 
> >     1. add l1d 2.0 support.
> >     2. fix atl1c_phy_power_saving bug.
> > 
> > 1.0.1.9
> > 
> >     1. fix AR8131 reset error TX pending.
> >     2. add AR8152 description.
> > 
> > 1.0.1.8
> > 
> >     1. add L2CB V2.0 support.
> > 
> > 1.0.1.7
> > 
> >     1. fix L0s/L1 bug.
> >     2. update suspend procedure.
> > 
> > 1.0.1.6
> > 
> >     1. fix valn error.
> >     2. use common task instead of reset task and link change task.
> >     3. reset phy when link down.
> > 
> > 1.0.1.5
> > 
> >     1. change rx mod.
> > 
> > 1.0.1.4
> > 
> >     1. add l1d support.
> > 
> > 1.0.1.3
> > 
> >     1. fix TSO error.
> > 
> > 1.0.1.2
> > 
> >     1. fix compile error for kernel >= 2.6.30.
> > 
> > 1.0.1.1
> > 
> >     1. add L2cB support.
> > 
> > 1.0.0.10
> > 
> >     1. fix memory leak when power suspend.
> > 
> > 1.0.0.9
> > 
> >     1. do power saving when bootup with link lost.
> >     2. remove ATL1C_INTR_CLEAR_ON_READ for power saving
> > 
> > 1.0.0.8
> > 
> >     1. remove dump_stack(), which was used for debugging.
> > 
> > So I found out the TSO is corrupt in the current version  and that
> > explain with the udp setting do the trick.
> > 
> > Now I tried to compile the new version from AR81Family-linux-
> > v1.0.1.14.tar.gz but was made for the 2.6 so I can't
> > compile.( <http://goog_56610235>
> > http://media.cdn.ubuntu-de.org/forum/attachments/2666793/AR81Family-
> > linux-
> > v1.0.1.14_10.10.tar.gz
> > )
> > 
> > The Atheros support and web page is gone after Qualcomm acquisition and
> > the patch I found on Ubuntu forum don't work either (
> > http://ubuntuforums.org/attachment.php?attachmentid=182141&d=1296221
> > 015)
> > 
> > I found out lots of people have the same issue and they using samba at
> > the moment.
> > 
> > My temp solution is use a usb/eth adapter with ax8112 chipset but it run
> > at 100mbps.
> > 
> > SO my request is this : Is possible for somebody of the kernel team look
> > the code inside AR81Family-linux-v1.0.1.14.tar.gz  and update the one in
> > the kernel 3.x?
> > 
> > Thank you for you time and consideration
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in the
> > body of a message to majordomo@vger.kernel.org More majordomo info at
> > http://vger.kernel.org/majordomo-info.html


Hi

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: Alan Cox @ 2012-08-10 19:28 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: H. Peter Anvin, Stanislav Kinsbursky,
	Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w, xemul-bzQdu9zFT3WakBO8gow8eQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	tim.c.chen-VuQAYsv1563Yd54FQh9/CA, devel-GEFAQzZX7r8dnm+yROfE0A
In-Reply-To: <20120810191149.GA17985-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>

On Fri, 10 Aug 2012 15:11:50 -0400
"J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org> wrote:

> On Fri, Aug 10, 2012 at 07:26:28PM +0100, Alan Cox wrote:
> > > On that whole subject...
> > > 
> > > Do we need a Unix domain socket equivalent to openat()?
> > 
> > I don't think so. The name is just a file system indexing trick, it's not
> > really the socket proper. It's little more than "ascii string with
> > permissions attached"
> 
> That's overstating the case.  As I understand it the address is resolved
> by a pathname lookup like any other--it can follow symlinks, is relative
> to the current working directory and filesystem namespace, etc. 

Explicitly for Linux yes - this is not generally true of the AF_UNIX
socket domain and even the permissions aspect isn't guaranteed to be
supported on some BSD environments !

The name is however just a proxy for the socket itself. You don't even
get a device node in the usual sense or the same inode in the file system
space.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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: WARNING: at net/ipv4/tcp.c:1598 tcp_recvmsg+0x641/0xd30()
From: Dave Jones @ 2012-08-10 20:29 UTC (permalink / raw)
  To: netdev; +Cc: Fedora Kernel Team
In-Reply-To: <20120806154616.GB2187@redhat.com>

On Mon, Aug 06, 2012 at 11:46:16AM -0400, Dave Jones wrote:
 > We just got an automated report of this WARN being hit in 3.5
 > 
 >  > backtrace:
 >  > :WARNING: at net/ipv4/tcp.c:1598 tcp_recvmsg+0x641/0xd30()
 >  > :Hardware name: P5Q DELUXE
 >  > :recvmsg bug: copied 99F66400 seq 99F6A4A8 rcvnxt 99F6CDAD fl 0
 >  > : [<ffffffff811848e6>] do_sync_read+0xe6/0x120
 >  > : [<ffffffff81275eea>] ? inode_has_perm.isra.31.constprop.61+0x2a/0x30
 >  > : [<ffffffff81272f32>] ? security_file_permission+0x92/0xb0
 >  > : [<ffffffff81184d81>] ? rw_verify_area+0x61/0xf0
 >  > : [<ffffffff811852cd>] vfs_read+0x15d/0x180
 >  > : [<ffffffff8118533a>] sys_read+0x4a/0x90
 >  > : [<ffffffff8160fc29>] system_call_fastpath+0x16/0x1b
 > 
 > 1594                         /* Now that we have two receive queues this
 > 1595                          * shouldn't happen.
 > 1596                          */
 > 1597                         if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
 > 1598                                  "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
 > 1599                                  *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
 > 1600                                  flags))
 > 1601                                 break;
 > 
 > 
 > Hopefully this means more to you guys than it does to me.

We're getting more reports of this happening too.

This guy managed to hit both of the recvmsg BUG's.

https://bugzilla.redhat.com/show_bug.cgi?id=846996
https://bugzilla.redhat.com/show_bug.cgi?id=846991

The first reporter claimed to be doing nothing special, just browsing with google chrome.

Anyone ?

	Dave

^ permalink raw reply

* Re: WARNING: at net/ipv4/tcp.c:1598 tcp_recvmsg+0x641/0xd30()
From: Eric Dumazet @ 2012-08-10 20:40 UTC (permalink / raw)
  To: Dave Jones; +Cc: netdev, Fedora Kernel Team
In-Reply-To: <20120810202910.GA19359@redhat.com>

On Fri, 2012-08-10 at 16:29 -0400, Dave Jones wrote:
> On Mon, Aug 06, 2012 at 11:46:16AM -0400, Dave Jones wrote:
>  > We just got an automated report of this WARN being hit in 3.5
>  > 
>  >  > backtrace:
>  >  > :WARNING: at net/ipv4/tcp.c:1598 tcp_recvmsg+0x641/0xd30()
>  >  > :Hardware name: P5Q DELUXE
>  >  > :recvmsg bug: copied 99F66400 seq 99F6A4A8 rcvnxt 99F6CDAD fl 0
>  >  > : [<ffffffff811848e6>] do_sync_read+0xe6/0x120
>  >  > : [<ffffffff81275eea>] ? inode_has_perm.isra.31.constprop.61+0x2a/0x30
>  >  > : [<ffffffff81272f32>] ? security_file_permission+0x92/0xb0
>  >  > : [<ffffffff81184d81>] ? rw_verify_area+0x61/0xf0
>  >  > : [<ffffffff811852cd>] vfs_read+0x15d/0x180
>  >  > : [<ffffffff8118533a>] sys_read+0x4a/0x90
>  >  > : [<ffffffff8160fc29>] system_call_fastpath+0x16/0x1b
>  > 
>  > 1594                         /* Now that we have two receive queues this
>  > 1595                          * shouldn't happen.
>  > 1596                          */
>  > 1597                         if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
>  > 1598                                  "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
>  > 1599                                  *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
>  > 1600                                  flags))
>  > 1601                                 break;
>  > 
>  > 
>  > Hopefully this means more to you guys than it does to me.
> 
> We're getting more reports of this happening too.
> 
> This guy managed to hit both of the recvmsg BUG's.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=846996
> https://bugzilla.redhat.com/show_bug.cgi?id=846991
> 
> The first reporter claimed to be doing nothing special, just browsing with google chrome.
> 
> Anyone ?

Might be a driver issue with LRO / GRO/ TCP coalescing

So we need a _lot_ of details.

^ permalink raw reply

* Re: [PATCH] ipv4: fix ip_send_skb()
From: David Miller @ 2012-08-10 21:09 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1344601367.31104.2672.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 10 Aug 2012 14:22:47 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> ip_send_skb() can send orphaned skb, so we must pass the net pointer to
> avoid possible NULL dereference in error path.
> 
> Bug added by commit 3a7c384ffd57 (ipv4: tcp: unicast_sock should not
> land outside of TCP stack)
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

^ permalink raw reply

* try your scekxual strength - use VjaqrRa sSupEer Acctivve Ppjills
From: Stuart Wacha @ 2012-08-10 13:09 UTC (permalink / raw)
  To: netdev

bBuy VjaqrRa ppiills in due course
 http://litoralcreativo.cl/_vti_txt/dis.php?Stuart Wacha
best wishes, Stuart Wacha

^ permalink raw reply

* Nice to meet you,
From: mary @ 2012-08-10 21:41 UTC (permalink / raw)



Nice to meet you,
Am miss Mary,interested in you,and wish to have you as my friend, for a friend is all about Respect,Admiration and love passion also friendship is consist of sharing of ideas and planing together, i intend to send you my picture for you,if you reply me.
thanks from Mary

^ permalink raw reply

* [PATCH 2/2] powerpc/85xx: add Fman MDIO muxing support to the P4080DS
From: Timur Tabi @ 2012-08-10 22:31 UTC (permalink / raw)
  To: Andy Fleming, Scott Wood, Kumar Gala, ddaney.cavm, linuxppc-dev,
	netdev
In-Reply-To: <1344637896-14267-1-git-send-email-timur@freescale.com>

The Freescale P4080 SOC contains two Fman Ethernet controllers, each of
which contains four 1G Ethernet MACs and one 10G Ethernet MAC.  The
SerDes protocol determines how the MACs are routed to various RGMII,
SGMII, or XGMII PHYs on the board, so the P4080DS reference board
provides a MDIO bus multiplexing feature that is controlled via GPIOs.

This patch adds the basic Ethernet, MDIO, mdio-mux, and PHY nodes
necessary to get MDIO bus muxing working, using Cavium's mdio-mux-gpio
driver.  The remaining DPAA nodes (Qman, Bman, etc), as well as the
DPAA device drivers, are not included.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |   12 +
 arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi  |    3 +
 arch/powerpc/boot/dts/p4080ds.dts           |  307 +++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/Kconfig         |    3 +
 arch/powerpc/platforms/85xx/corenet_ds.c    |    7 +
 5 files changed, 332 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index 8d35d2c..1ce5056 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -347,4 +347,16 @@
 /include/ "qoriq-usb2-mph-0.dtsi"
 /include/ "qoriq-usb2-dr-0.dtsi"
 /include/ "qoriq-sec4.0-0.dtsi"
+/include/ "qoriq-fman-0.dtsi"
+/include/ "qoriq-fman-0-1g-0.dtsi"
+/include/ "qoriq-fman-0-1g-1.dtsi"
+/include/ "qoriq-fman-0-1g-2.dtsi"
+/include/ "qoriq-fman-0-1g-3.dtsi"
+/include/ "qoriq-fman-0-10g-0.dtsi"
+/include/ "qoriq-fman-1.dtsi"
+/include/ "qoriq-fman-1-1g-0.dtsi"
+/include/ "qoriq-fman-1-1g-1.dtsi"
+/include/ "qoriq-fman-1-1g-2.dtsi"
+/include/ "qoriq-fman-1-1g-3.dtsi"
+/include/ "qoriq-fman-1-10g-0.dtsi"
 };
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
index b9556ee..1be6360 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
@@ -69,6 +69,9 @@
 		rtic_c = &rtic_c;
 		rtic_d = &rtic_d;
 		sec_mon = &sec_mon;
+
+		fman0 = &fman0;
+		fman1 = &fman1;
 	};
 
 	cpus {
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index 3e20460..68ae3bb 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -41,6 +41,44 @@
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
 
+	aliases {
+		ethernet0 = &fm1_gb0;	// FM1@DTSEC1
+		ethernet1 = &fm1_gb1;	// FM1@DTSEC2
+		ethernet2 = &fm1_gb2;	// FM1@DTSEC3
+		ethernet3 = &fm1_gb3;	// FM1@DTSEC4
+		ethernet4 = &fm1_10g;	// FM1@TGEC1
+		ethernet5 = &fm2_gb0;	// FM2@DTSEC1
+		ethernet6 = &fm2_gb1;	// FM2@DTSEC2
+		ethernet7 = &fm2_gb2;	// FM2@DTSEC3
+		ethernet8 = &fm2_gb3;	// FM2@DTSEC4
+		ethernet9 = &fm2_10g;	// FM2@TGEC1
+
+		phy_rgmii = &phy_rgmii;
+
+		phy_sgmii_slot3_1c = &phy_sgmii_slot3_1c;
+		phy_sgmii_slot3_1d = &phy_sgmii_slot3_1d;
+		phy_sgmii_slot3_1e = &phy_sgmii_slot3_1e;
+		phy_sgmii_slot3_1f = &phy_sgmii_slot3_1f;
+
+		phy_sgmii_slot4_1c = &phy_sgmii_slot4_1c;
+		phy_sgmii_slot4_1d = &phy_sgmii_slot4_1d;
+		phy_sgmii_slot4_1e = &phy_sgmii_slot4_1e;
+		phy_sgmii_slot4_1f = &phy_sgmii_slot4_1f;
+
+		phy_sgmii_slot5_1c = &phy_sgmii_slot5_1c;
+		phy_sgmii_slot5_1d = &phy_sgmii_slot5_1d;
+		phy_sgmii_slot5_1e = &phy_sgmii_slot5_1e;
+		phy_sgmii_slot5_1f = &phy_sgmii_slot5_1f;
+
+		// Used by U-Boot to find the mdio-mux nodes
+		emi1_rgmii = &emi1_rgmii;
+		emi1_slot3 = &emi1_slot3;
+		emi1_slot4 = &emi1_slot4;
+		emi1_slot5 = &emi1_slot5;
+		emi2_slot4 = &emi2_slot4;
+		emi2_slot5 = &emi2_slot5;
+	};
+
 	memory {
 		device_type = "memory";
 	};
@@ -106,6 +144,117 @@
 			dr_mode = "host";
 			phy_type = "ulpi";
 		};
+
+		fman0: fman@400000 {
+			fm1_gb0: ethernet@e0000 {
+				tbi-handle = <&tbi0>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio0: mdio@e1120 {
+				tbi0: tbi-phy@8 {
+					reg = <0x8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm1_gb1: ethernet@e2000 {
+				tbi-handle = <&tbi1>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e3120 {
+				tbi1: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm1_gb2: ethernet@e4000 {
+				tbi-handle = <&tbi2>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e5120 {
+				tbi2: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm1_gb3: ethernet@e6000 {
+				tbi-handle = <&tbi3>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e7120 {
+				tbi3: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm1_10g: ethernet@f0000 {
+				phy-handle = <&phy_xgmii_slot5>;
+				phy-connection-type = "xgmii";
+			};
+		};
+
+		fman1: fman@500000 {
+			fm2_gb0: ethernet@e0000 {
+				tbi-handle = <&tbi5>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e1120 {
+				tbi5: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm2_gb1: ethernet@e2000 {
+				tbi-handle = <&tbi6>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e3120 {
+				tbi6: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm2_gb2: ethernet@e4000 {
+				tbi-handle = <&tbi7>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e5120 {
+				tbi7: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm2_gb3: ethernet@e6000 {
+				tbi-handle = <&tbi8>;
+				phy-connection-type = "sgmii";
+			};
+
+			mdio@e7120 {
+				tbi8: tbi-phy@8 {
+					reg = <8>;
+					device_type = "tbi-phy";
+				};
+			};
+
+			fm2_10g: ethernet@f0000 {
+				phy-handle = <&phy_xgmii_slot4>;
+				phy-connection-type = "xgmii";
+			};
+		};
+
 	};
 
 	rio: rapidio@ffe0c0000 {
@@ -182,6 +331,164 @@
 		};
 	};
 
+	fsl,dpaa {
+		compatible = "fsl,p4080-dpaa", "fsl,dpaa";
+
+		ethernet@0 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm1_gb0>;
+		};
+		ethernet@1 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm1_gb1>;
+		};
+		ethernet@2 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm1_gb2>;
+		};
+		ethernet@3 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm1_gb3>;
+		};
+		ethernet@4 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm1_10g>;
+		};
+		ethernet@5 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm2_gb0>;
+		};
+		ethernet@6 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm2_gb1>;
+		};
+		ethernet@7 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm2_gb2>;
+		};
+		ethernet@8 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm2_gb3>;
+		};
+		ethernet@9 {
+			compatible = "fsl,p4080-dpa-ethernet", "fsl,dpa-ethernet";
+			fsl,fman-mac = <&fm2_10g>;
+		};
+	};
+
+	mdio-mux-emi1 {
+		compatible = "mdio-mux-gpio", "mdio-mux";
+		// The 'reg' property of the MDIO nodes is written to the
+		// GPIOs as a single number, but the driver parses the number
+		// in little-endian order, so these GPIO pins need to be in
+		// little-endian order.
+		gpios = <&gpio0 1 0>, <&gpio0 0 0>;
+		mdio-parent-bus = <&mdio0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		emi1_rgmii: mdio@0 {	// RGMII
+			status = "disabled";
+			reg = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_rgmii: ethernet-phy@0 {
+				reg = <0x0>;
+			};
+		};
+
+		emi1_slot3: mdio@2 {	// Slot 3 SGMII
+			status = "disabled";
+			reg = <2>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_sgmii_slot3_1c: ethernet-phy@1c {
+				reg = <0x1c>;
+			};
+			phy_sgmii_slot3_1d: ethernet-phy@1d {
+				reg = <0x1d>;
+			};
+			phy_sgmii_slot3_1e: ethernet-phy@1e {
+				reg = <0x1e>;
+			};
+			phy_sgmii_slot3_1f: ethernet-phy@1f {
+				reg = <0x1f>;
+			};
+		};
+
+		emi1_slot4: mdio@1 {	// Slot 4 SGMII
+			status = "disabled";
+			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_sgmii_slot4_1c: ethernet-phy@1c {
+				reg = <0x1c>;
+			};
+			phy_sgmii_slot4_1d: ethernet-phy@1d {
+				reg = <0x1d>;
+			};
+			phy_sgmii_slot4_1e: ethernet-phy@1e {
+				reg = <0x1e>;
+			};
+			phy_sgmii_slot4_1f: ethernet-phy@1f {
+				reg = <0x1f>;
+			};
+		};
+
+		emi1_slot5: mdio@3 {	// Slot 5 SGMII
+			status = "disabled";
+			reg = <3>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_sgmii_slot5_1c: ethernet-phy@1c {
+				reg = <0x1c>;
+			};
+			phy_sgmii_slot5_1d: ethernet-phy@1d {
+				reg = <0x1d>;
+			};
+			phy_sgmii_slot5_1e: ethernet-phy@1e {
+				reg = <0x1e>;
+			};
+			phy_sgmii_slot5_1f: ethernet-phy@1f {
+				reg = <0x1f>;
+			};
+		};
+	};
+
+	mdio-mux-emi2 {
+		compatible = "mdio-mux-gpio", "mdio-mux";
+		// The mdio-mux-gpio driver wants GPIOs in little-endian order
+		gpios = <&gpio0 3 0>, <&gpio0 2 0>;
+		mdio-parent-bus = <&xmdio0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		emi2_slot4: mdio@1 {	// Slot 4 XAUI (FM2)
+			status = "disabled";
+			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_xgmii_slot4: ethernet-phy@0 {
+				reg = <0>;
+			};
+		};
+
+		emi2_slot5: mdio@3 {	// Slot 5 XAUI (FM1)
+			status = "disabled";
+			reg = <3>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			phy_xgmii_slot5: ethernet-phy@4 {
+				reg = <4>;
+			};
+		};
+	};
 };
 
 /include/ "fsl/p4080si-post.dtsi"
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 159c01e..591ec5e 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -235,6 +235,9 @@ config P4080_DS
 	select GPIO_MPC8XXX
 	select HAS_RAPIDIO
 	select PPC_EPAPR_HV_PIC
+	select MPC8xxx_GPIO if PHYLIB
+	select MDIO_BUS_MUX if PHYLIB
+	select MDIO_BUS_MUX_GPIO if PHYLIB
 	help
 	  This option enables support for the P4080 DS board
 
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index 925b028..a79fc79 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -106,6 +106,13 @@ static const struct of_device_id of_device_ids[] __devinitconst = {
 	{
 		.name		= "handles",
 	},
+	{
+		/*
+		 * Warning: this entry might need to be located before those
+		 * for the Fman Ethernet nodes.
+		 */
+		.compatible	= "mdio-mux",
+	},
 	{}
 };
 
-- 
1.7.3.4

^ permalink raw reply related

* [PATCH 1/2] powerpc/85xx: add the Fman device tree template include files
From: Timur Tabi @ 2012-08-10 22:31 UTC (permalink / raw)
  To: Andy Fleming, Scott Wood, Kumar Gala, ddaney.cavm, linuxppc-dev,
	netdev

Introduce the template include files for the Freecale Frame Manager (Fman).
An SOC can have up to two Fman devices, and each Fman can have up to
five 1G Ethernet MACs and one 10G Ethernet MAC.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi       |  140 +++++++++++++++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi |   54 ++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi  |   63 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi       |  140 +++++++++++++++++++++
 14 files changed, 1027 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi
new file mode 100644
index 0000000..cc6bad3
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 10g port #0 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_10g_rx0: port@90000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-10g-rx";
+		reg = <0x90000 0x1000>;
+	};
+
+	fman0_10g_tx0: port@b0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-10g-tx";
+		reg = <0xb0000 0x1000>;
+		fsl,qman-channel-id = <0x40>;
+	};
+
+	ethernet@f0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-10g-mac";
+		reg = <0xf0000 0x1000>;
+		fsl,port-handles = <&fman0_10g_rx0 &fman0_10g_tx0>;
+	};
+
+	xmdio0: mdio@f1000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-xmdio";
+		reg = <0xf1000 0x1000>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi
new file mode 100644
index 0000000..d6dca2c
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #0 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_rx0: port@88000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x88000 0x1000>;
+	};
+
+	fman0_tx0: port@a8000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xa8000 0x1000>;
+	};
+
+	ethernet@e0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe0000 0x1000>;
+		fsl,port-handles = <&fman0_rx0 &fman0_tx0>;
+		ptimer-handle = <&ptp_timer0>;
+	};
+
+	mdio0: mdio@e1120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-mdio";
+		reg = <0xe1120 0xee0>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi
new file mode 100644
index 0000000..75e3dd6
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #1 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_rx1: port@89000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x89000 0x1000>;
+	};
+
+	fman0_tx1: port@a9000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xa9000 0x1000>;
+	};
+
+	ethernet@e2000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe2000 0x1000>;
+		fsl,port-handles = <&fman0_rx1 &fman0_tx1>;
+		ptimer-handle = <&ptp_timer0>;
+	};
+
+	mdio@e3120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe3120 0xee0>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi
new file mode 100644
index 0000000..d0fd687
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #2 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_rx2: port@8a000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8a000 0x1000>;
+	};
+
+	fman0_tx2: port@aa000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xaa000 0x1000>;
+	};
+
+	ethernet@e4000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe4000 0x1000>;
+		fsl,port-handles = <&fman0_rx2 &fman0_tx2>;
+		ptimer-handle = <&ptp_timer0>;
+	};
+
+	mdio@e5120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe5120 0xee0>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi
new file mode 100644
index 0000000..712785e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #3 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_rx3: port@8b000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8b000 0x1000>;
+	};
+
+	fman0_tx3: port@ab000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xab000 0x1000>;
+	};
+
+	ethernet@e6000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe6000 0x1000>;
+		fsl,port-handles = <&fman0_rx3 &fman0_tx3>;
+		ptimer-handle = <&ptp_timer0>;
+	};
+
+	mdio@e7120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe7120 0xee0>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi
new file mode 100644
index 0000000..0ba91f0
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #4 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@400000 {
+	fman0_rx4: port@8c000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8c000 0x1000>;
+	};
+
+	fman0_tx4: port@ac000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xac000 0x1000>;
+	};
+
+	ethernet@e8000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe8000 0x1000>;
+		fsl,port-handles = <&fman0_rx4 &fman0_tx4>;
+		ptimer-handle = <&ptp_timer0>;
+	};
+
+	mdio@e9120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe9120 0xee0>;
+		interrupts = <100 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi
new file mode 100644
index 0000000..c467e01
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi
@@ -0,0 +1,140 @@
+/*
+ * QorIQ FMan device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman0: fman@400000 {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	cell-index = <0>;
+	compatible = "fsl,fman", "simple-bus";
+	ranges = <0 0x400000 0x100000>;
+	reg = <0x400000 0x100000>;
+	clock-frequency = <0>;
+	interrupts = <
+		96 2 0 0
+		16 2 1 1>;
+
+	cc {
+		compatible = "fsl,fman-cc";
+	};
+
+	muram@0 {
+		compatible = "fsl,fman-muram";
+		reg = <0x0 0x28000>;
+	};
+
+	bmi@80000 {
+		compatible = "fsl,fman-bmi";
+		reg = <0x80000 0x400>;
+	};
+
+	qmi@80400 {
+		compatible = "fsl,fman-qmi";
+		reg = <0x80400 0x400>;
+	};
+
+	fman0_oh0: port@81000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x81000 0x1000>;
+	};
+
+	fman0_oh1: port@82000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x82000 0x1000>;
+	};
+
+	fman0_oh2: port@83000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x83000 0x1000>;
+	};
+
+	fman0_oh3: port@84000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x84000 0x1000>;
+	};
+
+	fman0_oh4: port@85000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x85000 0x1000>;
+		status = "disabled";
+	};
+
+	fman0_oh5: port@86000 {
+		cell-index = <5>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x86000 0x1000>;
+		status = "disabled";
+	};
+
+	fman0_oh6: port@87000 {
+		cell-index = <6>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x87000 0x1000>;
+		status = "disabled";
+	};
+
+	policer@c0000 {
+		compatible = "fsl,fman-policer";
+		reg = <0xc0000 0x1000>;
+	};
+
+	keygen@c1000 {
+		compatible = "fsl,fman-keygen";
+		reg = <0xc1000 0x1000>;
+	};
+
+	dma@c2000 {
+		compatible = "fsl,fman-dma";
+		reg = <0xc2000 0x1000>;
+	};
+
+	fpm@c3000 {
+		compatible = "fsl,fman-fpm";
+		reg = <0xc3000 0x1000>;
+	};
+
+	parser@c7000 {
+		compatible = "fsl,fman-parser";
+		reg = <0xc7000 0x1000>;
+	};
+
+	ptp_timer0: rtc@fe000 {
+		compatible = "fsl,fman-rtc";
+		reg = <0xfe000 0x1000>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi
new file mode 100644
index 0000000..2b05dee
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi
@@ -0,0 +1,54 @@
+/*
+ * QorIQ FMan 10g port #0 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_10g_rx0: port@90000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-10g-rx";
+		reg = <0x90000 0x1000>;
+	};
+
+	fman1_10g_tx0: port@b0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-10g-tx";
+		reg = <0xb0000 0x1000>;
+	};
+
+	ethernet@f0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-10g-mac";
+		reg = <0xf0000 0x1000>;
+		fsl,port-handles = <&fman1_10g_rx0 &fman1_10g_tx0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi
new file mode 100644
index 0000000..2c46174
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #0 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_rx0: port@88000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x88000 0x1000>;
+	};
+
+	fman1_tx0: port@a8000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xa8000 0x1000>;
+	};
+
+	ethernet@e0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe0000 0x1000>;
+		fsl,port-handles = <&fman1_rx0 &fman1_tx0>;
+		ptimer-handle = <&ptp_timer1>;
+	};
+
+	mdio@e1120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe1120 0xee0>;
+		interrupts = <101 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi
new file mode 100644
index 0000000..4bf2932
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #1 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_rx1: port@89000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x89000 0x1000>;
+	};
+
+	fman1_tx1: port@a9000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xa9000 0x1000>;
+	};
+
+	ethernet@e2000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe2000 0x1000>;
+		fsl,port-handles = <&fman1_rx1 &fman1_tx1>;
+		ptimer-handle = <&ptp_timer1>;
+	};
+
+	mdio@e3120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe3120 0xee0>;
+		interrupts = <101 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi
new file mode 100644
index 0000000..3ae25e4
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #2 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_rx2: port@8a000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8a000 0x1000>;
+	};
+
+	fman1_tx2: port@aa000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xaa000 0x1000>;
+	};
+
+	ethernet@e4000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe4000 0x1000>;
+		fsl,port-handles = <&fman1_rx2 &fman1_tx2>;
+		ptimer-handle = <&ptp_timer1>;
+	};
+
+	mdio@e5120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe5120 0xee0>;
+		interrupts = <101 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi
new file mode 100644
index 0000000..516d5b9
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #3 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_rx3: port@8b000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8b000 0x1000>;
+	};
+
+	fman1_tx3: port@ab000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xab000 0x1000>;
+	};
+
+	ethernet@e6000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe6000 0x1000>;
+		fsl,port-handles = <&fman1_rx3 &fman1_tx3>;
+		ptimer-handle = <&ptp_timer1>;
+	};
+
+	mdio@e7120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe7120 0xee0>;
+		interrupts = <101 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi
new file mode 100644
index 0000000..647b166
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi
@@ -0,0 +1,63 @@
+/*
+ * QorIQ FMan 1g port #4 device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman@500000 {
+	fman1_rx4: port@8c000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-1g-rx";
+		reg = <0x8c000 0x1000>;
+	};
+
+	fman1_tx4: port@ac000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-1g-tx";
+		reg = <0xac000 0x1000>;
+	};
+
+	ethernet@e8000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-1g-mac";
+		reg = <0xe8000 0x1000>;
+		fsl,port-handles = <&fman1_rx4 &fman1_tx4>;
+		ptimer-handle = <&ptp_timer1>;
+	};
+
+	mdio@e9120 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-tbi";
+		reg = <0xe9120 0xee0>;
+		interrupts = <101 1 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi
new file mode 100644
index 0000000..9e20dfa
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi
@@ -0,0 +1,140 @@
+/*
+ * QorIQ FMan device tree stub [ controller @ offset 0x500000 ]
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ */
+
+fman1: fman@500000 {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	cell-index = <1>;
+	compatible = "fsl,fman", "simple-bus";
+	ranges = <0 0x500000 0x100000>;
+	reg = <0x500000 0x100000>;
+	clock-frequency = <0>;
+	interrupts = <
+		97 2 0 0
+		16 2 1 0>;
+
+	cc {
+		compatible = "fsl,fman-cc";
+	};
+
+	muram@0 {
+		compatible = "fsl,fman-muram";
+		reg = <0x0 0x28000>;
+	};
+
+	bmi@80000 {
+		compatible = "fsl,fman-bmi";
+		reg = <0x80000 0x400>;
+	};
+
+	qmi@80400 {
+		compatible = "fsl,fman-qmi";
+		reg = <0x80400 0x400>;
+	};
+
+	fman1_oh0: port@81000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x81000 0x1000>;
+	};
+
+	fman1_oh1: port@82000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x82000 0x1000>;
+	};
+
+	fman1_oh2: port@83000 {
+		cell-index = <2>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x83000 0x1000>;
+	};
+
+	fman1_oh3: port@84000 {
+		cell-index = <3>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x84000 0x1000>;
+	};
+
+	fman1_oh4: port@85000 {
+		cell-index = <4>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x85000 0x1000>;
+		status = "disabled";
+	};
+
+	fman1_oh5: port@86000 {
+		cell-index = <5>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x86000 0x1000>;
+		status = "disabled";
+	};
+
+	fman1_oh6: port@87000 {
+		cell-index = <6>;
+		compatible = "fsl,fman-port-oh";
+		reg = <0x87000 0x1000>;
+		status = "disabled";
+	};
+
+	policer@c0000 {
+		compatible = "fsl,fman-policer";
+		reg = <0xc0000 0x1000>;
+	};
+
+	keygen@c1000 {
+		compatible = "fsl,fman-keygen";
+		reg = <0xc1000 0x1000>;
+	};
+
+	dma@c2000 {
+		compatible = "fsl,fman-dma";
+		reg = <0xc2000 0x1000>;
+	};
+
+	fpm@c3000 {
+		compatible = "fsl,fman-fpm";
+		reg = <0xc3000 0x1000>;
+	};
+
+	parser@c7000 {
+		compatible = "fsl,fman-parser";
+		reg = <0xc7000 0x1000>;
+	};
+
+	ptp_timer1: rtc@fe000 {
+		compatible = "fsl,fman-rtc";
+		reg = <0xfe000 0x1000>;
+	};
+};
-- 
1.7.3.4

^ permalink raw reply related

* Re: [PATCH 1/2] powerpc/85xx: add the Fman device tree template include files
From: Scott Wood @ 2012-08-10 22:34 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Andy Fleming, Kumar Gala, ddaney.cavm, linuxppc-dev, netdev
In-Reply-To: <1344637896-14267-1-git-send-email-timur@freescale.com>

On 08/10/2012 05:31 PM, Timur Tabi wrote:
> Introduce the template include files for the Freecale Frame Manager (Fman).
> An SOC can have up to two Fman devices, and each Fman can have up to
> five 1G Ethernet MACs and one 10G Ethernet MAC.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi       |  140 +++++++++++++++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi |   54 ++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi  |   63 +++++++++
>  arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi       |  140 +++++++++++++++++++++
>  14 files changed, 1027 insertions(+), 0 deletions(-)

Where's the binding document for all this?  Why isn't devicetree-discuss
on CC?

-Scott

^ permalink raw reply

* Re: [PATCH 1/2] powerpc/85xx: add the Fman device tree template include files
From: Timur Tabi @ 2012-08-10 22:37 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Andy Fleming, ddaney.cavm, netdev
In-Reply-To: <50258C5D.5070108@freescale.com>

Scott Wood wrote:
> Where's the binding document for all this?  Why isn't devicetree-discuss
> on CC?

Oops.  I don't even know if our existing documentation is up-to-date.
Ugh.  I'll dig it up and post a v2.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [RFC PATCH 0/2] net: connect to UNIX sockets from specified root
From: H. Peter Anvin @ 2012-08-10 23:09 UTC (permalink / raw)
  To: Alan Cox
  Cc: J. Bruce Fields, Stanislav Kinsbursky, Trond.Myklebust, davem,
	linux-nfs, eric.dumazet, xemul, netdev, linux-kernel, viro,
	tim.c.chen, devel
In-Reply-To: <20120810202818.06236f46@pyramind.ukuu.org.uk>

On 08/10/2012 12:28 PM, Alan Cox wrote:
> Explicitly for Linux yes - this is not generally true of the AF_UNIX
> socket domain and even the permissions aspect isn't guaranteed to be
> supported on some BSD environments !

Yes, but let's worry about what the Linux behavior should be.

> The name is however just a proxy for the socket itself. You don't even
> get a device node in the usual sense or the same inode in the file system
> space.


No, but it is looked up the same way any other inode is (the difference
between FIFOs and sockets is that sockets have separate connections,
which is also why open() on sockets would be nice.)

However, there is a fundamental difference between AF_UNIX sockets and
open(), and that is how the pathname is delivered.  It thus would make
more sense to provide the openat()-like information in struct
sockaddr_un, but that may be very hard to do in a sensible way.  In that
sense it perhaps would be cleaner to be able to do an open[at]() on the
socket node with O_PATH (perhaps there should be an O_SOCKET option,
even?) and pass the resulting file descriptor to bind() or connect().

	-hpa

^ 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