From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 23C671B512 for ; Fri, 30 Nov 2018 00:15:51 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:21:41 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW8s032075; Fri, 30 Nov 2018 01:15:46 +0200 From: Yongseok Koh To: Beilei Xing Cc: Qi Zhang , dpdk stable Date: Thu, 29 Nov 2018 15:11:48 -0800 Message-Id: <20181129231202.30436-114-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/i40e: fix X710 Rx after reading some registers' has been queued to LTS release 17.11.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:15:51 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 01208c8e526e1efdd8b81d8042c6c161489421ae Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Thu, 15 Nov 2018 11:17:02 +0800 Subject: [PATCH] net/i40e: fix X710 Rx after reading some registers [ upstream commit 199efc4ac5409403d24a0f21fe382bbce86638ac ] There's an issue that X710 can't receive any packet after reading some special registers. That's because these registers are only valid for X722, read access for non-X722 will cause ECC error. Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping") Signed-off-by: Beilei Xing Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5e2a0f79f..470f67542 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -11205,6 +11205,32 @@ i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) return 0; } +/** + * This function is used to check if the register is valid. + * Below is the valid registers list for X722 only: + * 0x2b800--0x2bb00 + * 0x38700--0x38a00 + * 0x3d800--0x3db00 + * 0x208e00--0x209000 + * 0x20be00--0x20c000 + * 0x263c00--0x264000 + * 0x265c00--0x266000 + */ +static inline int i40e_valid_regs(enum i40e_mac_type type, uint32_t reg_offset) +{ + if ((type != I40E_MAC_X722) && + ((reg_offset >= 0x2b800 && reg_offset <= 0x2bb00) || + (reg_offset >= 0x38700 && reg_offset <= 0x38a00) || + (reg_offset >= 0x3d800 && reg_offset <= 0x3db00) || + (reg_offset >= 0x208e00 && reg_offset <= 0x209000) || + (reg_offset >= 0x20be00 && reg_offset <= 0x20c000) || + (reg_offset >= 0x263c00 && reg_offset <= 0x264000) || + (reg_offset >= 0x265c00 && reg_offset <= 0x266000))) + return 0; + else + return 1; +} + static int i40e_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) { @@ -11246,8 +11272,11 @@ static int i40e_get_regs(struct rte_eth_dev *dev, reg_offset = arr_idx * reg_info->stride1 + arr_idx2 * reg_info->stride2; reg_offset += reg_info->base_addr; - ptr_data[reg_offset >> 2] = - I40E_READ_REG(hw, reg_offset); + if (!i40e_valid_regs(hw->mac.type, reg_offset)) + ptr_data[reg_offset >> 2] = 0; + else + ptr_data[reg_offset >> 2] = + I40E_READ_REG(hw, reg_offset); } } -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:50.187294304 -0800 +++ 0114-net-i40e-fix-X710-Rx-after-reading-some-registers.patch 2018-11-29 15:01:45.304958000 -0800 @@ -1,15 +1,16 @@ -From 199efc4ac5409403d24a0f21fe382bbce86638ac Mon Sep 17 00:00:00 2001 +From 01208c8e526e1efdd8b81d8042c6c161489421ae Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Thu, 15 Nov 2018 11:17:02 +0800 Subject: [PATCH] net/i40e: fix X710 Rx after reading some registers +[ upstream commit 199efc4ac5409403d24a0f21fe382bbce86638ac ] + There's an issue that X710 can't receive any packet after reading some special registers. That's because these registers are only valid for X722, read access for non-X722 will cause ECC error. Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping") -Cc: stable@dpdk.org Signed-off-by: Beilei Xing Acked-by: Qi Zhang @@ -18,10 +19,10 @@ 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c -index 790ecc3cc..3628d7f2a 100644 +index 5e2a0f79f..470f67542 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c -@@ -11609,6 +11609,32 @@ i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) +@@ -11205,6 +11205,32 @@ i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) return 0; } @@ -54,7 +55,7 @@ static int i40e_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) { -@@ -11650,8 +11676,11 @@ static int i40e_get_regs(struct rte_eth_dev *dev, +@@ -11246,8 +11272,11 @@ static int i40e_get_regs(struct rte_eth_dev *dev, reg_offset = arr_idx * reg_info->stride1 + arr_idx2 * reg_info->stride2; reg_offset += reg_info->base_addr;