nvethernet: remove spin locks and re-initialize private variable

Issue:
1) Spin locks are used for code path which is already serialized
by network stack
2) On interface down/up, MAC registers are getting reset and
re-initialized but private structure variables are not updated

Fix:
1) Remove spinlocks
2) Re-initialize private structure variables

Bug 200548252
Bug 200547544

Change-Id: Ifb0ce27ba96f8657eebde21e5d02d8b36fb1778b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2189974
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rakesh Goyal
2019-09-04 18:11:12 +05:30
committed by Revanth Kumar Uppala
parent 8708cf6e98
commit c080c796e2
3 changed files with 8 additions and 20 deletions

View File

@@ -192,9 +192,7 @@ static int ether_config_l3_l4_filtering(struct net_device *dev,
ret = osi_config_l3_l4_filter_enable(osi_core, filter_flags);
if (ret == 0) {
spin_lock_bh(&pdata->ioctl_lock);
pdata->l3_l4_filter = filter_flags;
spin_unlock_bh(&pdata->ioctl_lock);
}
return ret;
@@ -253,14 +251,12 @@ static int ether_config_ip4_filters(struct net_device *dev,
}
/* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */
spin_lock_bh(&pdata->ioctl_lock);
if (pdata->l3_l4_filter == OSI_DISABLE) {
ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE);
if (ret == 0) {
pdata->l3_l4_filter = OSI_ENABLE;
}
}
spin_unlock_bh(&pdata->ioctl_lock);
/* configure the L3 filters */
ret = osi_config_l3_filters(osi_core, l_l3_filter.filter_no,
@@ -333,14 +329,12 @@ static int ether_config_ip6_filters(struct net_device *dev,
}
/* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */
spin_lock_bh(&pdata->ioctl_lock);
if (pdata->l3_l4_filter == OSI_DISABLE) {
ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE);
if (ret == 0) {
pdata->l3_l4_filter = OSI_ENABLE;
}
}
spin_unlock_bh(&pdata->ioctl_lock);
/* configure the L3 filters */
ret = osi_config_l3_filters(osi_core, l_l3_filter.filter_no,
@@ -414,14 +408,12 @@ static int ether_config_tcp_udp_filters(struct net_device *dev,
}
/* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */
spin_lock_bh(&pdata->ioctl_lock);
if (pdata->l3_l4_filter == OSI_DISABLE) {
ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE);
if (ret == 0) {
pdata->l3_l4_filter = OSI_ENABLE;
}
}
spin_unlock_bh(&pdata->ioctl_lock);
/* configure the L4 filters */
ret = osi_config_l4_filters(osi_core, l_l4_filter.filter_no,