Netdev List
 help / color / mirror / Atom feed
* Re: slow performance on disk/network i/o full speed after drop_caches
From: Mel Gorman @ 2011-09-01 12:57 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Stefan Priebe - Profihost AG, Zhu Yanhai, Pekka Enberg, LKML,
	linux-mm@kvack.org, Andrew Morton, Jens Axboe, Linux Netdev List,
	KOSAKI Motohiro
In-Reply-To: <20110901041458.GA30123@localhost>

On Thu, Sep 01, 2011 at 12:14:58PM +0800, Wu Fengguang wrote:
> Hi Stefan,
> 
> On Wed, Aug 31, 2011 at 03:11:02PM +0800, Stefan Priebe - Profihost AG wrote:
> > Hi Fengguang,
> > Hi Yanhai,
> > 
> > > you're abssolutely corect zone_reclaim_mode is on - but why?
> > > There must be some linux software which switches it on.
> > >
> > > ~# grep 'zone_reclaim_mode' /etc/sysctl.* -r -i
> > > ~#
> > >
> > > also
> > > ~# grep 'zone_reclaim_mode' /etc/sysctl.* -r -i
> > > ~#
> > >
> > > tells us nothing.
> > >
> > > I've then read this:
> > >
> > > "zone_reclaim_mode is set during bootup to 1 if it is determined that
> > > pages from remote zones will cause a measurable performance reduction.
> > > The page allocator will then reclaim easily reusable pages (those page
> > > cache pages that are currently not used) before allocating off node pages."
> > >
> > > Why does the kernel do that here in our case on these machines.
> > 
> > Can nobody help why the kernel in this case set it to 1?
> 
> It's determined by RECLAIM_DISTANCE.
> 
> build_zonelists():
> 
>                 /*
>                  * If another node is sufficiently far away then it is better
>                  * to reclaim pages in a zone before going off node.
>                  */
>                 if (distance > RECLAIM_DISTANCE)
>                         zone_reclaim_mode = 1;
> 
> Since Linux v3.0 RECLAIM_DISTANCE is increased from 20 to 30 by this commit.
> It may well help your case, too.
> 

Even with that, it's known that zone_reclaim() can be a disaster when
it runs into problems. This should be fixed in 3.1 by the following
commits;

[cd38b115 mm: page allocator: initialise ZLC for first zone eligible for zone_reclaim]
[76d3fbf8 mm: page allocator: reconsider zones for allocation after direct reclaim]

The description in cd38b115 has the interesting details.

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply

* [PATCH v2 -next] 6LoWPAN: fix skb_copy call
From: Alexander Smirnov @ 2011-09-01 12:54 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1314879675-31989-1-git-send-email-alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

This patch fixes 2 issues in lowpan_skb_deliver function:
1. Check for return status of skb_copy call;
2. Use skb_copy with proper GFP flag depending on context.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 net/ieee802154/6lowpan.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index cf304cc..16100be 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -477,9 +477,15 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
 	struct sk_buff *new;
 	struct lowpan_dev_record *entry;
 	int stat = NET_RX_SUCCESS;
+	gfp_t mask;
 
-	new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
-								GFP_KERNEL);
+	if (in_interrupt())
+		mask = GFP_ATOMIC;
+	else
+		mask = GFP_KERNEL;
+
+	new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
+					skb_tailroom(skb), mask);
 	kfree_skb(skb);
 
 	if (NULL == new)
@@ -495,7 +501,13 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
 	rcu_read_lock();
 	list_for_each_entry_rcu(entry, &lowpan_devices, list)
 		if (lowpan_dev_info(entry->ldev)->real_dev == new->dev) {
-			skb = skb_copy(new, GFP_KERNEL);
+			skb = skb_copy(new, mask);
+
+			if (NULL == skb) {
+				stat = -ENOMEM;
+				break;
+			}
+
 			skb->dev = entry->ldev;
 
 			if (in_interrupt())
-- 
1.7.2.5


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

^ permalink raw reply related

* e1000e - BUG: sleeping function called from invalid context
From: Francois Romieu @ 2011-09-01 12:20 UTC (permalink / raw)
  To: netdev
  Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
	Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak

I got this one while running plain 'ip link show' with linus's post
3.1.0-rc3 (CONFIG_DEBUG_ATOMIC_SLEEP=y, 82544 LOM with Intel DP55KG
motherboard):

[18628.524980] BUG: sleeping function called from invalid context at /home/romieu/git/linux-2.6-ref/kernel/mutex.c:85
[18628.524987] in_atomic(): 1, irqs_disabled(): 0, pid: 1204, name: irqbalance
[18628.524993] Pid: 1204, comm: irqbalance Not tainted 3.1.0-rc3+ #4
[18628.524996] Call Trace:
[18628.525007]  [<ffffffff810421a1>] __might_sleep+0xeb/0xf0
[18628.525032]  [<ffffffff814a9dd8>] mutex_lock+0x24/0x4a
[18628.525040]  [<ffffffff8124dc82>] ? vsnprintf+0x83/0x44c
[18628.525057]  [<ffffffffa01e1697>] e1000_acquire_swflag_ich8lan+0x27/0x138 [e1000e]
[18628.525078]  [<ffffffffa01f0bae>] e1000e_update_stats+0x158/0x750 [e1000e]
[18628.525098]  [<ffffffffa01f11e8>] e1000e_get_stats64+0x42/0x143 [e1000e]
[18628.525105]  [<ffffffff813f4986>] dev_get_stats+0x38/0x7a
[18628.525110]  [<ffffffff813f49f0>] dev_seq_printf_stats+0x28/0xf8
[18628.525118]  [<ffffffff813f33e2>] ? dev_seq_start+0x1f/0x70
[18628.525123]  [<ffffffff813f4ae2>] dev_seq_show+0x22/0x26

The path looks the same in linus's (9e79e3e9dd9672b37ac9412e9a926714306551fe)
and in davem's net-next (3857e3ee2209b7289c434103e366f765ec82a22d) branches:

e1000e_get_stats64
-> spin_lock(&adapter->stats64_lock);
   e1000e_update_stats
   -> e1000e_update_phy_stats
      -> e1000_acquire_swflag_ich8lan (through hw->phy.ops.acquire)
         -> mutex_lock(&swflag_mutex);

Can you fix it ?

(either turn stats64_lock into a mutex or remove it - and swflag_mutex as
well ? - and use the rtnl sem in your work tasks from a quick glance at
the code)

Thanks.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH v2 -next] 6LoWPAN: fix skb_copy call
From: Alexander Smirnov @ 2011-09-01 12:34 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: davem, dbaryshkov, slapin, linux-zigbee-devel, netdev,
	kernel-janitors
In-Reply-To: <1314878443.2823.6.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

Hi Eric,

hmm, I think you are right.

First 6LoWPAN implementation was developed as a part of MAC layer and
code was based on this layer approach. But now 6lowpan is
MAC-independent, it's just a netif_rx hook and looks like I missed
this moment during migration.

sorry for confusion.

With best regards,
Alexander

2011/9/1 Eric Dumazet <eric.dumazet@gmail.com>:
> Le jeudi 01 septembre 2011 à 16:54 +0400, Alexander Smirnov a écrit :
>> This patch fixes 2 issues in lowpan_skb_deliver function:
>> 1. Check for return status of skb_copy call;
>> 2. Use skb_copy with proper GFP flag depending on context.
>>
>> Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
>> ---
>>  net/ieee802154/6lowpan.c |   18 +++++++++++++++---
>>  1 files changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
>> index cf304cc..16100be 100644
>> --- a/net/ieee802154/6lowpan.c
>> +++ b/net/ieee802154/6lowpan.c
>> @@ -477,9 +477,15 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
>>       struct sk_buff *new;
>>       struct lowpan_dev_record *entry;
>>       int stat = NET_RX_SUCCESS;
>> +     gfp_t mask;
>>
>> -     new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
>> -                                                             GFP_KERNEL);
>> +     if (in_interrupt())
>> +             mask = GFP_ATOMIC;
>> +     else
>> +             mask = GFP_KERNEL;
>
> I am not sure to understand if lowpan_skb_deliver() can be called in
> pure process context. I feel we are in softirq handler or we have
> disabled BH, so GFP_ATOMIC is the only choice.
>
> If you are unsure, you could use following helper :
>
>        mask = gfp_any();
>
>> +
>> +     new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
>> +                                     skb_tailroom(skb), mask);
>>       kfree_skb(skb);
>>
>
>

^ permalink raw reply

* Re: [PATCH 2/2] Add a netlink attribute INET_DIAG_SECCTX
From: Paul Moore @ 2011-09-01 12:28 UTC (permalink / raw)
  To: Rongqing Li; +Cc: netdev, selinux, linux-security-module
In-Reply-To: <4E5F5153.6070708@windriver.com>

On Thursday, September 01, 2011 05:33:07 PM Rongqing Li wrote:
> On 09/01/2011 05:18 AM, Paul Moore wrote:
> > On Wednesday, August 31, 2011 04:36:17 PM rongqing.li@windriver.com wrote:
> >> From: Roy.Li<rongqing.li@windriver.com>
> >> 
> >> Add a new netlink attribute INET_DIAG_SECCTX to dump the security
> >> context of TCP sockets.
> > 
> > You'll have to forgive me, I'm not familiar with the netlink code used
> > by
> > netstat and friends, but is there anyway to report back the security
> > context of UDP sockets?  Or does the code below handle that already?
> > 
> > In general, AF_INET and AF_INET6 sockets, regardless of any upper level
> > protocols, have security contexts associated with them and it would be
> > nice to see them in netstat.
> 
> Yes, this is real concern, If the dumping tcp security context can be
> accepted by netdev, I am planning to implement it for ipv4 udp socket, unix
> socket. then ipv6..

Great, I'm glad to hear you're planning on implementing this for more than 
just TCP.

I understand your desire to have the basic idea accepted with only TCP 
implemented - and that is fine with me - but I would like to see support for 
all of the protocols merged at the same time.  In other words, seeking the 
basic ACKs for TCP from the davem, et al is okay but I'd like to defer merging 
TCP support until you have everything implemented and ready to be merged.

-- 
paul moore
www.paul-moore.com


^ permalink raw reply

* [PATCH 1/1 -next] 6LoWPAN: fix skb_copy call
From: Alexander Smirnov @ 2011-09-01 12:21 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

This patch fixes 2 issues in lowpan_skb_deliver function:
1. Check for return status of skb_copy call;
2. Use skb_copy with proper GFP flag depending on context.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 net/ieee802154/6lowpan.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index cf304cc..cac1361 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -477,9 +477,15 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
 	struct sk_buff *new;
 	struct lowpan_dev_record *entry;
 	int stat = NET_RX_SUCCESS;
+	gfp_t mask;
 
-	new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
-								GFP_KERNEL);
+	if (in_interrupt())
+		mask = GFP_ATOMIC;
+	else
+		mask = GFP_KERNEL;
+
+	new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
+					skb_tailroom(skb), mask);
 	kfree_skb(skb);
 
 	if (NULL == new)
@@ -495,7 +501,13 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
 	rcu_read_lock();
 	list_for_each_entry_rcu(entry, &lowpan_devices, list)
 		if (lowpan_dev_info(entry->ldev)->real_dev == new->dev) {
-			skb = skb_copy(new, GFP_KERNEL);
+			skb = skb_copy(new, mask);
+
+			if (NULL == skb) {
+				kfree_skb(new);
+				return -ENOMEM;
+			}
+
 			skb->dev = entry->ldev;
 
 			if (in_interrupt())
-- 
1.7.2.5


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

^ permalink raw reply related

* Re: [PATCH v2 -next] 6LoWPAN: fix skb_copy call
From: Daniel Baluta @ 2011-09-01 12:10 UTC (permalink / raw)
  To: Alexander Smirnov
  Cc: davem, dbaryshkov, slapin, linux-zigbee-devel, netdev,
	eric.dumazet, kernel-janitors
In-Reply-To: <1314881653-1104-1-git-send-email-alex.bluesman.smirnov@gmail.com>

> +                       if (NULL == skb) {
> +                               stat = -ENOMEM;
> +                               break;
> +                       }

This can hurt our eyes :). I think the common convention
is to use: "if (skb == NULL) " or simply "if (!skb) "

thanks,
Daniel.

^ permalink raw reply

* Re: [PATCH v2 -next] 6LoWPAN: fix skb_copy call
From: Eric Dumazet @ 2011-09-01 12:00 UTC (permalink / raw)
  To: Alexander Smirnov
  Cc: davem, dbaryshkov, slapin, linux-zigbee-devel, netdev,
	kernel-janitors
In-Reply-To: <1314881653-1104-1-git-send-email-alex.bluesman.smirnov@gmail.com>

Le jeudi 01 septembre 2011 à 16:54 +0400, Alexander Smirnov a écrit :
> This patch fixes 2 issues in lowpan_skb_deliver function:
> 1. Check for return status of skb_copy call;
> 2. Use skb_copy with proper GFP flag depending on context.
> 
> Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
> ---
>  net/ieee802154/6lowpan.c |   18 +++++++++++++++---
>  1 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index cf304cc..16100be 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -477,9 +477,15 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
>  	struct sk_buff *new;
>  	struct lowpan_dev_record *entry;
>  	int stat = NET_RX_SUCCESS;
> +	gfp_t mask;
>  
> -	new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
> -								GFP_KERNEL);
> +	if (in_interrupt())
> +		mask = GFP_ATOMIC;
> +	else
> +		mask = GFP_KERNEL;

I am not sure to understand if lowpan_skb_deliver() can be called in
pure process context. I feel we are in softirq handler or we have
disabled BH, so GFP_ATOMIC is the only choice.

If you are unsure, you could use following helper :

	mask = gfp_any();

> +
> +	new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
> +					skb_tailroom(skb), mask);
>  	kfree_skb(skb);
>  

^ permalink raw reply

* Re: [PATCH net-next] net: linkwatch: allow vlans to get carrier changes faster
From: HAYASAKA Mitsuo @ 2011-09-01 11:53 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Herbert Xu, Stephen Hemminger, Patrick McHardy, David S. Miller,
	MichałMirosław, Tom Herbert, Jesse Gross, netdev,
	linux-kernel, yrl.pp-manager.tt
In-Reply-To: <1314783118.2801.13.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

Hi Eric,

I checked this patch solves the time-lag of IFF_RUNNING flag consistency
between vlan and real devices. 

Cheers.

Tested-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>


(2011/08/31 18:31), Eric Dumazet wrote:
> There is a time-lag of IFF_RUNNING flag consistency between vlan and
> real devices when the real devices are in problem such as link or cable
> broken.
> 
> This leads to a degradation of Availability such as a delay of failover
> in HA systems using vlan since the detection of the problem at real
> device is delayed.
> 
> We can avoid the linkwatch delay (~1 sec) for devices linked to another
> ones, since delay is already done for the realdev.
> 
> Based on a previous patch from Mitsuo Hayasaka
> 
> Reported-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
> Cc: Tom Herbert <therbert@google.com>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Jesse Gross <jesse@nicira.com>
> ---
>  net/core/link_watch.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/link_watch.c b/net/core/link_watch.c
> index 357bd4e..c3519c6 100644
> --- a/net/core/link_watch.c
> +++ b/net/core/link_watch.c
> @@ -78,8 +78,13 @@ static void rfc2863_policy(struct net_device *dev)
>  
>  static bool linkwatch_urgent_event(struct net_device *dev)
>  {
> -	return netif_running(dev) && netif_carrier_ok(dev) &&
> -		qdisc_tx_changing(dev);
> +	if (!netif_running(dev))
> +		return false;
> +
> +	if (dev->ifindex != dev->iflink)
> +		return true;
> +
> +	return netif_carrier_ok(dev) &&	qdisc_tx_changing(dev);
>  }
>  
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply

* Re: [PATCH 1/1 -next] 6LoWPAN: fix skb_copy call
From: Eric Dumazet @ 2011-09-01 11:30 UTC (permalink / raw)
  To: Alexander Smirnov
  Cc: davem, dbaryshkov, slapin, linux-zigbee-devel, netdev,
	kernel-janitors
In-Reply-To: <1314879675-31989-1-git-send-email-alex.bluesman.smirnov@gmail.com>

Le jeudi 01 septembre 2011 à 16:21 +0400, Alexander Smirnov a écrit :
> This patch fixes 2 issues in lowpan_skb_deliver function:
> 1. Check for return status of skb_copy call;
> 2. Use skb_copy with proper GFP flag depending on context.
> 

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>

patch adds a new bug, see below

> Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
> ---
>  net/ieee802154/6lowpan.c |   18 +++++++++++++++---
>  1 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index cf304cc..cac1361 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -477,9 +477,15 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
>  	struct sk_buff *new;
>  	struct lowpan_dev_record *entry;
>  	int stat = NET_RX_SUCCESS;
> +	gfp_t mask;
>  
> -	new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
> -								GFP_KERNEL);
> +	if (in_interrupt())
> +		mask = GFP_ATOMIC;
> +	else
> +		mask = GFP_KERNEL;
> +
> +	new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
> +					skb_tailroom(skb), mask);
>  	kfree_skb(skb);
>  
>  	if (NULL == new)
> @@ -495,7 +501,13 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(entry, &lowpan_devices, list)
>  		if (lowpan_dev_info(entry->ldev)->real_dev == new->dev) {
> -			skb = skb_copy(new, GFP_KERNEL);
> +			skb = skb_copy(new, mask);
> +
> +			if (NULL == skb) {
> +				kfree_skb(new);

rcu_read_unlock() missing.

	just do : 
			stat = -ENOMEM;
			break; (to exit from list_for_each_entry_rcu()) 

> +				return -ENOMEM;
> +			}
> +
>  			skb->dev = entry->ldev;
>  
>  			if (in_interrupt())

^ permalink raw reply

* RE: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Vladislav Zolotarov @ 2011-09-01 10:52 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Michal Schmidt, netdev@vger.kernel.org, Dmitry Kravkov,
	Eilon Greenstein
In-Reply-To: <CAHXqBFJR=5zTZeq+HnfRp2rb9yX3L=Kjwi_1AyWU2EDqZ=gCWQ@mail.gmail.com>

> If I understand correctly, bnx2x_reload_if_running() failure does not
> mean exactly that features change failed. It means that device failed
> to initialize, possibly because of other (transient?) conditions. So
> unless reverting features change and retrying the initialization is
> known to allow the device to be brought back, 

In a general case u can't be sure which (if at all) features change caused
the failure. So, u should return the configuration to the last known "good" one.

> there's no difference
> whether old or new dev->features value is kept and which set is
> reported by ethtool.

Well, I disagree with u on this one - I think that if the state change operation
(of any object, in our case it's a netdev) fails, the current state should remain unchanged.

Thanks,
vlad

> 
> Best Regards,
> Michał Mirosław

^ permalink raw reply

* Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Michał Mirosław @ 2011-09-01  9:37 UTC (permalink / raw)
  To: Vladislav Zolotarov
  Cc: Michal Schmidt, netdev@vger.kernel.org, Dmitry Kravkov,
	Eilon Greenstein
In-Reply-To: <8628FE4E7912BF47A96AE7DD7BAC0AAD01067097B03C@SJEXCHCCR02.corp.ad.broadcom.com>

W dniu 1 września 2011 10:37 użytkownik Vladislav Zolotarov
<vladz@broadcom.com> napisał:
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-
>> owner@vger.kernel.org] On Behalf Of Michal Miroslaw
>> Sent: Wednesday, August 31, 2011 9:05 PM
>> To: Vladislav Zolotarov
>> Cc: Michal Schmidt; netdev@vger.kernel.org; Dmitry Kravkov; Eilon
>> Greenstein
>> Subject: Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
>>
>> 2011/8/31 Vladislav Zolotarov <vladz@broadcom.com>:
>> >> -----Original Message-----
>> >> From: Michal Schmidt [mailto:mschmidt@redhat.com]
>> >> Sent: Wednesday, August 31, 2011 6:59 PM
>> >> To: Vladislav Zolotarov
>> >> Cc: netdev@vger.kernel.org; Dmitry Kravkov; Eilon Greenstein;
>> >> mirqus@gmail.com
>> >> Subject: Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
>> >>
>> >> On Wed, 31 Aug 2011 18:16:30 +0300 Vlad Zolotarov wrote:
>> >> > On Wednesday 31 August 2011 18:00:34 Michal Schmidt wrote:
>> >> > >   if (bnx2x_reload) {
>> >> > > -         if (bp->recovery_state == BNX2X_RECOVERY_DONE)
>> >> > > +         if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
>> >> > > +                 /*
>> >> > > +                  * Cheat! Normally dev->features will be
>> >> > > set after we
>> >> > > +                  * return, but that's too late. We need to
>> >> > > know how to
>> >> > > +                  * configure the NIC when reloading it, so
>> >> > > update
>> >> > > +                  * the features early.
>> >> > > +                  */
>> >> > > +                 dev->features = features;
>> >> > >                   return bnx2x_reload_if_running(dev);
>> >> >
>> >> > NACK
>> >> >
>> >> > This is bogus - what if bnx2x_reload_if_running(dev)
>> >> > (bnx2x_nic_load()) failes? The original dev->features would be
>> >> > lost...
>> >>
>> >> Well, yes, but since the NIC would be now not working, do we really
>> >> care about its features? :-)
>> >
>> > U r kidding, right? ;)
>> > We care about the consistency in the netdev features state - if we
>> failed
>> > to configure the requested feature and returned an error on e.g.
>> "ethtool -K ethX lro on"
>> > call, it's expected that a subsequent ethtool -k ethX call won't
>> report the requested
>> > feature (LRO) as set.
>>
>> If bnx2x_reload_if_running() failure means that NIC is disabled, then
>> Michal is right that there's no point in caring about dev->features,
>> sice 'load' operation (NIC configuration) needs to be done again
>> anyway.
> Michal, it's a matter of a consistent semantics/behavior of the ethtool callbacks just as I described above.
> As long as dev->features may be queried both when device is down I'm afraid I can't agree with u.

If I understand correctly, bnx2x_reload_if_running() failure does not
mean exactly that features change failed. It means that device failed
to initialize, possibly because of other (transient?) conditions. So
unless reverting features change and retrying the initialization is
known to allow the device to be brought back, there's no difference
whether old or new dev->features value is kept and which set is
reported by ethtool.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: [PATCH 2/2] Add a netlink attribute INET_DIAG_SECCTX
From: Rongqing Li @ 2011-09-01  9:33 UTC (permalink / raw)
  To: Paul Moore; +Cc: netdev, selinux, linux-security-module
In-Reply-To: <2593215.lUI7et83Qv@sifl>

On 09/01/2011 05:18 AM, Paul Moore wrote:
> On Wednesday, August 31, 2011 04:36:17 PM rongqing.li@windriver.com wrote:
>> From: Roy.Li<rongqing.li@windriver.com>
>>
>> Add a new netlink attribute INET_DIAG_SECCTX to dump the security
>> context of TCP sockets.
>
> You'll have to forgive me, I'm not familiar with the netlink code used by
> netstat and friends, but is there anyway to report back the security context
> of UDP sockets?  Or does the code below handle that already?
>
> In general, AF_INET and AF_INET6 sockets, regardless of any upper level
> protocols, have security contexts associated with them and it would be nice to
> see them in netstat.
>

Yes, this is real concern, If the dumping tcp security context can be 
accepted
by netdev, I am planning to implement it for ipv4 udp socket, unix socket.
then ipv6..

>> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
>> index 389a2e6..1faf752 100644
>> --- a/net/ipv4/inet_diag.c
>> +++ b/net/ipv4/inet_diag.c
>> @@ -34,6 +34,8 @@
>>
>>   #include<linux/inet_diag.h>
>>
>> +#define MAX_SECCTX_LEN 128
>
> I'll echo Stephen's concerns that this is too small.  A MCS/MLS system with a
> moderate number of categories could bump into this limit without too much
> difficulty.
>

I will reconsider this as Stephen's suggestion, just size the buffer 
appropriately
for the actual secctx length, so that, your next question will be fixed 
since we
have enough memory to place the security context.

>>   struct inet_diag_entry {
>> @@ -108,6 +110,25 @@ static int inet_csk_diag_fill(struct sock *sk,
>>   		       icsk->icsk_ca_ops->name);
>>   	}
>>
>> +	if (ext&  (1<<  (INET_DIAG_SECCTX - 1))) {
>> +		u32 ctxlen = 0;
>> +		void *secctx;
>> +		int error;
>> +
>> +		error = security_sk_getsecctx(sk,&secctx,&ctxlen);
>> +
>> +		if (!error&&  ctxlen) {
>> +			if (ctxlen<  MAX_SECCTX_LEN) {
>> +				strcpy(INET_DIAG_PUT(skb, INET_DIAG_SECCTX,
>> +					ctxlen + 1), secctx);
>> +			} else {
>> +				strcpy(INET_DIAG_PUT(skb, INET_DIAG_SECCTX,
>> +					2), "-");
>
> Is the "-" string a special value already interpreted by the userspace tools?
> If not, you might consider using a string that would indicate an out-of-space
> condition occurred; at first glance I thought the "-" string indicated no
> context.
>
>> +			}
>> +			security_release_secctx(secctx, ctxlen);
>> +		}
>> +	}
>> +
>>   	r->idiag_family = sk->sk_family;
>>   	r->idiag_state = sk->sk_state;
>>   	r->idiag_timer = 0;
>> @@ -246,7 +267,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff
>> *skb, static int inet_diag_get_exact(struct sk_buff *in_skb,
>>   			       const struct nlmsghdr *nlh)
>>   {
>> -	int err;
>> +	int err, len;
>>   	struct sock *sk;
>>   	struct inet_diag_req *req = NLMSG_DATA(nlh);
>>   	struct sk_buff *rep;
>> @@ -293,10 +314,17 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
>> goto out;
>>
>>   	err = -ENOMEM;
>> -	rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) +
>> -				     sizeof(struct inet_diag_meminfo) +
>> -				     handler->idiag_info_size + 64)),
>> -			GFP_KERNEL);
>> +	len = sizeof(struct inet_diag_msg) + 64;
>> +
>> +	len += (req->idiag_ext&  (1<<  (INET_DIAG_MEMINFO - 1))) ?
>> +		sizeof(struct inet_diag_meminfo) : 0;
>> +	len += (req->idiag_ext&  (1<<  (INET_DIAG_INFO - 1))) ?
>> +		handler->idiag_info_size : 0;
>> +	len += (req->idiag_ext&  (1<<  (INET_DIAG_SECCTX - 1))) ?
>> +		MAX_SECCTX_LEN : 0;
>> +
>> +	rep = alloc_skb(NLMSG_SPACE(len), GFP_KERNEL);
>
> How much of a problem would it be if you just allocated an entire page (or 4k
> in the case of huge pages) and used that?  Is memory usage a concern here?
>

The memory usage is main concern, or else the 4k page is good idea.
Other side is that this function is few called, so the 4k maybe acceptable.



-- 
Best Reagrds,
Roy | RongQing Li

^ permalink raw reply

* Re: [patch 1/3 -next] 6LoWPAN: use kfree_skb() instead of kfree()
From: Alexander Smirnov @ 2011-09-01  9:26 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Dan Carpenter, Dmitry Eremin-Solenikov, Sergey Lapin,
	David S. Miller, open list:IEEE 802.15.4 SUB...,
	open list:NETWORKING [GENERAL], kernel-janitors
In-Reply-To: <1314715248.2935.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

Hi Dan, Eric,

thank you a lot for the finds, that were my faults.

With best regards,
Alexander


2011/8/30 Eric Dumazet <eric.dumazet@gmail.com>:
> Le mardi 30 août 2011 à 16:45 +0300, Dan Carpenter a écrit :
>> Use kfree_skb() to free sbk_buffs.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>
>> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
>> index cf304cc..8a9dbaa 100644
>> --- a/net/ieee802154/6lowpan.c
>> +++ b/net/ieee802154/6lowpan.c
>> @@ -674,7 +674,7 @@ lowpan_process_data(struct sk_buff *skb)
>>                                                       sizeof(hdr));
>>       return lowpan_skb_deliver(skb, &hdr);
>>  drop:
>> -     kfree(skb);
>> +     kfree_skb(skb);
>>       return -EINVAL;
>>  }
>>
>
> Another bug is the skb_copy() done in lowpan_skb_deliver()
>
> 1) No check of skb_copy() return
>
> 2.1) Use of GFP_KERNEL : Is it safe at this point ? Aren’t we in
> softirq ?
>
> 2.2) If GFP_KERNEL is safe, why do we later do :
>
>        if (in_interrupt())
>                stat = netif_rx(skb);
>        else
>                stat = netif_rx_ni(skb);
>
>
>
>

^ permalink raw reply

* [PATCH 2/2] mii: Remove references to DP83840 PHY in mii.h
From: Mark Einon @ 2011-09-01  9:22 UTC (permalink / raw)
  To: netdev; +Cc: bhutchings, davem, Mark Einon
In-Reply-To: <1314868937-2536-1-git-send-email-mark.einon@gmail.com>

There are references to this PHY chip in the generic mii.h header, so removing them.
Re-jiggle the changed comments, in response to points raised by Ben Hutchings.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 include/linux/mii.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mii.h b/include/linux/mii.h
index d9f7750..2774823 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -39,12 +39,12 @@
 #define BMCR_CTST		0x0080	/* Collision test              */
 #define BMCR_FULLDPLX		0x0100	/* Full duplex                 */
 #define BMCR_ANRESTART		0x0200	/* Auto negotiation restart    */
-#define BMCR_ISOLATE		0x0400	/* Disconnect DP83840 from MII */
-#define BMCR_PDOWN		0x0800	/* Powerdown the DP83840       */
+#define BMCR_ISOLATE		0x0400	/* Isolate data paths from MII */
+#define BMCR_PDOWN		0x0800	/* Enable low power state      */
 #define BMCR_ANENABLE		0x1000	/* Enable auto negotiation     */
 #define BMCR_SPEED100		0x2000	/* Select 100Mbps              */
 #define BMCR_LOOPBACK		0x4000	/* TXD loopback bits           */
-#define BMCR_RESET		0x8000	/* Reset the DP83840           */
+#define BMCR_RESET		0x8000	/* Reset to default state      */
 
 /* Basic mode status register. */
 #define BMSR_ERCAP		0x0001	/* Ext-reg capability          */
-- 
1.7.6

^ permalink raw reply related

* [PATCH 1/2] [TRIVIAL] mii: Convert spaces to tabs in mii.h
From: Mark Einon @ 2011-09-01  9:22 UTC (permalink / raw)
  To: netdev; +Cc: bhutchings, davem, Mark Einon
In-Reply-To: <1314804928-7353-1-git-send-email-mark.einon@gmail.com>

Whitespace changes - spaces converted to tabs after each define name and value

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 include/linux/mii.h |  210 +++++++++++++++++++++++++--------------------------
 1 files changed, 104 insertions(+), 106 deletions(-)

diff --git a/include/linux/mii.h b/include/linux/mii.h
index 103113a..d9f7750 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -11,131 +11,130 @@
 #include <linux/types.h>
 
 /* Generic MII registers. */
-
-#define MII_BMCR            0x00        /* Basic mode control register */
-#define MII_BMSR            0x01        /* Basic mode status register  */
-#define MII_PHYSID1         0x02        /* PHYS ID 1                   */
-#define MII_PHYSID2         0x03        /* PHYS ID 2                   */
-#define MII_ADVERTISE       0x04        /* Advertisement control reg   */
-#define MII_LPA             0x05        /* Link partner ability reg    */
-#define MII_EXPANSION       0x06        /* Expansion register          */
-#define MII_CTRL1000        0x09        /* 1000BASE-T control          */
-#define MII_STAT1000        0x0a        /* 1000BASE-T status           */
-#define MII_ESTATUS	    0x0f	/* Extended Status */
-#define MII_DCOUNTER        0x12        /* Disconnect counter          */
-#define MII_FCSCOUNTER      0x13        /* False carrier counter       */
-#define MII_NWAYTEST        0x14        /* N-way auto-neg test reg     */
-#define MII_RERRCOUNTER     0x15        /* Receive error counter       */
-#define MII_SREVISION       0x16        /* Silicon revision            */
-#define MII_RESV1           0x17        /* Reserved...                 */
-#define MII_LBRERROR        0x18        /* Lpback, rx, bypass error    */
-#define MII_PHYADDR         0x19        /* PHY address                 */
-#define MII_RESV2           0x1a        /* Reserved...                 */
-#define MII_TPISTATUS       0x1b        /* TPI status for 10mbps       */
-#define MII_NCONFIG         0x1c        /* Network interface config    */
+#define MII_BMCR		0x00	/* Basic mode control register */
+#define MII_BMSR		0x01	/* Basic mode status register  */
+#define MII_PHYSID1		0x02	/* PHYS ID 1                   */
+#define MII_PHYSID2		0x03	/* PHYS ID 2                   */
+#define MII_ADVERTISE		0x04	/* Advertisement control reg   */
+#define MII_LPA			0x05	/* Link partner ability reg    */
+#define MII_EXPANSION		0x06	/* Expansion register          */
+#define MII_CTRL1000		0x09	/* 1000BASE-T control          */
+#define MII_STAT1000		0x0a	/* 1000BASE-T status           */
+#define MII_ESTATUS		0x0f	/* Extended Status             */
+#define MII_DCOUNTER		0x12	/* Disconnect counter          */
+#define MII_FCSCOUNTER		0x13	/* False carrier counter       */
+#define MII_NWAYTEST		0x14	/* N-way auto-neg test reg     */
+#define MII_RERRCOUNTER		0x15	/* Receive error counter       */
+#define MII_SREVISION		0x16	/* Silicon revision            */
+#define MII_RESV1		0x17	/* Reserved...                 */
+#define MII_LBRERROR		0x18	/* Lpback, rx, bypass error    */
+#define MII_PHYADDR		0x19	/* PHY address                 */
+#define MII_RESV2		0x1a	/* Reserved...                 */
+#define MII_TPISTATUS		0x1b	/* TPI status for 10mbps       */
+#define MII_NCONFIG		0x1c	/* Network interface config    */
 
 /* Basic mode control register. */
-#define BMCR_RESV               0x003f  /* Unused...                   */
-#define BMCR_SPEED1000		0x0040  /* MSB of Speed (1000)         */
-#define BMCR_CTST               0x0080  /* Collision test              */
-#define BMCR_FULLDPLX           0x0100  /* Full duplex                 */
-#define BMCR_ANRESTART          0x0200  /* Auto negotiation restart    */
-#define BMCR_ISOLATE            0x0400  /* Disconnect DP83840 from MII */
-#define BMCR_PDOWN              0x0800  /* Powerdown the DP83840       */
-#define BMCR_ANENABLE           0x1000  /* Enable auto negotiation     */
-#define BMCR_SPEED100           0x2000  /* Select 100Mbps              */
-#define BMCR_LOOPBACK           0x4000  /* TXD loopback bits           */
-#define BMCR_RESET              0x8000  /* Reset the DP83840           */
+#define BMCR_RESV		0x003f	/* Unused...                   */
+#define BMCR_SPEED1000		0x0040	/* MSB of Speed (1000)         */
+#define BMCR_CTST		0x0080	/* Collision test              */
+#define BMCR_FULLDPLX		0x0100	/* Full duplex                 */
+#define BMCR_ANRESTART		0x0200	/* Auto negotiation restart    */
+#define BMCR_ISOLATE		0x0400	/* Disconnect DP83840 from MII */
+#define BMCR_PDOWN		0x0800	/* Powerdown the DP83840       */
+#define BMCR_ANENABLE		0x1000	/* Enable auto negotiation     */
+#define BMCR_SPEED100		0x2000	/* Select 100Mbps              */
+#define BMCR_LOOPBACK		0x4000	/* TXD loopback bits           */
+#define BMCR_RESET		0x8000	/* Reset the DP83840           */
 
 /* Basic mode status register. */
-#define BMSR_ERCAP              0x0001  /* Ext-reg capability          */
-#define BMSR_JCD                0x0002  /* Jabber detected             */
-#define BMSR_LSTATUS            0x0004  /* Link status                 */
-#define BMSR_ANEGCAPABLE        0x0008  /* Able to do auto-negotiation */
-#define BMSR_RFAULT             0x0010  /* Remote fault detected       */
-#define BMSR_ANEGCOMPLETE       0x0020  /* Auto-negotiation complete   */
-#define BMSR_RESV               0x00c0  /* Unused...                   */
-#define BMSR_ESTATEN		0x0100	/* Extended Status in R15 */
-#define BMSR_100HALF2           0x0200  /* Can do 100BASE-T2 HDX */
-#define BMSR_100FULL2           0x0400  /* Can do 100BASE-T2 FDX */
-#define BMSR_10HALF             0x0800  /* Can do 10mbps, half-duplex  */
-#define BMSR_10FULL             0x1000  /* Can do 10mbps, full-duplex  */
-#define BMSR_100HALF            0x2000  /* Can do 100mbps, half-duplex */
-#define BMSR_100FULL            0x4000  /* Can do 100mbps, full-duplex */
-#define BMSR_100BASE4           0x8000  /* Can do 100mbps, 4k packets  */
+#define BMSR_ERCAP		0x0001	/* Ext-reg capability          */
+#define BMSR_JCD		0x0002	/* Jabber detected             */
+#define BMSR_LSTATUS		0x0004	/* Link status                 */
+#define BMSR_ANEGCAPABLE	0x0008	/* Able to do auto-negotiation */
+#define BMSR_RFAULT		0x0010	/* Remote fault detected       */
+#define BMSR_ANEGCOMPLETE	0x0020	/* Auto-negotiation complete   */
+#define BMSR_RESV		0x00c0	/* Unused...                   */
+#define BMSR_ESTATEN		0x0100	/* Extended Status in R15      */
+#define BMSR_100HALF2		0x0200	/* Can do 100BASE-T2 HDX       */
+#define BMSR_100FULL2		0x0400	/* Can do 100BASE-T2 FDX       */
+#define BMSR_10HALF		0x0800	/* Can do 10mbps, half-duplex  */
+#define BMSR_10FULL		0x1000	/* Can do 10mbps, full-duplex  */
+#define BMSR_100HALF		0x2000	/* Can do 100mbps, half-duplex */
+#define BMSR_100FULL		0x4000	/* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4		0x8000	/* Can do 100mbps, 4k packets  */
 
 /* Advertisement control register. */
-#define ADVERTISE_SLCT          0x001f  /* Selector bits               */
-#define ADVERTISE_CSMA          0x0001  /* Only selector supported     */
-#define ADVERTISE_10HALF        0x0020  /* Try for 10mbps half-duplex  */
-#define ADVERTISE_1000XFULL     0x0020  /* Try for 1000BASE-X full-duplex */
-#define ADVERTISE_10FULL        0x0040  /* Try for 10mbps full-duplex  */
-#define ADVERTISE_1000XHALF     0x0040  /* Try for 1000BASE-X half-duplex */
-#define ADVERTISE_100HALF       0x0080  /* Try for 100mbps half-duplex */
-#define ADVERTISE_1000XPAUSE    0x0080  /* Try for 1000BASE-X pause    */
-#define ADVERTISE_100FULL       0x0100  /* Try for 100mbps full-duplex */
-#define ADVERTISE_1000XPSE_ASYM 0x0100  /* Try for 1000BASE-X asym pause */
-#define ADVERTISE_100BASE4      0x0200  /* Try for 100mbps 4k packets  */
-#define ADVERTISE_PAUSE_CAP     0x0400  /* Try for pause               */
-#define ADVERTISE_PAUSE_ASYM    0x0800  /* Try for asymetric pause     */
-#define ADVERTISE_RESV          0x1000  /* Unused...                   */
-#define ADVERTISE_RFAULT        0x2000  /* Say we can detect faults    */
-#define ADVERTISE_LPACK         0x4000  /* Ack link partners response  */
-#define ADVERTISE_NPAGE         0x8000  /* Next page bit               */
-
-#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
-			ADVERTISE_CSMA)
-#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-                       ADVERTISE_100HALF | ADVERTISE_100FULL)
+#define ADVERTISE_SLCT		0x001f	/* Selector bits               */
+#define ADVERTISE_CSMA		0x0001	/* Only selector supported     */
+#define ADVERTISE_10HALF	0x0020	/* Try for 10mbps half-duplex  */
+#define ADVERTISE_1000XFULL	0x0020	/* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL	0x0040	/* Try for 10mbps full-duplex  */
+#define ADVERTISE_1000XHALF	0x0040	/* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF	0x0080	/* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE	0x0080	/* Try for 1000BASE-X pause    */
+#define ADVERTISE_100FULL	0x0100	/* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM	0x0100	/* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4	0x0200	/* Try for 100mbps 4k packets  */
+#define ADVERTISE_PAUSE_CAP	0x0400	/* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM	0x0800	/* Try for asymetric pause     */
+#define ADVERTISE_RESV		0x1000	/* Unused...                   */
+#define ADVERTISE_RFAULT	0x2000	/* Say we can detect faults    */
+#define ADVERTISE_LPACK		0x4000	/* Ack link partners response  */
+#define ADVERTISE_NPAGE		0x8000	/* Next page bit               */
+
+#define ADVERTISE_FULL		(ADVERTISE_100FULL | ADVERTISE_10FULL | \
+				  ADVERTISE_CSMA)
+#define ADVERTISE_ALL		(ADVERTISE_10HALF | ADVERTISE_10FULL | \
+				  ADVERTISE_100HALF | ADVERTISE_100FULL)
 
 /* Link partner ability register. */
-#define LPA_SLCT                0x001f  /* Same as advertise selector  */
-#define LPA_10HALF              0x0020  /* Can do 10mbps half-duplex   */
-#define LPA_1000XFULL           0x0020  /* Can do 1000BASE-X full-duplex */
-#define LPA_10FULL              0x0040  /* Can do 10mbps full-duplex   */
-#define LPA_1000XHALF           0x0040  /* Can do 1000BASE-X half-duplex */
-#define LPA_100HALF             0x0080  /* Can do 100mbps half-duplex  */
-#define LPA_1000XPAUSE          0x0080  /* Can do 1000BASE-X pause     */
-#define LPA_100FULL             0x0100  /* Can do 100mbps full-duplex  */
-#define LPA_1000XPAUSE_ASYM     0x0100  /* Can do 1000BASE-X pause asym*/
-#define LPA_100BASE4            0x0200  /* Can do 100mbps 4k packets   */
-#define LPA_PAUSE_CAP           0x0400  /* Can pause                   */
-#define LPA_PAUSE_ASYM          0x0800  /* Can pause asymetrically     */
-#define LPA_RESV                0x1000  /* Unused...                   */
-#define LPA_RFAULT              0x2000  /* Link partner faulted        */
-#define LPA_LPACK               0x4000  /* Link partner acked us       */
-#define LPA_NPAGE               0x8000  /* Next page bit               */
+#define LPA_SLCT		0x001f	/* Same as advertise selector  */
+#define LPA_10HALF		0x0020	/* Can do 10mbps half-duplex   */
+#define LPA_1000XFULL		0x0020	/* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL		0x0040	/* Can do 10mbps full-duplex   */
+#define LPA_1000XHALF		0x0040	/* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF		0x0080	/* Can do 100mbps half-duplex  */
+#define LPA_1000XPAUSE		0x0080	/* Can do 1000BASE-X pause     */
+#define LPA_100FULL		0x0100	/* Can do 100mbps full-duplex  */
+#define LPA_1000XPAUSE_ASYM	0x0100	/* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4		0x0200	/* Can do 100mbps 4k packets   */
+#define LPA_PAUSE_CAP		0x0400	/* Can pause                   */
+#define LPA_PAUSE_ASYM		0x0800	/* Can pause asymetrically     */
+#define LPA_RESV		0x1000	/* Unused...                   */
+#define LPA_RFAULT		0x2000	/* Link partner faulted        */
+#define LPA_LPACK		0x4000	/* Link partner acked us       */
+#define LPA_NPAGE		0x8000	/* Next page bit               */
 
 #define LPA_DUPLEX		(LPA_10FULL | LPA_100FULL)
 #define LPA_100			(LPA_100FULL | LPA_100HALF | LPA_100BASE4)
 
 /* Expansion register for auto-negotiation. */
-#define EXPANSION_NWAY          0x0001  /* Can do N-way auto-nego      */
-#define EXPANSION_LCWP          0x0002  /* Got new RX page code word   */
-#define EXPANSION_ENABLENPAGE   0x0004  /* This enables npage words    */
-#define EXPANSION_NPCAPABLE     0x0008  /* Link partner supports npage */
-#define EXPANSION_MFAULTS       0x0010  /* Multiple faults detected    */
-#define EXPANSION_RESV          0xffe0  /* Unused...                   */
+#define EXPANSION_NWAY		0x0001	/* Can do N-way auto-nego      */
+#define EXPANSION_LCWP		0x0002	/* Got new RX page code word   */
+#define EXPANSION_ENABLENPAGE	0x0004	/* This enables npage words    */
+#define EXPANSION_NPCAPABLE	0x0008	/* Link partner supports npage */
+#define EXPANSION_MFAULTS	0x0010	/* Multiple faults detected    */
+#define EXPANSION_RESV		0xffe0	/* Unused...                   */
 
-#define ESTATUS_1000_TFULL	0x2000	/* Can do 1000BT Full */
-#define ESTATUS_1000_THALF	0x1000	/* Can do 1000BT Half */
+#define ESTATUS_1000_TFULL	0x2000	/* Can do 1000BT Full          */
+#define ESTATUS_1000_THALF	0x1000	/* Can do 1000BT Half          */
 
 /* N-way test register. */
-#define NWAYTEST_RESV1          0x00ff  /* Unused...                   */
-#define NWAYTEST_LOOPBACK       0x0100  /* Enable loopback for N-way   */
-#define NWAYTEST_RESV2          0xfe00  /* Unused...                   */
+#define NWAYTEST_RESV1		0x00ff	/* Unused...                   */
+#define NWAYTEST_LOOPBACK	0x0100	/* Enable loopback for N-way   */
+#define NWAYTEST_RESV2		0xfe00	/* Unused...                   */
 
 /* 1000BASE-T Control register */
-#define ADVERTISE_1000FULL      0x0200  /* Advertise 1000BASE-T full duplex */
-#define ADVERTISE_1000HALF      0x0100  /* Advertise 1000BASE-T half duplex */
+#define ADVERTISE_1000FULL	0x0200  /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF	0x0100  /* Advertise 1000BASE-T half duplex */
 #define CTL1000_AS_MASTER	0x0800
 #define CTL1000_ENABLE_MASTER	0x1000
 
 /* 1000BASE-T Status register */
