Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] cxgb4/cxgb4i : Update & use ipv6 handling api
From: Anish Bhatt @ 2015-01-14 23:17 UTC (permalink / raw)
  To: netdev; +Cc: davem, hariprasad, kxie, deepak.s, Anish Bhatt

This patch series consolidates and updates the ipv6 api, as well as exports
it for use by upper level drivers dependent on cxgb4

v2: Fix formatting issues in clip_tbl.c

Anish Bhatt (2):
  cxgb4 : Update ipv6 address handling api
  cxgb4i : Call into recently added cxgb4 ipv6 api

 drivers/net/ethernet/chelsio/cxgb4/Makefile        |   2 +-
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c      | 314 +++++++++++++++++++++
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h      |  41 +++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h         |   3 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c |  19 ++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c    | 228 +++++----------
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h     |   3 -
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c                 |  23 +-
 8 files changed, 469 insertions(+), 164 deletions(-)
 create mode 100644 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
 create mode 100644 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h

-- 
2.2.1

^ permalink raw reply

* [PATCH net-next] ipv4: per cpu uncached list
From: Eric Dumazet @ 2015-01-14 23:17 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Willem de Bruijn

From: Eric Dumazet <edumazet@google.com>

RAW sockets with hdrinc suffer from contention on rt_uncached_lock
spinlock.

One solution is to use percpu lists, since most routes are destroyed
by the cpu that created them.

It is unclear why we even have to put these routes in uncached_list,
as all outgoing packets should be freed when a device is dismantled.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: caacf05e5ad1 ("ipv4: Properly purge netdev references on uncached routes.")
---
 include/net/route.h |    2 +
 net/ipv4/route.c    |   46 ++++++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index b17cf28f996e..fe22d03afb6a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -46,6 +46,7 @@
 
 struct fib_nh;
 struct fib_info;
+struct uncached_list;
 struct rtable {
 	struct dst_entry	dst;
 
@@ -64,6 +65,7 @@ struct rtable {
 	u32			rt_pmtu;
 
 	struct list_head	rt_uncached;
+	struct uncached_list	*rt_uncached_list;
 };
 
 static inline bool rt_is_input_route(const struct rtable *rt)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6a2155b02602..ce112d0f2698 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1325,14 +1325,22 @@ static bool rt_cache_route(struct fib_nh *nh, struct rtable *rt)
 	return ret;
 }
 
-static DEFINE_SPINLOCK(rt_uncached_lock);
-static LIST_HEAD(rt_uncached_list);
+struct uncached_list {
+	spinlock_t		lock;
+	struct list_head	head;
+};
+
+static DEFINE_PER_CPU_ALIGNED(struct uncached_list, rt_uncached_list);
 
 static void rt_add_uncached_list(struct rtable *rt)
 {
-	spin_lock_bh(&rt_uncached_lock);
-	list_add_tail(&rt->rt_uncached, &rt_uncached_list);
-	spin_unlock_bh(&rt_uncached_lock);
+	struct uncached_list *ul = raw_cpu_ptr(&rt_uncached_list);
+
+	rt->rt_uncached_list = ul;
+
+	spin_lock_bh(&ul->lock);
+	list_add_tail(&rt->rt_uncached, &ul->head);
+	spin_unlock_bh(&ul->lock);
 }
 
 static void ipv4_dst_destroy(struct dst_entry *dst)
@@ -1340,27 +1348,32 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
 	struct rtable *rt = (struct rtable *) dst;
 
 	if (!list_empty(&rt->rt_uncached)) {
-		spin_lock_bh(&rt_uncached_lock);
+		struct uncached_list *ul = rt->rt_uncached_list;
+
+		spin_lock_bh(&ul->lock);
 		list_del(&rt->rt_uncached);
-		spin_unlock_bh(&rt_uncached_lock);
+		spin_unlock_bh(&ul->lock);
 	}
 }
 
 void rt_flush_dev(struct net_device *dev)
 {
-	if (!list_empty(&rt_uncached_list)) {
-		struct net *net = dev_net(dev);
-		struct rtable *rt;
+	struct net *net = dev_net(dev);
+	struct rtable *rt;
+	int cpu;
+
+	for_each_possible_cpu(cpu) {
+		struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu);
 
-		spin_lock_bh(&rt_uncached_lock);
-		list_for_each_entry(rt, &rt_uncached_list, rt_uncached) {
+		spin_lock_bh(&ul->lock);
+		list_for_each_entry(rt, &ul->head, rt_uncached) {
 			if (rt->dst.dev != dev)
 				continue;
 			rt->dst.dev = net->loopback_dev;
 			dev_hold(rt->dst.dev);
 			dev_put(dev);
 		}
-		spin_unlock_bh(&rt_uncached_lock);
+		spin_unlock_bh(&ul->lock);
 	}
 }
 
@@ -2717,6 +2730,7 @@ struct ip_rt_acct __percpu *ip_rt_acct __read_mostly;
 int __init ip_rt_init(void)
 {
 	int rc = 0;
+	int cpu;
 
 	ip_idents = kmalloc(IP_IDENTS_SZ * sizeof(*ip_idents), GFP_KERNEL);
 	if (!ip_idents)
@@ -2724,6 +2738,12 @@ int __init ip_rt_init(void)
 
 	prandom_bytes(ip_idents, IP_IDENTS_SZ * sizeof(*ip_idents));
 
+	for_each_possible_cpu(cpu) {
+		struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu);
+
+		INIT_LIST_HEAD(&ul->head);
+		spin_lock_init(&ul->lock);
+	}
 #ifdef CONFIG_IP_ROUTE_CLASSID
 	ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct));
 	if (!ip_rt_acct)

^ permalink raw reply related

* Re: [PATCH] net: rocker: Add basic netdev counters
From: Florian Fainelli @ 2015-01-14 22:57 UTC (permalink / raw)
  To: David Ahern, netdev; +Cc: Scott Feldman, Jiri Pirko
In-Reply-To: <1421275161-99434-1-git-send-email-dsahern@gmail.com>

On 14/01/15 14:39, David Ahern wrote:
> Add packet and byte counters for RX and TX paths.
> 
> $ ifconfig eth1
> eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>         inet6 fe80::5054:ff:fe12:3501  prefixlen 64  scopeid 0x20<link>
>         ether 52:54:00:12:35:01  txqueuelen 1000  (Ethernet)
>         RX packets 63  bytes 15813 (15.4 KiB)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 79  bytes 17991 (17.5 KiB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Cc: Scott Feldman <sfeldma@gmail.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> ---
>  drivers/net/ethernet/rocker/rocker.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
> index 2f398fa4b9e6..9743279d9121 100644
> --- a/drivers/net/ethernet/rocker/rocker.c
> +++ b/drivers/net/ethernet/rocker/rocker.c
> @@ -3557,6 +3557,9 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev)
>  	if (!desc_info)
>  		netif_stop_queue(dev);
>  
> +	dev->stats.tx_packets++;
> +	dev->stats.tx_bytes += skb->len;

Potential use after free, the skb pointer is certainly not valid anymore
here.

BTW, increasing statistics here is valid because this is a driver for a
virtual piece of HW, which does not have TX reclaim/completion logic,
but if it did, statistics update should occur there, not in the
ndo_start_xmit() function.

> +
>  	return NETDEV_TX_OK;
>  
>  unmap_frags:
> @@ -3565,6 +3568,8 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev)
>  	rocker_tlv_nest_cancel(desc_info, frags);
>  out:
>  	dev_kfree_skb(skb);
> +	dev->stats.tx_dropped++;
> +
>  	return NETDEV_TX_OK;
>  }
>  
> @@ -3890,6 +3895,9 @@ static int rocker_port_rx_proc(struct rocker *rocker,
>  	skb->protocol = eth_type_trans(skb, rocker_port->dev);
>  	netif_receive_skb(skb);
>  
> +	rocker_port->dev->stats.rx_packets++;
> +	rocker_port->dev->stats.rx_bytes += skb->len;

Same here, past netif_receive_skb() you should not assume that this skb
reference is valid.

> +
>  	return rocker_dma_rx_ring_skb_alloc(rocker, rocker_port, desc_info);
>  }
>  
> 


-- 
Florian

^ permalink raw reply

* Re: [PATCH iproute2] ss: Filter inet dgram sockets with established state by default
From: Vadim Kochan @ 2015-01-14 22:43 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Vadim Kochan, netdev
In-Reply-To: <20150114144120.0e15ac1f@urahara>

On Wed, Jan 14, 2015 at 02:41:20PM -0800, Stephen Hemminger wrote:
> On Wed, 14 Jan 2015 08:49:44 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > On Tue, Jan 13, 2015 at 05:31:50PM -0800, Stephen Hemminger wrote:
> > > On Thu,  8 Jan 2015 19:32:22 +0200
> > > Vadim Kochan <vadim4j@gmail.com> wrote:
> > > 
> > > > From: Vadim Kochan <vadim4j@gmail.com>
> > > > 
> > > > As inet dgram sockets (udp, raw) can call connect(...)  - they
> > > > might be set in ESTABLISHED state. So keep the original behaviour of
> > > > 'ss' which filtered them by ESTABLISHED state by default. So:
> > > > 
> > > >     $ ss -u
> > > > 
> > > >     or
> > > > 
> > > >     $ ss -w
> > > > 
> > > > Will show only ESTABLISHED UDP sockets by default.
> > > > 
> > > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > > > ---
> > > >  misc/ss.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/misc/ss.c b/misc/ss.c
> > > > index 08d210a..015d829 100644
> > > > --- a/misc/ss.c
> > > > +++ b/misc/ss.c
> > > > @@ -170,11 +170,11 @@ static const struct filter default_dbs[MAX_DB] = {
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[UDP_DB] = {
> > > > -		.states   = (1 << SS_CLOSE),
> > > > +		.states   = (1 << SS_ESTABLISHED),
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[RAW_DB] = {
> > > > -		.states   = (1 << SS_CLOSE),
> > > > +		.states   = (1 << SS_ESTABLISHED),
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[UNIX_DG_DB] = {
> > > 
> > > This is a change likely to break somebody using 'ss -u' now and the bound
> > > sockets will disappear from the output.
> > > 
> > 
> > But thats was as original behaviour before I added table-driven code
> > (about few commits ago), so thats a rather fix (sorry I did not noticed
> > about it) to keep the previous behaviour for dgram sockets - show
> > established states by default.
> > 
> > Regards,
> 
> Ok, I will merge it and update the comments.
Even with this PATCH I am still confused what is preferred behaviour -
show established dgram sockets (as it was all the way) or closed + established by default.

What do you think ?

Thanks,

^ permalink raw reply

* Re: [PATCH RFC v2 net-next 2/2] ip_tunnel: Remove struct gro_cells
From: Eric Dumazet @ 2015-01-14 22:53 UTC (permalink / raw)
  To: Martin KaFai Lau; +Cc: netdev, kernel-team
In-Reply-To: <1421192564-437455-3-git-send-email-kafai@fb.com>

On Tue, 2015-01-13 at 15:42 -0800, Martin KaFai Lau wrote:
> After adding percpu gro_cells, struct gro_cells can be removed.
> 
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> ---
>  include/net/gro_cells.h  | 34 ++++++++++++++++------------------
>  include/net/ip_tunnels.h |  2 +-
>  net/ipv4/ip_tunnel.c     | 11 +++++------
>  3 files changed, 22 insertions(+), 25 deletions(-)
> 
> diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h
> index 0f712c0..b1aeea1 100644
> --- a/include/net/gro_cells.h
> +++ b/include/net/gro_cells.h
> @@ -10,21 +10,18 @@ struct gro_cell {
>  	struct napi_struct	napi;
>  };
>  
> -struct gro_cells {
> -	struct gro_cell __percpu	*cells;
> -};
> -

This seems a lot of code churn for no runtime difference ?

If we ever want to add an additional 'field', we likely have to revert
this patch.

-static inline void gro_cells_destroy(struct gro_cells *gcells)
+static inline void gro_cell_free_percpu(struct gro_cell __percpu *gcells)
 {
        int i;
 
-       if (!gcells->cells)
+       if (IS_ERR_OR_NULL(gcells))
                return;

For example, I have no idea why this part is needed.

^ permalink raw reply

* Re: [ 2375.793397] WARNING: CPU: 0 PID: 1149 at net/netlink/genetlink.c:1037 genl_unbind+0xc0/0xd0()
From: Johannes Berg @ 2015-01-14 22:48 UTC (permalink / raw)
  To: Jeff Layton; +Cc: netdev
In-Reply-To: <20150114161334.28acf5fc@tlielax.poochiereds.net>

On Wed, 2015-01-14 at 16:13 -0500, Jeff Layton wrote:
> While running the trinity fuzzer in a KVM guest, I ^C'ed it at an
> (apparent) inopportune moment, and saw a bunch of these WARN_ONs pop:

A bunch?!

> [ 2375.793396] ------------[ cut here ]------------
> [ 2375.793397] WARNING: CPU: 0 PID: 1149 at net/netlink/genetlink.c:1037 genl_unbind+0xc0/0xd0()

This warning is supposed to happen only when you somehow manage to
unsubscribe from a generic netlink group that doesn't actually exist, or
so.

Do you have any sort of log/trace of what trinity actually did at/before
this point?

johannes

^ permalink raw reply

* Re: [PATCH iproute2] ss: Filter inet dgram sockets with established state by default
From: Stephen Hemminger @ 2015-01-14 22:41 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <20150114064944.GA28611@angus-think.lan>

On Wed, 14 Jan 2015 08:49:44 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> On Tue, Jan 13, 2015 at 05:31:50PM -0800, Stephen Hemminger wrote:
> > On Thu,  8 Jan 2015 19:32:22 +0200
> > Vadim Kochan <vadim4j@gmail.com> wrote:
> > 
> > > From: Vadim Kochan <vadim4j@gmail.com>
> > > 
> > > As inet dgram sockets (udp, raw) can call connect(...)  - they
> > > might be set in ESTABLISHED state. So keep the original behaviour of
> > > 'ss' which filtered them by ESTABLISHED state by default. So:
> > > 
> > >     $ ss -u
> > > 
> > >     or
> > > 
> > >     $ ss -w
> > > 
> > > Will show only ESTABLISHED UDP sockets by default.
> > > 
> > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > > ---
> > >  misc/ss.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/misc/ss.c b/misc/ss.c
> > > index 08d210a..015d829 100644
> > > --- a/misc/ss.c
> > > +++ b/misc/ss.c
> > > @@ -170,11 +170,11 @@ static const struct filter default_dbs[MAX_DB] = {
> > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > >  	},
> > >  	[UDP_DB] = {
> > > -		.states   = (1 << SS_CLOSE),
> > > +		.states   = (1 << SS_ESTABLISHED),
> > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > >  	},
> > >  	[RAW_DB] = {
> > > -		.states   = (1 << SS_CLOSE),
> > > +		.states   = (1 << SS_ESTABLISHED),
> > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > >  	},
> > >  	[UNIX_DG_DB] = {
> > 
> > This is a change likely to break somebody using 'ss -u' now and the bound
> > sockets will disappear from the output.
> > 
> 
> But thats was as original behaviour before I added table-driven code
> (about few commits ago), so thats a rather fix (sorry I did not noticed
> about it) to keep the previous behaviour for dgram sockets - show
> established states by default.
> 
> Regards,

Ok, I will merge it and update the comments.

^ permalink raw reply

* [PATCH] net: rocker: Add basic netdev counters
From: David Ahern @ 2015-01-14 22:39 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Scott Feldman, Jiri Pirko

Add packet and byte counters for RX and TX paths.

$ ifconfig eth1
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5054:ff:fe12:3501  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:12:35:01  txqueuelen 1000  (Ethernet)
        RX packets 63  bytes 15813 (15.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 79  bytes 17991 (17.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Scott Feldman <sfeldma@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/ethernet/rocker/rocker.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 2f398fa4b9e6..9743279d9121 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -3557,6 +3557,9 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (!desc_info)
 		netif_stop_queue(dev);
 
+	dev->stats.tx_packets++;
+	dev->stats.tx_bytes += skb->len;
+
 	return NETDEV_TX_OK;
 
 unmap_frags:
@@ -3565,6 +3568,8 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev)
 	rocker_tlv_nest_cancel(desc_info, frags);
 out:
 	dev_kfree_skb(skb);
+	dev->stats.tx_dropped++;
+
 	return NETDEV_TX_OK;
 }
 
@@ -3890,6 +3895,9 @@ static int rocker_port_rx_proc(struct rocker *rocker,
 	skb->protocol = eth_type_trans(skb, rocker_port->dev);
 	netif_receive_skb(skb);
 
+	rocker_port->dev->stats.rx_packets++;
+	rocker_port->dev->stats.rx_bytes += skb->len;
+
 	return rocker_dma_rx_ring_skb_alloc(rocker, rocker_port, desc_info);
 }
 
-- 
1.9.3 (Apple Git-50)

^ permalink raw reply related

* [PATCH v2 2/2] fixup! net/macb: improved ethtool statistics support
From: Xander Huff @ 2015-01-14 22:20 UTC (permalink / raw)
  To: davem, nicolas.ferre
  Cc: netdev, jaeden.amero, rich.tollerton, ben.shelton, brad.mouring,
	linux-kernel, cyrille.pitchen, Xander Huff
In-Reply-To: <1421274051-21588-1-git-send-email-xander.huff@ni.com>

Add spaces around arithmetic operators.
Make a separate gem_ethtool_ops for the new statistics functions.
Adjust new block comments to match the existing comments in macb.h.

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.c |  25 +++--
 drivers/net/ethernet/cadence/macb.h | 203 +++++++++---------------------------
 2 files changed, 68 insertions(+), 160 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index dd8c202..f60f8f8 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1832,15 +1832,15 @@ static void gem_update_stats(struct macb *bp)
 
 	for (i = 0; i < GEM_STATS_LEN; ++i, ++p) {
 		u32 offset = gem_statistics[i].offset;
-		u64 val = __raw_readl(bp->regs+offset);
+		u64 val = __raw_readl(bp->regs + offset);
 
 		bp->ethtool_stats[i] += val;
 		*p += val;
 
 		if (offset == GEM_OCTTXL || offset == GEM_OCTRXL) {
 			/* Add GEM_OCTTXH, GEM_OCTRXH */
-			val = __raw_readl(bp->regs+offset+4);
-			bp->ethtool_stats[i] += ((u64)val)<<32;
+			val = __raw_readl(bp->regs+offset + 4);
+			bp->ethtool_stats[i] += ((u64)val) << 32;
 			*(++p) += val;
 		}
 	}
@@ -1891,7 +1891,7 @@ static void gem_get_ethtool_stats(struct net_device *dev,
 
 	bp = netdev_priv(dev);
 	gem_update_stats(bp);
-	memcpy(data, &bp->ethtool_stats, sizeof(u64)*GEM_STATS_LEN);
+	memcpy(data, &bp->ethtool_stats, sizeof(u64) * GEM_STATS_LEN);
 }
 
 static int gem_get_sset_count(struct net_device *dev, int sset)
@@ -2032,11 +2032,21 @@ const struct ethtool_ops macb_ethtool_ops = {
 	.get_regs		= macb_get_regs,
 	.get_link		= ethtool_op_get_link,
 	.get_ts_info		= ethtool_op_get_ts_info,
+};
+EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+
+const struct ethtool_ops gem_ethtool_ops = {
+	.get_settings		= macb_get_settings,
+	.set_settings		= macb_set_settings,
+	.get_regs_len		= macb_get_regs_len,
+	.get_regs		= macb_get_regs,
+	.get_link		= ethtool_op_get_link,
+	.get_ts_info		= ethtool_op_get_ts_info,
 	.get_ethtool_stats	= gem_get_ethtool_stats,
 	.get_strings		= gem_get_ethtool_strings,
 	.get_sset_count		= gem_get_sset_count,
 };
-EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+EXPORT_SYMBOL_GPL(gem_ethtool_ops);
 
 int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
@@ -2325,7 +2335,10 @@ static int __init macb_probe(struct platform_device *pdev)
 
 	dev->netdev_ops = &macb_netdev_ops;
 	netif_napi_add(dev, &bp->napi, macb_poll, 64);
-	dev->ethtool_ops = &macb_ethtool_ops;
+	if (macb_is_gem(bp))
+		dev->ethtool_ops = &gem_ethtool_ops;
+	else
+		dev->ethtool_ops = &macb_ethtool_ops;
 
 	dev->base_addr = regs->start;
 
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index d7b93d0..2ea5355 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -82,159 +82,52 @@
 #define GEM_SA4B				0x00A0 /* Specific4 Bottom */
 #define GEM_SA4T				0x00A4 /* Specific4 Top */
 #define GEM_OTX					0x0100 /* Octets transmitted */
-#define GEM_OCTTXL				0x0100 /* Octets transmitted
-							* [31:0]
-							*/
-#define GEM_OCTTXH				0x0104 /* Octets transmitted
-							* [47:32]
-							*/
-#define GEM_TXCNT				0x0108 /* Error-free Frames
-							* Transmitted counter
-							*/
-#define GEM_TXBCCNT				0x010c /* Error-free Broadcast
-							* Frames counter
-							*/
-#define GEM_TXMCCNT				0x0110 /* Error-free Multicast
-							* Frames counter
-							*/
-#define GEM_TXPAUSECNT				0x0114 /* Pause Frames
-							* Transmitted Counter
-							*/
-#define GEM_TX64CNT				0x0118 /* Error-free 64 byte
-							* Frames Transmitted
-							* counter
-							*/
-#define GEM_TX65CNT				0x011c /* Error-free 65-127 byte
-							* Frames Transmitted
-							* counter
-							*/
-#define GEM_TX128CNT				0x0120 /* Error-free 128-255
-							* byte Frames
-							* Transmitted counter
-							*/
-#define GEM_TX256CNT				0x0124 /* Error-free 256-511
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX512CNT				0x0128 /* Error-free 512-1023
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX1024CNT				0x012c /* Error-free 1024-1518
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX1519CNT				0x0130 /* Error-free larger than
-							* 1519 byte Frames
-							* tranmitted counter
-							*/
-#define GEM_TXURUNCNT				0x0134 /* TX under run error
-							* counter
-							*/
-#define GEM_SNGLCOLLCNT				0x0138 /* Single Collision Frame
-							* Counter
-							*/
-#define GEM_MULTICOLLCNT			0x013c /* Multiple Collision
-							* Frame Counter
-							*/
-#define GEM_EXCESSCOLLCNT			0x0140 /* Excessive Collision
-							* Frame Counter
-							*/
-#define GEM_LATECOLLCNT				0x0144 /* Late Collision Frame
-							* Counter
-							*/
-#define GEM_TXDEFERCNT				0x0148 /* Deferred Transmission
-							* Frame Counter
-							*/
-#define GEM_TXCSENSECNT				0x014c /* Carrier Sense Error
-							* Counter
-							*/
+#define GEM_OCTTXL				0x0100 /* Octets transmitted [31:0] */
+#define GEM_OCTTXH				0x0104 /* Octets transmitted [47:32] */
+#define GEM_TXCNT				0x0108 /* Error-free Frames Transmitted counter */
+#define GEM_TXBCCNT				0x010c /* Error-free Broadcast Frames counter */
+#define GEM_TXMCCNT				0x0110 /* Error-free Multicast Frames counter */
+#define GEM_TXPAUSECNT				0x0114 /* Pause Frames Transmitted Counter */
+#define GEM_TX64CNT				0x0118 /* Error-free 64 byte Frames Transmitted counter */
+#define GEM_TX65CNT				0x011c /* Error-free 65-127 byte Frames Transmitted counter */
+#define GEM_TX128CNT				0x0120 /* Error-free 128-255 byte Frames Transmitted counter */
+#define GEM_TX256CNT				0x0124 /* Error-free 256-511 byte Frames transmitted counter */
+#define GEM_TX512CNT				0x0128 /* Error-free 512-1023 byte Frames transmitted counter */
+#define GEM_TX1024CNT				0x012c /* Error-free 1024-1518 byte Frames transmitted counter */
+#define GEM_TX1519CNT				0x0130 /* Error-free larger than 1519 byte Frames tranmitted counter */
+#define GEM_TXURUNCNT				0x0134 /* TX under run error counter */
+#define GEM_SNGLCOLLCNT				0x0138 /* Single Collision Frame Counter */
+#define GEM_MULTICOLLCNT			0x013c /* Multiple Collision Frame Counter */
+#define GEM_EXCESSCOLLCNT			0x0140 /* Excessive Collision Frame Counter */
+#define GEM_LATECOLLCNT				0x0144 /* Late Collision Frame Counter */
+#define GEM_TXDEFERCNT				0x0148 /* Deferred Transmission Frame Counter */
+#define GEM_TXCSENSECNT				0x014c /* Carrier Sense Error Counter */
 #define GEM_ORX					0x0150 /* Octets received */
-#define GEM_OCTRXL				0x0150 /* Octets received
-							* [31:0]
-							*/
-#define GEM_OCTRXH				0x0154 /* Octets received
-							* [47:32]
-							*/
-#define GEM_RXCNT				0x0158 /* Error-free Frames
-							* Received Counter
-							*/
-#define GEM_RXBROADCNT				0x015c /* Error-free Broadcast
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RXMULTICNT				0x0160 /* Error-free Multicast
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RXPAUSECNT				0x0164 /* Error-free Pause
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX64CNT				0x0168 /* Error-free 64 byte
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX65CNT				0x016c /* Error-free 65-127 byte
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX128CNT				0x0170 /* Error-free 128-255
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX256CNT				0x0174 /* Error-free 256-511
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX512CNT				0x0178 /* Error-free 512-1023
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX1024CNT				0x017c /* Error-free 1024-1518
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX1519CNT				0x0180 /* Error-free larger than
-							* 1519 Frames Received
-							* Counter
-							*/
-#define GEM_RXUNDRCNT				0x0184 /* Undersize Frames
-							* Received Counter
-							*/
-#define GEM_RXOVRCNT				0x0188 /* Oversize Frames
-							* Received Counter
-							*/
-#define GEM_RXJABCNT				0x018c /* Jabbers Received
-							* Counter
-							*/
-#define GEM_RXFCSCNT				0x0190 /* Frame Check Sequence
-							* Error Counter
-							*/
-#define GEM_RXLENGTHCNT				0x0194 /* Length Field Error
-							* Counter
-							*/
-#define GEM_RXSYMBCNT				0x0198 /* Symbol Error
-							* Counter
-							*/
-#define GEM_RXALIGNCNT				0x019c /* Alignment Error
-							* Counter
-							*/
-#define GEM_RXRESERRCNT				0x01a0 /* Receive Resource Error
-							* Counter
-							*/
-#define GEM_RXORCNT				0x01a4 /* Receive Overrun
-							* Counter
-							*/
-#define GEM_RXIPCCNT				0x01a8 /* IP header Checksum
-							* Error Counter
-							*/
-#define GEM_RXTCPCCNT				0x01ac /* TCP Checksum Error
-							* Counter
-							*/
-#define GEM_RXUDPCCNT				0x01b0 /* UDP Checksum Error
-							* Counter
-							*/
+#define GEM_OCTRXL				0x0150 /* Octets received [31:0] */
+#define GEM_OCTRXH				0x0154 /* Octets received [47:32] */
+#define GEM_RXCNT				0x0158 /* Error-free Frames Received Counter */
+#define GEM_RXBROADCNT				0x015c /* Error-free Broadcast Frames Received Counter */
+#define GEM_RXMULTICNT				0x0160 /* Error-free Multicast Frames Received Counter */
+#define GEM_RXPAUSECNT				0x0164 /* Error-free Pause Frames Received Counter */
+#define GEM_RX64CNT				0x0168 /* Error-free 64 byte Frames Received Counter */
+#define GEM_RX65CNT				0x016c /* Error-free 65-127 byte Frames Received Counter */
+#define GEM_RX128CNT				0x0170 /* Error-free 128-255 byte Frames Received Counter */
+#define GEM_RX256CNT				0x0174 /* Error-free 256-511 byte Frames Received Counter */
+#define GEM_RX512CNT				0x0178 /* Error-free 512-1023 byte Frames Received Counter */
+#define GEM_RX1024CNT				0x017c /* Error-free 1024-1518 byte Frames Received Counter */
+#define GEM_RX1519CNT				0x0180 /* Error-free larger than 1519 Frames Received Counter */
+#define GEM_RXUNDRCNT				0x0184 /* Undersize Frames Received Counter */
+#define GEM_RXOVRCNT				0x0188 /* Oversize Frames Received Counter */
+#define GEM_RXJABCNT				0x018c /* Jabbers Received Counter */
+#define GEM_RXFCSCNT				0x0190 /* Frame Check Sequence Error Counter */
+#define GEM_RXLENGTHCNT				0x0194 /* Length Field Error Counter */
+#define GEM_RXSYMBCNT				0x0198 /* Symbol Error Counter */
+#define GEM_RXALIGNCNT				0x019c /* Alignment Error Counter */
+#define GEM_RXRESERRCNT				0x01a0 /* Receive Resource Error Counter */
+#define GEM_RXORCNT				0x01a4 /* Receive Overrun Counter */
+#define GEM_RXIPCCNT				0x01a8 /* IP header Checksum Error Counter */
+#define GEM_RXTCPCCNT				0x01ac /* TCP Checksum Error Counter */
+#define GEM_RXUDPCCNT				0x01b0 /* UDP Checksum Error Counter */
 #define GEM_DCFG1				0x0280 /* Design Config 1 */
 #define GEM_DCFG2				0x0284 /* Design Config 2 */
 #define GEM_DCFG3				0x0288 /* Design Config 3 */
@@ -748,7 +641,8 @@ struct gem_stats {
 	u32	rx_udp_checksum_errors;
 };
 
-/* Describes the name and offset of an individual statistic register, as
+/*
+ * Describes the name and offset of an individual statistic register, as
  * returned by `ethtool -S`. Also describes which net_device_stats statistics
  * this register should contribute to.
  */
@@ -778,7 +672,8 @@ struct gem_statistic {
 	.stat_bits = bits				\
 }
 
-/* list of gem statistic registers. The names MUST match the
+/*
+ * list of gem statistic registers. The names MUST match the
  * corresponding GEM_* definitions.
  */
 static const struct gem_statistic gem_statistics[] = {
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier
From: Xander Huff @ 2015-01-14 22:20 UTC (permalink / raw)
  To: davem, nicolas.ferre
  Cc: netdev, jaeden.amero, rich.tollerton, ben.shelton, brad.mouring,
	linux-kernel, cyrille.pitchen, Xander Huff
In-Reply-To: <20150114.165220.2282566005036464131.davem@davemloft.net>

Put #define comments into a single line.

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.h | 107 +++++++++---------------------------
 1 file changed, 26 insertions(+), 81 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 378b218..d7b93d0 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -275,9 +275,7 @@
 #define MACB_THALT_SIZE				1
 #define MACB_NCR_TPF_OFFSET			11 /* Transmit pause frame */
 #define MACB_NCR_TPF_SIZE			1
-#define MACB_TZQ_OFFSET				12 /* Transmit zero quantum
-						    * pause frame
-						    */
+#define MACB_TZQ_OFFSET				12 /* Transmit zero quantum pause frame */
 #define MACB_TZQ_SIZE				1
 
 /* Bitfields in NCFGR */
@@ -299,9 +297,7 @@
 #define MACB_UNI_SIZE				1
 #define MACB_BIG_OFFSET				8 /* Receive 1536 byte frames */
 #define MACB_BIG_SIZE				1
-#define MACB_EAE_OFFSET				9 /* External address match
-						   * enable
-						   */
+#define MACB_EAE_OFFSET				9 /* External address match enable */
 #define MACB_EAE_SIZE				1
 #define MACB_CLK_OFFSET				10
 #define MACB_CLK_SIZE				2
@@ -313,9 +309,7 @@
 #define MACB_RM9200_RMII_SIZE			1  /* AT91RM9200 only */
 #define MACB_RBOF_OFFSET			14 /* Receive buffer offset */
 #define MACB_RBOF_SIZE				2
-#define MACB_RLCE_OFFSET			16 /* Length field error frame
-						    * discard
-						    */
+#define MACB_RLCE_OFFSET			16 /* Length field error frame discard */
 #define MACB_RLCE_SIZE				1
 #define MACB_DRFCS_OFFSET			17 /* FCS remove */
 #define MACB_DRFCS_SIZE				1
@@ -335,41 +329,22 @@
 #define GEM_RXCOEN_SIZE				1
 
 /* Constants for data bus width. */
-#define GEM_DBW32				0 /* 32 bit AMBA AHB data bus
-						   * width
-						   */
-#define GEM_DBW64				1 /* 64 bit AMBA AHB data bus
-						   * width
-						   */
-#define GEM_DBW128				2 /* 128 bit AMBA AHB data bus
-						   * width
-						   */
+#define GEM_DBW32				0 /* 32 bit AMBA AHB data bus width */
+#define GEM_DBW64				1 /* 64 bit AMBA AHB data bus width */
+#define GEM_DBW128				2 /* 128 bit AMBA AHB data bus width */
 
 /* Bitfields in DMACFG. */
-#define GEM_FBLDO_OFFSET			0 /* AHB fixed burst length for
-						   * DMA data operations
-						   */
+#define GEM_FBLDO_OFFSET			0 /* AHB fixed burst length for DMA data operations */
 #define GEM_FBLDO_SIZE				5
-#define GEM_ENDIA_OFFSET			7 /* AHB endian swap mode enable
-						   * for packet data accesses
-						   */
+#define GEM_ENDIA_OFFSET			7 /* AHB endian swap mode enable for packet data accesses */
 #define GEM_ENDIA_SIZE				1
-#define GEM_RXBMS_OFFSET			8 /* Receiver packet buffer
-						   * memory size select
-						   */
+#define GEM_RXBMS_OFFSET			8 /* Receiver packet buffer memory size select */
 #define GEM_RXBMS_SIZE				2
-#define GEM_TXPBMS_OFFSET			10 /* Transmitter packet buffer
-						    * memory size select
-						    */
+#define GEM_TXPBMS_OFFSET			10 /* Transmitter packet buffer memory size select */
 #define GEM_TXPBMS_SIZE				1
-#define GEM_TXCOEN_OFFSET			11 /* Transmitter IP, TCP and
-						    * UDP checksum generation
-						    * offload enable
-						    */
+#define GEM_TXCOEN_OFFSET			11 /* Transmitter IP, TCP and UDP checksum generation offload enable */
 #define GEM_TXCOEN_SIZE				1
-#define GEM_RXBS_OFFSET				16 /* DMA receive buffer size in
-						    * AHB system memory
-						    */
+#define GEM_RXBS_OFFSET				16 /* DMA receive buffer size in AHB system memory */
 #define GEM_RXBS_SIZE				8
 #define GEM_DDRP_OFFSET				24 /* disc_when_no_ahb */
 #define GEM_DDRP_SIZE				1
@@ -378,13 +353,9 @@
 /* Bitfields in NSR */
 #define MACB_NSR_LINK_OFFSET			0 /* pcs_link_state */
 #define MACB_NSR_LINK_SIZE			1
-#define MACB_MDIO_OFFSET			1 /* status of the mdio_in
-						   * pin
-						   */
+#define MACB_MDIO_OFFSET			1 /* status of the mdio_in pin */
 #define MACB_MDIO_SIZE				1
-#define MACB_IDLE_OFFSET			2 /* The PHY management logic is
-						   * idle (i.e. has completed)
-						   */
+#define MACB_IDLE_OFFSET			2 /* The PHY management logic is idle (i.e. has completed) */
 #define MACB_IDLE_SIZE				1
 
 /* Bitfields in TSR */
@@ -396,9 +367,7 @@
 #define MACB_TSR_RLE_SIZE			1
 #define MACB_TGO_OFFSET				3 /* Transmit go */
 #define MACB_TGO_SIZE				1
-#define MACB_BEX_OFFSET				4 /* Transmit frame corruption
-						   * due to AHB error
-						   */
+#define MACB_BEX_OFFSET				4 /* Transmit frame corruption due to AHB error */
 #define MACB_BEX_SIZE				1
 #define MACB_RM9200_BNQ_OFFSET			4 /* AT91RM9200 only */
 #define MACB_RM9200_BNQ_SIZE			1 /* AT91RM9200 only */
@@ -424,43 +393,23 @@
 #define MACB_RXUBR_SIZE				1
 #define MACB_TXUBR_OFFSET			3 /* TX used bit read */
 #define MACB_TXUBR_SIZE				1
-#define MACB_ISR_TUND_OFFSET			4 /* Enable trnasmit buffer
-						   * under run interrupt
-						   */
+#define MACB_ISR_TUND_OFFSET			4 /* Enable trnasmit buffer under run interrupt */
 #define MACB_ISR_TUND_SIZE			1
-#define MACB_ISR_RLE_OFFSET			5 /* Enable retry limit exceeded
-						   * or late collision interrupt
-						   */
+#define MACB_ISR_RLE_OFFSET			5 /* Enable retry limit exceeded or late collision interrupt */
 #define MACB_ISR_RLE_SIZE			1
-#define MACB_TXERR_OFFSET			6 /* Enable transmit frame
-						   * corruption due to AHB error
-						   * interrupt
-						   */
+#define MACB_TXERR_OFFSET			6 /* Enable transmit frame corruption due to AHB error interrupt */
 #define MACB_TXERR_SIZE				1
-#define MACB_TCOMP_OFFSET			7 /* Enable transmit complete
-						   * interrupt
-						   */
+#define MACB_TCOMP_OFFSET			7 /* Enable transmit complete interrupt */
 #define MACB_TCOMP_SIZE				1
-#define MACB_ISR_LINK_OFFSET			9 /* Enable link change
-						   * interrupt
-						   */
+#define MACB_ISR_LINK_OFFSET			9 /* Enable link change interrupt */
 #define MACB_ISR_LINK_SIZE			1
-#define MACB_ISR_ROVR_OFFSET			10 /* Enable receive overrun
-						    * interrupt
-						    */
+#define MACB_ISR_ROVR_OFFSET			10 /* Enable receive overrun interrupt */
 #define MACB_ISR_ROVR_SIZE			1
-#define MACB_HRESP_OFFSET			11 /* Enable hrsep not OK
-						    * interrupt
-						    */
+#define MACB_HRESP_OFFSET			11 /* Enable hrsep not OK interrupt */
 #define MACB_HRESP_SIZE				1
-#define MACB_PFR_OFFSET				12 /* Enable pause frame with
-						    * non-zero pause quantum
-						    * interrupt
-						    */
+#define MACB_PFR_OFFSET				12 /* Enable pause frame with non-zero pause quantum interrupt */
 #define MACB_PFR_SIZE				1
-#define MACB_PTZ_OFFSET				13 /* Enable pause time zero
-						    * interrupt
-						    */
+#define MACB_PTZ_OFFSET				13 /* Enable pause time zero interrupt */
 #define MACB_PTZ_SIZE				1
 
 /* Bitfields in MAN */
@@ -472,13 +421,9 @@
 #define MACB_REGA_SIZE				5
 #define MACB_PHYA_OFFSET			23 /* PHY address */
 #define MACB_PHYA_SIZE				5
-#define MACB_RW_OFFSET				28 /* Operation. 10 is read. 01
-						    * is write.
-						    */
+#define MACB_RW_OFFSET				28 /* Operation. 10 is read. 01 is write. */
 #define MACB_RW_SIZE				2
-#define MACB_SOF_OFFSET				30 /* Must be written to 1 for
-						    * Clause 22 operation
-						    */
+#define MACB_SOF_OFFSET				30 /* Must be written to 1 for Clause 22 operation */
 #define MACB_SOF_SIZE				2
 
 /* Bitfields in USRIO (AVR32) */
-- 
1.9.1

^ permalink raw reply related

* [GIT] Networking
From: David Miller @ 2015-01-14 22:12 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) Don't use uninitialized data in IPVS, from Dan Carpenter.

2) conntrack race fixes from Pablo Neira Ayuso.

3) Fix TX hangs with i40e, from Jesse Brandeburg.

4) Fix budget return from poll calls in dnet and alx, from Eric Dumazet.

5) Fix bugus "if (unlikely(x) < 0)" test in AF_PACKET, from Christoph	
   Jaeger.

6) Fix bug introduced by conversion to list_head in TIPC retransmit
   code, from Jon Paul Maloy.

7) Don't use GFP_NOIO under spinlock in USB kaweth driver, from Alexey
   Khoroshilov.

