Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] net, vxlan Fix compile warning [v3]
From: David Miller @ 2013-09-19 13:09 UTC (permalink / raw)
  To: prarit; +Cc: netdev, jpirko, stephen, bhutchings
In-Reply-To: <1379595894-23200-1-git-send-email-prarit@redhat.com>


You must resend all of the patches in the series when you make
updates, not just the patches you have changed.

^ permalink raw reply

* Re: [PATCH 1/2] net, vxlan Fix compile warning [v3]
From: Prarit Bhargava @ 2013-09-19 13:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, jpirko, stephen, bhutchings
In-Reply-To: <20130919.090924.197034249810458131.davem@davemloft.net>



On 09/19/2013 09:09 AM, David Miller wrote:
> 
> You must resend all of the patches in the series when you make
> updates, not just the patches you have changed.

Ah, okay :)  I've been dealing with other mailing lists and they prefer single
patch updates like this.  My apologies ... I'll send out a new update in a week
or so when Jack Morgenstein, jackm@dev.mellanox.co.il, returns.

Again, my apologies for not adhering to this list's rules and procedures.

P.

^ permalink raw reply

* [stable] [PATCH] sfc: Fix efx_rx_buf_offset() for recycled pages
From: Ben Hutchings @ 2013-09-19 14:54 UTC (permalink / raw)
  To: David Miller; +Cc: stable, netdev

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

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

I'm attaching the patches for 3.0.y, 3.2.y and 3.4.y (the last of which
should also be applicable to the later unofficial stable branches).

Ben.

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

[-- Attachment #2: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.0.patch --]
[-- Type: text/x-patch, Size: 1833 bytes --]

>From d4e70d42eff6938c12d7d0b12f657b10d06a156d Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index d429f0a..26e4cca 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -311,8 +311,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->is_page = true;
 	++rx_queue->added_count;
-- 
1.8.1.4


[-- Attachment #3: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.2.patch --]
[-- Type: text/x-patch, Size: 1878 bytes --]

>From 43587737635de32882d9f69df36562e0d5b0e0bd Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 9ce8665..c231b3f 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -312,8 +312,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->is_page = true;
 	++rx_queue->added_count;
-- 
1.8.1.4


[-- Attachment #4: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.4.patch --]
[-- Type: text/x-patch, Size: 1888 bytes --]

>From 55961f9a914e637f143da275da42154a49c9743a Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 7b3c068..62311ad3 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -311,8 +311,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->flags = EFX_RX_BUF_PAGE;
 	++rx_queue->added_count;
-- 
1.8.1.4


^ permalink raw reply related

* Re: [PATCH v2.39 6/7] datapath: Break out deacceleration portion of vlan_push
From: Simon Horman @ 2013-09-19 14:56 UTC (permalink / raw)
  To: Jesse Gross
  Cc: dev@openvswitch.org, netdev, Ravi K, Isaku Yamahata,
	Pravin B Shelar, Joe Stringer
In-Reply-To: <CAEP_g=_ZQ6hNpxoHm6t3N=PxA+3WTrvNegL514j0R3GDM5C92A@mail.gmail.com>

On Fri, Sep 13, 2013 at 03:07:12PM -0700, Jesse Gross wrote:
> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
> > diff --git a/datapath/actions.c b/datapath/actions.c
> > index 30ea1d2..6741d81 100644
> > --- a/datapath/actions.c
> > +++ b/datapath/actions.c
> > @@ -105,22 +105,29 @@ static int pop_vlan(struct sk_buff *skb)
> >         return 0;
> >  }
> >
> > -static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vlan)
> > +/* push down current VLAN tag */
> > +static struct sk_buff *put_vlan(struct sk_buff *skb)
> 
> This never changes the skb, right? Can we simplify things and just
> return an error code?

Yes. I'm not sure what I was thinking when I chose not to do that
but I will change things around as you suggest.

^ permalink raw reply

* Re: [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Simon Horman @ 2013-09-19 15:57 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Ben Pfaff, Pravin Shelar, dev@openvswitch.org, netdev, Ravi K,
	Isaku Yamahata, Joe Stringer
In-Reply-To: <CAEP_g=8FBQPZ=C6G39YdHRzG57m5MqfXSZFAX2S_KLHRwfzc2w@mail.gmail.com>

On Mon, Sep 16, 2013 at 03:38:21PM -0500, Jesse Gross wrote:
> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
> > diff --git a/datapath/actions.c b/datapath/actions.c
> > index 6741d81..2335014 100644
> > --- a/datapath/actions.c
> > +++ b/datapath/actions.c
> > +/* Push MPLS after the ethernet header. */
> > +static int push_mpls(struct sk_buff *skb,
> > +                    const struct ovs_action_push_mpls *mpls)
> [...]
> > +       /* update mac_len for subsequent pop_mpls actions. */
> > +       skb->mac_len += VLAN_HLEN;
> 
> Is this supposed to be part of put_vlan()?

Thanks, this does seem bogus.

I will remove it as mac_len is already incremented in put_vlan().

> 
> [...]
> 
> > +       if (skb->ip_summed == CHECKSUM_COMPLETE)
> > +               skb->csum = csum_add(skb->csum, csum_partial(new_mpls_lse,
> > +                                                            MPLS_HLEN, 0));
> > +
> > +       hdr = (struct ethhdr *)(skb_mac_header(skb));
> 
> I think you could simplify this by using eth_hdr().

Thanks, I have updated the code as follows:

	hdr = eth_hdr(skb);

> > @@ -616,6 +736,13 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb)
> >                 goto out_loop;
> >         }
> >
> > +       /* Needed to initialise inner protocol on kernels older
> > +        * than v3.11 where skb->inner_protocol is not present
> > +        * and compatibility code uses the OVS_CB(skb) to store
> > +        * the inner protocol.
> > +        */
> > +       ovs_skb_set_inner_protocol(skb, skb->protocol);
> 
> The comment makes it sound like this code should just be deleted when
> upstreaming. However, I believe that we still need to initialize this
> field, right? Is this the best place do it or should it be conditional
> on adding a first MPLS header? (i.e. what happens if inner_protocol is
> already set and the packet simply passes through OVS?)

I believe there are several problems here.

The first one, which my comment was written around is that I think that if
inner_protocol is a field of struct sk_buff then we can rely on it already
being initialised.  However, if we are using compatibility code, where
inner_protcol is called in the callback field of struct sk_buff then I
think that OVS needs to initialise it.

Perhaps a good solution to that problem is to add
an ovs_skb_reset_inner_protocol() call which sets
the inner_protocol unconditionally if it is not a field of struct sk_buff.

I believe this could be called from ovs_execute_actions().


A second problem is one that you raise which I had not considered
which is how to handle things if inner_protocol is already set.

I believe this should only occur in the case where inner_protocol
is a field of struct sk_buff and I think it would be most convenient
to set it conditionally in ovs_skb_reset_inner_protocol().
I think that if it is not set it should be zero but it should be
safe to check for values less than ETH_P_802_3_MIN.

In short, I am thinking of something like this:

#ifdef HAVE_INNER_PROTOCOL
static inline void ovs_skb_reset_inner_protocol(struct sk_buff *skb)
{
	OVS_CB(skb)->inner_protocol = skb->protocol;
}
#else
static inline void ovs_skb_reset_inner_protocol(struct sk_buff *skb)
{
	if (skb->inner_protocol < ETH_P_802_3_MIN)
		skb->inner_protocol = skb->protocol;
}
#endif



Pravin has also raised a separate discussion on wheather
OVS_GSO_CB should be used in place of OVS_CB. I would like
to continue that discussion in the sub-thread where is started.
Though obviously the outcome of that discussion may affect the
exact implementation of a solution to the problem discussed above.

> > diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
> > index 215a47e..69f24d1 100644
> > --- a/datapath/vport-netdev.c
> > +++ b/datapath/vport-netdev.c
> > @@ -287,8 +291,17 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb)
> > +       inner_protocol = ovs_skb_get_inner_protocol(skb);
> > +       if (eth_p_mpls(skb->protocol) && !eth_p_mpls(inner_protocol))
> > +               mpls = true;
> > +
> > +       if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev))
> > +               vlan = true;
> 
> A couple of thoughts on this:
>  - I'm not sure that the check on inner_protocol is right since I
> don't think it will be set to an MPLS EtherType in any real situation.
> I think you can just drop it.

Sure, that sounds reasonable.

>  - Can we simplify the loop by just inserting the vlan tag (if
> necessary), calling skb_gso_segment(), and sending the packet? I think
> it should be possible now that our skb_gso_segment() backport is more
> robust and it would make things easier to read.

Pravin also raised that idea and yes I think it should be possible.
I have posted a prototype in the sub-thread where Pravin reviewed the code
(as I read that first).

>  - Can we have some kind of version check for MPLS, similar to what we
> do for VLAN, so that we don't call into this on kernels >= 3.11?

Sure, I'll see about making that so.

> These are all pretty targeted comments though, as was the one in the
> previous kernel patch so I am basically happy with this overall.
> 
> To move forward with this:
>  - Pravin, would you mind double checking the GSO compat code?
>  - Ben, do you want to take over for the userspace portions of the
> series on the assumption that the above comments can be fixed fairly
> easily?
> 

^ permalink raw reply

* [PATCH 5/5] net: ethernet: eth.c: removed checkpatch warnings and errors
From: avi.kp.137 @ 2013-09-19 16:06 UTC (permalink / raw)
  To: davem; +Cc: akong, stefanha, jiri, netdev, linux-kernel, Avinash Kumar

From: Avinash Kumar <avi.kp.137@gmail.com>

removed these checkpatch.pl warnings:
net/ethernet/eth.c:61: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
net/ethernet/eth.c:136: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...
net/ethernet/eth.c:181: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Avinash Kumar <avi.kp.137@gmail.com>
---
 net/ethernet/eth.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index be1f64d..9bd3c31 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -58,7 +58,7 @@
 #include <net/ipv6.h>
 #include <net/ip.h>
 #include <net/dsa.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 __setup("ether=", netdev_boot_setup);
 
@@ -133,7 +133,7 @@ int eth_rebuild_header(struct sk_buff *skb)
 		return arp_find(eth->h_dest, skb);
 #endif
 	default:
-		printk(KERN_DEBUG
+		netdev_dbg(dev,
 		       "%s: unable to resolve type %X addresses.\n",
 		       dev->name, ntohs(eth->h_proto));
 
@@ -178,7 +178,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	 *      seems to set IFF_PROMISC.
 	 */
 
-	else if (1 /*dev->flags&IFF_PROMISC */ ) {
+	else if (1 /*dev->flags&IFF_PROMISC */) {
 		if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
 						      dev->dev_addr)))
 			skb->pkt_type = PACKET_OTHERHOST;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH net-next 1/2] net_sched: add u64 rate to psched_ratecfg_precompute()
From: Eric Dumazet @ 2013-09-19 16:10 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Add an extra u64 rate parameter to psched_ratecfg_precompute()
so that some qdisc can opt-in for 64bit rates in the future,
to overcome the ~34 Gbits limit.

