netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
@ 2017-04-16 19:02 Chonggang Li
  2017-04-17 18:28 ` Jay Vosburgh
  2017-04-17 19:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Chonggang Li @ 2017-04-16 19:02 UTC (permalink / raw)
  To: j.vosburgh, andy, vfalico, nikolay, edumazet, davem
  Cc: netdev, Chonggang Li, Mahesh Bandewar, Maciej Żenczykowski

Bonding driver changes the skb->dev to the bonding-master before
passing the packet to stack for further processing. This, however
does not make sense for the link-local packets and it looses "the
link info" once its skb->dev is changed to bonding-master.  This
patch changes this behavior for link-local packets by not changing
the skb->dev to the bonding-master and maintaining it as it is,
i.e. the link on which the packet arrived.

Signed-off-by: Chonggang Li <chonggangli@google.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
Changes in v2:
  - Make the commit message more clearer.

 drivers/net/bonding/bond_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 01e4a69af421..6bd3b50faf48 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1176,6 +1176,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
 		}
 	}
 
+	/* don't change skb->dev for link-local packets */
+	if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
+		return RX_HANDLER_PASS;
 	if (bond_should_deliver_exact_match(skb, slave, bond))
 		return RX_HANDLER_EXACT;
 
-- 
2.12.2.762.g0e3151a226-goog

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

* Re: [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
  2017-04-16 19:02 [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on Chonggang Li
@ 2017-04-17 18:28 ` Jay Vosburgh
  2017-04-17 19:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jay Vosburgh @ 2017-04-17 18:28 UTC (permalink / raw)
  To: Chonggang Li
  Cc: andy, vfalico, nikolay, edumazet, davem, netdev, Mahesh Bandewar,
	Maciej Żenczykowski

Chonggang Li <chonggangli@google.com> wrote:

>Bonding driver changes the skb->dev to the bonding-master before
>passing the packet to stack for further processing. This, however
>does not make sense for the link-local packets and it looses "the
>link info" once its skb->dev is changed to bonding-master.  This
>patch changes this behavior for link-local packets by not changing
>the skb->dev to the bonding-master and maintaining it as it is,
>i.e. the link on which the packet arrived.

	Minor nit: "looses" should be "loses".  Other than that:

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>Signed-off-by: Chonggang Li <chonggangli@google.com>
>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>Signed-off-by: Maciej Żenczykowski <maze@google.com>
>---
>Changes in v2:
>  - Make the commit message more clearer.
>
> drivers/net/bonding/bond_main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 01e4a69af421..6bd3b50faf48 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1176,6 +1176,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> 		}
> 	}
> 
>+	/* don't change skb->dev for link-local packets */
>+	if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
>+		return RX_HANDLER_PASS;
> 	if (bond_should_deliver_exact_match(skb, slave, bond))
> 		return RX_HANDLER_EXACT;
> 
>-- 
>2.12.2.762.g0e3151a226-goog
>

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

* Re: [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
  2017-04-16 19:02 [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on Chonggang Li
  2017-04-17 18:28 ` Jay Vosburgh
@ 2017-04-17 19:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-04-17 19:46 UTC (permalink / raw)
  To: chonggangli
  Cc: j.vosburgh, andy, vfalico, nikolay, edumazet, netdev, maheshb,
	maze

From: Chonggang Li <chonggangli@google.com>
Date: Sun, 16 Apr 2017 12:02:18 -0700

> Bonding driver changes the skb->dev to the bonding-master before
> passing the packet to stack for further processing. This, however
> does not make sense for the link-local packets and it looses "the
> link info" once its skb->dev is changed to bonding-master.  This
> patch changes this behavior for link-local packets by not changing
> the skb->dev to the bonding-master and maintaining it as it is,
> i.e. the link on which the packet arrived.
> 
> Signed-off-by: Chonggang Li <chonggangli@google.com>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> ---
> Changes in v2:
>   - Make the commit message more clearer.

Applied with "looses" type fixed.

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

end of thread, other threads:[~2017-04-17 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-16 19:02 [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on Chonggang Li
2017-04-17 18:28 ` Jay Vosburgh
2017-04-17 19:46 ` 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).