8) Fix bridge build with INET disabled, from Arnd Bergmann.

9) Fix netlink array overrun for PROBE attributes in openvswitch,
   from Thomas Graf.

10) Don't hold spinlock across synchronize_irq() in tg3 driver, from
    Prashant Sreedharan.

Please pull, thanks a lot.

The following changes since commit bdec41963890f8ed9ad89f8b418959ab3cdc2aa3:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2015-01-06 17:48:14 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master

for you to fetch changes up to c637dbcedf31ce1dd813a461de406f45aa7a3d38:

  Merge branch 'tg3-net' (2015-01-14 17:05:55 -0500)

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

Alexandre Belloni (1):
      net/at91_ether: prepare and unprepare clock

Alexey Khoroshilov (1):
      usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()

Ani Sinha (1):
      update ip-sysctl.txt documentation (v2)

Anjali Singhai (2):
      i40e: Fix Rx checksum error counter
      i40e: Fix bug with TCP over IPv6 over VXLAN

Arik Nemtsov (1):
      iwlwifi: pcie: correctly define 7265-D cfg

Arnd Bergmann (1):
      bridge: only provide proxy ARP when CONFIG_INET is enabled

B Viswanath (1):
      net: Corrected the comment describing the ndo operations to reflect the actual prototype for couple of operations

Benjamin Poirier (1):
      netdevice: Add missing parentheses in macro

Christoph Jaeger (1):
      packet: bail out of packet_snd() if L2 header creation fails

Dan Carpenter (1):
      ipvs: uninitialized data with IP_VS_IPV6

David S. Miller (4):
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net
      Merge git://git.kernel.org/.../pablo/nf
      Merge tag 'wireless-drivers-for-davem-2015-01-09' of git://git.kernel.org/.../kvalo/wireless-drivers
      Merge branch 'tg3-net'

David Spinadel (2):
      iwlwifi: mvm: add a flag to enable match found notification
      iwlwifi: mvm: scan dwell time corrections

David Vrabel (1):
      xen-netfront: use different locks for Rx and Tx stats

Emmanuel Grumbach (2):
      iwlwifi: 7000: fix reported firmware name for 7265D
      iwlwifi: bump firmware API for mvm devices to 12

Eric Dumazet (2):
      net: dnet: fix dnet_poll()
      alx: fix alx_poll()

Eyal Shapira (2):
      iwlwifi: mvm: fix Rx with both chains
      iwlwifi: mvm: fix out of bounds access to tid_to_mac80211_ac

Giel van Schijndel (1):
      isdn: fix NUL (\0 or \x00) specification in string

Hariprasad Shenai (2):
      cxgb4vf: Initialize mdio_addr before using it
      cxgb4vf: Fix queue allocation for 40G adapter

Hubert Feurstein (1):
      net: fec: fix NULL pointer dereference in fec_enet_timeout_work

Jean-Francois Remy (1):
      neighbour: fix base_reachable_time(_ms) not effective immediatly when changed

Jesse Brandeburg (1):
      i40e: fix un-necessary Tx hangs

Jiri Pirko (1):
      team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin

Jon Paul Maloy (1):
      tipc: fix bug in broadcast retransmit code

Kalle Valo (1):
      Merge tag 'iwlwifi-for-kalle-2015-01-05' of https://git.kernel.org/.../iwlwifi/iwlwifi-fixes

Larry Finger (1):
      rtlwifi: Fix error when accessing unmapped memory in skb

Mugunthan V N (1):
      drivers: net: cpsw: fix multicast flush in dual emac mode

Nobuhiro Iwamatsu (2):
      sh-eth: Set fdr_value of R-Car SoCs
      sh_eth: Fix access to TRSCER register

Pablo Neira Ayuso (5):
      Merge tag 'ipvs2-for-v3.19' of https://git.kernel.org/.../horms/ipvs-next into ipvs-next
      netfilter: conntrack: fix race between confirmation and flush
      netfilter: nfnetlink: validate nfnetlink header from batch
      netfilter: nfnetlink: relax strict multicast group check from netlink_bind
      netfilter: nf_tables: fix flush ruleset chain dependencies

Prashant Sreedharan (3):
      tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
      tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
      tg3: Release tp->lock before invoking synchronize_irq()

Stefan Agner (1):
      net: fec: fix MDIO bus assignement for dual fec SoC's

Thomas Falcon (1):
      MAINTAINERS: add me as ibmveth maintainer

Thomas Graf (1):
      openvswitch: packet messages need their own probe attribtue

Vasu Dev (1):
      i40e: adds FCoE configure option

leroy christophe (1):
      netfilter: nf_tables: fix port natting in little endian archs

 Documentation/networking/ip-sysctl.txt              |   2 ++
 MAINTAINERS                                         |   2 +-
 arch/arm/boot/dts/imx6sx-sdb.dts                    |  15 ++++++++++
 arch/arm/boot/dts/vf610-twr.dts                     |  15 ++++++++++
 drivers/isdn/hardware/eicon/message.c               |   2 +-
 drivers/net/ethernet/atheros/alx/main.c             |  24 ++++++++--------
 drivers/net/ethernet/broadcom/tg3.c                 |  23 +++++++++++++--
 drivers/net/ethernet/cadence/at91_ether.c           |  10 +++----
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c |   2 +-
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c      |   2 ++
 drivers/net/ethernet/dnet.c                         |  18 ++++--------
 drivers/net/ethernet/freescale/fec.h                |   2 ++
 drivers/net/ethernet/freescale/fec_main.c           |  10 ++++---
 drivers/net/ethernet/intel/Kconfig                  |  11 ++++++++
 drivers/net/ethernet/intel/i40e/Makefile            |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_osdep.h        |   4 +--
 drivers/net/ethernet/intel/i40e/i40e_txrx.c         | 104 +++++++++++++++++++++++++++++++++++++++++++++++---------------------
 drivers/net/ethernet/intel/i40e/i40e_txrx.h         |   1 +
 drivers/net/ethernet/renesas/sh_eth.c               |   9 +++++-
 drivers/net/ethernet/renesas/sh_eth.h               |   5 ++++
 drivers/net/ethernet/ti/cpsw.c                      |  11 ++++++--
 drivers/net/ethernet/ti/cpsw_ale.c                  |  10 ++++++-
 drivers/net/ethernet/ti/cpsw_ale.h                  |   2 +-
 drivers/net/team/team.c                             |  16 +++++++++--
 drivers/net/usb/kaweth.c                            |   2 +-
 drivers/net/wireless/iwlwifi/iwl-7000.c             |   6 ++--
 drivers/net/wireless/iwlwifi/iwl-8000.c             |   2 +-
 drivers/net/wireless/iwlwifi/iwl-fw-file.h          |   4 +++
 drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h      |   2 ++
 drivers/net/wireless/iwlwifi/mvm/scan.c             |  19 +++++++++----
 drivers/net/wireless/iwlwifi/mvm/tx.c               |   8 ++++--
 drivers/net/wireless/iwlwifi/mvm/utils.c            |   2 +-
 drivers/net/wireless/iwlwifi/pcie/drv.c             |   4 ++-
 drivers/net/wireless/rtlwifi/pci.c                  |  32 +++++++++++++++------
 drivers/net/xen-netfront.c                          |  71 +++++++++++++++++++++++++++-------------------
 include/linux/netdevice.h                           |   6 ++--
 include/uapi/linux/openvswitch.h                    |   4 +++
 net/bridge/br_input.c                               |   3 +-
 net/core/neighbour.c                                |  44 +++++++++++++++++++++++++++++
 net/ipv4/netfilter/nft_redir_ipv4.c                 |   8 +++---
 net/ipv6/netfilter/nft_redir_ipv6.c                 |   8 +++---
 net/netfilter/ipvs/ip_vs_ftp.c                      |  10 +++----
 net/netfilter/nf_conntrack_core.c                   |  20 ++++++-------
 net/netfilter/nf_tables_api.c                       |  14 ++++++----
 net/netfilter/nfnetlink.c                           |   5 ++--
 net/netfilter/nft_nat.c                             |   8 +++---
 net/openvswitch/datapath.c                          |   3 +-
 net/packet/af_packet.c                              |   2 +-
 net/tipc/bcast.c                                    |   5 ++--
 49 files changed, 419 insertions(+), 175 deletions(-)

