DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/af_xdp: allow operation when multiprocess is disabled
@ 2022-02-16 15:59 Junxiao Shi
  2022-02-17 11:09 ` [PATCH v2] " Junxiao Shi
  0 siblings, 1 reply; 5+ messages in thread
From: Junxiao Shi @ 2022-02-16 15:59 UTC (permalink / raw)
  To: dev

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..7f23097c5f 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] net/af_xdp: allow operation when multiprocess is disabled
  2022-02-16 15:59 [PATCH] net/af_xdp: allow operation when multiprocess is disabled Junxiao Shi
@ 2022-02-17 11:09 ` Junxiao Shi
  2022-02-17 12:46   ` David Marchand
  2022-02-17 13:29   ` Loftus, Ciara
  0 siblings, 2 replies; 5+ messages in thread
From: Junxiao Shi @ 2022-02-17 11:09 UTC (permalink / raw)
  To: dev

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net/af_xdp: allow operation when multiprocess is disabled
  2022-02-17 11:09 ` [PATCH v2] " Junxiao Shi
@ 2022-02-17 12:46   ` David Marchand
  2022-02-17 13:29   ` Loftus, Ciara
  1 sibling, 0 replies; 5+ messages in thread
From: David Marchand @ 2022-02-17 12:46 UTC (permalink / raw)
  To: Junxiao Shi; +Cc: dev, Yigit, Ferruh, Ciara Loftus

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.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] net/af_xdp: allow operation when multiprocess is disabled
  2022-02-17 11:09 ` [PATCH v2] " Junxiao Shi
  2022-02-17 12:46   ` David Marchand
@ 2022-02-17 13:29   ` Loftus, Ciara
  2022-02-17 17:29     ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Loftus, Ciara @ 2022-02-17 13:29 UTC (permalink / raw)
  To: Junxiao Shi, dev

> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net/af_xdp: allow operation when multiprocess is disabled
  2022-02-17 13:29   ` Loftus, Ciara
@ 2022-02-17 17:29     ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2022-02-17 17:29 UTC (permalink / raw)
  To: Loftus, Ciara, Junxiao Shi, dev

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-17 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 15:59 [PATCH] net/af_xdp: allow operation when multiprocess is disabled Junxiao Shi
2022-02-17 11:09 ` [PATCH v2] " Junxiao Shi
2022-02-17 12:46   ` David Marchand
2022-02-17 13:29   ` Loftus, Ciara
2022-02-17 17:29     ` Ferruh Yigit

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).