From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91071A0A0C for ; Tue, 3 Aug 2021 14:22:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A76240E3C; Tue, 3 Aug 2021 14:22:35 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id D669740E3C for ; Tue, 3 Aug 2021 14:22:34 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id l34-20020a05600c1d22b02902573c214807so1605988wms.2 for ; Tue, 03 Aug 2021 05:22:34 -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=6iN1mhag2/gbXKMmzCGSMLK7G34yUW4BVWNzqth9XHo=; b=dVqfAf5efMWY7uBTpM0AD5ac+iBOXoprygnCdMe8NsTLLnl982wiKwr0+MOkn96biO hp45/l32/7ln0z4jiRp221Ve/fXMnCF3eYHwhzf3xmoQvBihUsAeOQUUZCZV2SXhrtHZ xJYyxW2MS7LSd4idVc2rYapx9Fcjwr4amVarQVosU1zZJD/n5vUkNrfEZpYUjXzPk8yL yvYki6mTw98iFQngiEg6zBFPHpRlyNGyV/fMvnt5SZ2atQBTIL45eZlIsXnoRioCwkdf B3toJd5dE04X912ZqNsWu1gZFbaecKktC5u1hrcZ7Wgh5MibAjp5FPs8eD1fKXaoKoPR 0x/Q== 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=6iN1mhag2/gbXKMmzCGSMLK7G34yUW4BVWNzqth9XHo=; b=VT8kdTywWsOOsERbvJmVaXQnHjqW9KiYAIROMw7D2Eq9/xZlYuJRFP7H5s3Nb/PkYm xCPu2Il7wAX5Kn/gPox3QxMSIgscWLD5S572HpIXbnfcErC5vwALjXjcdUq+xz+mzWWb VlGnnFAMucMyGyGI70aT5sRHQ9eQ0tV+YbYl4QJXo9IaACJrlNHN4rDSaF9NEruhsN+E E3LYvN/5QzQWhtNynzYxFEeXay6wW6ohCXkqNRC6fmo/q1e8Am/QE0/uAMcehoyJ49xW UnTdd8OpNKgjxyDeY8A75/YTEbTIVod4i//8Pxamrb3uBdmlI71qw4O+5G6F19iqG5NZ 8whQ== X-Gm-Message-State: AOAM530+CmGXNPInh12XETf3xlGCpvSoO9hXd7J6PZAAURyk/GGsIvzn Es1KJr4RK4uENTD/hloxBNw= X-Google-Smtp-Source: ABdhPJyTmo7ODlCjAEdyhgy0neG/vm/v3WVnBr4swZVf6R9cIg7ixIhLeXko9ETx9uF5qIYS1MfTkw== X-Received: by 2002:a1c:730d:: with SMTP id d13mr4147843wmb.129.1627993354669; Tue, 03 Aug 2021 05:22:34 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id c12sm14654587wrm.29.2021.08.03.05.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 05:22:34 -0700 (PDT) From: luca.boccassi@gmail.com To: Gregory Etelson Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 3 Aug 2021 13:21:55 +0100 Message-Id: <20210803122214.1094992-6-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210803122214.1094992-1-luca.boccassi@gmail.com> References: <20210726135322.149850-59-luca.boccassi@gmail.com> <20210803122214.1094992-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix representor interrupt handler' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.3 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/05/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3003560e240031c57a11a034357a9aecb82f85d0 Thanks. Luca Boccassi --- >From 3003560e240031c57a11a034357a9aecb82f85d0 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Tue, 20 Jul 2021 18:38:19 +0300 Subject: [PATCH] net/mlx5: fix representor interrupt handler [ upstream commit 494d6863c2464838e8ee65b9a7d3d108145ae08d ] In mlx5 PMD the PCI device interrupt vector was used by Uplink representor exclusively and other VF representors did not support interrupt mode. All the VFs and Uplink representors are separate ethernet devices and must have dedicated interrupt vectors. The fix provides each representor with a dedicated interrupt vector. Fixes: 5882bde88da2 ("net/mlx5: fix representor interrupts handler") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/linux/mlx5_os.c | 25 +++++++++++++++++++++++++ drivers/net/mlx5/mlx5.c | 5 +++++ drivers/net/mlx5/mlx5_rxq.c | 6 ------ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index e25d6ffe22..44af6f1c4e 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -2166,6 +2166,31 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, } restore = list[i].eth_dev->data->dev_flags; rte_eth_copy_pci_info(list[i].eth_dev, pci_dev); + /** + * Each representor has a dedicated interrupts vector. + * rte_eth_copy_pci_info() assigns PF interrupts handle to + * representor eth_dev object because representor and PF + * share the same PCI address. + * Override representor device with a dedicated + * interrupts handle here. + * Representor interrupts handle is released in mlx5_dev_stop(). + */ + if (list[i].info.representor) { + struct rte_intr_handle *intr_handle; + intr_handle = mlx5_malloc(MLX5_MEM_SYS | MLX5_MEM_ZERO, + sizeof(*intr_handle), 0, + SOCKET_ID_ANY); + if (!intr_handle) { + DRV_LOG(ERR, + "port %u failed to allocate memory for interrupt handler " + "Rx interrupts will not be supported", + i); + rte_errno = ENOMEM; + ret = -rte_errno; + goto exit; + } + list[i].eth_dev->intr_handle = intr_handle; + } /* Restore non-PCI flags cleared by the above call. */ list[i].eth_dev->data->dev_flags |= restore; rte_eth_dev_probing_finish(list[i].eth_dev); diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 7953a27834..bf37e5eaeb 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1335,6 +1335,11 @@ mlx5_dev_close(struct rte_eth_dev *dev) priv->rxqs_n = 0; priv->rxqs = NULL; } + if (priv->representor) { + /* Each representor has a dedicated interrupts handler */ + mlx5_free(dev->intr_handle); + dev->intr_handle = NULL; + } if (priv->txqs != NULL) { /* XXX race condition if mlx5_tx_burst() is still running. */ usleep(1000); diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 002df27ab4..b5268df57d 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -904,9 +904,6 @@ mlx5_rx_intr_vec_enable(struct rte_eth_dev *dev) unsigned int count = 0; struct rte_intr_handle *intr_handle = dev->intr_handle; - /* Representor shares dev->intr_handle with PF. */ - if (priv->representor) - return 0; if (!dev->data->dev_conf.intr_conf.rxq) return 0; mlx5_rx_intr_vec_disable(dev); @@ -987,9 +984,6 @@ mlx5_rx_intr_vec_disable(struct rte_eth_dev *dev) unsigned int rxqs_n = priv->rxqs_n; unsigned int n = RTE_MIN(rxqs_n, (uint32_t)RTE_MAX_RXTX_INTR_VEC_ID); - /* Representor shares dev->intr_handle with PF. */ - if (priv->representor) - return; if (!dev->data->dev_conf.intr_conf.rxq) return; if (!intr_handle->intr_vec) -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-03 12:35:08.471811608 +0100 +++ 0006-net-mlx5-fix-representor-interrupt-handler.patch 2021-08-03 12:35:08.186818169 +0100 @@ -1 +1 @@ -From 494d6863c2464838e8ee65b9a7d3d108145ae08d Mon Sep 17 00:00:00 2001 +From 3003560e240031c57a11a034357a9aecb82f85d0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 494d6863c2464838e8ee65b9a7d3d108145ae08d ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 4712bd6f9b..14a3b912cc 100644 +index e25d6ffe22..44af6f1c4e 100644 @@ -29 +30 @@ -@@ -2525,6 +2525,31 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev, +@@ -2166,6 +2166,31 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, @@ -62 +63 @@ -index f68c7693c7..90990ffdc2 100644 +index 7953a27834..bf37e5eaeb 100644 @@ -65 +66 @@ -@@ -1580,6 +1580,11 @@ mlx5_dev_close(struct rte_eth_dev *dev) +@@ -1335,6 +1335,11 @@ mlx5_dev_close(struct rte_eth_dev *dev) @@ -76 +77 @@ - rte_delay_us_sleep(1000); + usleep(1000); @@ -78 +79 @@ -index 49165f482e..abd8ce7989 100644 +index 002df27ab4..b5268df57d 100644 @@ -81 +82 @@ -@@ -834,9 +834,6 @@ mlx5_rx_intr_vec_enable(struct rte_eth_dev *dev) +@@ -904,9 +904,6 @@ mlx5_rx_intr_vec_enable(struct rte_eth_dev *dev) @@ -91 +92 @@ -@@ -917,9 +914,6 @@ mlx5_rx_intr_vec_disable(struct rte_eth_dev *dev) +@@ -987,9 +984,6 @@ mlx5_rx_intr_vec_disable(struct rte_eth_dev *dev)