^ permalink raw reply

* Re: [PATCH net 0/3 v2]tg3: synchronize_irq() should be called without taking locks
From: David Miller @ 2015-01-14 22:06 UTC (permalink / raw)
  To: prashant; +Cc: netdev, mchan, peter
In-Reply-To: <1421263992-23907-1-git-send-email-prashant@broadcom.com>

From: Prashant Sreedharan <prashant@broadcom.com>
Date: Wed, 14 Jan 2015 11:33:12 -0800

> v2: Added Reported-by, Tested-by fields and reference to the thread that
>     reported the problem
> 
> This series addresses the problem reported by Peter Hurley in mail thread
> https://lkml.org/lkml/2015/1/12/1082

Series applied, thanks.

^ permalink raw reply

* Re: [patch net-next v4 1/2] tc: add BPF based action
From: Daniel Borkmann @ 2015-01-14 21:55 UTC (permalink / raw)
  To: Cong Wang
  Cc: Jiri Pirko, netdev, David Miller, Jamal Hadi Salim,
	Alexei Starovoitov, Hannes Frederic Sowa, willemb
In-Reply-To: <CAHA+R7NWShJo_0apkOa5pudpE69EdWkzAQpW00zfO7ePhxt2XA@mail.gmail.com>

On 01/14/2015 08:27 PM, Cong Wang wrote:
> On Wed, Jan 14, 2015 at 9:43 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> This action provides a possibility to exec custom BPF code.
>
> I still don't like it, sorry, not just for your patch, I never like
> cls_bpf either, in terms of the user interface and the duplicated
> functionalities: cls_bpf vs u32, act_bpf vs gact.
...
> Ideally we should be able to implement them with the same
> interface, transparent to users, I think probably because
> the nature of bpf implementation somewhat enforces such
> interface everywhere, it is clearly overrated.

Hmm, I guess you're talking about the interface from tc side, other
than that cls_bpf is also faster when JITed. I can only speak for
cls_bpf here, which is modelled the same way after xt_bpf and takes
low-level BPF opcodes directly or stored somewhere as a file. Not
overly pretty, that's true.

For somewhat higher but still low-level enough description, I've
added bpf_asm for that purpose so you can still have full control
and if that's still too much and you don't care about unsupported
BPF extensions, then the libpcap compiler is your friend. For example,
Willem has added [1] longer time ago which takes tcpdump-like
filters and spills out related opcodes for you, if you don't want
to use tcpdump -ddd directly.

The other possibility would be to have an own internal BPF filter
compiler inside of tc (w/o any external lib dependencies), a thought
lingering in my head for quite some time now. I guess I could scratch
some cycles off from my spare time and start hacking on it.

Other than that, for the eBPF part, there are efforts to upstream
backends to llvm and gcc, afaik, so their produced output could be
passed onwards to tc, similarly as in samples/bpf/ as one possibility
I could imagine.

   [1] http://git.netfilter.org/iptables/tree/utils/nfbpf_compile.c

^ permalink raw reply

* Re: [patch net] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
From: David Miller @ 2015-01-14 21:55 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jbenc
In-Reply-To: <1421255730-10681-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 14 Jan 2015 18:15:30 +0100

> This patch is fixing a race condition that may cause setting
> count_pending to -1, which results in unwanted big bulk of arp messages
> (in case of "notify peers").
> 
> Consider following scenario:
 ...
> Fix this race by using atomic_dec_if_positive - that will prevent
> count_pending running under 0.
> 
> Fixes: fc423ff00df3a1955441 ("team: add peer notification")
> Fixes: 492b200efdd20b8fcfd  ("team: add support for sending multicast rejoins")
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Jiri Benc <jbenc@redhat.com>

Applied, thanks.

I am assuming that v3.12 and later need this fix, therefore I'm queueing it up for
-stable.

^ permalink raw reply

* Re: [net-next PATCH v2 03/12] net: flow: implement flow cache for get routines
From: Thomas Graf @ 2015-01-14 21:52 UTC (permalink / raw)
  To: John Fastabend
  Cc: simon.horman, sfeldma, netdev, gerlitz.or, jhs, andy, davem
In-Reply-To: <20150113213621.13874.40461.stgit@nitbit.x32>

On 01/13/15 at 01:36pm, John Fastabend wrote:
> I chose rhashtable to get the dynamic resizing. I could use arrays
> but I don't want to pre-allocate large cache tables when we may
> never use them.
> 
> One oddity in the rhashtable implementation is there is no way
> AFAICS to do delayed free's so we use rcu_sync heavily. This should be
> fine, get operations shouldn't be a used heavily.

John, can you please clarify a bit, I'm not sure I understand. Are you
talking about delayed freeing of the table itself or elements?

The Netlink usage would be an example of a user with delayed element
freeing.

I'm glad to add whatever is required.

^ permalink raw reply

