From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3DC98C326 for ; Fri, 12 Jun 2015 17:18:23 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 12 Jun 2015 08:18:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,602,1427785200"; d="scan'208";a="726108931" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 12 Jun 2015 08:18:21 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5CFIKmp031683 for ; Fri, 12 Jun 2015 16:18:20 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t5CFIJ6v001671 for ; Fri, 12 Jun 2015 16:18:19 +0100 Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id t5CFIJoY001666 for dev@dpdk.org; Fri, 12 Jun 2015 16:18:19 +0100 From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Fri, 12 Jun 2015 16:18:19 +0100 Message-Id: <1434122299-1632-1-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 Subject: [dpdk-dev] [PATCH] ixgbevf: fix incorrect RX function selection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2015 15:18:23 -0000 The logic to select ixgbe VF RX function is different than PF side. There are a few issues with its current state: - it does not allow to select ixgbe_recv_pkts_vec among other options. - it can cause memory corruption for scatter mode as it does not allocate enough entries in sw_ring. - when checksum is enabled, incorrect vector RX function is selected. To solve above issues, change the VF RX function selection logic to mimic PF side. Signed-off-by: Sergio Gonzalez Monroy --- drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++ drivers/net/ixgbe/ixgbe_rxtx.c | 11 ++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0d9f9b2..c1a70a1 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2947,6 +2947,8 @@ static int ixgbevf_dev_configure(struct rte_eth_dev *dev) { struct rte_eth_conf* conf = &dev->data->dev_conf; + struct ixgbe_adapter *adapter = + (struct ixgbe_adapter *)dev->data->dev_private; PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d", dev->data->port_id); @@ -2967,6 +2969,13 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev) } #endif + /* + * Initialize to TRUE. If any of Rx queues doesn't meet the bulk + * allocation or vector Rx preconditions we will reset it. + */ + adapter->rx_bulk_alloc_allowed = true; + adapter->rx_vec_allowed = true; + return 0; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 4f9ab22..7cc26ef 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -4549,7 +4549,6 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) (uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len); /* Setup RX queues */ - dev->rx_pkt_burst = ixgbe_recv_pkts; for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; @@ -4615,14 +4614,6 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) if (!dev->data->scattered_rx) PMD_INIT_LOG(DEBUG, "forcing scatter mode"); dev->data->scattered_rx = 1; -#ifdef RTE_IXGBE_INC_VECTOR - if (rte_is_power_of_2(rxq->nb_rx_desc)) - dev->rx_pkt_burst = - ixgbe_recv_scattered_pkts_vec; - else -#endif - dev->rx_pkt_burst = - ixgbe_recv_pkts_lro_single_alloc; } } @@ -4640,6 +4631,8 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) IXGBE_PSRTYPE_RQPL_SHIFT; IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype); + ixgbe_set_rx_function(dev); + return 0; } -- 1.9.3