DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 3/4] net/txgbe: remove port representor
Date: Tue, 27 Apr 2021 17:46:15 +0100	[thread overview]
Message-ID: <2e535676-2d8e-5fb2-ceb7-2f3da4831c0a@intel.com> (raw)
In-Reply-To: <20210425080347.20376-4-jiawenwu@trustnetic.com>

On 4/25/2021 9:03 AM, Jiawen Wu wrote:
> Remove port representor in device probe process.
> 

It can be good to highlight that is because port representor is not supported by
the driver.

> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  drivers/net/txgbe/txgbe_ethdev.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index 87c041c2ec..afb25fb8a0 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -930,32 +930,15 @@ static int
>  eth_txgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  		struct rte_pci_device *pci_dev)
>  {
> -	struct rte_eth_dev *pf_ethdev;
> -	struct rte_eth_devargs eth_da;
>  	int retval;
>  
> -	if (pci_dev->device.devargs) {
> -		retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
> -				&eth_da);
> -		if (retval)
> -			return retval;
> -	} else {
> -		memset(&eth_da, 0, sizeof(eth_da));
> -	}
> -
>  	retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
>  			sizeof(struct txgbe_adapter),
>  			eth_dev_pci_specific_init, pci_dev,
>  			eth_txgbe_dev_init, NULL);
>  
> -	if (retval || eth_da.nb_representor_ports < 1)
> +	if (retval)
>  		return retval;
> -	if (eth_da.type != RTE_ETH_REPRESENTOR_VF)
> -		return -ENOTSUP;
> -
> -	pf_ethdev = rte_eth_dev_allocated(pci_dev->device.name);
> -	if (pf_ethdev == NULL)
> -		return -ENODEV;
>  

After patch it becomes:

if (retval)
	return retval;
return 0;

Why not just "return retval"? Or even can eliminate the 'retval' variable.


>  	return 0;
>  }
> @@ -966,7 +949,7 @@ static int eth_txgbe_pci_remove(struct rte_pci_device *pci_dev)
>  
>  	ethdev = rte_eth_dev_allocated(pci_dev->device.name);
>  	if (!ethdev)
> -		return -ENODEV;
> +		return 0;
>  
>  	return rte_eth_dev_destroy(ethdev, eth_txgbe_dev_uninit);
>  }
> 


  reply	other threads:[~2021-04-27 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  8:03 [dpdk-dev] [PATCH 0/4] Fixes for txgbe Jiawen Wu
2021-04-25  8:03 ` [dpdk-dev] [PATCH 1/4] net/txgbe: fix RSS in double VALN Jiawen Wu
2021-04-27 16:42   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2021-04-25  8:03 ` [dpdk-dev] [PATCH 2/4] net/txgbe: fix VF MTU limit setting Jiawen Wu
2021-04-27 16:44   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2021-04-25  8:03 ` [dpdk-dev] [PATCH 3/4] net/txgbe: remove port representor Jiawen Wu
2021-04-27 16:46   ` Ferruh Yigit [this message]
2021-04-25  8:03 ` [dpdk-dev] [PATCH 4/4] net/txgbe: add copyright owner Jiawen Wu
2021-04-27 16:50   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e535676-2d8e-5fb2-ceb7-2f3da4831c0a@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).