nvethernet: Add VLAN add/del actions

Bug 200565888

Change-Id: I20e33a09af0d64bc5beaa49d83aae98394d6998f
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2313481
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
This commit is contained in:
Bhadram Varka
2020-03-16 21:51:47 +05:30
committed by Revanth Kumar Uppala
parent 663753148e
commit 5ab61e947e
2 changed files with 6 additions and 3 deletions

View File

@@ -41,6 +41,7 @@ nvethernet-objs:= ether_linux.o \
$(OSI_DMA)/eqos_dma.o \
$(OSI_DMA)/eqos_desc.o \
$(OSI_DMA)/mgbe_desc.o \
$(OSI_CORE)/mgbe_mmc.o
$(OSI_CORE)/mgbe_mmc.o \
$(OSI_CORE)/vlan_filter.o
nvethernet-$(CONFIG_NVETHERNET_SELFTESTS) += selftests.o

View File

@@ -2729,13 +2729,14 @@ static int ether_vlan_rx_add_vid(struct net_device *ndev, __be16 vlan_proto,
{
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
unsigned int vlan_id = (vid | OSI_VLAN_ACTION_ADD);
int ret = -1;
if (pdata->vlan_hash_filtering == OSI_HASH_FILTER_MODE) {
dev_err(pdata->dev,
"HASH FILTERING for VLAN tag is not supported in SW\n");
} else {
ret = osi_update_vlan_id(osi_core, vid);
ret = osi_update_vlan_id(osi_core, vlan_id);
}
return ret;
@@ -2765,6 +2766,7 @@ static int ether_vlan_rx_kill_vid(struct net_device *ndev, __be16 vlan_proto,
{
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
unsigned int vlan_id = (vid | OSI_VLAN_ACTION_DEL);
int ret = -1;
if (!netif_running(ndev)) {
@@ -2778,7 +2780,7 @@ static int ether_vlan_rx_kill_vid(struct net_device *ndev, __be16 vlan_proto,
/* By default, receive only VLAN pkt with VID = 1 because
* writing 0 will pass all VLAN pkt
*/
ret = osi_update_vlan_id(osi_core, 0x1U);
ret = osi_update_vlan_id(osi_core, vlan_id);
}
return ret;