net/failsafe: Fix crash due to in-valid sub-device port id
Checks
Commit Message
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(+)
Comments
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.
@@ -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);