psched_ratecfg_getrate() reports a legacy structure to
tc utility, so if actual rate is above the 32bit rate field,
cap it to the 34Gbit limit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/sch_generic.h |   11 +++++++++--
 net/sched/act_police.c    |    4 ++--
 net/sched/sch_generic.c   |    5 +++--
 net/sched/sch_htb.c       |    4 ++--
 net/sched/sch_tbf.c       |    4 ++--
 5 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f4eb365..d0a6321 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -702,13 +702,20 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
 }
 
 void psched_ratecfg_precompute(struct psched_ratecfg *r,
-			       const struct tc_ratespec *conf);
+			       const struct tc_ratespec *conf,
+			       u64 rate64);
 
 static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
 					  const struct psched_ratecfg *r)
 {
 	memset(res, 0, sizeof(*res));
-	res->rate = r->rate_bytes_ps;
+
+	/* legacy struct tc_ratespec has a 32bit @rate field
+	 * Qdisc using 64bit rate should add new attributes
+	 * in order to maintain compatibility.
+	 */
+	res->rate = min_t(u64, r->rate_bytes_ps, ~0U);
+
 	res->overhead = r->overhead;
 	res->linklayer = (r->linklayer & TC_LINKLAYER_MASK);
 }
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 189e3c5..272d8e9 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -231,14 +231,14 @@ override:
 	}
 	if (R_tab) {
 		police->rate_present = true;
-		psched_ratecfg_precompute(&police->rate, &R_tab->rate);
+		psched_ratecfg_precompute(&police->rate, &R_tab->rate, 0);
 		qdisc_put_rtab(R_tab);
 	} else {
 		police->rate_present = false;
 	}
 	if (P_tab) {
 		police->peak_present = true;
-		psched_ratecfg_precompute(&police->peak, &P_tab->rate);
+		psched_ratecfg_precompute(&police->peak, &P_tab->rate, 0);
 		qdisc_put_rtab(P_tab);
 	} else {
 		police->peak_present = false;
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index a74e278..e7121d2 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -910,11 +910,12 @@ void dev_shutdown(struct net_device *dev)
 }
 
 void psched_ratecfg_precompute(struct psched_ratecfg *r,
-			       const struct tc_ratespec *conf)
+			       const struct tc_ratespec *conf,
+			       u64 rate64)
 {
 	memset(r, 0, sizeof(*r));
 	r->overhead = conf->overhead;
-	r->rate_bytes_ps = conf->rate;
+	r->rate_bytes_ps = max_t(u64, conf->rate, rate64);
 	r->linklayer = (conf->linklayer & TC_LINKLAYER_MASK);
 	r->mult = 1;
 	/*
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 863846c..6b126f6 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1491,8 +1491,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
 			cl->prio = TC_HTB_NUMPRIO - 1;
 	}
 
-	psched_ratecfg_precompute(&cl->rate, &hopt->rate);
-	psched_ratecfg_precompute(&cl->ceil, &hopt->ceil);
+	psched_ratecfg_precompute(&cl->rate, &hopt->rate, 0);
+	psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, 0);
 
 	cl->buffer = PSCHED_TICKS2NS(hopt->buffer);
 	cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer);
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 1aaf1b6..b057122 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -341,9 +341,9 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt)
 	q->tokens = q->buffer;
 	q->ptokens = q->mtu;
 
-	psched_ratecfg_precompute(&q->rate, &rtab->rate);
+	psched_ratecfg_precompute(&q->rate, &rtab->rate, 0);
 	if (ptab) {
-		psched_ratecfg_precompute(&q->peak, &ptab->rate);
+		psched_ratecfg_precompute(&q->peak, &ptab->rate, 0);
 		q->peak_present = true;
 	} else {
 		q->peak_present = false;

^ permalink raw reply related

* [PATCH net-next 2/2] net_sched: htb: support of 64bit rates
From: Eric Dumazet @ 2013-09-19 16:10 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

HTB already can deal with 64bit rates, we only have to add two new
attributes so that tc can use them to break the current 32bit ABI
barrier.

TCA_HTB_RATE64 : class rate  (in bytes per second)
TCA_HTB_CEIL64 : class ceil  (in bytes per second)

This allows us to setup HTB on 40Gbps links, as 32bit limit is
actually ~34Gbps

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/uapi/linux/pkt_sched.h |    2 ++
 net/sched/sch_htb.c            |   17 +++++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 9b82913..f2624b5 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -357,6 +357,8 @@ enum {
 	TCA_HTB_CTAB,
 	TCA_HTB_RTAB,
 	TCA_HTB_DIRECT_QLEN,
+	TCA_HTB_RATE64,
+	TCA_HTB_CEIL64,
 	__TCA_HTB_MAX,
 };
 
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 6b126f6..0e1e38b 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -997,6 +997,8 @@ static const struct nla_policy htb_policy[TCA_HTB_MAX + 1] = {
 	[TCA_HTB_CTAB]	= { .type = NLA_BINARY, .len = TC_RTAB_SIZE },
 	[TCA_HTB_RTAB]	= { .type = NLA_BINARY, .len = TC_RTAB_SIZE },
 	[TCA_HTB_DIRECT_QLEN] = { .type = NLA_U32 },
+	[TCA_HTB_RATE64] = { .type = NLA_U64 },
+	[TCA_HTB_CEIL64] = { .type = NLA_U64 },
 };
 
 static void htb_work_func(struct work_struct *work)
@@ -1114,6 +1116,12 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
 	opt.level = cl->level;
 	if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))
 		goto nla_put_failure;
+	if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) &&
+	    nla_put_u64(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps))
+		goto nla_put_failure;
+	if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) &&
+	    nla_put_u64(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps))
+		goto nla_put_failure;
 
 	nla_nest_end(skb, nest);
 	spin_unlock_bh(root_lock);
@@ -1332,6 +1340,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
 	struct qdisc_rate_table *rtab = NULL, *ctab = NULL;
 	struct nlattr *tb[TCA_HTB_MAX + 1];
 	struct tc_htb_opt *hopt;
+	u64 rate64, ceil64;
 
 	/* extract all subattrs from opt attr */
 	if (!opt)
@@ -1491,8 +1500,12 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
 			cl->prio = TC_HTB_NUMPRIO - 1;
 	}
 
-	psched_ratecfg_precompute(&cl->rate, &hopt->rate, 0);
-	psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, 0);
+	rate64 = tb[TCA_HTB_RATE64] ? nla_get_u64(tb[TCA_HTB_RATE64]) : 0;
+
+	ceil64 = tb[TCA_HTB_CEIL64] ? nla_get_u64(tb[TCA_HTB_CEIL64]) : 0;
+
+	psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64);
+	psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64);
 
 	cl->buffer = PSCHED_TICKS2NS(hopt->buffer);
 	cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer);

^ permalink raw reply related

* [stable] [PATCH] sfc: Fix efx_rx_buf_offset() for recycled pages
From: Ben Hutchings @ 2013-09-19 16:13 UTC (permalink / raw)
  To: David Miller; +Cc: stable, netdev

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

