Subject: Re: [PATCH 02/11] benet: interrupt/i/o handling, network layer i/f and ethtool functions

From: Patrick McHardy <[email-masked]>
Date: Tue, 09 Dec 2008 15:34:27 +0100

Sathya Perla wrote:
> +/*
> + * This is the driver entry point to add a vlan vlan_id
> + * with the device netdev
> + */
> +static void benet_vlan_add_vid(struct net_device *netdev, u16 vlan_id)
> +{
> +	struct be_net_object *pnob = netdev->priv;
> +
> +	if (pnob->num_vlans == (BE_NUM_VLAN_SUPPORTED - 1)) {
> +		/* no  way to return an error */
> +		dev_info(&netdev->dev,
> +		       "BladeEngine: Cannot configure more than %d Vlans\n",
> +			       BE_NUM_VLAN_SUPPORTED);
> +		return;

I'd suggest to either make ->vlan_add_vid() return an error code
or disable VLAN hardware filtering completely when you exceed the
number of supported VLANs. The later is probably the better choice
since people expect to be able to add any number of VLANs.