Skip to contentSkip to conversation

net/af_xdp: allow operation when multiprocess is disabled

PATCH Superseded Junxiao Shi 4 participants 5 messages Feb 16, 2022 – Feb 17, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
index 6ac710c6bd..7f23097c5f 100644
@@ -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;
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 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")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
index 6ac710c6bd..2163df7c5c 100644
@@ -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;
Signature · 1 line
2.17.1
#2 lore raw
Quoted 28 lines · Junxiao Shi

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")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -2
index 6ac710c6bd..2163df7c5c 100644
@@ -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;
--
Quoted 2 lines

2.17.1

I just encountered the same issue.
Patch lgtm.

Signature · 1 line
David Marchand
Acked-by on v2 1/1
#3 lore raw
In reply to Junxiao Shi
Quoted 9 lines

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.

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

Thanks for the patch!

Quoted 24 lines
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +0 -0
index 6ac710c6bd..2163df7c5c 100644
@@ -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 */

drivers/net/af_xdp/rte_eth_af_xdp.c +0 -0
 	if (!afxdp_dev_count) {
 		ret = rte_mp_action_register(ETH_AF_XDP_MP_KEY,

afxdp_mp_send_fds);

drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
-		if (ret < 0) {
+		if (ret < 0 && rte_errno != ENOTSUP) {
 			AF_XDP_LOG(ERR, "%s: Failed to register multi-

process IPC callback: %s",

drivers/net/af_xdp/rte_eth_af_xdp.c +0 -1
 				   name, strerror(rte_errno));
 			return -1;
--

2.17.1

Applied
#4 lore raw
Quoted 9 lines · Ciara
Quoted 9 lines

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.

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

Thanks for the patch!

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