From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E24D71C0E0 for ; Fri, 11 May 2018 12:49:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2018 03:49:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,388,1520924400"; d="scan'208";a="45158174" Received: from awalabdu-mobl.ger.corp.intel.com (HELO [163.33.228.102]) ([163.33.228.102]) by fmsmga002.fm.intel.com with ESMTP; 11 May 2018 03:49:22 -0700 To: Remy Horton , dev@dpdk.org Cc: Konstantin Ananyev , Wenzhuo Lu , Ferruh Yigit References: <20180509150013.2581-1-remy.horton@intel.com> From: Mohammad Abdul Awal Message-ID: <0b6c9f40-080b-59a3-48fd-ff582c0aa8ba@intel.com> Date: Fri, 11 May 2018 11:49:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180509150013.2581-1-remy.horton@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [DPDK] net/ixgbe: fix missing Port Representor data-path callbacks 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: , X-List-Received-Date: Fri, 11 May 2018 10:49:26 -0000 On 09/05/2018 16:00, Remy Horton wrote: > This patch adds Rx and Tx burst functions to the ixgbe > Port Representors, so that the implementation within > ixgbe PMD can be tested using applications such as > testpmd which require data-path functionality. > > Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") > > Signed-off-by: Remy Horton > --- > drivers/net/ixgbe/ixgbe_vf_representor.c | 27 ++++++++++++++++++++++++--- > 1 file changed, 24 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c > index 8f8af49..21c44d1 100644 > --- a/drivers/net/ixgbe/ixgbe_vf_representor.c > +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c > @@ -153,6 +153,25 @@ struct eth_dev_ops ixgbe_vf_representor_dev_ops = { > .mac_addr_set = ixgbe_vf_representor_mac_addr_set, > }; > > +static uint16_t > +ixgbe_vf_representor_rx_burst(__rte_unused void *rx_queue, > + __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) > +{ > + return 0; > +} > + > +static uint16_t > +ixgbe_vf_representor_tx_burst(__rte_unused void *tx_queue, > + struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) > +{ > + uint16_t idx_pkt; > + > + for (idx_pkt = 0; idx_pkt < nb_pkts; idx_pkt++) > + rte_pktmbuf_free(tx_pkts[idx_pkt]); We should not free them in the driver silently whereas the application will think that it has been sent successfully. Please use the same rule for rx_burst, and return 0. > + return nb_pkts; > +} > + > int > ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) > { > @@ -182,9 +201,11 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) > /* Set representor device ops */ > ethdev->dev_ops = &ixgbe_vf_representor_dev_ops; > > - /* No data-path so no RX/TX functions */ > - ethdev->rx_pkt_burst = NULL; > - ethdev->tx_pkt_burst = NULL; > + /* No data-path, but need stub Rx/Tx functions to avoid crash > + * when testing with the likes of testpmd. > + */ > + ethdev->rx_pkt_burst = ixgbe_vf_representor_rx_burst; > + ethdev->tx_pkt_burst = ixgbe_vf_representor_tx_burst; > > /* Setting the number queues allocated to the VF */ > ethdev->data->nb_rx_queues = IXGBE_VF_MAX_RX_QUEUES;