From: Wujiahai wujiahai@huawei.com
1. a low probability that iBMA cdev_veth driver causes softlockup problem 2. a low probability that iBMA veth driver causes soft interrupt loops 3. Change the iBMA driver version. 4. Resolved the problem that the DMA reset does not meet the expectation due to the mismatch between the register configuration and the communication transmission direction during DMA reset.
Wujiahai (5): BMA/edma_drv: Fix DMA reset problem and change the version number. BMA/cdev_drv: Change the version number. BMA/veth_drv: Fix soft interrupt loops and change the version number BMA/kbox_drv: Change the version number. BMA/cdev_veth_drv: Fix softlockup problem
.../net/ethernet/huawei/bma/cdev_drv/bma_cdev.c | 2 +- .../bma/cdev_veth_drv/virtual_cdev_eth_net.c | 14 ++++++++------ drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h | 2 +- .../net/ethernet/huawei/bma/edma_drv/edma_host.c | 4 ++-- .../ethernet/huawei/bma/kbox_drv/kbox_include.h | 2 +- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c | 12 +++++++++++- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.h | 2 +- 7 files changed, 25 insertions(+), 13 deletions(-)
From: Wujiahai wujiahai@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IA97VA CVE: NA
-----------------------------------------
1. Resolved the problem that the DMA reset does not meet the expectation due to the mismatch between the register configuration and the communication transmission direction during DMA reset. 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/edma_drv/bma_pci.h | 2 +- drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h b/drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h index b6a0d11704a2..0f6098ee5560 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h +++ b/drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h @@ -71,7 +71,7 @@ struct bma_pci_dev_s { #ifdef DRV_VERSION #define BMA_VERSION MICRO_TO_STR(DRV_VERSION) #else -#define BMA_VERSION "0.3.5" +#define BMA_VERSION "0.3.7" #endif
#ifdef CONFIG_ARM64 diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c index 2d5f4ffd79d9..cf6e4fd1de3c 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c +++ b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c @@ -689,9 +689,9 @@ void edma_host_reset_dma(struct edma_host_s *edma_host, int dir) return;
if (dir == BMC_TO_HOST) - reg_addr = REG_PCIE1_DMA_READ_ENGINE_ENABLE; - else if (dir == HOST_TO_BMC) reg_addr = REG_PCIE1_DMA_WRITE_ENGINE_ENABLE; + else if (dir == HOST_TO_BMC) + reg_addr = REG_PCIE1_DMA_READ_ENGINE_ENABLE; else return;
From: Wujiahai wujiahai@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IA97VA CVE: NA
-----------------------------------------
1. 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/cdev_drv/bma_cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/bma/cdev_drv/bma_cdev.c b/drivers/net/ethernet/huawei/bma/cdev_drv/bma_cdev.c index 9468a5a0c768..0ca73d40e6d8 100644 --- a/drivers/net/ethernet/huawei/bma/cdev_drv/bma_cdev.c +++ b/drivers/net/ethernet/huawei/bma/cdev_drv/bma_cdev.c @@ -28,7 +28,7 @@ #ifdef DRV_VERSION #define CDEV_VERSION MICRO_TO_STR(DRV_VERSION) #else -#define CDEV_VERSION "0.3.5" +#define CDEV_VERSION "0.3.7" #endif
#define CDEV_DEFAULT_NUM 4
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"
From: Wujiahai wujiahai@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IA97VA CVE: NA
-----------------------------------------
1. 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/kbox_drv/kbox_include.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h b/drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h index b027306e52c1..efc108a5a9d8 100644 --- a/drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h +++ b/drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h @@ -23,7 +23,7 @@ #ifdef DRV_VERSION #define KBOX_VERSION MICRO_TO_STR(DRV_VERSION) #else -#define KBOX_VERSION "0.3.5" +#define KBOX_VERSION "0.3.7" #endif
#define UNUSED(x) (x = x)
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 cdev_veth driver causes softlockup problem
Fixes: 22c4847a5ab9 ("Huawei BMA: Fix iBMA driver bug") Signed-off-by: Wujiahai wujiahai@huawei.com --- .../bma/cdev_veth_drv/virtual_cdev_eth_net.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c index 04ea55f4e0a2..6df11dc9c8f9 100644 --- a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c +++ b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c @@ -667,6 +667,7 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev, u8 *packet, u32 len) { unsigned int count = 0; + unsigned long flags = 0; u8 *ptr = NULL;
LOG(DLOG_DEBUG, "Recv full packet, len %u.", len); @@ -674,14 +675,14 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev, ptr = kmalloc(len, GFP_ATOMIC); if (ptr) { /* lock the queue. */ - spin_lock(ð_dev->rx_queue_lock); + spin_lock_irqsave(ð_dev->rx_queue_lock, flags);
count = edma_veth_get_ring_buf_count(eth_dev->rx_packet_head, eth_dev->rx_packet_tail, MAX_RXTX_PACKET_LEN); if (count >= (MAX_RXTX_PACKET_LEN - 1)) { LOG(DLOG_DEBUG, "The rx queue is full."); - spin_unlock(ð_dev->rx_queue_lock); + spin_unlock_irqrestore(ð_dev->rx_queue_lock, flags); kfree(ptr); return -EBUSY; } @@ -692,7 +693,7 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev, eth_dev->rx_packet_tail = (eth_dev->rx_packet_tail + 1) % MAX_RXTX_PACKET_LEN;
- spin_unlock(ð_dev->rx_queue_lock); + spin_unlock_irqrestore(ð_dev->rx_queue_lock, flags);
return 0; } @@ -1672,16 +1673,17 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, unsigned char *packet = NULL; unsigned char *start = NULL; unsigned int free_packet = 0; + unsigned long flags = 0; ssize_t length = (ssize_t)count; ssize_t left;
LOG(DLOG_DEBUG, "rx_packet_head:%u, rx_packet_tail: %u", dev->rx_packet_head, dev->rx_packet_tail);
- spin_lock(&dev->rx_queue_lock); + spin_lock_irqsave(&dev->rx_queue_lock, flags);
if (!cdev_check_ring_recv()) { - spin_unlock(&dev->rx_queue_lock); + spin_unlock_irqrestore(&dev->rx_queue_lock, flags); return -EAGAIN; }
@@ -1712,7 +1714,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, MAX_RXTX_PACKET_LEN; }
- spin_unlock(&dev->rx_queue_lock); + spin_unlock_irqrestore(&dev->rx_queue_lock, flags);
if (length > 0 && copy_to_user(data, start, length)) { LOG(DLOG_DEBUG, "Failed to copy to user, skip this message.");
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/10324 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/10324 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...