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 324E8A034E for ; Fri, 15 May 2020 08:35:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 14A7F1DA20; Fri, 15 May 2020 08:35:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 520B51D6B3; Fri, 15 May 2020 08:35:07 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04F6WGvh020175; Thu, 14 May 2020 23:35:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=i5Apu4y/rQnSqThiypyCVCK/OAHSqHNAcBZkMbVEKa0=; b=EHl6lNlt9pvM1RG78xKCuQlEiREFGJeoR9iy2Mxh2MdzeAJLEpuWVzduohfRs4Tpr0Qy +BfRgrTGS6P3T2+7TP8nTL7haevhL8fAyl/1Bj0k1eu7Mwk2CpmrPBoTj8lrTm3U1KAv DV2k/0kyJSjCCX/0KnkRHf5kfSAB4cZtWqSaIZGwKUHc6uU6C4D9xHpyxgYpMep6zLke mLfwkysTPvY7xV6xVzc43CssfWQE+SI0jC3qBh+f5JIYbmo+Pb4UdNAG3PvYg8xLmyoZ lg9h13L/3snOE61ywpHCagrWU/GhCqtBdVcNJvjVxKqx1JYo+X+EP1vZl8HOOcmdUToP eg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 3100xk6fkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 23:35:06 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 23:35:04 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 23:35:03 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 May 2020 23:35:03 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id CECAE3F7052; Thu, 14 May 2020 23:35:02 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 04F6Z2qB015084; Thu, 14 May 2020 23:35:02 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: , , CC: Rasesh Mody , , , Igor Russkikh Date: Thu, 14 May 2020 23:34:18 -0700 Message-ID: <20200515063419.14525-1-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200505030943.1091-1-rmody@marvell.com> References: <20200505030943.1091-1-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-15_01:2020-05-14, 2020-05-15 signatures=0 Subject: [dpdk-stable] [PATCH v3 1/2] net/qede: fix assignment of Rx/Tx handlers 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" Fix to assign dummy Rx/Tx handlers in dev_stop. For MTU set, assignment of the appropriate Rx/Tx handlers will be handled by dev_start/dev_stop. Fixes: 81f8804992c9 ("net/qede: enhance Rx CPU utilization") Fixes: 8de0c4201926 ("net/qede: fix odd number of queues usage in 100G mode") Cc: stable@dpdk.org Signed-off-by: Rasesh Mody Signed-off-by: Igor Russkikh --- drivers/net/qede/qede_ethdev.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 0b1fca9ac..d3d916e81 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -320,13 +320,19 @@ qede_interrupt_handler(void *param) } static void -qede_assign_rxtx_handlers(struct rte_eth_dev *dev) +qede_assign_rxtx_handlers(struct rte_eth_dev *dev, bool is_dummy) { uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads; struct qede_dev *qdev = dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; bool use_tx_offload = false; + if (is_dummy) { + dev->rx_pkt_burst = qede_rxtx_pkts_dummy; + dev->tx_pkt_burst = qede_rxtx_pkts_dummy; + return; + } + if (ECORE_IS_CMT(edev)) { dev->rx_pkt_burst = qede_recv_pkts_cmt; dev->tx_pkt_burst = qede_xmit_pkts_cmt; @@ -1153,7 +1159,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev) /* Start/resume traffic */ qede_fastpath_start(edev); - qede_assign_rxtx_handlers(eth_dev); + /* Assign I/O handlers */ + qede_assign_rxtx_handlers(eth_dev, false); + DP_INFO(edev, "Device started\n"); return 0; @@ -1175,6 +1183,11 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev) /* Update link status */ qede_link_update(eth_dev, 0); + /* Replace I/O functions with dummy ones. It cannot + * be set to NULL because rte_eth_rx_burst() doesn't check for NULL. + */ + qede_assign_rxtx_handlers(eth_dev, true); + /* Disable vport */ if (qede_activate_vport(eth_dev, false)) return; @@ -2323,11 +2336,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) dev->data->min_rx_buf_size); return -EINVAL; } - /* Temporarily replace I/O functions with dummy ones. It cannot - * be set to NULL because rte_eth_rx_burst() doesn't check for NULL. - */ - dev->rx_pkt_burst = qede_rxtx_pkts_dummy; - dev->tx_pkt_burst = qede_rxtx_pkts_dummy; if (dev->data->dev_started) { dev->data->dev_started = 0; qede_dev_stop(dev); @@ -2366,15 +2374,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) /* update max frame size */ dev->data->dev_conf.rxmode.max_rx_pkt_len = max_rx_pkt_len; - /* Reassign back */ - qede_assign_rxtx_handlers(dev); - if (ECORE_IS_CMT(edev)) { - dev->rx_pkt_burst = qede_recv_pkts_cmt; - dev->tx_pkt_burst = qede_xmit_pkts_cmt; - } else { - dev->rx_pkt_burst = qede_recv_pkts; - dev->tx_pkt_burst = qede_xmit_pkts; - } return 0; } @@ -2577,7 +2576,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) strncpy((char *)params.name, QEDE_PMD_VER_PREFIX, QEDE_PMD_DRV_VER_STR_SIZE); - qede_assign_rxtx_handlers(eth_dev); + qede_assign_rxtx_handlers(eth_dev, true); eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts; /* For CMT mode device do periodic polling for slowpath events. -- 2.18.0