From patchwork Wed Nov 16 09:52:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Madhuker Mythri X-Patchwork-Id: 119886 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3D03A0553; Wed, 16 Nov 2022 10:52:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C553C40DFB; Wed, 16 Nov 2022 10:52:59 +0100 (CET) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by mails.dpdk.org (Postfix) with ESMTP id 6BF0F400EF for ; Wed, 16 Nov 2022 10:52:58 +0100 (CET) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AG8Ow4O000886; Wed, 16 Nov 2022 09:52:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2022-7-12; bh=AEuIOWjo5ZR8uPsyxpaTbMR6VmEbuRD6lHko+ZrObpo=; b=vsJwCZCvqhyPmJh2bdrf13wo7SDRhr6MaeHtBcyWEHdbZmi67tZIiAGZCvuwEOKrtiAq 0TSx2B3jI8VBDN5/fcLCZsbhT1H8BgSpwn2DgRtafORr/anNZmlnoqXQxR9DooyTpKlv lWOk1nuRSMLofiKBnKeJWG4EjqazrvAh/IeIWuGTf3z+F313WHqZ5Y3zlaW+aPPprubL rBCifiYnwInyvXZ0CUJFSGmDjMgHqEklNDndOEFM8gzcjCTtY4D4Dnuig/V3WZBeeYeX PvUZ8id9vIIYb1iSjWFSF+CkgQqnJvLeIyWO4uJ7sTcIueWStGDqC+ZP3gmVYjokdje0 8g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kv3ns4bpk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 09:52:57 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AG8geOK034835; Wed, 16 Nov 2022 09:52:56 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kt1x75f07-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 09:52:56 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AG9pwj8034027; Wed, 16 Nov 2022 09:52:56 GMT Received: from mmythri-7410.in.oracle.com (dhcp-10-191-207-105.vpn.oracle.com [10.191.207.105]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3kt1x75ey1-1; Wed, 16 Nov 2022 09:52:56 +0000 From: madhuker.mythri@oracle.com To: grive@u256.net Cc: dev@dpdk.org, Madhuker Mythri Subject: [PATCH] net/failsafe: Fix crash due to in-valid sub-device port id Date: Wed, 16 Nov 2022 15:22:24 +0530 Message-Id: <20221116095224.1576-1-madhuker.mythri@oracle.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-15_08,2022-11-15_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 mlxlogscore=980 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160069 X-Proofpoint-GUID: F8xEmx3XxKWTdSOmNBem2t9cEvhPSq6c X-Proofpoint-ORIG-GUID: F8xEmx3XxKWTdSOmNBem2t9cEvhPSq6c X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Madhuker Mythri 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 --- 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);