[Re-sending with cc to the current stable address.  I still had the old
address in contacts, though I've definitely sent to the current address
previously...]

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

I'm attaching the patches for 3.0.y, 3.2.y and 3.4.y (the last of which
should also be applicable to the later unofficial stable branches).

Ben.

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


[-- Attachment #2: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.0.patch --]
[-- Type: text/x-patch, Size: 1833 bytes --]

>From d4e70d42eff6938c12d7d0b12f657b10d06a156d Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index d429f0a..26e4cca 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -311,8 +311,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->is_page = true;
 	++rx_queue->added_count;
-- 
1.8.1.4


[-- Attachment #3: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.2.patch --]
[-- Type: text/x-patch, Size: 1878 bytes --]

>From 43587737635de32882d9f69df36562e0d5b0e0bd Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 9ce8665..c231b3f 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -312,8 +312,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->is_page = true;
 	++rx_queue->added_count;
-- 
1.8.1.4


[-- Attachment #4: sfc-Fix-efx_rx_buf_offset-for-recycled-pages-3.4.patch --]
[-- Type: text/x-patch, Size: 1888 bytes --]

>From 55961f9a914e637f143da275da42154a49c9743a Mon Sep 17 00:00:00 2001
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Sep 2013 22:39:20 +0100
Subject: sfc: Fix efx_rx_buf_offset() for recycled pages

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 7b3c068..62311ad3 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -311,8 +311,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->flags = EFX_RX_BUF_PAGE;
 	++rx_queue->added_count;
-- 
1.8.1.4


^ permalink raw reply related

* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
From: Claudiu Manoil @ 2013-09-19 16:30 UTC (permalink / raw)
  To: Aida Mynzhasova; +Cc: richardcochran, netdev
In-Reply-To: <5239D74F.5030801@skitlab.ru>



On 9/18/2013 7:39 PM, Aida Mynzhasova wrote:
> On 18.09.2013 19:44, Claudiu Manoil wrote:
>>
>> On 9/18/2013 4:21 PM, Aida Mynzhasova wrote:
>>> IEEE 1588 timer reference clock source is determined through hard-coded
>>> value in gianfar_ptp driver by default. This patch allows to select ptp
>>> clock source by means of device tree file node.
>>>
>>> For instance:
>>>
>>>     fsl,cksel = <0>;
>>>
>>
>> Has this device tree binding been defined? (Where?)
>> I don't see this property in the net-next.git tree at least.
>>
>> Claudiu
>>
>>
>
> Hi Claudiu,
>
> actually, I don't know where I should define this binding, my only idea
> is to add "cksel" property description in
> /Documentation/devicetree/bindings/net/fsl-tsec-phy.txt. Am I right or I
> need to do some additional changes?
>
> Thanks.
>
>


If you ask me, updates for the device trees of several powerpc boards, 
like the 83xx series (as this patch implies), should be discussed and 
agreed upon on the powerpc list (linuxppc-dev@lists.ozlabs.org),
where these kind of changes are usually being discussed with people more
knowledgeable in device tree bindings and the powerpc/83xx hardware.

Regards,
Claudiu

^ permalink raw reply

* [PATCH] skge: fix broken driver
From: Mikulas Patocka @ 2013-09-19 16:33 UTC (permalink / raw)
  To: David S. Miller, Stephen Hemminger, netdev

The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver.

Note this part of the patch:
+               if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
+                       dev_kfree_skb(nskb);
+                       goto resubmit;
+               }
+
                pci_unmap_single(skge->hw->pdev,
                                 dma_unmap_addr(e, mapaddr),
                                 dma_unmap_len(e, maplen),
                                 PCI_DMA_FROMDEVICE);
                skb = e->skb;
                prefetch(skb->data);
-               skge_rx_setup(skge, e, nskb, skge->rx_buf_size);

The function skge_rx_setup modifies e->skb to point to the new skb. Thus,
after this change, the new buffer, not the old, is returned to the
networking stack.

This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org # 3.11

---
 drivers/net/ethernet/marvell/skge.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c
===================================================================
--- linux-3.11.1-fast.orig/drivers/net/ethernet/marvell/skge.c	2013-09-10 19:46:58.000000000 +0200
+++ linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c	2013-09-19 18:20:43.000000000 +0200
@@ -3092,6 +3092,9 @@ static struct sk_buff *skge_rx_get(struc
 		if (!nskb)
 			goto resubmit;
 
+		skb = e->skb;
+		prefetch(skb->data);
+
 		if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
 			dev_kfree_skb(nskb);
 			goto resubmit;
@@ -3101,8 +3104,6 @@ static struct sk_buff *skge_rx_get(struc
 				 dma_unmap_addr(e, mapaddr),
 				 dma_unmap_len(e, maplen),
 				 PCI_DMA_FROMDEVICE);
-		skb = e->skb;
-		prefetch(skb->data);
 	}
 
 	skb_put(skb, len);

^ permalink raw reply

* Re: add ip to interface as primary ip address, not secondary ip when there is alreadly primary ip?
From: Vincent Li @ 2013-09-19 16:54 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev@vger.kernel.org
In-Reply-To: <l1as5j$7cs$1@ger.gmane.org>

thanks for the pointer

'ip addr' indeed has flag IFA_F_SECONDARY for this, but it is not
available for 'ip addr add', so I made a simple patch for iproute2
ip/ipaddress.c as below:

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 1c3e4da..b5aa96a 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1307,6 +1307,11 @@ static int ipaddr_modify(int cmd, int flags,
int argc, char **argv)
                                invarg("invalid scope value.", *argv);
                        req.ifa.ifa_scope = scope;
                        scoped = 1;
+                } else if (strcmp(*argv, "secondary") == 0 ||
+                           strcmp(*argv, "temporary") == 0) {
+                        req.ifa.ifa_flags |= IFA_F_SECONDARY;
+                } else if (strcmp(*argv, "primary") == 0) {
+                        req.ifa.ifa_flags &= ~IFA_F_SECONDARY;
                } else if (strcmp(*argv, "dev") == 0) {
                        NEXT_ARG();
                        d = *argv;

I also found that I need to patch up the kernel and here is the kernel
patch, it might look silly, but it works as I tested

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a1b5bcb..2a1d61b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -440,14 +440,18 @@ static int __inet_insert_ifa(struct in_ifaddr
*ifa, struct nlmsghdr *nlh,
                return 0;
        }

-       ifa->ifa_flags &= ~IFA_F_SECONDARY;
        last_primary = &in_dev->ifa_list;

        for (ifap = &in_dev->ifa_list; (ifa1 = *ifap) != NULL;
             ifap = &ifa1->ifa_next) {
                if (!(ifa1->ifa_flags & IFA_F_SECONDARY) &&
-                   ifa->ifa_scope <= ifa1->ifa_scope)
-                       last_primary = &ifa1->ifa_next;
+                   ifa->ifa_scope <= ifa1->ifa_scope) {
+                        if (ifa->ifa_flags & IFA_F_SECONDARY) {
+                                last_primary = &ifa1->ifa_next;
+                        } else {
+                                ifa1->ifa_flags |= IFA_F_SECONDARY;
+                        }
+                }
                if (ifa1->ifa_mask == ifa->ifa_mask &&
                    inet_ifa_match(ifa1->ifa_address, ifa)) {
                        if (ifa1->ifa_local == ifa->ifa_local) {
@@ -458,7 +462,11 @@ static int __inet_insert_ifa(struct in_ifaddr
*ifa, struct nlmsghdr *nlh,
                                inet_free_ifa(ifa);
                                return -EINVAL;
                        }
-                       ifa->ifa_flags |= IFA_F_SECONDARY;
+                        if (ifa->ifa_flags & IFA_F_SECONDARY) {
+                                ifa->ifa_flags |= IFA_F_SECONDARY;
+                        } else {
+                                ifa->ifa_flags &= ~IFA_F_SECONDARY;
+                        }
                }
        }

my test steps:

1
 ./ip/ip addr add 192.168.1.1/24 scope global secondary dev eth0
./ip/ip adrr show eth0 >> /tmp/ipaddr.txt

2
./ip/ip addr add 192.168.1.2/24 scope global primary dev eth0
./ip/ip addr show eth0 >> /tmp/ipaddr.txt

3
./ip/ip addr add 192.168.1.3/24 scope global primary dev eth0
./ip/ip addr show eth0 >> /tmp/ipaddr.txt

4
./ip/ip addr add 192.168.1.4/24 scope global secondary dev eth0
./ip/ip addr show eth0 >> /tmp/ipaddr.txt

5
./ip/ip addr add 192.168.1.5/24 scope global  dev eth0
./ip/ip addr show eth0 >> /tmp/ipaddr.txt

6
./ip/ip addr del 192.168.1.5/24  dev eth0
./ip/ip addr show eth0 >> /tmp/ipaddr.txt

test result for each step

result 1

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

result 2

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.1/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

result 3

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.2/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.1/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

result 4

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.2/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.1/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.4/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

result 5

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.3/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.2/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.1/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.1.4/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

result 6

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 52:54:00:e3:8f:33 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5054:ff:fee3:8f33/64 scope link
       valid_lft forever preferred_lft forever

it does seems to achieve what I wanted, any comment on this?



On Tue, Sep 17, 2013 at 5:29 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Tue, 17 Sep 2013 at 22:31 GMT, Vincent Li <vincent.mc.li@gmail.com> wrote:
>>
>> ideally though, we would like to have the capability in
>> kernel/userspace  to specify a flag or something to add any ip as
>> primary even if there is already existing primary ip address (could
>> downgrade the existing primary to secondary ip). does this make sense
>> ?
>
> 'ip addr' already has flags for this.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
From: Richard Cochran @ 2013-09-19 17:12 UTC (permalink / raw)
  To: Claudiu Manoil; +Cc: Aida Mynzhasova, netdev
In-Reply-To: <523B268A.2010805@freescale.com>

On Thu, Sep 19, 2013 at 07:30:02PM +0300, Claudiu Manoil wrote:
> 
> If you ask me, updates for the device trees of several powerpc
> boards, like the 83xx series (as this patch implies), should be
> discussed and agreed upon on the powerpc list (linuxppc-dev@lists.ozlabs.org),
> where these kind of changes are usually being discussed with people more
> knowledgeable in device tree bindings and the powerpc/83xx hardware.

Yes, and also CC the devicetree list. The original device tree
attributes for the gianfar eTSEC timer functions were reviewed on
all three lists.

Thanks,
Richard

^ permalink raw reply

* Re: [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Jesse Gross @ 2013-09-19 17:21 UTC (permalink / raw)
  To: Simon Horman
  Cc: Ben Pfaff, Pravin Shelar, dev@openvswitch.org, netdev, Ravi K,
	Isaku Yamahata, Joe Stringer
In-Reply-To: <20130919155732.GC24919@verge.net.au>

On Thu, Sep 19, 2013 at 10:57 AM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Sep 16, 2013 at 03:38:21PM -0500, Jesse Gross wrote:
>> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
>> > @@ -616,6 +736,13 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb)
>> >                 goto out_loop;
>> >         }
>> >
>> > +       /* Needed to initialise inner protocol on kernels older
>> > +        * than v3.11 where skb->inner_protocol is not present
>> > +        * and compatibility code uses the OVS_CB(skb) to store
>> > +        * the inner protocol.
>> > +        */
>> > +       ovs_skb_set_inner_protocol(skb, skb->protocol);
>>
>> The comment makes it sound like this code should just be deleted when
>> upstreaming. However, I believe that we still need to initialize this
>> field, right? Is this the best place do it or should it be conditional
>> on adding a first MPLS header? (i.e. what happens if inner_protocol is
>> already set and the packet simply passes through OVS?)
>
> I believe there are several problems here.
>
> The first one, which my comment was written around is that I think that if
> inner_protocol is a field of struct sk_buff then we can rely on it already
> being initialised.  However, if we are using compatibility code, where
> inner_protcol is called in the callback field of struct sk_buff then I
> think that OVS needs to initialise it.

I'm not sure that it's true that inner_protocol is already initialized
- I grepped the tree and the only assignment that I found is in
skbuff.c in __copy_skb_header().

> A second problem is one that you raise which I had not considered
> which is how to handle things if inner_protocol is already set.
>
> I believe this should only occur in the case where inner_protocol
> is a field of struct sk_buff and I think it would be most convenient
> to set it conditionally in ovs_skb_reset_inner_protocol().
> I think that if it is not set it should be zero but it should be
> safe to check for values less than ETH_P_802_3_MIN.

It's probably OK to check for values less than ETH_P_802_3_MIN but I'm
not sure that it's the most correct thing to do since skb->protocol
could contain these values (such as ETH_P_802_2). It's unlikely that
they will be GSO packets but it seems better to use the more strict
check against zero.

One other consideration in the OVS case - with recirculation we may
hit this code multiple times and the difference in behavior could be
surprising. However, on the other hand, we need to be careful because
skb->cb is not guaranteed to be initialized to zero.

^ permalink raw reply

* Re: [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Jesse Gross @ 2013-09-19 17:31 UTC (permalink / raw)
  To: Simon Horman
  Cc: Pravin Shelar, dev@openvswitch.org, netdev, Ravi K,
	Isaku Yamahata, Joe Stringer
In-Reply-To: <20130918220756.GA24919@verge.net.au>

On Wed, Sep 18, 2013 at 5:07 PM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Sep 17, 2013 at 11:38:18AM -0700, Pravin Shelar wrote:
>> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
>> > diff --git a/datapath/datapath.h b/datapath/datapath.h
>> > index 5d50dd4..babae3b 100644
>> > --- a/datapath/datapath.h
>> > +++ b/datapath/datapath.h
>> > @@ -36,6 +36,10 @@
>> >
>> >  #define SAMPLE_ACTION_DEPTH 3
>> >
>> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
>> > +#define HAVE_INNER_PROTOCOL
>> > +#endif
>> > +
>> >  /**
>> >   * struct dp_stats_percpu - per-cpu packet processing statistics for a given
>> >   * datapath.
>> > @@ -93,11 +97,16 @@ struct datapath {
>> >   * @pkt_key: The flow information extracted from the packet.  Must be nonnull.
>> >   * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the
>> >   * packet is not being tunneled.
>> > + * @inner_protocol: Provides a substitute for the skb->inner_protocol field on
>> > + * kernels before 3.11.
>> >   */
>> >  struct ovs_skb_cb {
>> >         struct sw_flow          *flow;
>> >         struct sw_flow_key      *pkt_key;
>> >         struct ovs_key_ipv4_tunnel  *tun_key;
>> > +#ifndef HAVE_INNER_PROTOCOL
>> > +       __be16                  inner_protocol;
>> > +#endif
>> >  };
>> >  #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
>> >
>> Can you move this to compat struct ovs_gso_cb {}
>
> I think that you are correct and inner_protocol needs
> to be in struct ovs_gso_cb so that it can
> be accessed via skb_network_protocol() from
> rpl___skb_gso_segment().
>
> However I think it may also need to be present in struct ovs_cb
> so that it can be set correctly.
>
> Currently it is set unconditionally
> in ovs_execute_actions() and Jesse has suggested setting
> it conditionally in pop_mpls() (which is called by do_execute_actions()).
> But regardless it seems to me that the field would need to be available
> in struct ovs_cb.

Since the helper functions are also in the compat code, I think they
should have access to ovs_gso_cb.

>> I think we can simplify code by pushing vlan and then segmenting skb,
>> the way we do it for MPLS.
>
> Are you thinking of something like the following which applies
> prior to the MPLS code.

This is basically what I was thinking about. We might actually be able
to move all of this to compat code by having a replacement for
dev_queue_xmit() similar to what we have for ip_local_out() in the
tunnel code.

^ permalink raw reply

* [PATCH] phy/micrel: Add suspend/resume support to Micrel PHYs
From: Nicolas Ferre @ 2013-09-19 17:39 UTC (permalink / raw)
  To: davem, netdev
  Cc: f.fainelli, linux-kernel, linux-arm-kernel, Patrice Vilchez,
	Nicolas Ferre, David J. Choi

From: Patrice Vilchez <patrice.vilchez@atmel.com>

All supported Micrel PHYs implement the standard "power down" bit 11 of BMCR,
so this patch adds support using the generic genphy_{suspend,resume} functions.

Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
[b.brezillon@overkiz.com: adapt to newer kernel and generalize to other phys]
Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
[nicolas.ferre@atmel.com: commit message modification]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: David J. Choi <david.choi@micrel.com>
---
 drivers/net/phy/micrel.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c31aad0..3ae28f4 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -287,6 +287,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ks8737_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8021,
@@ -300,6 +302,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8031,
@@ -313,6 +317,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8041,
@@ -326,6 +332,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8051,
@@ -339,6 +347,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8001,
@@ -351,6 +361,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8081,
@@ -363,6 +375,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8061,
@@ -375,6 +389,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ9021,
@@ -387,6 +403,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ksz9021_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ9031,
@@ -400,6 +418,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ksz9021_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ8873MLL,
@@ -410,6 +430,8 @@ static struct phy_driver ksphy_driver[] = {
 	.config_init	= kszphy_config_init,
 	.config_aneg	= ksz8873mll_config_aneg,
 	.read_status	= ksz8873mll_read_status,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ886X,
@@ -420,6 +442,8 @@ static struct phy_driver ksphy_driver[] = {
 	.config_init	= kszphy_config_init,
 	.config_aneg	= genphy_config_aneg,
 	.read_status	= genphy_read_status,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 } };
 
-- 
1.8.2.2

^ permalink raw reply related

* [PATCH] phy/micrel: Add suspend/resume support to Micrel PHYs
From: Nicolas Ferre @ 2013-09-19 17:40 UTC (permalink / raw)
  To: davem, netdev
  Cc: b.brezillon, f.fainelli, linux-kernel, linux-arm-kernel,
	Patrice Vilchez, Nicolas Ferre, David J. Choi

From: Patrice Vilchez <patrice.vilchez@atmel.com>

All supported Micrel PHYs implement the standard "power down" bit 11 of BMCR,
so this patch adds support using the generic genphy_{suspend,resume} functions.

Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
[b.brezillon@overkiz.com: adapt to newer kernel and generalize to other phys]
Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
[nicolas.ferre@atmel.com: commit message modification]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: David J. Choi <david.choi@micrel.com>
---
 drivers/net/phy/micrel.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c31aad0..3ae28f4 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -287,6 +287,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ks8737_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8021,
@@ -300,6 +302,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8031,
@@ -313,6 +317,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8041,
@@ -326,6 +332,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8051,
@@ -339,6 +347,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8001,
@@ -351,6 +361,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8081,
@@ -363,6 +375,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8061,
@@ -375,6 +389,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ9021,
@@ -387,6 +403,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ksz9021_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ9031,
@@ -400,6 +418,8 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= ksz9021_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ8873MLL,
@@ -410,6 +430,8 @@ static struct phy_driver ksphy_driver[] = {
 	.config_init	= kszphy_config_init,
 	.config_aneg	= ksz8873mll_config_aneg,
 	.read_status	= ksz8873mll_read_status,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ886X,
@@ -420,6 +442,8 @@ static struct phy_driver ksphy_driver[] = {
 	.config_init	= kszphy_config_init,
 	.config_aneg	= genphy_config_aneg,
 	.read_status	= genphy_read_status,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE, },
 } };
 
-- 
1.8.2.2

^ permalink raw reply related

* Re: [PATCH] sfc: Fix efx_rx_buf_offset() for recycled pages
From: David Miller @ 2013-09-19 17:43 UTC (permalink / raw)
  To: bhutchings; +Cc: stable, netdev
In-Reply-To: <1379607231.1514.13.camel@bwh-desktop.uk.level5networks.com>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu, 19 Sep 2013 17:13:51 +0100

> This bug fix is only for stable branches older than 3.10.  The bug was
> fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
> mapping/unmapping costs'), but that change is totally unsuitable for
> stable.
> 
> Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
> swiotlb') added an explicit page_offset member to struct
> efx_rx_buffer, which must be set consistently with the u.page and
> dma_addr fields.  However, it failed to add the necessary assignment
> in efx_resurrect_rx_buffer().  It also did not correct the calculation
> of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
> that DMA-mapping a page will result in a page-aligned DMA address
> (exactly what swiotlb violates).
> 
> Add the assignment of efx_rx_buffer::page_offset and change the
> calculation of dma_addr to make use of it.

No objections.

^ permalink raw reply

* Re: [PATCH] skge: fix broken driver
From: David Miller @ 2013-09-19 17:56 UTC (permalink / raw)
  To: mpatocka; +Cc: stephen, netdev
In-Reply-To: <alpine.LRH.2.02.1309191229480.32035@file01.intranet.prod.int.rdu2.redhat.com>

From: Mikulas Patocka <mpatocka@redhat.com>
Date: Thu, 19 Sep 2013 12:33:30 -0400 (EDT)

> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Cc: stable@kernel.org # 3.11

First, this is missing the reported-by and tested-by tags provided
by people who tested this patch.

Secondly, CC:'ing stable is not the correct way to submit networking
patches for -stable inclusion.  You simply ask me to queue them up
for -stable explicitly instead.

Please re-submit this with the currect signoffs, thank you.

^ permalink raw reply

* Re: [PATCH v2] ip6tnl: do route updating for redirect in ip6_tnl_err()
From: David Miller @ 2013-09-19 18:02 UTC (permalink / raw)
  To: djduanjiong; +Cc: netdev, duanj.fnst
In-Reply-To: <1379474877-3097-1-git-send-email-duanj.fnst@cn.fujitsu.com>

From: Duan Jiong <djduanjiong@gmail.com>
Date: Tue, 17 Sep 2013 20:27:57 -0700

> After the ip6_tnl_err() is called, the rel_msg is assigned to
> 0, and the ip4ip6_err() will return directly, the instruction
> below will not be executed.
> 
> In rfc2473, we can know that the tunnel ICMP redirect message
> should not be reported to the source of the original packet,
> so we can handle it in ip6_tnl_err().
> 
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>

I do not think this change is correct.

> @@ -576,9 +579,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>  		rel_type = ICMP_DEST_UNREACH;
>  		rel_code = ICMP_FRAG_NEEDED;
>  		break;
> -	case NDISC_REDIRECT:
> -		rel_type = ICMP_REDIRECT;
> -		rel_code = ICMP_REDIR_HOST;
>  	default:
>  		return 0;
>  	}

