Skip to content
  • dingtianhong's avatar
    bonding: support QinQ for bond arp interval · fbd929f2
    dingtianhong authored
    
    
    The bond send arp request to indicate that the slave is active, and if the bond dev
    is a vlan dev, it will set the vlan tag in skb to notice the vlan group, but the
    bond could only send a skb with 802.1q proto, not support for QinQ.
    
    So add outer tag for lower vlan tag and inner tag for upper vlan tag to support QinQ,
    The new skb will be consist of two vlan tag just like this:
    
    dst mac | src mac | outer vlan tag | inner vlan tag | data | .....
    
    If We don't need QinQ, the inner vlan tag could be set to 0 and use outer vlan tag
     as a normal vlan group.
    
    Using "ip link" to configure the bond for QinQ and add test log:
    
    ip link add link bond0  bond0.20 type vlan proto 802.1ad id 20
    ip link add link bond0.20  bond0.20.200 type vlan proto 802.1q id 200
    
    ifconfig bond0.20 11.11.20.36/24
    ifconfig bond0.20.200 11.11.200.36/24
    
    echo +11.11.200.37 > /sys/class/net/bond0/bonding/arp_ip_target
    
    90:e2:ba:07:4a:5c (oui Unknown) > Broadcast, ethertype 802.1Q-QinQ (0x88a8),length 50: vlan 20, p 0,ethertype 802.1Q, vlan 200, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 11.11.200.37 tell 11.11.200.36, length 28
    
    90:e2:ba:06:f9:86 (oui Unknown) > 90:e2:ba:07:4a:5c (oui Unknown), ethertype 802.1Q-QinQ (0x88a8), length 50: vlan 20, p 0, ethertype 802.1Q, vlan 200, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 11.11.200.37 is-at 90:e2:ba:06:f9:86 (oui Unknown), length 28
    
    v1->v2: remove the comment "TODO: QinQ?".
    
    Cc: Jay Vosburgh <fubar@us.ibm.com>
    Cc: Veaceslav Falico <vfalico@redhat.com>
    Cc: Andy Gospodarek <andy@greyhouse.net>
    Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fbd929f2