|
@@ -2568,12 +2568,15 @@ int i40e_add_vlan_all_mac(struct i40e_vsi *vsi, s16 vid)
|
|
/**
|
|
/**
|
|
* i40e_vsi_add_vlan - Add VSI membership for given VLAN
|
|
* i40e_vsi_add_vlan - Add VSI membership for given VLAN
|
|
* @vsi: the VSI being configured
|
|
* @vsi: the VSI being configured
|
|
- * @vid: VLAN id to be added (0 = untagged only , -1 = any)
|
|
|
|
|
|
+ * @vid: VLAN id to be added
|
|
**/
|
|
**/
|
|
-int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
|
|
|
|
|
|
+int i40e_vsi_add_vlan(struct i40e_vsi *vsi, u16 vid)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
|
|
|
|
|
|
+ if (!vid || vsi->info.pvid)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
/* Locked once because all functions invoked below iterates list*/
|
|
/* Locked once because all functions invoked below iterates list*/
|
|
spin_lock_bh(&vsi->mac_filter_hash_lock);
|
|
spin_lock_bh(&vsi->mac_filter_hash_lock);
|
|
err = i40e_add_vlan_all_mac(vsi, vid);
|
|
err = i40e_add_vlan_all_mac(vsi, vid);
|
|
@@ -2616,10 +2619,13 @@ void i40e_rm_vlan_all_mac(struct i40e_vsi *vsi, s16 vid)
|
|
/**
|
|
/**
|
|
* i40e_vsi_kill_vlan - Remove VSI membership for given VLAN
|
|
* i40e_vsi_kill_vlan - Remove VSI membership for given VLAN
|
|
* @vsi: the VSI being configured
|
|
* @vsi: the VSI being configured
|
|
- * @vid: VLAN id to be removed (0 = untagged only , -1 = any)
|
|
|
|
|
|
+ * @vid: VLAN id to be removed
|
|
**/
|
|
**/
|
|
-void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
|
|
|
|
|
|
+void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, u16 vid)
|
|
{
|
|
{
|
|
|
|
+ if (!vid || vsi->info.pvid)
|
|
|
|
+ return;
|
|
|
|
+
|
|
spin_lock_bh(&vsi->mac_filter_hash_lock);
|
|
spin_lock_bh(&vsi->mac_filter_hash_lock);
|
|
i40e_rm_vlan_all_mac(vsi, vid);
|
|
i40e_rm_vlan_all_mac(vsi, vid);
|
|
spin_unlock_bh(&vsi->mac_filter_hash_lock);
|
|
spin_unlock_bh(&vsi->mac_filter_hash_lock);
|