The bug is a missing "break;" statement for this case, and:

> @@ -637,8 +637,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>  
>  		skb_dst(skb2)->ops->update_pmtu(skb_dst(skb2), NULL, skb2, rel_info);
>  	}
> -	if (rel_type == ICMP_REDIRECT)
> -		skb_dst(skb2)->ops->redirect(skb_dst(skb2), NULL, skb2);
>  

We absolutely must run the ipv4 dst_ops redirect handler here so you must
keep this code around as well.

The only change you need to make is to add the missing break;
statement to ip4ip6_err() and then also add appropriate NDISC_REDIRECT
handling to ip6ip6_err().

^ permalink raw reply

* Re: [PATCH ] ipv6: handle the update of the NDISC_REDIRECT error code in icmpv6_err_convert
From: David Miller @ 2013-09-19 18:02 UTC (permalink / raw)
  To: djduanjiong; +Cc: duanj.fnst, netdev
In-Reply-To: <523A8A74.30005@gmail.com>

From: Duan Jiong <djduanjiong@gmail.com>
Date: Thu, 19 Sep 2013 13:24:04 +0800

> 于 2013/9/19 0:36, David Miller 写道:
>> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>> Date: Wed, 18 Sep 2013 20:04:48 +0800
>>
>>> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>>>
>>> when dealing with redirect message in udpv6_err() and
>>> rawv6_err() the err shoud be assigned to 0, not EPROTO.
>>>
>>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>> No, you should fix this the same way you handled DCCP, but skipping
>> the whole socket error setting path for NDISC_REDIRECT.
> 
> Your meaning is that we should return directly after calling
> ip6_sk_redirect(), is that it?

It depends upon whether udp/raw sockets are expected to receive redirect
notifications this way, are they?  You seem to believe so.

^ permalink raw reply

* Re: [PATCH] skge: fix broken driver
From: Mikulas Patocka @ 2013-09-19 18:04 UTC (permalink / raw)
  To: David Miller; +Cc: stephen, netdev
In-Reply-To: <20130919.135628.1201613770803318193.davem@davemloft.net>



On Thu, 19 Sep 2013, David Miller wrote:

> From: Mikulas Patocka <mpatocka@redhat.com>
> Date: Thu, 19 Sep 2013 12:33:30 -0400 (EDT)
> 
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Cc: stable@kernel.org # 3.11
> 
> First, this is missing the reported-by and tested-by tags provided
> by people who tested this patch.

I noticed the problem and tested the patch on my own machine. So I added 
myself to these tags.

> Secondly, CC:'ing stable is not the correct way to submit networking
> patches for -stable inclusion.  You simply ask me to queue them up
> for -stable explicitly instead.
> 
> Please re-submit this with the currect signoffs, thank you.

Here I'm re-submitting it.

---

skge: fix broken driver

The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver.
Note this part of the patch:
+               if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
+                       dev_kfree_skb(nskb);
+                       goto resubmit;
+               }
+
                pci_unmap_single(skge->hw->pdev,
                                 dma_unmap_addr(e, mapaddr),
                                 dma_unmap_len(e, maplen),
                                 PCI_DMA_FROMDEVICE);
                skb = e->skb;
                prefetch(skb->data);
