From: Wujiahai wujiahai@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IA97VA CVE: NA
-----------------------------------------
1. a low probability that iBMA veth driver causes soft interrupt loops 2. Change the iBMA driver version.
Fixes: 22c4847a5ab9 ("Huawei BMA: Fix iBMA driver bug") Signed-off-by: Wujiahai wujiahai@huawei.com --- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c | 12 +++++++++++- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c index e226582693b6..dd2764bd00ff 100644 --- a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c +++ b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c @@ -87,6 +87,13 @@ u32 g_testlbk;
struct bspveth_device g_bspveth_dev = {};
+/* g_shutdown_flag is used to prevent veth_shutdown_task + * from being preempted by veth_dma_tx_timer_do_H. + * The default value is 0.The value 1 + * indicates that veth_shutdown_flag cannot be preempted, + * and the value 0 indicates that veth_shutdown_task can be preempted. + */ +static int g_shutdown_flag; static int veth_int_handler(struct notifier_block *pthis, unsigned long ev, void *unuse);
@@ -1607,6 +1614,7 @@ void veth_netdev_exit(void) static void veth_shutdown_task(struct work_struct *work) { struct net_device *netdev = g_bspveth_dev.pnetdev; + g_shutdown_flag = 1;
VETH_LOG(DLOG_ERROR, "veth is going down, please restart it manual\n");
@@ -1626,6 +1634,7 @@ static void veth_shutdown_task(struct work_struct *work)
(void)veth_dmatimer_close_H(); } + g_shutdown_flag = 0; }
s32 veth_netdev_init(void) @@ -1728,7 +1737,8 @@ void veth_dma_tx_timer_do_H(unsigned long data)
rxret = veth_dma_task_H(BSPVETH_RX);
- if (txret == BSP_ERR_AGAIN || rxret == BSP_ERR_AGAIN) { + if ((txret == BSP_ERR_AGAIN || rxret == BSP_ERR_AGAIN) && + g_shutdown_flag == 0) { #ifndef USE_TASKLET (void)mod_timer(&g_bspveth_dev.dmatimer, jiffies_64); #else diff --git a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h index 503636549320..f54d2df2771e 100644 --- a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h +++ b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h @@ -31,7 +31,7 @@ extern "C" { #ifdef DRV_VERSION #define VETH_VERSION MICRO_TO_STR(DRV_VERSION) #else -#define VETH_VERSION "0.3.5" +#define VETH_VERSION "0.3.7" #endif
#define MODULE_NAME "veth"