[dpdk-dev,v2,2/2] net/ixgbe: fix missing Port Representor data-path

Message ID 20180511122845.22757-3-remy.horton@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Remy Horton May 11, 2018, 12:28 p.m. UTC
  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 <remy.horton@intel.com>
---
 drivers/net/ixgbe/ixgbe_vf_representor.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
  

Comments

Mohammad Abdul Awal May 11, 2018, 2:04 p.m. UTC | #1
On 11/05/2018 13:28, 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 <remy.horton@intel.com>
> ---
>   drivers/net/ixgbe/ixgbe_vf_representor.c | 22 +++++++++++++++++++---
>   1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
> index 8f8af49..db516d9 100644
> --- a/drivers/net/ixgbe/ixgbe_vf_representor.c
> +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
> @@ -153,6 +153,20 @@ 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,
> +	__rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
> +{
> +	return 0;
> +}
> +
>   int
>   ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
>   {
> @@ -182,9 +196,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;
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
  
Ferruh Yigit May 11, 2018, 4:08 p.m. UTC | #2
On 5/11/2018 3:04 PM, Mohammad Abdul Awal wrote:
> 
> 
> On 11/05/2018 13:28, 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 <remy.horton@intel.com>

> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
index 8f8af49..db516d9 100644
--- a/drivers/net/ixgbe/ixgbe_vf_representor.c
+++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
@@ -153,6 +153,20 @@  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,
+	__rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
+{
+	return 0;
+}
+
 int
 ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 {
@@ -182,9 +196,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;