• Roopa Prabhu's avatar
    iproute2: add VF_PORT support · 632110aa
    Roopa Prabhu authored
    Resubmitting Scott Feldmans original patch with below changes
    
    - Fix port profile strlen which was off by 1
    - Added function to convert IFLA_PORT_RESPONSE codes to string
    
    Add support for IFLA_VF_PORTS.  VF port netlink msg layout is
    
            [IFLA_NUM_VF]
            [IFLA_VF_PORTS]
                    [IFLA_VF_PORT]
                            [IFLA_PORT_*], ...
                    [IFLA_VF_PORT]
                            [IFLA_PORT_*], ...
                    ...
            [IFLA_PORT_SELF]
                    [IFLA_PORT_*], ...
    
    The iproute2 cmd line for link set is now:
    
    Usage: ip link add link DEV [ name ] NAME
                       [ txqueuelen PACKETS ]
                       [ address LLADDR ]
                       [ broadcast LLADDR ]
                       [ mtu MTU ]
                       type TYPE [ ARGS ]
           ip link delete DEV type TYPE [ ARGS ]
    
           ip link set DEVICE [ { up | down } ]
                              [ arp { on | off } ]
                              [ dynamic { on | off } ]
                              [ multicast { on | off } ]
                              [ allmulticast { on | off } ]
                              [ promisc { on | off } ]
                              [ trailers { on | off } ]
                              [ txqueuelen PACKETS ]
                              [ name NEWNAME ]
                              [ address LLADDR ]
                              [ broadcast LLADDR ]
                              [ mtu MTU ]
                              [ netns PID ]
                              [ alias NAME ]
                              [ port MODE { PROFILE | VSI } ]
                              [ vf NUM [ mac LLADDR ]
                                       [ vlan VLANID [ qos VLAN-QOS ] ]
                                       [ rate TXRATE ]
                                       [ port MODE { PROFILE | VSI } ] ]
           ip link show [ DEVICE ]
    
    TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can }
    MODE := { assoc | preassoc | preassocrr | disassoc }
    PROFILE := profile PROFILE
               [ instance UUID ]
               [ host UUID ]
    VSI := vsi mgr MGRID type VTID ver VER
           [ instance UUID ]
    Signed-off-by: default avatarScott Feldman <scofeldm@cisco.com>
    Signed-off-by: default avatarRoopa Prabhu <roprabhu@cisco.com>
    632110aa
ipaddress.c 35.7 KB