[v2] net/af_xdp: allow operation when multiprocess is disabled

Message ID 2c422567d3640972@cs.arizona.edu (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/af_xdp: allow operation when multiprocess is disabled |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Junxiao Shi Feb. 17, 2022, 11:09 a.m. UTC
  If EAL multiprocess feature has been disabled via rte_mp_disable()
function, AF_XDP driver may not be able to register its IPC callback.
Previously this leads to probe failure.
This commit adds a check for this condition so that AF_XDP can still be
used even if multiprocess is disabled.

Fixes: 9876cf8316b3 ("net/af_xdp: re-enable secondary process support")

Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Feb. 17, 2022, 12:46 p.m. UTC | #1
On Thu, Feb 17, 2022 at 12:14 PM Junxiao Shi <git@mail1.yoursunny.com> wrote:
>
> If EAL multiprocess feature has been disabled via rte_mp_disable()
> function, AF_XDP driver may not be able to register its IPC callback.
> Previously this leads to probe failure.
> This commit adds a check for this condition so that AF_XDP can still be
> used even if multiprocess is disabled.
>
> Fixes: 9876cf8316b3 ("net/af_xdp: re-enable secondary process support")
>
> Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 6ac710c6bd..2163df7c5c 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -1995,7 +1995,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
>         /* Register IPC callback which shares xsk fds from primary to secondary */
>         if (!afxdp_dev_count) {
>                 ret = rte_mp_action_register(ETH_AF_XDP_MP_KEY, afxdp_mp_send_fds);
> -               if (ret < 0) {
> +               if (ret < 0 && rte_errno != ENOTSUP) {
>                         AF_XDP_LOG(ERR, "%s: Failed to register multi-process IPC callback: %s",
>                                    name, strerror(rte_errno));
>                         return -1;
> --
> 2.17.1
>

I just encountered the same issue.
Patch lgtm.
  
Loftus, Ciara Feb. 17, 2022, 1:29 p.m. UTC | #2
> Subject: [PATCH v2] net/af_xdp: allow operation when multiprocess is
> disabled
> 
> If EAL multiprocess feature has been disabled via rte_mp_disable()
> function, AF_XDP driver may not be able to register its IPC callback.
> Previously this leads to probe failure.
> This commit adds a check for this condition so that AF_XDP can still be
> used even if multiprocess is disabled.
> 
> Fixes: 9876cf8316b3 ("net/af_xdp: re-enable secondary process support")
> 
> Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>

Thanks for the patch!

Acked-by: Ciara Loftus <ciara.loftus@intel.com>

> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c
> b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 6ac710c6bd..2163df7c5c 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -1995,7 +1995,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device
> *dev)
>  	/* Register IPC callback which shares xsk fds from primary to
> secondary */
>  	if (!afxdp_dev_count) {
>  		ret = rte_mp_action_register(ETH_AF_XDP_MP_KEY,
> afxdp_mp_send_fds);
> -		if (ret < 0) {
> +		if (ret < 0 && rte_errno != ENOTSUP) {
>  			AF_XDP_LOG(ERR, "%s: Failed to register multi-
> process IPC callback: %s",
>  				   name, strerror(rte_errno));
>  			return -1;
> --
> 2.17.1
  
Ferruh Yigit Feb. 17, 2022, 5:29 p.m. UTC | #3
On 2/17/2022 1:29 PM, Loftus, Ciara wrote:
>> Subject: [PATCH v2] net/af_xdp: allow operation when multiprocess is
>> disabled
>>
>> If EAL multiprocess feature has been disabled via rte_mp_disable()
>> function, AF_XDP driver may not be able to register its IPC callback.
>> Previously this leads to probe failure.
>> This commit adds a check for this condition so that AF_XDP can still be
>> used even if multiprocess is disabled.
>>
>> Fixes: 9876cf8316b3 ("net/af_xdp: re-enable secondary process support")
>>
>> Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
> 
> Thanks for the patch!
> 
> Acked-by: Ciara Loftus <ciara.loftus@intel.com>
> 

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

Patch

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 6ac710c6bd..2163df7c5c 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1995,7 +1995,7 @@  rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
 	/* Register IPC callback which shares xsk fds from primary to secondary */
 	if (!afxdp_dev_count) {
 		ret = rte_mp_action_register(ETH_AF_XDP_MP_KEY, afxdp_mp_send_fds);
-		if (ret < 0) {
+		if (ret < 0 && rte_errno != ENOTSUP) {
 			AF_XDP_LOG(ERR, "%s: Failed to register multi-process IPC callback: %s",
 				   name, strerror(rte_errno));
 			return -1;