netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 12/19] neigh: Convert over to dst_neigh_lookup_skb().
@ 2012-07-03  9:46 David Miller
  2012-07-03 22:08 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-07-03  9:46 UTC (permalink / raw)
  To: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/core/neighbour.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index a793af9..eb3efdc 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1202,9 +1202,15 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 
 			rcu_read_lock();
 			/* On shaper/eql skb->dst->neighbour != neigh :( */
-			if (dst && (n2 = dst_get_neighbour_noref(dst)) != NULL)
-				n1 = n2;
+			n2 = NULL;
+			if (dst) {
+				n2 = dst_neigh_lookup_skb(dst, skb);
+				if (n2)
+					n1 = n2;
+			}
 			n1->output(n1, skb);
+			if (n2)
+				neigh_release(n2);
 			rcu_read_unlock();
 
 			write_lock_bh(&neigh->lock);
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 12/19] neigh: Convert over to dst_neigh_lookup_skb().
  2012-07-03  9:46 [PATCH 12/19] neigh: Convert over to dst_neigh_lookup_skb() David Miller
@ 2012-07-03 22:08 ` Ben Hutchings
  2012-07-03 23:18   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2012-07-03 22:08 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tue, 2012-07-03 at 02:46 -0700, David Miller wrote:
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  net/core/neighbour.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index a793af9..eb3efdc 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1202,9 +1202,15 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
>  
>  			rcu_read_lock();
>  			/* On shaper/eql skb->dst->neighbour != neigh :( */

It might be time to delete that comment too.

Ben.

> -			if (dst && (n2 = dst_get_neighbour_noref(dst)) != NULL)
> -				n1 = n2;
> +			n2 = NULL;
> +			if (dst) {
> +				n2 = dst_neigh_lookup_skb(dst, skb);
> +				if (n2)
> +					n1 = n2;
> +			}
>  			n1->output(n1, skb);
> +			if (n2)
> +				neigh_release(n2);
>  			rcu_read_unlock();
>  
>  			write_lock_bh(&neigh->lock);

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 12/19] neigh: Convert over to dst_neigh_lookup_skb().
  2012-07-03 22:08 ` Ben Hutchings
@ 2012-07-03 23:18   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-07-03 23:18 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Tue, 3 Jul 2012 23:08:29 +0100

> On Tue, 2012-07-03 at 02:46 -0700, David Miller wrote:
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>> ---
>>  net/core/neighbour.c |   10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>> 
>> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
>> index a793af9..eb3efdc 100644
>> --- a/net/core/neighbour.c
>> +++ b/net/core/neighbour.c
>> @@ -1202,9 +1202,15 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
>>  
>>  			rcu_read_lock();
>>  			/* On shaper/eql skb->dst->neighbour != neigh :( */
> 
> It might be time to delete that comment too.

It's still accurate, so it needs to be adjusted rather then removed.
sch_teql creates this situation as well.

What this code is effectively doing is reinjecting the packet back to
the top-most neigh, and it will filter back down to the thing that
uses a different neigh for packet output.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-03 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03  9:46 [PATCH 12/19] neigh: Convert over to dst_neigh_lookup_skb() David Miller
2012-07-03 22:08 ` Ben Hutchings
2012-07-03 23:18   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).