Displaying 20 results from an estimated 58 matches for "virtnet_validate_feature".
Did you mean:
virtnet_validate_features
2014 Nov 19
3
[PATCH V2 net] virtio-net: validate features during probe
...le changed, 91 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..b16a761 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1673,6 +1673,93 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
};
#endif
+static int virtnet_validate_features(struct virtio_device *dev,
+ unsigned int *table,
+ int table_size,
+ unsigned int feature)
+{
+ int i;
+
+ if (!virtio_has_feature(dev, feature)) {
+ for (i = 0; i < table_size; i++) {
+ unsigned int f = table[i];
+
+ if (virtio_has_feature(dev, f)) {
+ dev_err(...
2014 Nov 19
3
[PATCH V2 net] virtio-net: validate features during probe
...le changed, 91 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..b16a761 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1673,6 +1673,93 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
};
#endif
+static int virtnet_validate_features(struct virtio_device *dev,
+ unsigned int *table,
+ int table_size,
+ unsigned int feature)
+{
+ int i;
+
+ if (!virtio_has_feature(dev, feature)) {
+ for (i = 0; i < table_size; i++) {
+ unsigned int f = table[i];
+
+ if (virtio_has_feature(dev, f)) {
+ dev_err(...
2014 Nov 19
4
[PATCH net] virtio-net: validate features during probe
...le changed, 93 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..4a0ad46 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
};
#endif
+static int virtnet_validate_features(struct virtio_device *dev,
+ unsigned int *table,
+ int table_size,
+ unsigned int feature)
+{
+ int i;
+
+ if (!virtio_has_feature(dev, feature)) {
+ for (i = 0; i < table_size; i++) {
+ unsigned int f = table[i];
+
+ if (virtio_has_feature(dev, f)) {
+ dev_err(...
2014 Nov 19
4
[PATCH net] virtio-net: validate features during probe
...le changed, 93 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..4a0ad46 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
};
#endif
+static int virtnet_validate_features(struct virtio_device *dev,
+ unsigned int *table,
+ int table_size,
+ unsigned int feature)
+{
+ int i;
+
+ if (!virtio_has_feature(dev, feature)) {
+ for (i = 0; i < table_size; i++) {
+ unsigned int f = table[i];
+
+ if (virtio_has_feature(dev, f)) {
+ dev_err(...
2014 Nov 20
4
[PATCH net V5] virtio-net: validate features during probe
...me)
+{
+ if (!virtio_has_feature(vdev, fbit))
+ return false;
+
+ dev_err(&vdev->dev, "device advertises feature %s but not %s",
+ fname, dname);
+
+ return true;
+}
+
+#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \
+ virtnet_fail_on_feature(vdev, fbit, #fbit, dbit)
+
+static bool virtnet_validate_features(struct virtio_device *vdev)
+{
+ if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) &&
+ (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX,
+ "VIRTIO_NET_F_CTRL_VQ") ||
+ VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN,
+ "VIRTIO_NET_F_CTRL_VQ") ||
+...
2014 Nov 20
4
[PATCH net V5] virtio-net: validate features during probe
...me)
+{
+ if (!virtio_has_feature(vdev, fbit))
+ return false;
+
+ dev_err(&vdev->dev, "device advertises feature %s but not %s",
+ fname, dname);
+
+ return true;
+}
+
+#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \
+ virtnet_fail_on_feature(vdev, fbit, #fbit, dbit)
+
+static bool virtnet_validate_features(struct virtio_device *vdev)
+{
+ if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) &&
+ (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX,
+ "VIRTIO_NET_F_CTRL_VQ") ||
+ VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN,
+ "VIRTIO_NET_F_CTRL_VQ") ||
+...
2020 Jan 05
2
[PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ
...9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4d7d5434cc5d..7b8805b47f0d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2971,6 +2971,15 @@ static int virtnet_validate(struct virtio_device *vdev)
if (!virtnet_validate_features(vdev))
return -EINVAL;
+ /* VIRTIO_NET_F_CTRL_GUEST_OFFLOADS does not work without
+ * VIRTIO_NET_F_CTRL_VQ. Unfortunately spec forgot to
+ * specify that VIRTIO_NET_F_CTRL_GUEST_OFFLOADS depends
+ * on VIRTIO_NET_F_CTRL_VQ so devices can set the later but
+ * not the former.
+ */
+ if (...
2020 Jan 05
2
[PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ
...9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4d7d5434cc5d..7b8805b47f0d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2971,6 +2971,15 @@ static int virtnet_validate(struct virtio_device *vdev)
if (!virtnet_validate_features(vdev))
return -EINVAL;
+ /* VIRTIO_NET_F_CTRL_GUEST_OFFLOADS does not work without
+ * VIRTIO_NET_F_CTRL_VQ. Unfortunately spec forgot to
+ * specify that VIRTIO_NET_F_CTRL_GUEST_OFFLOADS depends
+ * on VIRTIO_NET_F_CTRL_VQ so devices can set the later but
+ * not the former.
+ */
+ if (...
2014 Nov 19
0
[PATCH V2 net] virtio-net: validate features during probe
...t a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index ec2a8b4..b16a761 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1673,6 +1673,93 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
> };
> #endif
>
> +static int virtnet_validate_features(struct virtio_device *dev,
> + unsigned int *table,
> + int table_size,
> + unsigned int feature)
> +{
> + int i;
> +
> + if (!virtio_has_feature(dev, feature)) {
Do an early return, get rid of one indentation level?
> + for (i = 0; i < table_s...
2020 Jan 06
2
[PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ
...--git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 4d7d5434cc5d..7b8805b47f0d 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -2971,6 +2971,15 @@ static int virtnet_validate(struct virtio_device *vdev)
> > if (!virtnet_validate_features(vdev))
> > return -EINVAL;
> > + /* VIRTIO_NET_F_CTRL_GUEST_OFFLOADS does not work without
> > + * VIRTIO_NET_F_CTRL_VQ. Unfortunately spec forgot to
> > + * specify that VIRTIO_NET_F_CTRL_GUEST_OFFLOADS depends
> > + * on VIRTIO_NET_F_CTRL_VQ so devices can se...
2020 Jan 06
2
[PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ
...--git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 4d7d5434cc5d..7b8805b47f0d 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -2971,6 +2971,15 @@ static int virtnet_validate(struct virtio_device *vdev)
> > if (!virtnet_validate_features(vdev))
> > return -EINVAL;
> > + /* VIRTIO_NET_F_CTRL_GUEST_OFFLOADS does not work without
> > + * VIRTIO_NET_F_CTRL_VQ. Unfortunately spec forgot to
> > + * specify that VIRTIO_NET_F_CTRL_GUEST_OFFLOADS depends
> > + * on VIRTIO_NET_F_CTRL_VQ so devices can se...
2014 Nov 19
2
[PATCH net] virtio-net: validate features during probe
...ivers/net/virtio_net.c
>> index ec2a8b4..4a0ad46 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
>> };
>> #endif
>>
>> +static int virtnet_validate_features(struct virtio_device *dev,
>> + unsigned int *table,
>> + int table_size,
>> + unsigned int feature)
>> +{
>> + int i;
>> +
>> + if (!virtio_has_feature(dev, feature)) {
>> + for (i = 0; i < table_size; i++) {
>> +...
2014 Nov 19
2
[PATCH net] virtio-net: validate features during probe
...ivers/net/virtio_net.c
>> index ec2a8b4..4a0ad46 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
>> };
>> #endif
>>
>> +static int virtnet_validate_features(struct virtio_device *dev,
>> + unsigned int *table,
>> + int table_size,
>> + unsigned int feature)
>> +{
>> + int i;
>> +
>> + if (!virtio_has_feature(dev, feature)) {
>> + for (i = 0; i < table_size; i++) {
>> +...
2014 Nov 20
2
[PATCH net V3] virtio-net: validate features during probe
...if (!virtio_has_feature(vdev, fbit))
+ return false;
+
+ dev_err(&vdev->dev, "Hypervisor bug: advertise feature %s but not %s",
+ fname, dname);
+
+ return true;
+}
+
+#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \
+ virtnet_fail_on_feature(vdev, fbit, #fbit, #dbit)
+
+static bool virtnet_validate_features(struct virtio_device *vdev)
+{
+ if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) &&
+ (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX,
+ VIRTIO_NET_F_CTRL_VQ) ||
+ VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_CTRL_VQ) ||
+ VIRTNET_FAIL_ON(vdev, V...
2014 Nov 20
2
[PATCH net V3] virtio-net: validate features during probe
...if (!virtio_has_feature(vdev, fbit))
+ return false;
+
+ dev_err(&vdev->dev, "Hypervisor bug: advertise feature %s but not %s",
+ fname, dname);
+
+ return true;
+}
+
+#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \
+ virtnet_fail_on_feature(vdev, fbit, #fbit, #dbit)
+
+static bool virtnet_validate_features(struct virtio_device *vdev)
+{
+ if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) &&
+ (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX,
+ VIRTIO_NET_F_CTRL_VQ) ||
+ VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_CTRL_VQ) ||
+ VIRTNET_FAIL_ON(vdev, V...
2014 Nov 19
1
[PATCH V2 net] virtio-net: validate features during probe
...drivers/net/virtio_net.c
>> index ec2a8b4..b16a761 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -1673,6 +1673,93 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
>> };
>> #endif
>>
>> +static int virtnet_validate_features(struct virtio_device *dev,
>> + unsigned int *table,
>> + int table_size,
>> + unsigned int feature)
>> +{
>> + int i;
>> +
>> + if (!virtio_has_feature(dev, feature)) {
> Do an early return, get rid of one indentation level?
Th...
2014 Nov 19
1
[PATCH V2 net] virtio-net: validate features during probe
...drivers/net/virtio_net.c
>> index ec2a8b4..b16a761 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -1673,6 +1673,93 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
>> };
>> #endif
>>
>> +static int virtnet_validate_features(struct virtio_device *dev,
>> + unsigned int *table,
>> + int table_size,
>> + unsigned int feature)
>> +{
>> + int i;
>> +
>> + if (!virtio_has_feature(dev, feature)) {
> Do an early return, get rid of one indentation level?
Th...
2014 Nov 19
0
[PATCH net] virtio-net: validate features during probe
...a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index ec2a8b4..4a0ad46 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
> };
> #endif
>
> +static int virtnet_validate_features(struct virtio_device *dev,
> + unsigned int *table,
> + int table_size,
> + unsigned int feature)
> +{
> + int i;
> +
> + if (!virtio_has_feature(dev, feature)) {
> + for (i = 0; i < table_size; i++) {
> + unsigned int f = table[i];
> +
&...
2014 Nov 19
0
[PATCH net] virtio-net: validate features during probe
...ex ec2a8b4..4a0ad46 100644
> >> --- a/drivers/net/virtio_net.c
> >> +++ b/drivers/net/virtio_net.c
> >> @@ -1673,6 +1673,95 @@ static const struct attribute_group virtio_net_mrg_rx_group = {
> >> };
> >> #endif
> >>
> >> +static int virtnet_validate_features(struct virtio_device *dev,
> >> + unsigned int *table,
> >> + int table_size,
> >> + unsigned int feature)
> >> +{
> >> + int i;
> >> +
> >> + if (!virtio_has_feature(dev, feature)) {
> >> + for (i = 0...
2020 Jan 07
1
[PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ
...tio_net.c
> > > > index 4d7d5434cc5d..7b8805b47f0d 100644
> > > > --- a/drivers/net/virtio_net.c
> > > > +++ b/drivers/net/virtio_net.c
> > > > @@ -2971,6 +2971,15 @@ static int virtnet_validate(struct virtio_device *vdev)
> > > > if (!virtnet_validate_features(vdev))
> > > > return -EINVAL;
> > > > + /* VIRTIO_NET_F_CTRL_GUEST_OFFLOADS does not work without
> > > > + * VIRTIO_NET_F_CTRL_VQ. Unfortunately spec forgot to
> > > > + * specify that VIRTIO_NET_F_CTRL_GUEST_OFFLOADS depends
> > >...