From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E8F9A0351 for ; Thu, 6 Aug 2020 11:58:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D75BC1C115; Thu, 6 Aug 2020 11:58:34 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id D06E21C115 for ; Thu, 6 Aug 2020 11:58:33 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id k20so9059693wmi.5 for ; Thu, 06 Aug 2020 02:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YbKgpIL9AeulES4c7fViHkhABep7TNnefOTJf1fK/0Y=; b=D1e0PWHz42z9XG9c819h7nCxD47yxE9qsY/+Z/syFS8Nhb3XDRoHLyoltkhrWHXup9 MhpPfakfeXohwgZAtP+h3g88mmIrFvKHKmMJRQ4ScNkbhpJrn89/UJoFvQqh8s6mTAp1 +KYj1pXm7HA50ZAwY86zheFdZ1Sk1Rwb9VGGrP3Pbvp9gZnjfLLgr0GMKCENPTWuNA3I OI9M0LeGJ00mxhwrt45dGuzgupkCV0FM3AUw0pmcmgWAF0RoHT/25opPTK7Ru4ZSTKjg GE3RqLUip63H1d1qeYe4fOErUPaB9jXiyowXiY0t5CNVp3XbifwONHa8jglT3FDZcIr4 LKEQ== 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=YbKgpIL9AeulES4c7fViHkhABep7TNnefOTJf1fK/0Y=; b=J3PkX8PkcX09h1aplGWIV1o6deJt4J4CXrz8bgdHibTCKmAIM3YrORhEQWSHCa0cEt CeW9u9YQc9xzyud3mRZjWrNsY/2U6mICl0kHwdvHBDvu/pelhVuYhJAcZz1uUvQVKzvX nwEkbzBRV3ew2XRaOR6oXkCq2Q7ODDqL5gbmtttN13ch2etD15+1vUE/5jufxCy0Gh/w 7Qb0kK/3I3Owt4pki3YdjMtKsDJWDfFovOOeT9LWZkZmTV9iqju7q3hBnsuxtIv6BeCT y0yvXwA5WtiRTkQUVdlEjyOX4AjfnRj21L/z6u8p8JtL5MWQzl3VwXH99yJnFzYBZqAr QO9Q== X-Gm-Message-State: AOAM532fBQCyJDSUL9i9jsjUqhefcled32lxI5uaw3LVCIYNGQLCLwN7 WuE4wXmEJET+aY+g4iFoQE2eX0kSqoQ= X-Google-Smtp-Source: ABdhPJzSF3tnUKFuOk1LfwPud3C1MIvhcfuL0ZJNd0/YydAq8Ah55fWWWpluQZTtXnFaJxgWt1TMsg== X-Received: by 2002:a7b:c953:: with SMTP id i19mr7066285wml.103.1596707913527; Thu, 06 Aug 2020 02:58:33 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q4sm5902538wme.31.2020.08.06.02.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 02:58:32 -0700 (PDT) From: luca.boccassi@gmail.com To: Mao Jiang Cc: Qi Zhang , dpdk stable Date: Thu, 6 Aug 2020 10:53:47 +0100 Message-Id: <20200806095411.774624-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200806095411.774624-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> <20200806095411.774624-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix binding interrupt without MSI-X vector' has been queued to stable release 19.11.4 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/08/20. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 7e08e79f888c5075c8adbc13c509f362676236c2 Mon Sep 17 00:00:00 2001 From: Mao Jiang Date: Thu, 23 Jul 2020 23:27:10 +0800 Subject: [PATCH] net/i40e: fix binding interrupt without MSI-X vector [ upstream commit 6f1998a4f0411ea3b2bed7c05faa81243917a76e ] The value of vsi->nb_msix shouldn't`t be zero, otherwise, all of interrupts will be bind to vector 0. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Mao Jiang Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev.c | 25 +++++++++++++++++++------ drivers/net/i40e/i40e_ethdev.h | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index c23581123..39c8b847c 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2005,7 +2005,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, I40E_WRITE_FLUSH(hw); } -void +int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2025,10 +2025,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) /* VF bind interrupt */ if (vsi->type == I40E_VSI_SRIOV) { + if (vsi->nb_msix == 0) { + PMD_DRV_LOG(ERR, "No msix resource"); + return -EINVAL; + } __vsi_queues_bind_intr(vsi, msix_vect, vsi->base_queue, vsi->nb_qps, itr_idx); - return; + return 0; } /* PF & VMDq bind interrupt */ @@ -2045,7 +2049,10 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) } for (i = 0; i < vsi->nb_used_qps; i++) { - if (nb_msix <= 1) { + if (vsi->nb_msix == 0) { + PMD_DRV_LOG(ERR, "No msix resource"); + return -EINVAL; + } else if (nb_msix <= 1) { if (!rte_intr_allow_others(intr_handle)) /* allow to share MISC_VEC_ID */ msix_vect = I40E_MISC_VEC_ID; @@ -2070,6 +2077,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) msix_vect++; nb_msix--; } + + return 0; } void @@ -2310,14 +2319,18 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Map queues with MSIX interrupt */ main_vsi->nb_used_qps = dev->data->nb_rx_queues - pf->nb_cfg_vmdq_vsi * RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM; - i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT); + ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT); + if (ret < 0) + return ret; i40e_vsi_enable_queues_intr(main_vsi); /* Map VMDQ VSI queues with MSIX interrupt */ for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) { pf->vmdq[i].vsi->nb_used_qps = RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM; - i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi, - I40E_ITR_INDEX_DEFAULT); + ret = i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi, + I40E_ITR_INDEX_DEFAULT); + if (ret < 0) + return ret; i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi); } diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 1e01b312d..e9621d67a 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -1170,7 +1170,7 @@ void i40e_update_vsi_stats(struct i40e_vsi *vsi); void i40e_pf_disable_irq0(struct i40e_hw *hw); void i40e_pf_enable_irq0(struct i40e_hw *hw); int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); -void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx); +int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx); void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi); void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi); int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-06 10:53:16.535354038 +0100 +++ 0019-net-i40e-fix-binding-interrupt-without-MSI-X-vector.patch 2020-08-06 10:53:15.780597005 +0100 @@ -1,13 +1,14 @@ -From 6f1998a4f0411ea3b2bed7c05faa81243917a76e Mon Sep 17 00:00:00 2001 +From 7e08e79f888c5075c8adbc13c509f362676236c2 Mon Sep 17 00:00:00 2001 From: Mao Jiang Date: Thu, 23 Jul 2020 23:27:10 +0800 Subject: [PATCH] net/i40e: fix binding interrupt without MSI-X vector +[ upstream commit 6f1998a4f0411ea3b2bed7c05faa81243917a76e ] + The value of vsi->nb_msix shouldn't`t be zero, otherwise, all of interrupts will be bind to vector 0. Fixes: 4861cde46116 ("i40e: new poll mode driver") -Cc: stable@dpdk.org Signed-off-by: Mao Jiang Acked-by: Qi Zhang @@ -17,10 +18,10 @@ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c -index 05d5f2861..0c32e451c 100644 +index c23581123..39c8b847c 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c -@@ -2117,7 +2117,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, +@@ -2005,7 +2005,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, I40E_WRITE_FLUSH(hw); } @@ -29,7 +30,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; -@@ -2137,10 +2137,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2025,10 +2025,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) /* VF bind interrupt */ if (vsi->type == I40E_VSI_SRIOV) { @@ -45,7 +46,7 @@ } /* PF & VMDq bind interrupt */ -@@ -2157,7 +2161,10 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2045,7 +2049,10 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) } for (i = 0; i < vsi->nb_used_qps; i++) { @@ -57,7 +58,7 @@ if (!rte_intr_allow_others(intr_handle)) /* allow to share MISC_VEC_ID */ msix_vect = I40E_MISC_VEC_ID; -@@ -2182,6 +2189,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2070,6 +2077,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) msix_vect++; nb_msix--; } @@ -66,7 +67,7 @@ } void -@@ -2422,14 +2431,18 @@ i40e_dev_start(struct rte_eth_dev *dev) +@@ -2310,14 +2319,18 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Map queues with MSIX interrupt */ main_vsi->nb_used_qps = dev->data->nb_rx_queues - pf->nb_cfg_vmdq_vsi * RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM; @@ -89,10 +90,10 @@ } diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h -index aef88abed..19f821829 100644 +index 1e01b312d..e9621d67a 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h -@@ -1319,7 +1319,7 @@ void i40e_update_vsi_stats(struct i40e_vsi *vsi); +@@ -1170,7 +1170,7 @@ void i40e_update_vsi_stats(struct i40e_vsi *vsi); void i40e_pf_disable_irq0(struct i40e_hw *hw); void i40e_pf_enable_irq0(struct i40e_hw *hw); int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);