[dpdk-dev] [PATCH v3 06/22] vhost: introduce API to fetch negotiated features

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri Mar 31 10:51:51 CEST 2017


On Fri, Mar 31, 2017 at 09:45:11AM +0200, Maxime Coquelin wrote:
> >+uint64_t
> >+rte_vhost_get_negotiated_features(int vid)
> >+{
> >+	struct virtio_net *dev;
> >+
> >+	dev = get_device(vid);
> >+	if (!dev)
> >+		return 0;
> It's unlikely to happen with net devices, but as this series is about
> generalizing the use of this lib, couldn't we have cases where the
> negotiated features is 0?

Yes, I think so.

> If so, shouldn't be preferable the caller passes features pointer as
> argument?

I thought of that. The reason I did that is to keep the semantics with
rte_vhost_driver_get_feature(path). But you are right, we don't have
to follow that. More importantly, we may also need change the return
value of rte_vhost_driver_get_features(path): which could also fail
if 'path' is not found.

	--yliu


More information about the dev mailing list