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 D5A81A04B1 for ; Fri, 28 Aug 2020 12:14:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDDB2A3; Fri, 28 Aug 2020 12:14:28 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id BD00F1C11C for ; Fri, 28 Aug 2020 12:14:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598609666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=njovNDJDjY9hgFCpMoy4izGnd04x4RlvhCm+eSXXk54=; b=ZuaiALM0NAmKXsee/WKW6DIK4i4pL8+GKNzi+owom/ae0UoWVfC7APnAxaucMmZkH4fAh/ /oeXez4dQ80Mob5hm5M72iGC8aKMiVIshOstv3tDUrAWP7gvysQozXfHOHGti3Fvss3AnJ M/WGtncrrDNbNDTdgXnJZqC+VSjMgO8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-WNXZN5nZNc-iMCs6zDV28Q-1; Fri, 28 Aug 2020 06:14:22 -0400 X-MC-Unique: WNXZN5nZNc-iMCs6zDV28Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F17F807338; Fri, 28 Aug 2020 10:14:21 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 113A619D7C; Fri, 28 Aug 2020 10:14:19 +0000 (UTC) From: Kevin Traynor To: Mao Jiang Cc: Qi Zhang , dpdk stable Date: Fri, 28 Aug 2020 11:12:56 +0100 Message-Id: <20200828101308.223767-30-ktraynor@redhat.com> In-Reply-To: <20200828101308.223767-1-ktraynor@redhat.com> References: <20200828101308.223767-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix binding interrupt without MSI-X vector' has been queued to LTS release 18.11.10 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 LTS release 18.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 09/02/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/75d6efa0b1a246989bfa5e62cac477d70cfc93e6 Thanks. Kevin. --- >From 75d6efa0b1a246989bfa5e62cac477d70cfc93e6 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 759fc76c85..80410e89ea 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1979,5 +1979,5 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, } -void +int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) { @@ -1999,8 +1999,12 @@ 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; } @@ -2019,5 +2023,8 @@ 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 */ @@ -2044,4 +2051,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) nb_msix--; } + + return 0; } @@ -2287,5 +2296,7 @@ i40e_dev_start(struct rte_eth_dev *dev) 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); @@ -2293,6 +2304,8 @@ i40e_dev_start(struct rte_eth_dev *dev) 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 2ebbe84782..d224a35020 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -1138,5 +1138,5 @@ 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); -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-28 11:03:26.639284081 +0100 +++ 0030-net-i40e-fix-binding-interrupt-without-MSI-X-vector.patch 2020-08-28 11:03:25.970955814 +0100 @@ -1 +1 @@ -From 6f1998a4f0411ea3b2bed7c05faa81243917a76e Mon Sep 17 00:00:00 2001 +From 75d6efa0b1a246989bfa5e62cac477d70cfc93e6 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6f1998a4f0411ea3b2bed7c05faa81243917a76e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 05d5f28615..0c32e451c5 100644 +index 759fc76c85..80410e89ea 100644 @@ -23 +24 @@ -@@ -2118,5 +2118,5 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, +@@ -1979,5 +1979,5 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, @@ -30 +31 @@ -@@ -2138,8 +2138,12 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -1999,8 +1999,12 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) @@ -44 +45 @@ -@@ -2158,5 +2162,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2019,5 +2023,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) @@ -54 +55 @@ -@@ -2183,4 +2190,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2044,4 +2051,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) @@ -61 +62 @@ -@@ -2423,5 +2432,7 @@ i40e_dev_start(struct rte_eth_dev *dev) +@@ -2287,5 +2296,7 @@ i40e_dev_start(struct rte_eth_dev *dev) @@ -70 +71 @@ -@@ -2429,6 +2440,8 @@ i40e_dev_start(struct rte_eth_dev *dev) +@@ -2293,6 +2304,8 @@ i40e_dev_start(struct rte_eth_dev *dev) @@ -82 +83 @@ -index aef88abed0..19f821829a 100644 +index 2ebbe84782..d224a35020 100644 @@ -85 +86 @@ -@@ -1320,5 +1320,5 @@ void i40e_pf_disable_irq0(struct i40e_hw *hw); +@@ -1138,5 +1138,5 @@ void i40e_pf_disable_irq0(struct i40e_hw *hw);