-#define LPA_1000LOCALRXOK       0x2000  /* Link partner local receiver status */
-#define LPA_1000REMRXOK         0x1000  /* Link partner remote receiver status */
-#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
-#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */
+#define LPA_1000LOCALRXOK	0x2000	/* Link partner local receiver status */
+#define LPA_1000REMRXOK		0x1000	/* Link partner remote receiver status */
+#define LPA_1000FULL		0x0800	/* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF		0x0400	/* Link partner 1000BASE-T half duplex */
 
 /* Flow control flags */
 #define FLOW_CTRL_TX		0x01
@@ -149,7 +148,7 @@ struct mii_ioctl_data {
 	__u16		val_out;
 };
 
-#ifdef __KERNEL__ 
+#ifdef __KERNEL__
 
 #include <linux/if.h>
 
@@ -180,7 +179,7 @@ extern unsigned int mii_check_media (struct mii_if_info *mii,
 				     unsigned int ok_to_print,
 				     unsigned int init_media);
 extern int generic_mii_ioctl(struct mii_if_info *mii_if,
-                      	     struct mii_ioctl_data *mii_data, int cmd,
+			     struct mii_ioctl_data *mii_data, int cmd,
 			     unsigned int *duplex_changed);
 
 
@@ -189,7 +188,6 @@ static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
 	return (struct mii_ioctl_data *) &rq->ifr_ifru;
 }
 
-
 /**
  * mii_nway_result
  * @negotiated: value of MII ANAR and'd with ANLPAR
-- 
1.7.6

^ permalink raw reply related

* Re: [PATCH] mii: Remove references to DP83840 PHY in mii.h
From: Mark Einon @ 2011-09-01  9:22 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, davem
In-Reply-To: <1314812070.3274.19.camel@bwh-desktop>

On 31 August 2011 18:34, Ben Hutchings <bhutchings@solarflare.com> wrote:
>
> Since you're trying to improve these comments, I think this could do
> with further improvement.  When this bit is set, the PHY's data paths
> are isolated from the MII (or other interface to the MAC).  The control
> path is still connected to the management interface (MDIO), which is
> important when we want to clear this bit!  So it would be better to say
> something like 'Isolate data paths fromn MII'.

>
> This selects a low-power state (if implemented).  It doesn't entirely
> turn the PHY off, and at least the management interface must stil be
> functional.  So it would be better to say 'Request low-power state'.

Hi Ben,

Fair points, hope I've addressed these in the revised patch.

> This formatting change is unrelated.  If you're going to fix formatting
> then please convert spaces to tabs after each name and value.
>

Done, and broken out into a separate patch.

Cheers,

Mark

^ permalink raw reply

* RE: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Vladislav Zolotarov @ 2011-09-01  8:37 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Michal Schmidt, netdev@vger.kernel.org, Dmitry Kravkov,
	Eilon Greenstein
In-Reply-To: <CAHXqBF+f=3yM88CJ+FpNELBb+Sof5q1=pTXm303-QN7y6M9Dsg@mail.gmail.com>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Michal Miroslaw
> Sent: Wednesday, August 31, 2011 9:05 PM
> To: Vladislav Zolotarov
> Cc: Michal Schmidt; netdev@vger.kernel.org; Dmitry Kravkov; Eilon
> Greenstein
> Subject: Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
> 
> 2011/8/31 Vladislav Zolotarov <vladz@broadcom.com>:
> >> -----Original Message-----
> >> From: Michal Schmidt [mailto:mschmidt@redhat.com]
> >> Sent: Wednesday, August 31, 2011 6:59 PM
> >> To: Vladislav Zolotarov
> >> Cc: netdev@vger.kernel.org; Dmitry Kravkov; Eilon Greenstein;
> >> mirqus@gmail.com
> >> Subject: Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
> >>
> >> On Wed, 31 Aug 2011 18:16:30 +0300 Vlad Zolotarov wrote:
> >> > On Wednesday 31 August 2011 18:00:34 Michal Schmidt wrote:
> >> > >   if (bnx2x_reload) {
> >> > > -         if (bp->recovery_state == BNX2X_RECOVERY_DONE)
> >> > > +         if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
> >> > > +                 /*
> >> > > +                  * Cheat! Normally dev->features will be
> >> > > set after we
> >> > > +                  * return, but that's too late. We need to
> >> > > know how to
> >> > > +                  * configure the NIC when reloading it, so
> >> > > update
> >> > > +                  * the features early.
> >> > > +                  */
> >> > > +                 dev->features = features;
> >> > >                   return bnx2x_reload_if_running(dev);
> >> >
> >> > NACK
> >> >
> >> > This is bogus - what if bnx2x_reload_if_running(dev)
> >> > (bnx2x_nic_load()) failes? The original dev->features would be
> >> > lost...
> >>
> >> Well, yes, but since the NIC would be now not working, do we really
> >> care about its features? :-)
> >
> > U r kidding, right? ;)
> > We care about the consistency in the netdev features state - if we
> failed
> > to configure the requested feature and returned an error on e.g.
> "ethtool -K ethX lro on"
> > call, it's expected that a subsequent ethtool -k ethX call won't
> report the requested
> > feature (LRO) as set.
> 
> If bnx2x_reload_if_running() failure means that NIC is disabled, then
> Michal is right that there's no point in caring about dev->features,
> sice 'load' operation (NIC configuration) needs to be done again
> anyway.

Michal, it's a matter of a consistent semantics/behavior of the ethtool callbacks just as I described above.
As long as dev->features may be queried both when device is down I'm afraid I can't agree with u.

Thanks,
vlad

> 
> Best Regards,
> Michał Mirosław
> --
> 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


^ permalink raw reply

* [linux-firmware v4 1/2] rtl_nic: update firmware for RTL8111E-VL
From: Hayes Wang @ 2011-09-01  7:07 UTC (permalink / raw)
  To: dwmw2; +Cc: romieu, netdev, Hayes Wang

Updated firmware with stability fixes.
Version: 0.0.2

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 WHENCE                |    2 ++
 rtl_nic/rtl8168e-3.fw |  Bin 2804 -> 3552 bytes
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/WHENCE b/WHENCE
index a47b307..3803906 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1657,7 +1657,9 @@ File: rtl_nic/rtl8168d-2.fw
 File: rtl_nic/rtl8105e-1.fw
 File: rtl_nic/rtl8168e-1.fw
 File: rtl_nic/rtl8168e-2.fw
+
 File: rtl_nic/rtl8168e-3.fw
+Version: 0.0.2
 
 Licence:
  * Copyright © 2011, Realtek Semiconductor Corporation
diff --git a/rtl_nic/rtl8168e-3.fw b/rtl_nic/rtl8168e-3.fw
index cb494071d0273c7b3102b97552f4bc7b756c0e17..525f467e04229c52fbc38676b2bbdc93832bc945 100644
GIT binary patch
literal 3552
zcmaKve{5Cd8OPsy+xzsE9~)pR9DZDGe?Uc~?Y&Ga?vHiMEi6%ENR~`pMwgT<E*gxG
z4L9AM3S6}nVsxM`S=Vj;vyEGkk?jvN${z%iEm>BCL?*a%YYT3gdouzpl$N{CbI-Zt
zXvl7I@_paueSZIV&$-Sy_tehEyD}TPwyj&gwX?mmJ)7?A>R6x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!cJ1~>im{8Vz-`~JVLoPJ1tB3k(VpR;cq
z549yM4sWVk$qW8X<XXk|Uzp~?dm}aE3&HPpjQ6?tvjF3!v&>}THF4M7;BBXOiog9s
zF>vEIZ8AI_W~DZNKJ5$Yws{?ujYFHW#^(WkJG!`Y<!z7G1&-)U&tto>L9`)HUyyrg
zPV@=(`B&iJVbPyF^k9Cnhkmj>Slwfy59L$Fqy2}R%G%R#hg|&c<--4_g@POZZ(97n
VdHX+Uxf?6kf6?+D|9>1#e*sYqwB!H)

-- 
1.7.6

^ permalink raw reply related

* [linux-firmware v4 2/2] rtl_nic: add new firmware for RTL8111F
From: Hayes Wang @ 2011-09-01  7:07 UTC (permalink / raw)
  To: dwmw2; +Cc: romieu, netdev, Hayes Wang
In-Reply-To: <1314860833-4000-1-git-send-email-hayeswang@realtek.com>

Add new firmware:
1. rtl_nic/rtl8168f-1.fw
   version: 0.0.2
2. rtl_nic/rtl8168f-2.fw
   version: 0.0.2

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 WHENCE                |    6 ++++++
 rtl_nic/rtl8168f-1.fw |  Bin 0 -> 3024 bytes
 rtl_nic/rtl8168f-2.fw |  Bin 0 -> 336 bytes
 3 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 rtl_nic/rtl8168f-1.fw
 create mode 100644 rtl_nic/rtl8168f-2.fw

diff --git a/WHENCE b/WHENCE
index 3803906..ea3918c 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1661,6 +1661,12 @@ File: rtl_nic/rtl8168e-2.fw
 File: rtl_nic/rtl8168e-3.fw
 Version: 0.0.2
 
+File: rtl_nic/rtl8168f-1.fw
+Version: 0.0.2
+
+File: rtl_nic/rtl8168f-2.fw
+Version: 0.0.2
+
 Licence:
  * Copyright © 2011, Realtek Semiconductor Corporation
  *
diff --git a/rtl_nic/rtl8168f-1.fw b/rtl_nic/rtl8168f-1.fw
new file mode 100644
index 0000000000000000000000000000000000000000..ffb1dd137eebeb2394acbfcf14c96a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@(RsDZkm<<p=7`QpM{QQ@zi5AGOYML5`Tv40
z{EwT>I)_8t{^REVw?6uBJH$nDafY;*Um>gCo?^^BpQ<i+$U7Hv-C6tp8^gAL$oGfm
MzqYOImd5}71$?3tJpcdz

literal 0
HcmV?d00001

diff --git a/rtl_nic/rtl8168f-2.fw b/rtl_nic/rtl8168f-2.fw
new file mode 100644
index 0000000000000000000000000000000000000000..880a223f35ab98b5367d2d1ee788ac0c9b05d762
GIT binary patch
literal 336
zcmXw!y-EX75QUEk8YD%wS#>~kA+_0i?~<^j5w%s2yud<;R)L6ETFfJeRqT8MpCOem
z;a{vRY(+5f%(A&~_=YnxoI3z;eKXE|FTXqph3mLZNL-#~KJ}hGd*{?4HN@bw7lJ!3
z21jSb$z*g<c<=I%B_ZqkZolhs2ka|$pg@e}HxhD&DYQX9#U6cJtpRgj*M<^B?QsO#
zTX(Bnn{9J;qrRmLYKmB!x1tZmvFKODALB%HLAJ;ja+7=||DHtOs{Xt2S@eVah3K68
pbi(+!%m6bidzA}pqXtCe%=|h92o_7bN9aXW9hLp^-}iP7@DF!bO921?

literal 0
HcmV?d00001

-- 
1.7.6

^ permalink raw reply related

* [PATCH net-next v2 3/4] r8169: fix the reset setting for 8111evl
From: Hayes Wang @ 2011-09-01  6:53 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1314860034-3911-1-git-send-email-hayeswang@realtek.com>

rtl8111evl should stop any TLP requirement before resetting by
enabling register 0x37 bit 7.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 193daf1..b999433 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3995,6 +3995,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
 		while (RTL_R8(TxPoll) & NPQ)
 			udelay(20);
 	} else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
+		RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
 		while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
 			udelay(100);
 	} else {
-- 
1.7.6

^ permalink raw reply related

* [PATCH net-next v2 1/4] r8169: fix WOL setting for 8105 and 8111EVL
From: Hayes Wang @ 2011-09-01  6:53 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang

rtl8105, rtl8111E, and rtl8111evl need enable RxConfig bit 1 ~ 3
for supporting wake on lan.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1cf8c3c..764c98e 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3322,6 +3322,11 @@ static void r810x_pll_power_down(struct rtl8169_private *tp)
 	if (__rtl8169_get_wol(tp) & WAKE_ANY) {
 		rtl_writephy(tp, 0x1f, 0x0000);
 		rtl_writephy(tp, MII_BMCR, 0x0000);
+
+		if (tp->mac_version == RTL_GIGA_MAC_VER_29 ||
+		    tp->mac_version == RTL_GIGA_MAC_VER_30)
+			RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
+				AcceptMulticast | AcceptMyPhys);
 		return;
 	}
 
@@ -3417,7 +3422,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
 		rtl_writephy(tp, MII_BMCR, 0x0000);
 
 		if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
-		    tp->mac_version == RTL_GIGA_MAC_VER_33)
+		    tp->mac_version == RTL_GIGA_MAC_VER_33 ||
+		    tp->mac_version == RTL_GIGA_MAC_VER_34)
 			RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
 				AcceptMulticast | AcceptMyPhys);
 		return;
-- 
1.7.6

^ permalink raw reply related

* [PATCH net-next v2 4/4] r8169: support new chips of RTL8111F
From: Hayes Wang @ 2011-09-01  6:53 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1314860034-3911-1-git-send-email-hayeswang@realtek.com>

Support new chips of RTL8111F.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c |  178 +++++++++++++++++++++++++++++++++-
 1 files changed, 176 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index b999433..40008d2 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -42,6 +42,8 @@
 #define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-1.fw"
 #define FIRMWARE_8168E_2	"rtl_nic/rtl8168e-2.fw"
 #define FIRMWARE_8168E_3	"rtl_nic/rtl8168e-3.fw"
+#define FIRMWARE_8168F_1	"rtl_nic/rtl8168f-1.fw"
+#define FIRMWARE_8168F_2	"rtl_nic/rtl8168f-2.fw"
 #define FIRMWARE_8105E_1	"rtl_nic/rtl8105e-1.fw"
 
 #ifdef RTL8169_DEBUG
@@ -133,6 +135,8 @@ enum mac_version {
 	RTL_GIGA_MAC_VER_32,
 	RTL_GIGA_MAC_VER_33,
 	RTL_GIGA_MAC_VER_34,
+	RTL_GIGA_MAC_VER_35,
+	RTL_GIGA_MAC_VER_36,
 	RTL_GIGA_MAC_NONE   = 0xff,
 };
 
@@ -218,7 +222,11 @@ static const struct {
 	[RTL_GIGA_MAC_VER_33] =
 		_R("RTL8168e/8111e",	RTL_TD_1, FIRMWARE_8168E_2),
 	[RTL_GIGA_MAC_VER_34] =
-		_R("RTL8168evl/8111evl",RTL_TD_1, FIRMWARE_8168E_3)
+		_R("RTL8168evl/8111evl",RTL_TD_1, FIRMWARE_8168E_3),
+	[RTL_GIGA_MAC_VER_35] =
+		_R("RTL8168f/8111f",	RTL_TD_1, FIRMWARE_8168F_1),
+	[RTL_GIGA_MAC_VER_36] =
+		_R("RTL8168f/8111f",	RTL_TD_1, FIRMWARE_8168F_2)
 };
 #undef _R
 
@@ -1200,6 +1208,19 @@ static void rtl_link_chg_patch(struct rtl8169_private *tp)
 			     ERIAR_EXGMAC);
 		rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x01, 0x00,
 			     ERIAR_EXGMAC);
+	} else if (tp->mac_version == RTL_GIGA_MAC_VER_35 ||
+		   tp->mac_version == RTL_GIGA_MAC_VER_36) {
+		if (RTL_R8(PHYstatus) & _1000bpsF) {
+			rtl_eri_write(ioaddr, 0x1bc, ERIAR_MASK_1111,
+				      0x00000011, ERIAR_EXGMAC);
+			rtl_eri_write(ioaddr, 0x1dc, ERIAR_MASK_1111,
+				      0x00000005, ERIAR_EXGMAC);
+		} else {
+			rtl_eri_write(ioaddr, 0x1bc, ERIAR_MASK_1111,
+				      0x0000001f, ERIAR_EXGMAC);
+			rtl_eri_write(ioaddr, 0x1dc, ERIAR_MASK_1111,
+				      0x0000003f, ERIAR_EXGMAC);
+		}
 	}
 }
 
@@ -1739,6 +1760,10 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
 		u32 val;
 		int mac_version;
 	} mac_info[] = {
+		/* 8168F family. */
+		{ 0x7cf00000, 0x48100000,	RTL_GIGA_MAC_VER_36 },
+		{ 0x7cf00000, 0x48000000,	RTL_GIGA_MAC_VER_35 },
+
 		/* 8168E family. */
 		{ 0x7c800000, 0x2c800000,	RTL_GIGA_MAC_VER_34 },
 		{ 0x7cf00000, 0x2c200000,	RTL_GIGA_MAC_VER_33 },
@@ -2873,6 +2898,97 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
+static void rtl8168f_1_hw_phy_config(struct rtl8169_private *tp)
+{
+	static const struct phy_reg phy_reg_init[] = {
+		/* Channel estimation fine tune */
+		{ 0x1f, 0x0003 },
+		{ 0x09, 0xa20f },
+		{ 0x1f, 0x0000 },
+
+		/* Modify green table for giga & fnet */
+		{ 0x1f, 0x0005 },
+		{ 0x05, 0x8b55 },
+		{ 0x06, 0x0000 },
+		{ 0x05, 0x8b5e },
+		{ 0x06, 0x0000 },
+		{ 0x05, 0x8b67 },
+		{ 0x06, 0x0000 },
+		{ 0x05, 0x8b70 },
+		{ 0x06, 0x0000 },
+		{ 0x1f, 0x0000 },
+		{ 0x1f, 0x0007 },
+		{ 0x1e, 0x0078 },
+		{ 0x17, 0x0000 },
+		{ 0x19, 0x00fb },
+		{ 0x1f, 0x0000 },
+
+		/* Modify green table for 10M */
+		{ 0x1f, 0x0005 },
+		{ 0x05, 0x8b79 },
+		{ 0x06, 0xaa00 },
+		{ 0x1f, 0x0000 },
+
+		/* Disable hiimpedance detection (RTCT) */
+		{ 0x1f, 0x0003 },
+		{ 0x01, 0x328a },
+		{ 0x1f, 0x0000 }
+	};
+
+	rtl_apply_firmware(tp);
+
+	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+	/* For 4-corner performance improve */
+	rtl_writephy(tp, 0x1f, 0x0005);
+	rtl_writephy(tp, 0x05, 0x8b80);
+	rtl_w1w0_phy(tp, 0x06, 0x0006, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* PHY auto speed down */
+	rtl_writephy(tp, 0x1f, 0x0007);
+	rtl_writephy(tp, 0x1e, 0x002d);
+	rtl_w1w0_phy(tp, 0x18, 0x0010, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+	rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+	/* improve 10M EEE waveform */
+	rtl_writephy(tp, 0x1f, 0x0005);
+	rtl_writephy(tp, 0x05, 0x8b86);
+	rtl_w1w0_phy(tp, 0x06, 0x0001, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* Improve 2-pair detection performance */
+	rtl_writephy(tp, 0x1f, 0x0005);
+	rtl_writephy(tp, 0x05, 0x8b85);
+	rtl_w1w0_phy(tp, 0x06, 0x4000, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+}
+
+static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp)
+{
+	rtl_apply_firmware(tp);
+
+	/* For 4-corner performance improve */
+	rtl_writephy(tp, 0x1f, 0x0005);
+	rtl_writephy(tp, 0x05, 0x8b80);
+	rtl_w1w0_phy(tp, 0x06, 0x0006, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* PHY auto speed down */
+	rtl_writephy(tp, 0x1f, 0x0007);
+	rtl_writephy(tp, 0x1e, 0x002d);
+	rtl_w1w0_phy(tp, 0x18, 0x0010, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+	rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+	/* improve 10M EEE waveform */
+	rtl_writephy(tp, 0x1f, 0x0005);
+	rtl_writephy(tp, 0x05, 0x8b86);
+	rtl_w1w0_phy(tp, 0x06, 0x0001, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0000);
+}
+
 static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
@@ -2997,6 +3113,12 @@ static void rtl_hw_phy_config(struct net_device *dev)
 	case RTL_GIGA_MAC_VER_34:
 		rtl8168e_2_hw_phy_config(tp);
 		break;
+	case RTL_GIGA_MAC_VER_35:
+		rtl8168f_1_hw_phy_config(tp);
+		break;
+	case RTL_GIGA_MAC_VER_36:
+		rtl8168f_2_hw_phy_config(tp);
+		break;
 
 	default:
 		break;
@@ -3522,6 +3644,8 @@ static void __devinit rtl_init_pll_power_ops(struct rtl8169_private *tp)
 	case RTL_GIGA_MAC_VER_32:
 	case RTL_GIGA_MAC_VER_33:
 	case RTL_GIGA_MAC_VER_34:
+	case RTL_GIGA_MAC_VER_35:
+	case RTL_GIGA_MAC_VER_36:
 		ops->down	= r8168_pll_power_down;
 		ops->up		= r8168_pll_power_up;
 		break;
@@ -3994,7 +4118,9 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
 	    tp->mac_version == RTL_GIGA_MAC_VER_31) {
 		while (RTL_R8(TxPoll) & NPQ)
 			udelay(20);
-	} else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
+	} else if (tp->mac_version == RTL_GIGA_MAC_VER_34 ||
+		   tp->mac_version == RTL_GIGA_MAC_VER_35 ||
+		   tp->mac_version == RTL_GIGA_MAC_VER_36) {
 		RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
 		while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
 			udelay(100);
@@ -4480,6 +4606,49 @@ static void rtl_hw_start_8168e_2(void __iomem *ioaddr, struct pci_dev *pdev)
 	RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
 }
 
+static void rtl_hw_start_8168f_1(void __iomem *ioaddr, struct pci_dev *pdev)
+{
+	static const struct ephy_info e_info_8168f_1[] = {
+		{ 0x06, 0x00c0,	0x0020 },
+		{ 0x08, 0x0001,	0x0002 },
+		{ 0x09, 0x0000,	0x0080 },
+		{ 0x19, 0x0000,	0x0224 }
+	};
+
+	rtl_csi_access_enable_1(ioaddr);
+
+	rtl_ephy_init(ioaddr, e_info_8168f_1, ARRAY_SIZE(e_info_8168f_1));
+
+	rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+	rtl_eri_write(ioaddr, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+	rtl_eri_write(ioaddr, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+	rtl_eri_write(ioaddr, 0xc8, ERIAR_MASK_1111, 0x00100002, ERIAR_EXGMAC);
+	rtl_eri_write(ioaddr, 0xe8, ERIAR_MASK_1111, 0x00100006, ERIAR_EXGMAC);
+	rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x00, 0x01, ERIAR_EXGMAC);
+	rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x01, 0x00, ERIAR_EXGMAC);
+	rtl_w1w0_eri(ioaddr, 0x1b0, ERIAR_MASK_0001, 0x10, 0x00, ERIAR_EXGMAC);
+	rtl_w1w0_eri(ioaddr, 0x1d0, ERIAR_MASK_0001, 0x10, 0x00, ERIAR_EXGMAC);
+	rtl_eri_write(ioaddr, 0xcc, ERIAR_MASK_1111, 0x00000050, ERIAR_EXGMAC);
+	rtl_eri_write(ioaddr, 0xd0, ERIAR_MASK_1111, 0x00000060, ERIAR_EXGMAC);
+	rtl_w1w0_eri(ioaddr, 0x0d4, ERIAR_MASK_0011, 0x0c00, 0xff00,
+		     ERIAR_EXGMAC);
+
+	RTL_W8(MaxTxPacketSize, EarlySize);
+
+	rtl_disable_clock_request(pdev);
+
+	RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO);
+	RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB);
+
+	/* Adjust EEE LED frequency */
+	RTL_W8(EEE_LED, RTL_R8(EEE_LED) & ~0x07);
+
+	RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN);
+	RTL_W32(MISC, RTL_R32(MISC) | PWM_EN);
+	RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
+}
+
 static void rtl_hw_start_8168(struct net_device *dev)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
@@ -4574,6 +4743,11 @@ static void rtl_hw_start_8168(struct net_device *dev)
 		rtl_hw_start_8168e_2(ioaddr, pdev);
 		break;
 
+	case RTL_GIGA_MAC_VER_35:
+	case RTL_GIGA_MAC_VER_36:
+		rtl_hw_start_8168f_1(ioaddr, pdev);
+		break;
+
 	default:
 		printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
 			dev->name, tp->mac_version);
-- 
1.7.6

^ permalink raw reply related

* [PATCH net-next v2 2/4] r8169: define the early size for 8111evl
From: Hayes Wang @ 2011-09-01  6:53 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1314860034-3911-1-git-send-email-hayeswang@realtek.com>

For RTL8111EVL, the register of MaxTxPacketSize doesn't acctually
limit the tx size. It influnces the feature of early tx.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 764c98e..193daf1 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -311,6 +311,7 @@ enum rtl_registers {
 	MaxTxPacketSize	= 0xec,	/* 8101/8168. Unit of 128 bytes. */
 
 #define TxPacketMax	(8064 >> 7)
+#define EarlySize	0x27
 
 	FuncEvent	= 0xf0,
 	FuncEventMask	= 0xf4,
@@ -4463,7 +4464,7 @@ static void rtl_hw_start_8168e_2(void __iomem *ioaddr, struct pci_dev *pdev)
 	rtl_w1w0_eri(ioaddr, 0x0d4, ERIAR_MASK_0011, 0x0c00, 0xff00,
 		     ERIAR_EXGMAC);
 
-	RTL_W8(MaxTxPacketSize, 0x27);
+	RTL_W8(MaxTxPacketSize, EarlySize);
 
 	rtl_disable_clock_request(pdev);
 
-- 
1.7.6

^ permalink raw reply related

* Re: [RFMC] per-container tcp buffer limitation
From: KAMEZAWA Hiroyuki @ 2011-09-01  6:48 UTC (permalink / raw)
  To: Glauber Costa
  Cc: netdev, Linux Containers, linux-mm, Pavel Emelyanov,
	Eric W. Biederman, David Miller, Stephen Hemminger, penberg
In-Reply-To: <4E5EF14F.3040300@parallels.com>

On Wed, 31 Aug 2011 23:43:27 -0300
Glauber Costa <glommer@parallels.com> wrote:

> Hello People,
> 
> [ For the ones in linux-mm that are receiving this for the first time,
>    this is a follow up of
>    http://thread.gmane.org/gmane.linux.kernel.containers/21295 ]
> 
> Here is a new, a bit more mature version of my previous RFC. Now I 
> Request For More Comments from you guys in this new version of the patch.
> 
> Highlights:
> 
> * Although I do intend to experiment with more scenarios (suggestions 
> welcome), there does not seem to be a (huge) performance hit with this 
> patch applied, at least in a basic latency benchmark. That indicates 
> that even if we can demonstrate a performance hit, it won't be too hard 
> to optimize it away (famous last words?)
> 
> Since the patch touches both rcv and snd sides, I benchmarked it with 
> netperf against localhost. Command line: netperf -t TCP_RR -H localhost.
> 
> Without the patch
> =================
> 
> Socket Size   Request  Resp.   Elapsed  Trans.
> Send   Recv   Size     Size    Time     Rate
> bytes  Bytes  bytes    bytes   secs.    per sec
> 
> 16384  87380  1        1       10.00    26996.35
> 16384  87380
> 
> With the patch
> ===============
> 
> Local /Remote
> Socket Size   Request  Resp.   Elapsed  Trans.
> Send   Recv   Size     Size    Time     Rate
> bytes  Bytes  bytes    bytes   secs.    per sec
> 
> 16384  87380  1        1       10.00    27291.86
> 16384  87380
> 
> 
> As you can see, rate is a bit higher, but still under an one percent 
> range, meaning it is basically unchanged. I will benchmark it with 
> various levels of cgroup nesting on my next submission so we can have a 
> better idea of the impact of it when enabled.
> 
seems nice.

> * As nicely pointed out by Kamezawa, I dropped the sockets cgroup, and 
> introduced a kmem cgroup. After careful consideration, I decided not to 
> reuse the memcg. Basically, my impression is that memcg is concerned 
> with user objects, with page granularity and its swap attributes. 
> Because kernel objects are entirely different, I prefer to group them here.
> 

I myself has no objection to this direction. Other guys ?

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ 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