From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D0F14C326 for ; Fri, 12 Jun 2015 17:45:22 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 12 Jun 2015 08:45:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,602,1427785200"; d="scan'208";a="726126374" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga001.fm.intel.com with ESMTP; 12 Jun 2015 08:45:09 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.73]) by IRSMSX107.ger.corp.intel.com ([169.254.10.94]) with mapi id 14.03.0224.002; Fri, 12 Jun 2015 16:45:08 +0100 From: "Ananyev, Konstantin" To: "Gonzalez Monroy, Sergio" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ixgbevf: fix incorrect RX function selection Thread-Index: AQHQpSMa2P3btBDHIUiNBmhcTgYYvp2pAxVw Date: Fri, 12 Jun 2015 15:45:09 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836A09119@irsmsx105.ger.corp.intel.com> References: <1434122299-1632-1-git-send-email-sergio.gonzalez.monroy@intel.com> In-Reply-To: <1434122299-1632-1-git-send-email-sergio.gonzalez.monroy@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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:45:23 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez Monr= oy > Sent: Friday, June 12, 2015 4:18 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbevf: fix incorrect RX function selection >=20 > The logic to select ixgbe VF RX function is different than PF side. >=20 > 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 allocat= e > enough entries in sw_ring. > - when checksum is enabled, incorrect vector RX function is selected. >=20 > To solve above issues, change the VF RX function selection logic to > mimic PF side. >=20 > 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(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.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 =3D &dev->data->dev_conf; > + struct ixgbe_adapter *adapter =3D > + (struct ixgbe_adapter *)dev->data->dev_private; >=20 > 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 >=20 > + /* > + * 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 =3D true; > + adapter->rx_vec_allowed =3D true; > + > return 0; > } >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxt= x.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); >=20 > /* Setup RX queues */ > - dev->rx_pkt_burst =3D ixgbe_recv_pkts; > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > rxq =3D dev->data->rx_queues[i]; >=20 > @@ -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 =3D 1; > -#ifdef RTE_IXGBE_INC_VECTOR > - if (rte_is_power_of_2(rxq->nb_rx_desc)) > - dev->rx_pkt_burst =3D > - ixgbe_recv_scattered_pkts_vec; > - else > -#endif > - dev->rx_pkt_burst =3D > - ixgbe_recv_pkts_lro_single_alloc; > } > } >=20 > @@ -4640,6 +4631,8 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) > IXGBE_PSRTYPE_RQPL_SHIFT; > IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype); >=20 > + ixgbe_set_rx_function(dev); > + > return 0; > } >=20 Acked-by: Konstantin Ananyev > -- > 1.9.3