-               skge_rx_setup(skge, e, nskb, skge->rx_buf_size);

The function skge_rx_setup modifies e->skb to point to the new skb. Thus,
after this change, the new buffer, not the old, is returned to the
networking stack.

This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1. The patch should 
be queued for 3.11-stable.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/net/ethernet/marvell/skge.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c
===================================================================
--- linux-3.11.1-fast.orig/drivers/net/ethernet/marvell/skge.c	2013-09-10 19:46:58.000000000 +0200
+++ linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c	2013-09-19 18:20:43.000000000 +0200
@@ -3092,6 +3092,9 @@ static struct sk_buff *skge_rx_get(struc
 		if (!nskb)
 			goto resubmit;
 
+		skb = e->skb;
+		prefetch(skb->data);
+
 		if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
 			dev_kfree_skb(nskb);
 			goto resubmit;
@@ -3101,8 +3104,6 @@ static struct sk_buff *skge_rx_get(struc
 				 dma_unmap_addr(e, mapaddr),
 				 dma_unmap_len(e, maplen),
 				 PCI_DMA_FROMDEVICE);
-		skb = e->skb;
-		prefetch(skb->data);
 	}
 
 	skb_put(skb, len);

^ permalink raw reply

* Re: [PATCH net-next v4] Don't destroy the netdev until the vif is shut down
From: David Miller @ 2013-09-19 18:05 UTC (permalink / raw)
  To: paul.durrant; +Cc: xen-devel, netdev, david.vrabel, wei.liu2, ian.campbell
In-Reply-To: <1379436368-6882-1-git-send-email-paul.durrant@citrix.com>

From: Paul Durrant <paul.durrant@citrix.com>
Date: Tue, 17 Sep 2013 17:46:08 +0100

> Without this patch, if a frontend cycles through states Closing
> and Closed (which Windows frontends need to do) then the netdev
> will be destroyed and requires re-invocation of hotplug scripts
> to restore state before the frontend can move to Connected. Thus
> when udev is not in use the backend gets stuck in InitWait.
> 
> With this patch, the netdev is left alone whilst the backend is
> still online and is only de-registered and freed just prior to
> destroying the vif (which is also nicely symmetrical with the
> netdev allocation and registration being done during probe) so
> no re-invocation of hotplug scripts is required.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>

I think all of the testing requests have been satisfied so I have
applied this.

But _please_ write a more proper subject line in future patch
submissions.  You have to provide a subsystem prefix in the
subject line, here I added "xen-netback: ", otherwise someone
skimming the shortlog has no idea what area of code this change
touches.

Thanks.

^ permalink raw reply

* Re: [PATCH] skge: fix broken driver
From: David Miller @ 2013-09-19 18:07 UTC (permalink / raw)
  To: mpatocka; +Cc: stephen, netdev
In-Reply-To: <alpine.LRH.2.02.1309191359300.12162@file01.intranet.prod.int.rdu2.redhat.com>

From: Mikulas Patocka <mpatocka@redhat.com>
Date: Thu, 19 Sep 2013 14:04:38 -0400 (EDT)

> Here I'm re-submitting it.

Please do not hijack an existing discussions to resubmit the patch.

Instead, make a fresh, completely new, mailing list posting for the
patch submissions.

Thank you.

^ permalink raw reply

* Re: [PATCH] phy/micrel: Add suspend/resume support to Micrel PHYs
From: David Miller @ 2013-09-19 18:08 UTC (permalink / raw)
  To: nicolas.ferre
  Cc: netdev, b.brezillon, f.fainelli, linux-kernel, linux-arm-kernel,
	patrice.vilchez, david.choi
In-Reply-To: <1379612448-20805-1-git-send-email-nicolas.ferre@atmel.com>

From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Thu, 19 Sep 2013 19:40:48 +0200

> From: Patrice Vilchez <patrice.vilchez@atmel.com>
> 
> All supported Micrel PHYs implement the standard "power down" bit 11 of BMCR,
> so this patch adds support using the generic genphy_{suspend,resume} functions.
> 
> Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
> [b.brezillon@overkiz.com: adapt to newer kernel and generalize to other phys]
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> [nicolas.ferre@atmel.com: commit message modification]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: David J. Choi <david.choi@micrel.com>

What's the difference between this patch and the one you sent 60
seconds beforehand?

^ 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