From patchwork Sat Jul 14 00:54:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 43081 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 13E9B2C17; Sat, 14 Jul 2018 02:54:59 +0200 (CEST) Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id 2F0602C16 for ; Sat, 14 Jul 2018 02:54:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2068; q=dns/txt; s=iport; t=1531529697; x=1532739297; h=from:to:cc:subject:date:message-id; bh=murdWaz2iy5ImSAOlyqJXIGJKOoFD548l3FVJlSnFho=; b=OZYDbRLHTV5cKatpP2uFccTtD1r3yfLamv1dpdTm5DeE2gTgp0H/vXVn xAX3kuky84gUeZ/zoWKQqTryRyBembfVzulFlncUylxM618ufDqzWmuR2 otddzvUCXWEPhOH/tYCJECFOpLEWr50GjY3TLgYMgX/5+lc99Fze/L8fo M=; X-IronPort-AV: E=Sophos;i="5.51,350,1526342400"; d="scan'208";a="142923193" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jul 2018 00:54:56 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id w6E0st2e003329; Sat, 14 Jul 2018 00:54:55 GMT Received: by cisco.com (Postfix, from userid 392789) id A408120F2001; Fri, 13 Jul 2018 17:54:55 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Fri, 13 Jul 2018 17:54:52 -0700 Message-Id: <20180714005452.28195-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 Subject: [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU 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" From: Hyong Youb Kim enic_set_mtu always reverts to the default Rx handler after changing MTU. Try to use the simpler, non-scatter handler in this case as well. Fixes: 1187012c1ede ("net/enic: add simple Rx handler") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_main.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index c8456c4b7..aa3f79df5 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -514,6 +514,20 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, uint16_t queue_idx) } } +static void pick_rx_handler(struct enic *enic) +{ + struct rte_eth_dev *eth_dev; + + /* Use the non-scatter, simplified RX handler if possible. */ + if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) { + PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler"); + eth_dev = enic->rte_dev; + eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts; + } else { + PMD_INIT_LOG(DEBUG, " use the normal Rx handler"); + } +} + int enic_enable(struct enic *enic) { unsigned int index; @@ -571,13 +585,7 @@ int enic_enable(struct enic *enic) eth_dev->tx_pkt_burst = &enic_xmit_pkts; } - /* Use the non-scatter, simplified RX handler if possible. */ - if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) { - PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler"); - eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts; - } else { - PMD_INIT_LOG(DEBUG, " use the normal Rx handler"); - } + pick_rx_handler(enic); for (index = 0; index < enic->wq_count; index++) enic_start_wq(enic, index); @@ -1550,7 +1558,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu) /* put back the real receive function */ rte_mb(); - eth_dev->rx_pkt_burst = enic_recv_pkts; + pick_rx_handler(enic); rte_mb(); /* restart Rx traffic */