net/af_xdp: do not attempt probe for secondary processes

Message ID 20210930134604.32585-1-ciara.loftus@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/af_xdp: do not attempt probe for secondary processes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Loftus, Ciara Sept. 30, 2021, 1:46 p.m. UTC
  Since the AF_XDP PMD does not work for secondary processes as reported
in Bugzilla 805, check for the process type at the beginning of probe
and return ENOTSUP if the process type is secondary.

Bugzilla ID: 805
Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
  

Comments

Stephen Hemminger Sept. 30, 2021, 3:18 p.m. UTC | #1
On Thu, 30 Sep 2021 13:46:04 +0000
Ciara Loftus <ciara.loftus@intel.com> wrote:

> Since the AF_XDP PMD does not work for secondary processes as reported
> in Bugzilla 805, check for the process type at the beginning of probe
> and return ENOTSUP if the process type is secondary.
> 
> Bugzilla ID: 805
> Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> Reported-by: Stephen Hemminger <stephen@networkplumber.org>

Thanks for fixing.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Ferruh Yigit Oct. 5, 2021, 3:06 p.m. UTC | #2
On 9/30/2021 2:46 PM, Ciara Loftus wrote:
> Since the AF_XDP PMD does not work for secondary processes as reported
> in Bugzilla 805, check for the process type at the beginning of probe
> and return ENOTSUP if the process type is secondary.
> 

Hi Ciara,

'Do not attempt probe for secondary process' practically means disabling the
secondary process support for af_xdp, what to you think highlight this in
the patch title?

Also can you please add a brief release notes update, for the possible
af_xdp secondary process users.

And would you mind putting the discussed plan to the commit log to record it,
to support the secondary process fully in 22.02 etc..

Thanks,
ferruh

> Bugzilla ID: 805
> Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> Reported-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   drivers/net/af_xdp/rte_eth_af_xdp.c | 15 +++++----------
>   1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 9bea0a895a..d61cb0aa7c 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -1790,16 +1790,11 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
>   		rte_vdev_device_name(dev));
>   
>   	name = rte_vdev_device_name(dev);
> -	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
> -		strlen(rte_vdev_device_args(dev)) == 0) {
> -		eth_dev = rte_eth_dev_attach_secondary(name);
> -		if (eth_dev == NULL) {
> -			AF_XDP_LOG(ERR, "Failed to probe %s\n", name);
> -			return -EINVAL;
> -		}
> -		eth_dev->dev_ops = &ops;
> -		rte_eth_dev_probing_finish(eth_dev);
> -		return 0;
> +	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
> +		AF_XDP_LOG(ERR, "Failed to probe %s. "
> +				"AF_XDP PMD does not support secondary processes.\n",
> +				name);
> +		return -ENOTSUP;
>   	}
>   
>   	kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments);
>
  

Patch

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 9bea0a895a..d61cb0aa7c 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1790,16 +1790,11 @@  rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
 		rte_vdev_device_name(dev));
 
 	name = rte_vdev_device_name(dev);
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-		strlen(rte_vdev_device_args(dev)) == 0) {
-		eth_dev = rte_eth_dev_attach_secondary(name);
-		if (eth_dev == NULL) {
-			AF_XDP_LOG(ERR, "Failed to probe %s\n", name);
-			return -EINVAL;
-		}
-		eth_dev->dev_ops = &ops;
-		rte_eth_dev_probing_finish(eth_dev);
-		return 0;
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		AF_XDP_LOG(ERR, "Failed to probe %s. "
+				"AF_XDP PMD does not support secondary processes.\n",
+				name);
+		return -ENOTSUP;
 	}
 
 	kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments);