lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 17 Mar 2021 12:07:53 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Zhu Lingshan <lingshan.zhu@...el.com>, mst@...hat.com,
        lulu@...hat.com, leonro@...dia.com
Cc:     virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 7/7] vDPA/ifcvf: deduce VIRTIO device ID from pdev ids


在 2021/3/15 下午3:45, Zhu Lingshan 写道:
>   static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev)
>   {
> -	return VIRTIO_ID_NET;
> +	struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev);
> +	u32 ret = -EOPNOTSUPP;
> +
> +	if (ifcvf_probed_virtio_net(vf))
> +		ret = VIRTIO_ID_NET;


So the point is to simplify the future extension.

How about simply?

if (device_id>0x1040)
     return devce_id - 0x1040;
else
     return device_id;

Since I don't think you plan to introduce device whose vendor id is not 
1AF4 and the subsys vendor/device id is not interesting to vDPA bus.

Thanks


> +
> +	return ret;
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