* Re: [PATCH v8 4/9] tcp memory pressure controls
From: KAMEZAWA Hiroyuki @ 2011-12-09 1:51 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, lizf, ebiederm, davem, gthelen, netdev, linux-mm,
kirill, avagin, devel, eric.dumazet, cgroups, hannes, mhocko,
KAMEZAWA Hiroyuki
In-Reply-To: <1323120903-2831-5-git-send-email-glommer@parallels.com>
On Mon, 5 Dec 2011 19:34:58 -0200
Glauber Costa <glommer@parallels.com> wrote:
> This patch introduces memory pressure controls for the tcp
> protocol. It uses the generic socket memory pressure code
> introduced in earlier patches, and fills in the
> necessary data in cg_proto struct.
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujtisu.com>
> CC: Eric W. Biederman <ebiederm@xmission.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
--
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
* Re: [PATCH v8 3/9] socket: initial cgroup code.
From: KAMEZAWA Hiroyuki @ 2011-12-09 1:49 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, lizf-BthXqXjhjHXQFUHtdCDX3A,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
gthelen-hpIqsD4AKlfQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, kirill-oKw7cIdHH8eLwutG50LtGA,
avagin-bzQdu9zFT3WakBO8gow8eQ, devel-GEFAQzZX7r8dnm+yROfE0A,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w,
mhocko-AlSwsSmVLrQ, KAMEZAWA Hiroyuki
In-Reply-To: <1323120903-2831-4-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
On Mon, 5 Dec 2011 19:34:57 -0200
Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> wrote:
> The goal of this work is to move the memory pressure tcp
> controls to a cgroup, instead of just relying on global
> conditions.
>
> To avoid excessive overhead in the network fast paths,
> the code that accounts allocated memory to a cgroup is
> hidden inside a static_branch(). This branch is patched out
> until the first non-root cgroup is created. So when nobody
> is using cgroups, even if it is mounted, no significant performance
> penalty should be seen.
>
> This patch handles the generic part of the code, and has nothing
> tcp-specific.
>
> Signed-off-by: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
> CC: Kirill A. Shutemov <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
> CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu-ZTyZJ+IMMTwvtab9mdV7tw@public.gmane.org>
> CC: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> CC: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> CC: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe cgroups" 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
* [PATCH RESEND] sctp: fix incorrect overflow check on autoclose
From: Xi Wang @ 2011-12-09 1:24 UTC (permalink / raw)
To: netdev
Cc: linux-sctp, Xi Wang, Andrew Morton, Andrei Pelinescu-Onciul,
Vlad Yasevich, David S. Miller
The commit 8ffd3208 voids the previous patches f6778aab and 810c0719
for limiting the maximum autoclose value. If userspace passes in -1
on 32-bit platform, the overflow check didn't work and autoclose
would be set to 0xffffffff.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrei Pelinescu-Onciul <andrei@iptel.org>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: David S. Miller <davem@davemloft.net>
---
net/sctp/socket.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 13bf5fc..bb91281 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2201,7 +2201,8 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
if (copy_from_user(&sp->autoclose, optval, optlen))
return -EFAULT;
/* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */
- sp->autoclose = min_t(long, sp->autoclose, MAX_SCHEDULE_TIMEOUT / HZ);
+ sp->autoclose = min_t(unsigned long, sp->autoclose,
+ MAX_SCHEDULE_TIMEOUT / HZ);
return 0;
}
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH v8 2/9] foundations of per-cgroup memory pressure controlling.
From: KAMEZAWA Hiroyuki @ 2011-12-09 1:24 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, lizf-BthXqXjhjHXQFUHtdCDX3A,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
gthelen-hpIqsD4AKlfQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, kirill-oKw7cIdHH8eLwutG50LtGA,
avagin-bzQdu9zFT3WakBO8gow8eQ, devel-GEFAQzZX7r8dnm+yROfE0A,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w,
mhocko-AlSwsSmVLrQ
In-Reply-To: <1323120903-2831-3-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
On Mon, 5 Dec 2011 19:34:56 -0200
Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> wrote:
> This patch replaces all uses of struct sock fields' memory_pressure,
> memory_allocated, sockets_allocated, and sysctl_mem to acessor
> macros. Those macros can either receive a socket argument, or a mem_cgroup
> argument, depending on the context they live in.
>
> Since we're only doing a macro wrapping here, no performance impact at all is
> expected in the case where we don't have cgroups disabled.
>
> Signed-off-by: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
> CC: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> CC: Hiroyouki Kamezawa <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
> CC: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> CC: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
please get ack from network guys.
from me.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller
From: KAMEZAWA Hiroyuki @ 2011-12-09 1:21 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, lizf, ebiederm, davem, gthelen, netdev, linux-mm,
kirill, avagin, devel, eric.dumazet, cgroups, hannes, mhocko,
Paul Menage
In-Reply-To: <1323120903-2831-2-git-send-email-glommer@parallels.com>
On Mon, 5 Dec 2011 19:34:55 -0200
Glauber Costa <glommer@parallels.com> wrote:
> This patch lays down the foundation for the kernel memory component
> of the Memory Controller.
>
> As of today, I am only laying down the following files:
>
> * memory.independent_kmem_limit
> * memory.kmem.limit_in_bytes (currently ignored)
> * memory.kmem.usage_in_bytes (always zero)
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
> CC: Paul Menage <paul@paulmenage.org>
> CC: Greg Thelen <gthelen@google.com>
As I wrote, please CC Johannes and Michal Hocko for memcg related parts.
A few questions.
==
> + val = !!val;
> +
> + if (parent && parent->use_hierarchy &&
> + (val != parent->kmem_independent_accounting))
> + return -EINVAL;
==
Hm, why you check val != parent->kmem_independent_accounting ?
if (parent && parent->use_hierarchy)
return -EINVAL;
?
BTW, you didn't check this cgroup has children or not.
I think
if (this_cgroup->use_hierarchy &&
!list_empty(this_cgroup->childlen))
return -EINVAL;
==
> + /*
> + * TODO: We need to handle the case in which we are doing
> + * independent kmem accounting as authorized by our parent,
> + * but then our parent changes its parameter.
> + */
> + cgroup_lock();
> + memcg->kmem_independent_accounting = val;
> + cgroup_unlock();
Do we need cgroup_lock() here ?
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
* Re: [PATCH v8 0/9] per-cgroup tcp memory pressure controls
From: KAMEZAWA Hiroyuki @ 2011-12-09 1:04 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, lizf, ebiederm, davem, gthelen, netdev, linux-mm,
kirill, avagin, devel, eric.dumazet, cgroups, hannes, mhocko
In-Reply-To: <4EDF48A9.6090306@parallels.com>
On Wed, 7 Dec 2011 09:06:17 -0200
Glauber Costa <glommer@parallels.com> wrote:
> On 12/05/2011 07:34 PM, Glauber Costa wrote:
> > Hi,
> >
> > This is my new attempt to fix all the concerns that were raised during
> > the last iteration.
> >
> > I should highlight:
> > 1) proc information is kept intact. (although I kept the wrapper functions)
> > it will be submitted as a follow up patch so it can get the attention it
> > deserves
> > 2) sockets now hold a reference to memcg. sockets can be alive even after the
> > task is gone, so we don't bother with between cgroups movements.
> > To be able to release resources more easily in this cenario, the parent
> > pointer in struct cg_proto was replaced by a memcg object. We then iterate
> > through its pointer (which is cleaner anyway)
> >
> > The rest should be mostly the same except for small fixes and style changes.
> >
>
> Kame,
>
> Does this one address your previous concerns?
>
Your highlight seems good. I'll look into details.
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
* Re: [PATCH net-next] sch_red: Adaptative RED AQM
From: David Miller @ 2011-12-09 0:55 UTC (permalink / raw)
To: eric.dumazet; +Cc: dave.taht, bloat, bloat-devel, netdev, linux-wireless, hagen
In-Reply-To: <1323360363.2521.30.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 08 Dec 2011 17:06:03 +0100
> Adaptative RED AQM for linux, based on paper from Sally FLoyd,
> Ramakrishna Gummadi, and Scott Shenker, August 2001 :
Applied.
^ permalink raw reply
* Re: [PATCH net-next v2 0/6] tg3: Stats and flowctrl cleanups
From: David Miller @ 2011-12-09 0:56 UTC (permalink / raw)
To: mcarlson; +Cc: netdev
In-Reply-To: <1323391218-32241-1-git-send-email-mcarlson@broadcom.com>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Thu, 8 Dec 2011 16:40:12 -0800
> This patchset integrates a few flow control and statistics cleanups.
Applied.
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: properly initialize L5 features
From: David Miller @ 2011-12-09 0:56 UTC (permalink / raw)
To: dmitry; +Cc: netdev, eric.dumazet, barak
In-Reply-To: <1323367447-28074-1-git-send-email-dmitry@broadcom.com>
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Thu, 8 Dec 2011 20:04:07 +0200
> The code is missing initialization of NO_FCOE_FLAG and NO_ISCSI*FLAGS
> when CONFIG_CNIC is not selected.
> This causes panic during driver load since commit
> 1d187b34daaecbb87aa523ba46b92930a388cb21 where NO_FCOE tested
> unconditionally (outside #ifdef BCM_CNIC structure) and
> accessed fp[FCOE_IDX] which is not allocated.
>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 0/3] bridge forwarding database patches
From: David Miller @ 2011-12-09 0:56 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20111208091816.6ba5a0e9@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 8 Dec 2011 09:18:16 -0800
> On Wed, 07 Dec 2011 13:50:15 -0500 (EST)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Tue, 06 Dec 2011 15:02:23 -0800
>>
>> > These three patches address issue of receiving packets when
>> > bridge mac address is modified.
>>
>
> Resent 2 and 3, patch 1 is unchanged.
Applied but please repost the entire series again next time,
even the patches that haven't changed.
Updating individual patches makes the process a real pain in
the butt for me, and reposting everything takes a minimal
amount of effort on your part.
^ permalink raw reply
* Re: [PATCH net-next v2] vlan: add 802.1q netpoll support
From: David Miller @ 2011-12-09 0:55 UTC (permalink / raw)
To: bcrl; +Cc: netdev
In-Reply-To: <20111208162049.GF30652@kvack.org>
From: Benjamin LaHaise <bcrl@kvack.org>
Date: Thu, 8 Dec 2011 11:20:49 -0500
> [PATCH net-next v2] vlan: add 802.1q netpoll support
>
> Add netpoll support to 802.1q vlan devices. Based on the netpoll support
> in the bridging code. Tested on a forced_eth device with netconsole.
>
> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Applied.
^ permalink raw reply
* Re: [patch] sock_diag: off by one checks
From: David Miller @ 2011-12-09 0:54 UTC (permalink / raw)
To: dan.carpenter; +Cc: xemul, netdev, kernel-janitors
In-Reply-To: <20111208064938.GB16735@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 8 Dec 2011 09:49:38 +0300
> These tests are off by one because sock_diag_handlers[] only has AF_MAX
> elements.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply
* Re: [net-next PATCH] net: netprio_cgroup: make net_prio_subsys static
From: David Miller @ 2011-12-09 0:53 UTC (permalink / raw)
To: nhorman; +Cc: john.r.fastabend, netdev
In-Reply-To: <20111208114555.GA1246@hmsreliant.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Thu, 8 Dec 2011 06:45:55 -0500
> On Wed, Dec 07, 2011 at 09:17:17PM -0800, John Fastabend wrote:
>> net_prio_subsys can be made static this removes the sparse
>> warning it was throwing.
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
...
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Applied.
^ permalink raw reply
* Re: [patch net-next 0/6] vlan: introduce per-device vlan id list
From: David Miller @ 2011-12-09 0:53 UTC (permalink / raw)
To: jpirko
Cc: netdev, eric.dumazet, bhutchings, shemminger, ebiederm, mirqus,
kaber, greearb, jesse
In-Reply-To: <1323353480-1900-1-git-send-email-jpirko@redhat.com>
From: Jiri Pirko <jpirko@redhat.com>
Date: Thu, 8 Dec 2011 15:11:14 +0100
> Many drivers store vlan ids in their private structures.
> They are maintaining the private lists in vlan_add_vid and vlan_kill_vid.
>
> This patchset creates an infrastructure of storing vlan ids in one place,
> vlan core. Another benefit of this is that it allows to keep track of vlan
> ids needed. For example if eth0 has vlan id 10 on it, then it enters bonding,
> bonding gets added 10 as well, then eth0 leaves bonding. Final step would
> remove vlan id 10 from eth1 vlan filter resulting in potentially unfunction
> vlan device. This patchset fixes this.
>
> Jiri Pirko (6):
> vlan: rename vlan_dev_info to vlan_dev_priv
> net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
> net: introduce vlan_vid_[add/del] and use them instead of direct
> [add/kill]_vid ndo calls
> vlan: introduce vid list with reference counting
> vlan: introduce functions to do mass addition/deletion of vids by
> another device
> team: use vlan_vids_[addr/del]_by_dev
All applied.
^ permalink raw reply
* Re: [PATCH v3 0/8] net/fec: several cleanups and bugfixes
From: David Miller @ 2011-12-09 0:54 UTC (permalink / raw)
To: LW; +Cc: netdev, linux-kernel, shawn.guo
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
From: Lothar Waßmann <LW@KARO-electronics.de>
Date: Thu, 8 Dec 2011 08:59:24 +0100
> The following set of patches provides some cleanup and bugfixes for
> drivers/net/ethernet/freescale/fec.c and makes the driver buildable as
> a module.
>
> Changes wrt v2:
> - subject prefix changed to be in sync with existing commits
> - added Acked-by:
All applied.
^ permalink raw reply
* Re: [patch] sock_diag: off by one checks
From: David Miller @ 2011-12-09 0:54 UTC (permalink / raw)
To: xemul; +Cc: dan.carpenter, netdev, kernel-janitors
In-Reply-To: <4EE07E6B.5050608@parallels.com>
From: Pavel Emelyanov <xemul@parallels.com>
Date: Thu, 08 Dec 2011 13:07:55 +0400
> On 12/08/2011 10:49 AM, Dan Carpenter wrote:
>> These tests are off by one because sock_diag_handlers[] only has AF_MAX
>> elements.
>
> Oops :(
>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Acked-by: Pavel Emelyanov <xemul@parallels.com>
Applied.
^ permalink raw reply
* Re: [PATCH] be2net: netpoll support
From: David Miller @ 2011-12-09 0:53 UTC (permalink / raw)
To: ivecera; +Cc: netdev, sathya.perla, subbu.seetharaman, ajit.khaparde
In-Reply-To: <1323343881-7864-1-git-send-email-ivecera@redhat.com>
From: Ivan Vecera <ivecera@redhat.com>
Date: Thu, 8 Dec 2011 12:31:21 +0100
> Add missing netpoll support.
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH iproute2] red: harddrop support and cleanups
From: Stephen Hemminger @ 2011-12-09 0:44 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1323385900.2529.12.camel@edumazet-laptop>
On Fri, 09 Dec 2011 00:11:40 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Add harddrop support (kernel support added a long time ago), and various
> cleanups.
>
> min BYTES, max BYTES are now optional and follow Sally Floyd's
> recommendations.
>
> By the way, our default 2% probability is a bit low, Sally recommends
> 10%.
> Not a big deal if upcoming adaptative algo is deployed.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied (minor whitespace cleanup).
^ permalink raw reply
* Re: policing actions pipe and ok
From: jamal @ 2011-12-09 0:42 UTC (permalink / raw)
To: John A. Sullivan III; +Cc: netdev
In-Reply-To: <1323382496.3159.1.camel@denise.theartistscloset.com>
On Thu, 2011-12-08 at 17:14 -0500, John A. Sullivan III wrote:
> Hello, all. I'm having trouble finding documentation on the tc filter
> policing actions pipe and ok.
Look at the iproute2 docs and enjoy:
doc/actions/actions-general
cheers,
jamal
^ permalink raw reply
* [PATCH net-next v2 6/6] tg3: Update version to 3.122
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch updates the tg3 version to 3.122.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 28a959d..1979151 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -89,10 +89,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
#define DRV_MODULE_NAME "tg3"
#define TG3_MAJ_NUM 3
-#define TG3_MIN_NUM 121
+#define TG3_MIN_NUM 122
#define DRV_MODULE_VERSION \
__stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
-#define DRV_MODULE_RELDATE "November 2, 2011"
+#define DRV_MODULE_RELDATE "December 7, 2011"
#define RESET_KIND_SHUTDOWN 0
#define RESET_KIND_INIT 1
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next v2 4/6] tg3: Track LP advertising
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson, Ben Hutchings
This patch adds code to track the autonegotiation advertisements of the
link partner and report them through ethtool.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 40 ++++++++++++++++++++++++++++++++--
drivers/net/ethernet/broadcom/tg3.h | 1 +
2 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index d1681db..924dce5 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -3803,6 +3803,28 @@ static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv)
return true;
}
+static bool tg3_phy_copper_fetch_rmtadv(struct tg3 *tp, u32 *rmtadv)
+{
+ u32 lpeth = 0;
+
+ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
+ u32 val;
+
+ if (tg3_readphy(tp, MII_STAT1000, &val))
+ return false;
+
+ lpeth = mii_stat1000_to_ethtool_lpa_t(val);
+ }
+
+ if (tg3_readphy(tp, MII_LPA, rmtadv))
+ return false;
+
+ lpeth |= mii_lpa_to_ethtool_lpa_t(*rmtadv);
+ tp->link_config.rmt_adv = lpeth;
+
+ return true;
+}
+
static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
{
int current_link_up;
@@ -3907,6 +3929,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
current_speed = SPEED_INVALID;
current_duplex = DUPLEX_INVALID;
tp->phy_flags &= ~TG3_PHYFLG_MDIX_STATE;
+ tp->link_config.rmt_adv = 0;
if (tp->phy_flags & TG3_PHYFLG_CAPACITIVE_COUPLING) {
err = tg3_phy_auxctl_read(tp,
@@ -3963,8 +3986,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
if (tp->link_config.autoneg == AUTONEG_ENABLE) {
if ((bmcr & BMCR_ANENABLE) &&
tg3_phy_copper_an_config_ok(tp, &lcl_adv) &&
- (tg3_flag(tp, PAUSE_AUTONEG) &&
- !tg3_readphy(tp, MII_LPA, &rmt_adv)))
+ tg3_phy_copper_fetch_rmtadv(tp, &rmt_adv))
current_link_up = 1;
} else {
if (!(bmcr & BMCR_ANENABLE) &&
@@ -4601,6 +4623,9 @@ restart_autoneg:
if (sg_dig_status & SG_DIG_PARTNER_ASYM_PAUSE)
remote_adv |= LPA_1000XPAUSE_ASYM;
+ tp->link_config.rmt_adv =
+ mii_adv_to_ethtool_adv_x(remote_adv);
+
tg3_setup_flow_control(tp, local_adv, remote_adv);
current_link_up = 1;
tp->serdes_counter = 0;
@@ -4672,6 +4697,9 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status)
if (rxflags & MR_LP_ADV_ASYM_PAUSE)
remote_adv |= LPA_1000XPAUSE_ASYM;
+ tp->link_config.rmt_adv =
+ mii_adv_to_ethtool_adv_x(remote_adv);
+
tg3_setup_flow_control(tp, local_adv, remote_adv);
current_link_up = 1;
@@ -4754,6 +4782,7 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
udelay(40);
current_link_up = 0;
+ tp->link_config.rmt_adv = 0;
mac_status = tr32(MAC_STATUS);
if (tg3_flag(tp, HW_AUTONEG))
@@ -4845,6 +4874,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
current_link_up = 0;
current_speed = SPEED_INVALID;
current_duplex = DUPLEX_INVALID;
+ tp->link_config.rmt_adv = 0;
err |= tg3_readphy(tp, MII_BMSR, &bmsr);
err |= tg3_readphy(tp, MII_BMSR, &bmsr);
@@ -4951,6 +4981,9 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
current_duplex = DUPLEX_FULL;
else
current_duplex = DUPLEX_HALF;
+
+ tp->link_config.rmt_adv =
+ mii_adv_to_ethtool_adv_x(remote_adv);
} else if (!tg3_flag(tp, 5780_CLASS)) {
/* Link is up via parallel detect */
} else {
@@ -10283,9 +10316,10 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->advertising |= ADVERTISED_Asym_Pause;
}
}
- if (netif_running(dev)) {
+ if (netif_running(dev) && netif_carrier_ok(dev)) {
ethtool_cmd_speed_set(cmd, tp->link_config.active_speed);
cmd->duplex = tp->link_config.active_duplex;
+ cmd->lp_advertising = tp->link_config.rmt_adv;
if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES)) {
if (tp->phy_flags & TG3_PHYFLG_MDIX_STATE)
cmd->eth_tp_mdix = ETH_TP_MDI_X;
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index a2818ef..9d9f634 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2698,6 +2698,7 @@ struct tg3_link_config {
#define DUPLEX_INVALID 0xff
#define AUTONEG_INVALID 0xff
u16 active_speed;
+ u32 rmt_adv;
/* When we go in and out of low power mode we need
* to swap with this state.
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next v2 5/6] tg3: Return flowctrl config through ethtool
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch changes the driver to return the flow control configuration
rather than the flow control status through the ETHTOOL_GPAUSEPARAM
ioctl.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 924dce5..28a959d 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10596,12 +10596,12 @@ static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam
epause->autoneg = !!tg3_flag(tp, PAUSE_AUTONEG);
- if (tp->link_config.active_flowctrl & FLOW_CTRL_RX)
+ if (tp->link_config.flowctrl & FLOW_CTRL_RX)
epause->rx_pause = 1;
else
epause->rx_pause = 0;
- if (tp->link_config.active_flowctrl & FLOW_CTRL_TX)
+ if (tp->link_config.flowctrl & FLOW_CTRL_TX)
epause->tx_pause = 1;
else
epause->tx_pause = 0;
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next v2 1/6] tg3: Remove ethtool stats member from dev struct
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson, Michael Chan
This patch removes the ethtool stats member from the tg3 device
structure.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/broadcom/tg3.c | 14 +++++++-------
drivers/net/ethernet/broadcom/tg3.h | 1 -
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index cf36312..26eb4d4 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -9770,7 +9770,8 @@ err_out1:
static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *,
struct rtnl_link_stats64 *);
-static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *);
+static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *,
+ struct tg3_ethtool_stats *);
static int tg3_close(struct net_device *dev)
{
@@ -9804,9 +9805,7 @@ static int tg3_close(struct net_device *dev)
tg3_ints_fini(tp);
tg3_get_stats64(tp->dev, &tp->net_stats_prev);
-
- memcpy(&tp->estats_prev, tg3_get_estats(tp),
- sizeof(tp->estats_prev));
+ tg3_get_estats(tp, &tp->estats_prev);
tg3_napi_fini(tp);
@@ -9854,9 +9853,9 @@ static u64 calc_crc_errors(struct tg3 *tp)
estats->member = old_estats->member + \
get_stat64(&hw_stats->member)
-static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
+static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp,
+ struct tg3_ethtool_stats *estats)
{
- struct tg3_ethtool_stats *estats = &tp->estats;
struct tg3_ethtool_stats *old_estats = &tp->estats_prev;
struct tg3_hw_stats *hw_stats = tp->hw_stats;
@@ -10762,7 +10761,8 @@ static void tg3_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *estats, u64 *tmp_stats)
{
struct tg3 *tp = netdev_priv(dev);
- memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
+
+ tg3_get_estats(tp, (struct tg3_ethtool_stats *)tmp_stats);
}
static __be32 *tg3_vpd_readblock(struct tg3 *tp, u32 *vpdlen)
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 9cc10a8..a2818ef 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3013,7 +3013,6 @@ struct tg3 {
unsigned long rx_dropped;
unsigned long tx_dropped;
struct rtnl_link_stats64 net_stats_prev;
- struct tg3_ethtool_stats estats;
struct tg3_ethtool_stats estats_prev;
DECLARE_BITMAP(tg3_flags, TG3_FLAG_NUMBER_OF_FLAGS);
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next v2 3/6] tg3: Integrate flowctrl check into AN adv check
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch integrates tg3_adv_1000T_flowctrl_ok() into
tg3_copper_is_advertising_all() and renames the function
tg3_phy_copper_an_config_ok().
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/broadcom/tg3.c | 81 +++++++++++------------------------
1 files changed, 25 insertions(+), 56 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 713e37a..d1681db 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -3768,65 +3768,39 @@ static int tg3_init_5401phy_dsp(struct tg3 *tp)
return err;
}
-static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
+static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv)
{
- u32 adv_reg, all_mask = 0;
+ u32 advmsk, tgtadv, advertising;
- all_mask = ethtool_adv_to_mii_adv_t(mask) & ADVERTISE_ALL;
+ advertising = tp->link_config.advertising;
+ tgtadv = ethtool_adv_to_mii_adv_t(advertising) & ADVERTISE_ALL;
- if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
- return 0;
+ advmsk = ADVERTISE_ALL;
+ if (tp->link_config.active_duplex == DUPLEX_FULL) {
+ tgtadv |= tg3_advert_flowctrl_1000T(tp->link_config.flowctrl);
+ advmsk |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
+ }
- if ((adv_reg & ADVERTISE_ALL) != all_mask)
- return 0;
+ if (tg3_readphy(tp, MII_ADVERTISE, lcladv))
+ return false;
+
+ if ((*lcladv & advmsk) != tgtadv)
+ return false;
if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
u32 tg3_ctrl;
- all_mask = ethtool_adv_to_mii_ctrl1000_t(mask);
+ tgtadv = ethtool_adv_to_mii_ctrl1000_t(advertising);
if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl))
- return 0;
+ return false;
tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL);
- if (tg3_ctrl != all_mask)
- return 0;
- }
-
- return 1;
-}
-
-static int tg3_adv_1000T_flowctrl_ok(struct tg3 *tp, u32 *lcladv, u32 *rmtadv)
-{
- u32 curadv, reqadv;
-
- if (tg3_readphy(tp, MII_ADVERTISE, lcladv))
- return 1;
-
- curadv = *lcladv & (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
- reqadv = tg3_advert_flowctrl_1000T(tp->link_config.flowctrl);
-
- if (tp->link_config.active_duplex == DUPLEX_FULL) {
- if (curadv != reqadv)
- return 0;
-
- if (tg3_flag(tp, PAUSE_AUTONEG))
- tg3_readphy(tp, MII_LPA, rmtadv);
- } else {
- /* Reprogram the advertisement register, even if it
- * does not affect the current link. If the link
- * gets renegotiated in the future, we can save an
- * additional renegotiation cycle by advertising
- * it correctly in the first place.
- */
- if (curadv != reqadv) {
- *lcladv &= ~(ADVERTISE_PAUSE_CAP |
- ADVERTISE_PAUSE_ASYM);
- tg3_writephy(tp, MII_ADVERTISE, *lcladv | reqadv);
- }
+ if (tg3_ctrl != tgtadv)
+ return false;
}
- return 1;
+ return true;
}
static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
@@ -3988,12 +3962,10 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
if (tp->link_config.autoneg == AUTONEG_ENABLE) {
if ((bmcr & BMCR_ANENABLE) &&
- tg3_copper_is_advertising_all(tp,
- tp->link_config.advertising)) {
- if (tg3_adv_1000T_flowctrl_ok(tp, &lcl_adv,
- &rmt_adv))
- current_link_up = 1;
- }
+ tg3_phy_copper_an_config_ok(tp, &lcl_adv) &&
+ (tg3_flag(tp, PAUSE_AUTONEG) &&
+ !tg3_readphy(tp, MII_LPA, &rmt_adv)))
+ current_link_up = 1;
} else {
if (!(bmcr & BMCR_ANENABLE) &&
tp->link_config.speed == current_speed &&
@@ -13323,7 +13295,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
!tg3_flag(tp, ENABLE_APE) &&
!tg3_flag(tp, ENABLE_ASF)) {
- u32 bmsr, mask;
+ u32 bmsr, dummy;
tg3_readphy(tp, MII_BMSR, &bmsr);
if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
@@ -13336,10 +13308,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
tg3_phy_set_wirespeed(tp);
- mask = (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
- ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
- ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full);
- if (!tg3_copper_is_advertising_all(tp, mask)) {
+ if (!tg3_phy_copper_an_config_ok(tp, &dummy)) {
tg3_phy_autoneg_cfg(tp, tp->link_config.advertising,
tp->link_config.flowctrl);
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next v2 2/6] tg3: Save stats across chip resets
From: Matt Carlson @ 2011-12-09 0:40 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
Tg3 has a place to store stats, but doesn't really use it. This patch
modifies the driver so that stats are saved across chip resets and gets
cleared across close / open calls.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/broadcom/tg3.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 26eb4d4..713e37a 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7588,8 +7588,6 @@ static int tg3_abort_hw(struct tg3 *tp, int silent)
if (tnapi->hw_status)
memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
}
- if (tp->hw_stats)
- memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats));
return err;
}
@@ -7905,6 +7903,11 @@ static int tg3_chip_reset(struct tg3 *tp)
return 0;
}
+static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *,
+ struct rtnl_link_stats64 *);
+static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *,
+ struct tg3_ethtool_stats *);
+
/* tp->lock is held. */
static int tg3_halt(struct tg3 *tp, int kind, int silent)
{
@@ -7922,6 +7925,15 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent)
tg3_write_sig_legacy(tp, kind);
tg3_write_sig_post_reset(tp, kind);
+ if (tp->hw_stats) {
+ /* Save the stats across chip resets... */
+ tg3_get_stats64(tp->dev, &tp->net_stats_prev),
+ tg3_get_estats(tp, &tp->estats_prev);
+
+ /* And make sure the next sample is new data */
+ memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats));
+ }
+
if (err)
return err;
@@ -9768,11 +9780,6 @@ err_out1:
return err;
}
-static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *,
- struct rtnl_link_stats64 *);
-static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *,
- struct tg3_ethtool_stats *);
-
static int tg3_close(struct net_device *dev)
{
int i;
@@ -9804,8 +9811,9 @@ static int tg3_close(struct net_device *dev)
tg3_ints_fini(tp);
- tg3_get_stats64(tp->dev, &tp->net_stats_prev);
- tg3_get_estats(tp, &tp->estats_prev);
+ /* Clear stats across close / open calls */
+ memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev));
+ memset(&tp->estats_prev, 0, sizeof(tp->estats_prev));
tg3_napi_fini(tp);
--
1.7.3.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox