netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Jay Vosburgh <jay.vosburgh@canonical.com>
Cc: netdev@vger.kernel.org
Subject: Re: [Discuss] IPv4 packets lost with macvlan over bond alb
Date: Thu, 8 Jun 2023 11:43:31 +0800	[thread overview]
Message-ID: <ZIFOY02zi9FZ+aNh@Laptop-X1> (raw)
In-Reply-To: <ZHmjlzbRi0nHUuTU@Laptop-X1>

Hi Jay, any thoughts?

Thanks
Hangbin
On Fri, Jun 02, 2023 at 04:09:00PM +0800, Hangbin Liu wrote:
> Hi Jay,
> 
> It looks there is an regression for commit 14af9963ba1e ("bonding: Support
> macvlans on top of tlb/rlb mode bonds"). The author export modified ARP to
> remote when there is macvlan over bond, which make remote add neighbor
> with macvlan's IP and bond's mac. The author expect RLB will replace all
> inner packets to correct mac address if target is macvlan, but RLB only
> handle ARP packets. This make all none arp packets macvlan received have
> incorrect mac address, and dropped directly.
> 
> In short, remote client learned macvlan's ip with bond's mac. So the macvlan
> will receive packets with incorrect macs and dropped.
> 
> To fix this, one way is to revert the patch and only send learning packets for
> both tlb and alb mode for macvlan. This would make all macvlan rx packets go
> through bond's active slave.
> 
> Another way is to replace the bond's mac address to correct macvlan's address
> based on the rx_hashtbl . But this may has impact to the receive performance
> since we need to check all the upper devices and deal the mac address for
> each packets in bond_handle_frame().
> 
> So which way do you prefer?
> 
> Reproducer:
> ```
> #!/bin/bash
> 
> # Source the topo in bond selftest
> source bond_topo_3d1c.sh
> 
> trap cleanup EXIT
> 
> setup_prepare
> bond_reset "mode balance-alb"
> ip -n ${s_ns} addr flush dev bond0
> 
> ip -n ${s_ns} link add link bond0 name macv0 type macvlan mode bridge
> ip -n ${s_ns} link set macv0 up
> 
> # I just add macvlan on the server netns, you can also move it to another netns for testing
> ip -n ${s_ns} addr add ${s_ip4}/24 dev macv0
> ip -n ${s_ns} addr add ${s_ip6}/24 dev macv0
> ip netns exec ${c_ns} ping ${s_ip4} -c 4
> sleep 5
> ip netns exec ${c_ns} ping ${s_ip4} -c 4
> ```
> 
> Thanks
> Hangbin

  reply	other threads:[~2023-06-08  3:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02  8:08 [Discuss] IPv4 packets lost with macvlan over bond alb Hangbin Liu
2023-06-08  3:43 ` Hangbin Liu [this message]
2023-06-08  4:44   ` Jay Vosburgh
2023-06-17  1:45   ` Jay Vosburgh
2023-06-17  8:29     ` Hangbin Liu
2023-06-22  1:42       ` Jay Vosburgh
2023-06-25  7:37         ` Hangbin Liu
2023-07-14  9:18           ` Hangbin Liu
2023-08-05  8:25             ` Hangbin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIFOY02zi9FZ+aNh@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).