• Cindy Lu's avatar
    vdpa: support set mac address from vdpa tool · 2f87e9cf
    Cindy Lu authored
    Add new UAPI to support the mac address from vdpa tool
    Function vdpa_nl_cmd_dev_attr_set_doit() will get the
    new MAC address from the vdpa tool and then set it to the device.
    
    The usage is: vdpa dev set name vdpa_name mac **:**:**:**:**:**
    
    Here is example:
    root@L1# vdpa -jp dev config show vdpa0
    {
        "config": {
            "vdpa0": {
                "mac": "82:4d:e9:5d:d7:e6",
                "link ": "up",
                "link_announce ": false,
                "mtu": 1500
            }
        }
    }
    
    root@L1# vdpa dev set name vdpa0 mac 00:11:22:33:44:55
    
    root@L1# vdpa -jp dev config show vdpa0
    {
        "config": {
            "vdpa0": {
                "mac": "00:11:22:33:44:55",
                "link ": "up",
                "link_announce ": false,
                "mtu": 1500
            }
        }
    }
    Signed-off-by: default avatarCindy Lu <lulu@redhat.com>
    Message-Id: <20240731031653.1047692-2-lulu@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    2f87e9cf
vdpa.c 40.4 KB