* Re: [PATCH 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier
From: David Miller @ 2015-01-14 21:52 UTC (permalink / raw)
  To: xander.huff
  Cc: nicolas.ferre, netdev, jaeden.amero, rich.tollerton, ben.shelton,
	brad.mouring, linux-kernel, cyrille.pitchen
In-Reply-To: <54B6DD2A.1050502@ni.com>

From: Xander Huff <xander.huff@ni.com>
Date: Wed, 14 Jan 2015 15:18:34 -0600

> On 1/14/2015 3:09 PM, David Miller wrote:
>>
>> As I mentioned, this won't do.
>>
>> I've already applied your original patches to net-next, therefore you
>> will
>> have to submit fixups relative to that.
>>
> These fixup commits are relative to an updated net-next, specifically
> "237de6e Merge branch 'hip04'".
> 
> Do you need them relative to (what I'm seeing is the latest) "2733135
> Merge branch 'vxlan_rco'"?

Why don't you make your subject lines and commit messages just say what
they are doing, rather than just saying "fix this other change"?

^ permalink raw reply

* Re: [PATCH net] openvswitch: packet messages need their own probe attribtue
From: David Miller @ 2015-01-14 21:49 UTC (permalink / raw)
  To: tgraf-G/eBtMaohhA
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	fw-HFFVJYpyMKqzQB+pC5nmwQ, linux-6SM94LqRVpn6gRhOQ7JHfg
In-Reply-To: <20150114135619.GC564-FZi0V3Vbi30CUdFEqe4BF2D2FQJk+8+b@public.gmane.org>

From: Thomas Graf <tgraf@suug.ch>
Date: Wed, 14 Jan 2015 13:56:19 +0000

> User space is currently sending a OVS_FLOW_ATTR_PROBE for both flow
> and packet messages. This leads to an out-of-bounds access in
> ovs_packet_cmd_execute() because OVS_FLOW_ATTR_PROBE >
> OVS_PACKET_ATTR_MAX.
> 
> Introduce a new OVS_PACKET_ATTR_PROBE with the same numeric value
> as OVS_FLOW_ATTR_PROBE to grow the range of accepted packet attributes
> while maintaining to be binary compatible with existing OVS binaries.
> 
> Fixes: 05da589 ("openvswitch: Add support for OVS_FLOW_ATTR_PROBE.")
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Tracked-down-by: Florian Westphal <fw@strlen.de>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* Re: [net] i40e: adds FCoE configure option
From: David Miller @ 2015-01-14 21:49 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: vasu.dev, netdev, nhorman, sassmann, jogreene, stable
In-Reply-To: <1421241247-22594-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 14 Jan 2015 05:14:07 -0800

> From: Vasu Dev <vasu.dev@intel.com>
> 
> Adds FCoE config option I40E_FCOE, so that FCoE can be enabled
> as needed but otherwise have it disabled by default.
> 
> This also eliminate multiple FCoE config checks, instead now just
> one config check for CONFIG_I40E_FCOE.
> 
> The I40E FCoE was added with 3.17 kernel and therefore this patch
> shall be applied to stable 3.17 kernel also.
> 
> CC: <stable@vger.kernel.org>
> Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> Tested-by: Jim Young <jamesx.m.young@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [PATCH net] cxgb4vf: Fix queue allocation for 40G adapter
From: David Miller @ 2015-01-14 21:48 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, nirranjan
In-Reply-To: <1421238490-26590-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Wed, 14 Jan 2015 17:58:10 +0530

> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied.

^ permalink raw reply

* Re: [PATCH_V4] dm9000: Add regulator and reset support to dm9000
From: David Miller @ 2015-01-14 21:47 UTC (permalink / raw)
  To: Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8
In-Reply-To: <1421231777-12589-1-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>

From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Date: Wed, 14 Jan 2015 10:36:17 +0000

> +	power = devm_regulator_get(dev, "vcc");
> +	if (PTR_ERR(power) == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +	if (IS_ERR(power)) {
> +		dev_dbg(dev, "no regulator provided\n");

I know it may seem silly, but to me it is more logical to always
guard PTR_ERR() uses with IS_ERR().

Therefore could you please restructure this as:

	if (IS_ERR(power)) {
		if (PTR_ERR(power) == -EPROBE_DEFER)
			return -EPROBE_DEFER;
		else
			dev_dbg(dev, "no regulator provided\n");
	} else {

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 net-next] socket: use iov_length()
From: David Miller @ 2015-01-14 21:45 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev
In-Reply-To: <1421230070-4104-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 14 Jan 2015 11:07:50 +0100

> @@ -883,10 +883,8 @@ static ssize_t do_sock_read(struct msghdr *msg, struct kiocb *iocb,
>  {
>  	struct socket *sock = file->private_data;
>  	size_t size = 0;
> -	int i;
>  
> -	for (i = 0; i < nr_segs; i++)
> -		size += iov[i].iov_len;
> +	size = iov_length(iov, nr_segs);

In both of these cases you can now remove the initialization of size to '0'.

^ permalink raw reply

* net: prevent of emerging cross-namespace symlinks patches for 3.14?
From: Miquel van Smoorenburg @ 2015-01-14 21:45 UTC (permalink / raw)
  To: netdev; +Cc: stable, Alexander Y. Fomichev, David Miller

[first sent to lkml, now to netdev and the original patch author]

When running 'lxc' on the latest -stable kernel, 3.14.28, I'm seeing 
these errors:

Jan 14 17:47:16 lxc2 kernel: [   10.704890] WARNING: CPU: 0 PID: 3209 at 
fs/sys
fs/dir.c:52 sysfs_warn_dup+0x8c/0xb0()
Jan 14 17:47:16 lxc2 kernel: [   10.704892] sysfs: cannot create 
duplicate filename '/devices/virtual/net/eth0.104/upper_eth0'
Jan 14 17:47:16 lxc2 kernel: [   10.704954] CPU: 0 PID: 3209 Comm: 
lxc-autostart Not tainted 3.14.28-xsserver #1

I did not see these errors in 3.12. This was fixed in 3.17 by:

net: prevent of emerging cross-namespace symlinks
https://github.com/torvalds/linux/commit/4c75431ac3520631f1d9e74aa88407e6374dbbc4

net: fix creation adjacent device symlinks
https://github.com/torvalds/linux/commit/7ce64c79c4decdeb1afe0bf2f6ef834b382871d1

These patches apply cleanly to 3.14.28.

If you agree that this should go into 3.14-stable, please ack.

Thanks,

Mike.

^ permalink raw reply

* Re: [PATCH 1/1] ipv6:icmp:remove unnecessary brackets
From: David Miller @ 2015-01-14 21:36 UTC (permalink / raw)
  To: zyjzyj2000; +Cc: netdev, Yanjun.Zhu
In-Reply-To: <1421227439-13996-1-git-send-email-Yanjun.Zhu@windriver.com>

From: Zhu Yanjun <zyjzyj2000@gmail.com>
Date: Wed, 14 Jan 2015 17:23:59 +0800

> There are too many brackets. Maybe only one bracket is enough.
> 
> Signed-off-by: Zhu Yanjun <Yanjun.Zhu@windriver.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH] netdevice: Add missing parentheses in macro
From: David Miller @ 2015-01-14 21:34 UTC (permalink / raw)
  To: bpoirier; +Cc: nikolay, netdev, linux-kernel
In-Reply-To: <1421221955-9505-1-git-send-email-bpoirier@suse.de>

From: Benjamin Poirier <bpoirier@suse.de>
Date: Wed, 14 Jan 2015 16:52:35 +0900

> For example, one could conceivably call
> 	for_each_netdev_in_bond_rcu(condition ? bond1 : bond2, slave)
> and get an unexpected result.
> 
> Signed-off-by: Benjamin Poirier <bpoirier@suse.de>

Applied.

^ permalink raw reply

* Re: [PATCHv3 net-next] openvswitch: Introduce ovs_tunnel_route_lookup
From: David Miller @ 2015-01-14 21:34 UTC (permalink / raw)
  To: fan.du; +Cc: pshelar, netdev, dev, fengyuleidian0615
In-Reply-To: <1421212235-29447-1-git-send-email-fan.du@intel.com>

aFrom: Fan Du <fan.du@intel.com>
Date: Wed, 14 Jan 2015 13:10:35 +0800

> Introduce ovs_tunnel_route_lookup to consolidate route lookup
> shared by vxlan, gre, and geneve ports.
> 
> Signed-off-by: Fan Du <fan.du@intel.com>

Applied.

^ 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