Hello steven,
I used the native memif to be the member of bonding interface, below is my 
configuration:

DBGvpp# create bond mode active-backup
DBGvpp# bond add BondEthernet1 line2    
DBGvpp# show bond details
BondEthernet0
  mode: active-backup
  load balance: l23
  number of active slaves: 0
  number of slaves: 1
    line1
  device instance: 0
  sw_if_index: 1
  hw_if_index: 1
BondEthernet1
  mode: active-backup
  load balance: l2
  number of active slaves: 1
    line2
  number of slaves: 1
    line2
  device instance: 1
  sw_if_index: 22
  hw_if_index: 20

DBGvpp# set interface l2 bridge BondEthernet1 300
DBGvpp# show bridge-domain 300 detail
  BD-ID   Index   BSN  Age(min)  Learning  U-Forwrd  UU-Flood  Flooding  
ARP-Term  BVI-Intf
   300      4      2      44        on        on        on        on       off  
     N/A   
 
           Interface           If-idx ISN  SHG  BVI  TxFlood        
VLAN-Tag-Rewrite       
         BondEthernet1           22    3    0    -      *                 none

DBGvpp# set interface l3  BondEthernet0 

when the bonding is in l3 mode, the packet trace below:
packet:
00:00:00:000000: memif-input
  memif: hw_if_index 3 next-index 7
    slot: ring 0
00:00:00:000000: bond-input
  src 00:00:5e:22:22:2c, dst ff:ff:ff:ff:ff:ff, line2 -> BondEthernet1
00:00:00:000000: ethernet-input
  ARP: 00:00:5e:22:22:2c -> ff:ff:ff:ff:ff:ff 802.1q vlan 0
00:00:00:000000: arp-input
  request, type ethernet/IP4, address size 6/4
  00:00:5e:22:22:2c/110.0.0.2 -> 00:00:00:00:00:00/110.0.0.1
00:00:00:000000: BondEthernet1-output
  BondEthernet1
  ARP: 00:00:5e:51:3c:38 -> 00:00:5e:22:22:2c
  reply, type ethernet/IP4, address size 6/4
  00:00:5e:51:3c:38/110.0.0.1 -> 00:00:5e:22:22:2c/110.0.0.2

when the bonding is in l2 mode, the packet trace below:
packet:
00:00:00:000000: memif-input
  memif: hw_if_index 3 next-index 4
    slot: ring 0
00:00:00:000000: ethernet-input
  ARP: 00:00:5e:22:22:2c -> ff:ff:ff:ff:ff:ff 802.1q vlan 0
00:00:00:000000: arp-input
  request, type ethernet/IP4, address size 6/4
  00:00:5e:22:22:2c/110.0.0.2 -> 00:00:00:00:00:00/110.0.0.1
00:00:00:000000: error-drop
  arp-input: Interface is not IP enabled

The mode switch code of bonding device:
static __clib_unused clib_error_t *
bond_set_l2_mode_function (vnet_main_t * vnm,
   struct vnet_hw_interface_t *bif_hw,
   i32 l2_if_adjust)
{
  bond_if_t *bif;
  u32 *sw_if_index;
  struct vnet_hw_interface_t *sif_hw;

  bif = bond_get_master_by_sw_if_index (bif_hw->sw_if_index);
  if (!bif)
    return 0;

  if ((bif_hw->l2_if_count == 1) && (l2_if_adjust == 1))
    {
      /* Just added first L2 interface on this port */
      vec_foreach (sw_if_index, bif->slaves)
      {
sif_hw = vnet_get_sup_hw_interface (vnm, *sw_if_index);
ethernet_set_flags (vnm, sif_hw->hw_if_index,
    ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);

/* ensure all packets go to ethernet-input */
ethernet_set_rx_redirect (vnm, sif_hw, 1);
      }
    }

  return 0;
}

when I switch the mode of bonding interface to l2,

the function(blue color code above) redirects all the members to ethernet-input 
,

but when I switch it back to l3, all the members don't redirect to bond-input.



saint_...@aliyun.com
 
From: steven luong via Lists.Fd.Io
Date: 2018-10-25 12:06
To: saint_...@aliyun.com; John Lo (loj)
CC: vpp-dev
Subject: Re: [vpp-dev] Problem switching a bonded interface from L2 to L3 mode
Are you using VPP native bonding driver or DPDK bonding driver? How do you 
configure the bonding interface? Please include the configuration and process 
to recreate the problem.
 
Steven
 
From: <vpp-dev@lists.fd.io> on behalf of "saint_sun 孙 via Lists.Fd.Io" 
<saint_sun=aliyun....@lists.fd.io>
Reply-To: "saint_...@aliyun.com" <saint_...@aliyun.com>
Date: Wednesday, October 24, 2018 at 8:07 PM
To: "John Lo (loj)" <l...@cisco.com>
Cc: "vpp-dev@lists.fd.io" <vpp-dev@lists.fd.io>
Subject: Re: [vpp-dev] Problem switching a bonded interface from L2 to L3 mode
 
Ok, I forgot to click the reply-all. who is familiar with the problem I 
mentioned below please tell me,thanks!
 




2018年10月25日 星期四 +0800 10:32 发件人 John Lo (loj) <l...@cisco.com>:
Please include vpp-dev alias on any questions about VPP, instead of unicast an 
individual only. Then whoever is familiar with the area you are asking about 
may respond.  Does anyone know about the potential problem of switching between 
L2 and L3 modes on a bonded interface described in this email (I did change the 
email subject accordingly)?   -John
 
From: saint_sun 孙 <saint_...@aliyun.com> 
Sent: Wednesday, October 24, 2018 8:52 PM
To: John Lo (loj) <l...@cisco.com>
Subject: Re: RE: RE: [vpp-dev]vlan interface support?
 
I am very grateful for your help. 
And when I test the VLAN, maybe I find a bug that if I switch the mode of the 
Bonding interface to L2 and then switch back to L3,the bonding interface can 
not work as before. 
I have found the error code that is in the mode switch function of bonding 
device: when set the mode of bonding interface to l2, all the members of the 
bonding interface will be set to l2, but when set the bonding interface back, 
all the members do not recover to l3.
 
At last I have another doubt that when I configure an IP address for an 
interface, then I ping the address from VPP, it’s failed, why?should I do other 
more settings?
 


2018年10月15日 星期一 +0800 22:20 发件人 John Lo (loj) <l...@cisco.com>:
If there is a BVI in a BD with sub-interfaces in the same BD which get packets 
with VLAN tags, it is best to configure a tag-rewrite operation on the 
sub-interfaces to pop their VLAN tags.  Then all packets are forwarded in BD 
without VLAN tags.  The CLI is “set interface l2 tag-rewrite <sub-interface> 
pop 1” if the sub-interface has one VLAN tag.    –John
 
From: saint_sun 孙 <saint_...@aliyun.com> 
Sent: Monday, October 15, 2018 2:42 AM
To: John Lo (loj) <l...@cisco.com>
Cc: vpp-dev@lists.fd.io
Subject: Re: RE: [vpp-dev]vlan interface support?
 
I am very grateful to you for your advice!
I have tested it,But there is something wrong. when I receive an arp or ICMP 
packet from a l2 subif  that joins to bd 200 and encapsulates vlan 200,the 
reply packet that send from the subif does not have the vlan tag 200. Any more 
other configurations should I set?
 


可用于iOS的myMail发送


2018年10月14日 星期日 +0800 04:58 发件人 l...@cisco.com <l...@cisco.com>:
The equivalent of VLAN on a switch in VPP is a bridge domain or BD for short.  
One can put interfaces or VLAN sub-interfaces in a BD to form a L2 network 
among all interfaces in it.  One can also create a loopback interface, put it 
in a BD as its BVI (Bridge Virtual Interface) and assign IP addresses to it.  
Then packet can be IP forwarded into a BD through its BVI.
 
Following is the VPP CLI sequence to create a loopback (resulting in interface 
name loop0), put it in BD 13 as a BVI, and put an IP address on it:
 
loopback create mac 1a:2b:3c:4d:5e:6f
set interface l2 bridge loop0 13 bvi
set interface state loop0 up
set interface ip address loop0 6.0.0.250/16
 
Regards,
John
 
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of saint_sun ? via 
Lists.Fd.Io
Sent: Friday, October 12, 2018 3:52 AM
To: vpp-dev@lists.fd.io
Cc: vpp-dev@lists.fd.io
Subject: [vpp-dev]vlan interface support?
 
I have a question:
Does vpp has the function like the configuration example:
interface f0/1
switchport access vlan 10
 
Interface vlan 10
ip address 10.0.0.1 255.255.255.0
 
If vpp has the function, where can I find the command and the source code?
 
Another question, does vpp support superVLAN?
 
anyone who knows please tell me, appreciate for your reply very much!
 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10980): https://lists.fd.io/g/vpp-dev/message/10980
Mute This Topic: https://lists.fd.io/mt/27628831/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to