From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 3D72F2B92 for ; Mon, 19 Nov 2018 13:26:09 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id u13-v6so5045464wmc.4 for ; Mon, 19 Nov 2018 04:26:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qyPYorkNaEJXR3uRk7QHQ7YGZuhMTZyz3gP3LY23szo=; b=EqTWqUjdEY43OWP7p413pxTFFIViUNQZUDaCN3ZHElhcoW8/BsjuVKltcGiOxYV4Ys Tv8iDpXopdz5ZpnHHLjTcDsg+tEDAFyAR6cbEpDrVhnBXFGnVDFRvZl0oUOv5/Ee9z8e LYcumIugpOF1a4NDyNN5U2DujUpuhovLuQgawW2n1VPug2YhkS90vCwFYDZBHDzJjKG9 QVRem9QcvZHVBCjWJrXjSp/Rk9J8tov/jjHQQ4FFxUGrw/9pjbFSkSRLeKiUtguBt9eh PBUSqwFYlnNMY4Tl8jAUEH9mfFN1tEVOhPKp5elv+eJh2l/6GOKXpn0dXM9xqTVNxQWm He8Q== X-Gm-Message-State: AGRZ1gI9jnBNadcZMAPN8IEuBvjvA1UbWJE/RFLHGgzP+k38Q+e03kJg dy5RzqVngqOb0cRhsHYRNZmcbH66 X-Google-Smtp-Source: AFSGD/Xg0SP3YYx+xrDVqGrPEqaj48hvoPJd8YgANd6TK0SCFB+K6istboN1gXt8MBsSM1qHl/DmkA== X-Received: by 2002:a1c:28c6:: with SMTP id o189-v6mr6763750wmo.89.1542630368875; Mon, 19 Nov 2018 04:26:08 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id 125-v6sm34392093wmm.25.2018.11.19.04.26.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:26:08 -0800 (PST) From: Luca Boccassi To: Beilei Xing Cc: Qi Zhang , dpdk stable Date: Mon, 19 Nov 2018 12:25:33 +0000 Message-Id: <20181119122538.14207-16-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119122538.14207-1-bluca@debian.org> References: <20181108180111.25873-1-bluca@debian.org> <20181119122538.14207-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix X710 Rx after reading some registers' has been queued to LTS release 16.11.9 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: Mon, 19 Nov 2018 12:26:09 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/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. Luca Boccassi --- >>From a7e063446170d1dae5a2e310515579de88080e63 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 52974a3a9..62b36c9a1 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -10084,6 +10084,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) { @@ -10125,8 +10151,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.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-19 12:15:18.436906000 +0000 +++ 0016-net-i40e-fix-X710-Rx-after-reading-some-registers.patch 2018-11-19 12:15:18.115611432 +0000 @@ -1,15 +1,16 @@ -From 199efc4ac5409403d24a0f21fe382bbce86638ac Mon Sep 17 00:00:00 2001 +From a7e063446170d1dae5a2e310515579de88080e63 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 52974a3a9..62b36c9a1 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) +@@ -10084,6 +10084,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, +@@ -10125,8 +10151,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;