Re: [PATCH v2 4/4] virtio_net: Add support for VLAN filtering in the hypervisor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 30 January 2009 09:35:23 Alex Williamson wrote:
> +	if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
> +				  VIRTIO_NET_CTRL_VLAN_ADD, &vid, sizeof(vid)))
> +		printk(KERN_WARNING "%s: Failed to add VLAN ID %d.\n",
> +		       dev->name, vid);
> +}

Hmm, I should have mentioned dev_warn() in previous patches.

And possibly (since we never expect it to happen), we should move it into virtnet_send_command to save all the callers sweating on it.  It'd be
less informative tho.

> +		if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN)) {
> +			u8 enable = 1;
> +
> +			/* Enable VLAN filtering */
> +			if (virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
> +						 VIRTIO_NET_CTRL_VLAN_ENABLE,
> +						 &enable, sizeof(enable)))
> +				dev->features |= NETIF_F_HW_VLAN_FILTER;
> +			else
> +				printk(KERN_WARNING "virtio_net: "
> +				       "Failed to enable VLAN filter\n");
> +		}

We can kill VLAN_ENABLE.  We activate it by acking the feature bit.

So this becomes:
	if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN))
		dev->features |= NETIF_F_HW_VLAN_FILTER;

> + * The VLAN filter table is controlled via a simple ADD/DEL interface.
> + * VLAN IDs not added will be dropped.  Del is the opposite of add.
> + * Both commands expect an out entry containing a 2 byte VLAN ID.

s/will be dropped/may be filtered out by the host/ ?

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux