From patchwork Fri Sep 4 07:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76490 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EEC80A04C5; Fri, 4 Sep 2020 09:46:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AC86E1C0C2; Fri, 4 Sep 2020 09:46:07 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D21F21C0BD for ; Fri, 4 Sep 2020 09:46:05 +0200 (CEST) IronPort-SDR: eNFh+7b5J2F9CYxEiuKXqM3Z2kbX2uk2a6Wm2ScBGXctczsxLHGf2FUDGLnI5HFLlB324HtWty YwuFrnbCnQLw== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407663" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407663" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:05 -0700 IronPort-SDR: P9G0TDHq2Sprj5QQkG02Kw8PCyNJdOlgP/y8j6Rzmx0rFWvlFaMmpL56AH7u5irwzC5TMM1Cjp +p1yc2IwbLKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315769952" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:03 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:02 +0000 Message-Id: <20200904072907.10648-2-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 1/6] net/iavf: fix scattered Rx enabling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" No need to add additional vlan tag size for max packet size, the queue's Rx Max Frame Size (rxq->max_pkt_len) already includes the vlan header size in iavf. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index c3aa4cd72..f9dd5710c 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -253,7 +253,7 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq) rxq->max_pkt_len = max_pkt_len; if ((dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_SCATTER) || - (rxq->max_pkt_len + 2 * IAVF_VLAN_TAG_SIZE) > buf_size) { + rxq->max_pkt_len > buf_size) { dev_data->scattered_rx = 1; } IAVF_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1); From patchwork Fri Sep 4 07:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76491 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D6BCA04C5; Fri, 4 Sep 2020 09:46:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6677D1C0D9; Fri, 4 Sep 2020 09:46:10 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 224C51C0CC for ; Fri, 4 Sep 2020 09:46:07 +0200 (CEST) IronPort-SDR: SYgpZxHIxSo76BjjBxP9xAtvFONqnFSdC95WnYa1ChD57KNND0nCsNRwfcCvRIaeGVv0PI/Y8S gTmSOSlZQOCg== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407666" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407666" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:07 -0700 IronPort-SDR: 8okImplYYhzHRnLXgxfe4/A6VMJnquFNaXsIqV1bX2Ed4Tfq3ORKYBfjdBsLMmRWbyWnlqJ+ni fQtcoNcYUsyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315769978" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:05 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:03 +0000 Message-Id: <20200904072907.10648-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 2/6] net/iavf: fix incorrect link status when speed is undefined X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When PF is put in no-carrier state, iavf VFs will switch to "in carrier" state due to a link up + a link speed set to 0 (default value if no speed detected). To be consistent with linux drivers on which PF and VFs are in same carrier state, updates a link status of VF only if link is up and speed is different from undefined. Fixes: 48de41ca11f0 ("net/avf: enable link status update") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index f9dd5710c..ae508f2f0 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -620,8 +620,9 @@ iavf_dev_link_update(struct rte_eth_dev *dev, } new_link.link_duplex = ETH_LINK_FULL_DUPLEX; - new_link.link_status = vf->link_up ? ETH_LINK_UP : - ETH_LINK_DOWN; + new_link.link_status = (vf->link_up && + new_link.link_speed != ETH_SPEED_NUM_NONE) + ? ETH_LINK_UP : ETH_LINK_DOWN; new_link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); From patchwork Fri Sep 4 07:29:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76492 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5AFD1A04C5; Fri, 4 Sep 2020 09:46:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AC6BA1C0DC; Fri, 4 Sep 2020 09:46:11 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0BCE41C0D5 for ; Fri, 4 Sep 2020 09:46:09 +0200 (CEST) IronPort-SDR: Zh5ArwhOLO+lztltj8ydvm5/AJMuIDTxWdOQfWmu2WlDKIj9/OYO/zEn5XJLK1vtjueMHd3lq3 dyvwguMxfBxw== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407670" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407670" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:09 -0700 IronPort-SDR: vFATXosQg+C8WKAHOYDLckFDAW2MsPwmBxZ7wRJv/H30j22o+0N5/unYKsBWFvaq6yO/hyffQa IXryrjg+nLVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315769997" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:07 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:04 +0000 Message-Id: <20200904072907.10648-4-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 3/6] net/iavf: fix port start during configuration restore X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If configuring VF promiscuous mode is not supported, return -ENOTSUP error code in .promiscuous_enable/disable dev_ops. This is to fix the port start during configuration restore, where if .promiscuous_enable/disable dev_ops exists and return any value other than -ENOTSUP, start will fail. Same is done for .allmulticast_enable/disable dev_ops. Fixes: ca041cd44fcc ("ethdev: change allmulticast callbacks to return status") Fixes: 9039c8125730 ("ethdev: change promiscuous callbacks to return status") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index ae508f2f0..349c82cae 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -648,6 +648,8 @@ iavf_dev_promiscuous_enable(struct rte_eth_dev *dev) ret = iavf_config_promisc(adapter, true, vf->promisc_multicast_enabled); if (!ret) vf->promisc_unicast_enabled = true; + else if (ret == IAVF_NOT_SUPPORTED) + ret = -ENOTSUP; else ret = -EAGAIN; @@ -669,6 +671,8 @@ iavf_dev_promiscuous_disable(struct rte_eth_dev *dev) vf->promisc_multicast_enabled); if (!ret) vf->promisc_unicast_enabled = false; + else if (ret == IAVF_NOT_SUPPORTED) + ret = -ENOTSUP; else ret = -EAGAIN; @@ -689,6 +693,8 @@ iavf_dev_allmulticast_enable(struct rte_eth_dev *dev) ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, true); if (!ret) vf->promisc_multicast_enabled = true; + else if (ret == IAVF_NOT_SUPPORTED) + ret = -ENOTSUP; else ret = -EAGAIN; @@ -709,6 +715,8 @@ iavf_dev_allmulticast_disable(struct rte_eth_dev *dev) ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, false); if (!ret) vf->promisc_multicast_enabled = false; + else if (ret == IAVF_NOT_SUPPORTED) + ret = -ENOTSUP; else ret = -EAGAIN; From patchwork Fri Sep 4 07:29:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76493 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D42AA04C5; Fri, 4 Sep 2020 09:46:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0ACC31C113; Fri, 4 Sep 2020 09:46:14 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 03C5A1C10D for ; Fri, 4 Sep 2020 09:46:11 +0200 (CEST) IronPort-SDR: gnlFIQNW8Mjq4bTDpVSKrK1zX4xLnpLh52taaAi07N7PjAVD2bGLKsDjhDk/0Z0HDXqLx8IrxG BkJHOKaZoWmw== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407673" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407673" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:11 -0700 IronPort-SDR: +2qP8a1Qbipoj7i2xsFVHbXuMtah4Hv3fAhURDADqLPs/EiC1ZgijjWMMjtmz+Nbx2HIeWwFZe aP1I5Ts2oH8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315770025" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:09 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:05 +0000 Message-Id: <20200904072907.10648-5-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 4/6] net/iavf: fix setting of MAC address on iavf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When setting the MAC address, the ethdev layer copies the new mac address in dev->data->mac_addrs[0] before calling the dev_ops. Therefore, is_same_ether_addr(mac_addr, dev->data->mac_addrs) was always true, and the MAC was never set. Remove this test to fix the issue. Fixes: 538da7a1cad2 ("net: add rte prefix to ether functions") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 349c82cae..f16aff531 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -978,9 +978,6 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, old_addr = (struct rte_ether_addr *)hw->mac.addr; perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; - if (rte_is_same_ether_addr(mac_addr, old_addr)) - return 0; - /* If the MAC address is configured by host, skip the setting */ if (rte_is_valid_assigned_ether_addr(perm_addr)) return -EPERM; From patchwork Fri Sep 4 07:29:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76494 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA31DA04C5; Fri, 4 Sep 2020 09:46:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E36C81C119; Fri, 4 Sep 2020 09:46:15 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 164E21C114 for ; Fri, 4 Sep 2020 09:46:13 +0200 (CEST) IronPort-SDR: 4MMX6So/jwatNUxY0repO4ct0WJkBw/5uLVUAa29KjAu2IplO+CZd1zS9wSJL51DZf1LBbi9YC rk8+0xiHN8RQ== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407678" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407678" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:13 -0700 IronPort-SDR: K5o6dB279rAi8qERMaDt1Be2eHqwzq/POQlg8adZa8rRguWgw2KRDEU/w9d4Vg2h58S+9qASon yH1tJHx1FL7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315770052" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:11 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:06 +0000 Message-Id: <20200904072907.10648-6-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 5/6] net/iavf: fix multiple interrupts for VF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Interrupt mapping should be 1:n queue(s).This patch fixes the logic of interrupt bind by code reconstruction. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_vchnl.c | 56 ++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 33acea54a..614ea7e79 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "iavf.h" #include "iavf_rxtx.h" @@ -686,20 +687,53 @@ int iavf_config_irq_map(struct iavf_adapter *adapter) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); + struct iavf_cmd_info args; + uint8_t *cmd_buffer = NULL; struct virtchnl_irq_map_info *map_info; struct virtchnl_vector_map *vecmap; - struct iavf_cmd_info args; - int len, i, err; + struct rte_eth_dev *dev = adapter->eth_dev; + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + uint32_t vec, cmd_buffer_size, max_vectors, nb_msix, msix_base, i; + uint16_t rxq_map[vf->vf_res->max_vectors]; + int err; - len = sizeof(struct virtchnl_irq_map_info) + - sizeof(struct virtchnl_vector_map) * vf->nb_msix; + memset(rxq_map, 0, sizeof(rxq_map)); + if (dev->data->dev_conf.intr_conf.rxq && + rte_intr_allow_others(intr_handle)) { + msix_base = IAVF_RX_VEC_START; + max_vectors = vf->vf_res->max_vectors - 1; + nb_msix = RTE_MIN(max_vectors, intr_handle->nb_efd); + + vec = msix_base; + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rxq_map[vec] |= 1 << i; + intr_handle->intr_vec[i] = vec++; + if (vec >= vf->vf_res->max_vectors) + vec = msix_base; + } + } else { + msix_base = IAVF_MISC_VEC_ID; + nb_msix = 1; - map_info = rte_zmalloc("map_info", len, 0); - if (!map_info) - return -ENOMEM; + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rxq_map[msix_base] |= 1 << i; + if (rte_intr_dp_is_en(intr_handle)) + intr_handle->intr_vec[i] = msix_base; + } + } - map_info->num_vectors = vf->nb_msix; - for (i = 0; i < vf->nb_msix; i++) { + cmd_buffer_size = sizeof(struct virtchnl_irq_map_info) + + sizeof(struct virtchnl_vector_map) * nb_msix; + cmd_buffer = rte_zmalloc("iavf", cmd_buffer_size, 0); + if (!cmd_buffer) { + PMD_DRV_LOG(ERR, "Failed to allocate memory"); + return IAVF_ERR_NO_MEMORY; + } + + map_info = (struct virtchnl_irq_map_info *)cmd_buffer; + map_info->num_vectors = nb_msix; + for (i = 0; i < nb_msix; i++) { vecmap = &map_info->vecmap[i]; vecmap->vsi_id = vf->vsi_res->vsi_id; vecmap->rxitr_idx = IAVF_ITR_INDEX_DEFAULT; @@ -709,8 +743,8 @@ iavf_config_irq_map(struct iavf_adapter *adapter) } args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP; - args.in_args = (u8 *)map_info; - args.in_args_size = len; + args.in_args = (u8 *)cmd_buffer; + args.in_args_size = cmd_buffer_size; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; err = iavf_execute_vf_cmd(adapter, &args); From patchwork Fri Sep 4 07:29:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 76495 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D5AB3A04C5; Fri, 4 Sep 2020 09:46:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B5DE1C11F; Fri, 4 Sep 2020 09:46:18 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 335191C11C for ; Fri, 4 Sep 2020 09:46:16 +0200 (CEST) IronPort-SDR: sc2FL1ucvE3btCq5xR4mO8FmKe7frEPEUayYO8xcZMeeC4RzXE8OItBDKJulqQkzAmrmB1bo2Z eRa8TeVHOEiQ== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145407681" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="145407681" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:46:15 -0700 IronPort-SDR: GXup9MrMzA6ljfDkSuVnp9UhAGJtknWn6AEbHU0/iluhGGvZ/n5HchvrcVK6x9Myg32FRFLwX6 8VbDQBXOUTBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="315770077" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2020 00:46:14 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, SteveX Yang Date: Fri, 4 Sep 2020 07:29:07 +0000 Message-Id: <20200904072907.10648-7-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904072907.10648-1-stevex.yang@intel.com> References: <20200827011410.18401-1-stevex.yang@intel.com> <20200904072907.10648-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 6/6] net/iavf: downgrade error log X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When receiving the unsupported AQ messages, it's taken as an error. It's not appropriate and triggers too much unnecessary print. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_vchnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 614ea7e79..06eaae0e4 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -266,7 +266,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) } break; default: - PMD_DRV_LOG(ERR, "Request %u is not supported yet", + PMD_DRV_LOG(DEBUG, "Request %u is not supported yet", aq_opc); break; }