lkml.org 
[lkml]   [2021]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 8/8] eni_vdpa: add vDPA driver for Alibaba ENI
From
Date

在 2021/10/15 下午3:15, Wu Zongyong 写道:
> +
> +static u64 eni_vdpa_get_features(struct vdpa_device *vdpa)
> +{
> + struct virtio_pci_legacy_device *ldev = vdpa_to_ldev(vdpa);
> + u64 features = vp_legacy_get_features(ldev);
> +
> + features |= BIT_ULL(VIRTIO_F_ACCESS_PLATFORM);
> + features |= BIT_ULL(VIRTIO_F_ORDER_PLATFORM);
> +
> + return features;
> +}
> +
> +static int eni_vdpa_set_features(struct vdpa_device *vdpa, u64 features)
> +{
> + struct virtio_pci_legacy_device *ldev = vdpa_to_ldev(vdpa);
> +
> + if (!(features & BIT_ULL(VIRTIO_NET_F_MRG_RXBUF)) && features) {
> + ENI_ERR(ldev->pci_dev,
> + "VIRTIO_NET_F_MRG_RXBUF is not negotiated\n");
> + return -EINVAL;
> + }
> +
> + vp_legacy_set_features(ldev, (u32)features);
> +
> + return 0;
> +}


Hi:

It looks like some of my previous comments were ignored?

> +static u64 eni_vdpa_get_features(struct vdpa_device *vdpa)
> +{
> + struct virtio_pci_legacy_device *ldev = vdpa_to_ldev(vdpa);
> + u64 features = vp_legacy_get_features(ldev);
> +
> + features |= BIT_ULL(VIRTIO_F_ACCESS_PLATFORM);
> + features |= BIT_ULL(VIRTIO_F_ORDER_PLATFORM);

VERSION_1 is also needed?


> +
> + return features;
> +}
> +
> +static int eni_vdpa_set_features(struct vdpa_device *vdpa, u64 features)
> +{
> + struct virtio_pci_legacy_device *ldev = vdpa_to_ldev(vdpa);
> +
> + if (!(features & BIT_ULL(VIRTIO_NET_F_MRG_RXBUF)) && features) {
> + ENI_ERR(ldev->pci_dev,
> + "VIRTIO_NET_F_MRG_RXBUF is not negotiated\n");
> + return -EINVAL;

Do we need to make sure FEATURE_OK is not set in this case or the ENI can do
this for us?

Other looks good.

Thanks

\
 
 \ /
  Last update: 2021-10-15 10:21    [W:0.309 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site