RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout
From: Parav Pandit <hidden>
Date: 2021-06-30 06:03:24
Hi Jason,
From: Jason Wang <jasowang@redhat.com> Sent: Wednesday, June 30, 2021 10:02 AM
quoted
quoted
It looks to we don't need the rest of fields in the virtio_net_config to build the config since they are all hardware attributes.Today it is only mac and max queues. Later on we may need to define rsshashing as hw/device advances.quoted
And structure size will change. Hence, I propose to have each as individual attribute that doesn’t need tocast in struct. Ok, that should work. If Michael are fine with this, I'm also fine. Just to clarify, if I understand this correctly, with the individual attribute, there's no need for the bit like xxx_is_valid?
xxx_is_valid is not present in the get calls.
It is also not present in UAPI set calls.
It is not a UAPI.
It is an internal between vdpa.c and vendor driver to tell which fields to use as there are optional.
If we want to get rid of those valid flags below code will move to vendor driver where we pass nl_attr, during device add callback.
+ if (nl_attrs[VDPA_ATTR_DEV_NET_CFG_MACADDR]) {
+ macaddr = nla_data(nl_attrs[VDPA_ATTR_DEV_NET_CFG_MACADDR]);
+ memcpy(config.net.mac, macaddr, sizeof(config.net.mac));
+ config.net_mask.mac_valid = true;
+ }
+ if (nl_attrs[VDPA_ATTR_DEV_NET_CFG_MTU]) {
+ config.net.mtu =
+ nla_get_u16(nl_attrs[VDPA_ATTR_DEV_NET_CFG_MTU]);
+ config.net_mask.mtu_valid = true;
+ }
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization