DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id
@ 2022-11-16 12:11 madhuker.mythri
  2022-12-07 17:21 ` Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: madhuker.mythri @ 2022-11-16 12:11 UTC (permalink / raw)
  To: grive; +Cc: dev, Madhuker Mythri

From: Madhuker Mythri <madhuker.mythri@oracle.com>

Crash occurring while the DPDK secondary processes trying to probe the
tap-device, where tap-device is a sub-device of Fail-safe device.
Some-times we get in-valid sub-devices(with the in-valid port-id's),
due to which the IPC communication does not get response and causes the
communication failures b/w primary/secondary process.
So, need to validate the sub-device(tap) while secondary process probe in
the Fail-safe PMD, to avoid such issues.

Bugzilla Id: 1116

Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
---
 drivers/net/failsafe/failsafe.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 32811403b4..51d4440ac7 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -361,6 +361,9 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
 			if (sdev->devargs.name[0] == '\0')
 				continue;
 
+			if (!rte_eth_dev_is_valid_port(PORT_ID(sdev)))
+				continue;
+
 			/* rebuild devargs to be able to get the bus name. */
 			ret = rte_devargs_parse(&devargs,
 						sdev->devargs.name);
-- 
2.32.0.windows.1


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

* Re: [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id
  2022-11-16 12:11 [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id madhuker.mythri
@ 2022-12-07 17:21 ` Ferruh Yigit
  2023-10-17 16:49   ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2022-12-07 17:21 UTC (permalink / raw)
  To: madhuker.mythri, grive; +Cc: dev

On 11/16/2022 12:11 PM, madhuker.mythri@oracle.com wrote:
> From: Madhuker Mythri <madhuker.mythri@oracle.com>
> 
> Crash occurring while the DPDK secondary processes trying to probe the
> tap-device, where tap-device is a sub-device of Fail-safe device.
> Some-times we get in-valid sub-devices(with the in-valid port-id's),
> due to which the IPC communication does not get response and causes the
> communication failures b/w primary/secondary process.
> So, need to validate the sub-device(tap) while secondary process probe in
> the Fail-safe PMD, to avoid such issues.
> 
> Bugzilla Id: 1116
> 
> Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
> ---
>  drivers/net/failsafe/failsafe.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
> index 32811403b4..51d4440ac7 100644
> --- a/drivers/net/failsafe/failsafe.c
> +++ b/drivers/net/failsafe/failsafe.c
> @@ -361,6 +361,9 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
>  			if (sdev->devargs.name[0] == '\0')
>  				continue;
>  
> +			if (!rte_eth_dev_is_valid_port(PORT_ID(sdev)))
> +				continue;
> +


This is in the 'FOREACH_SUBDEV()' block, why an invalid subdevice
provided by the macro?

Instead of invalid port check, should we fix the macro?

Overall I am not clear why this defect occurs, bugzilla report also
don't have much detail.
Can you please provide more details why this defect happens?


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

* Re: [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id
  2022-12-07 17:21 ` Ferruh Yigit
@ 2023-10-17 16:49   ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-10-17 16:49 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: madhuker.mythri, grive, dev

On Wed, 7 Dec 2022 17:21:42 +0000
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> This is in the 'FOREACH_SUBDEV()' block, why an invalid subdevice
> provided by the macro?
> 
> Instead of invalid port check, should we fix the macro?
> 
> Overall I am not clear why this defect occurs, bugzilla report also
> don't have much detail.
> Can you please provide more details why this defect happens?

This looks like a duplicate of same problem Oracle was having when there was
a race during setup and secondary process failed.

https://patchwork.dpdk.org/project/dpdk/patch/20211021214215.1633-1-vipul.ashri@oracle.com/

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

* Re: [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id
  2022-11-16  9:52 madhuker.mythri
@ 2022-11-16 17:51 ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2022-11-16 17:51 UTC (permalink / raw)
  To: madhuker.mythri; +Cc: grive, dev

On Wed, 16 Nov 2022 15:22:24 +0530
madhuker.mythri@oracle.com wrote:

>  
> +			if (!rte_eth_dev_is_valid_port(PORT_ID(sdev))) {
> +				continue;
> +			}
> +

Looks ok but DPDK follows kernel style {} is unnecessary on single statement.
Checkpatch will give you warnings on this.

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

* [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id
@ 2022-11-16  9:52 madhuker.mythri
  2022-11-16 17:51 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: madhuker.mythri @ 2022-11-16  9:52 UTC (permalink / raw)
  To: grive; +Cc: dev, Madhuker Mythri

From: Madhuker Mythri <madhuker.mythri@oracle.com>

Crash occuring while the DPDK secondary processes trying to probe the tap-device, where tap-device is a sub-device of Fail-safe device.
Some-times we get in-valid sub-devices(with the in-valid port-id’s and device-names), due to which the IPC communication does not get response and causes the communication failures b/w primary/secondary process.
So, need to validate the sub-device(tap) while secondary process probe in the Fail-safe PMD, to avoid such issues.
Bugzilla Id: 1116

Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
---
 drivers/net/failsafe/failsafe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 32811403b4..3663976697 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -361,6 +361,10 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
 			if (sdev->devargs.name[0] == '\0')
 				continue;
 
+			if (!rte_eth_dev_is_valid_port(PORT_ID(sdev))) {
+				continue;
+			}
+
 			/* rebuild devargs to be able to get the bus name. */
 			ret = rte_devargs_parse(&devargs,
 						sdev->devargs.name);
-- 
2.32.0.windows.1


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

end of thread, other threads:[~2023-10-17 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 12:11 [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id madhuker.mythri
2022-12-07 17:21 ` Ferruh Yigit
2023-10-17 16:49   ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2022-11-16  9:52 madhuker.mythri
2022-11-16 17:51 ` Stephen Hemminger

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