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 2E36556A1 for ; Wed, 9 May 2018 17:00:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 08:00:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,381,1520924400"; d="scan'208";a="47930764" Received: from rhorton-mobl1.ger.corp.intel.com (HELO FC23.ir.intel.com) ([163.33.230.88]) by FMSMGA003.fm.intel.com with ESMTP; 09 May 2018 08:00:07 -0700 From: Remy Horton To: dev@dpdk.org Cc: Qi Zhang , Beilei Xing , Ferruh Yigit Date: Wed, 9 May 2018 16:00:05 +0100 Message-Id: <20180509150005.2531-1-remy.horton@intel.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/i40e: 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: Wed, 09 May 2018 15:00:09 -0000 This patch adds Rx and Tx burst functions to the i40e Port Representors, so that the implementation within this PMD can be tested using applications such as testpmd which require data-path functionality. Fixes: e0cb96204b71 ("net/i40e: add support for representor ports") Signed-off-by: Remy Horton --- drivers/net/i40e/i40e_vf_representor.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 96b3787..e205019 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -337,6 +337,25 @@ struct eth_dev_ops i40e_representor_dev_ops = { }; +static uint16_t +i40e_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 +i40e_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]); + return nb_pkts; +} + int i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) { @@ -365,9 +384,11 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) /* Set representor device ops */ ethdev->dev_ops = &i40e_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 = i40e_vf_representor_rx_burst; + ethdev->tx_pkt_burst = i40e_vf_representor_tx_burst; vf = &pf->vfs[representor->vf_id]; -- 2.9.5