From patchwork Wed Nov 16 12:11:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhuker Mythri X-Patchwork-Id: 119890 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 28056A055A; Wed, 16 Nov 2022 13:11:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0810640E03; Wed, 16 Nov 2022 13:11:57 +0100 (CET) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by mails.dpdk.org (Postfix) with ESMTP id 3108C40DFB for ; Wed, 16 Nov 2022 13:11:55 +0100 (CET) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AGBWaeh003361; Wed, 16 Nov 2022 12:11:55 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-transfer-encoding; s=corp-2022-7-12; bh=LbUHfuSs/D8m2YSZii+48D0x66KrV/doe4P0vWad5xM=; b=Zq+ncRNmxUENlbeDDmLrR8y7Uvhm1badDQjcGQ4TsqxM2JxxOXn3QLJX2xBVzVbVoPfS 5I0J5jnAwEI3QWAZCoO7oz1J6b8FtKW22g2R6H/nMNvggw3BbfgVCqZlFm/PTF0FG+z3 8NAEkFh9oCN7jgTLtQ4HRs+WAH+czlRDqTji7EEGKhLluaDPf1Lug/dlsV9JcvQC+0Yh FxUoFAdto0eSORI6tZqnUGBIK/O3I+OnWVjMg7t0CRWHg8mgIbGjcoDqdOXptAbpyHn8 1l58cHcsEdh52Z7PHSgtvpCWPOnJBPb5aONFnHrQIIKUCJSUmCzXpb5wO4o7/r5oM05v Ag== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kv3hdveby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 12:11:55 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AGBt4af016789; Wed, 16 Nov 2022 12:11:54 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kuk1x5kqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 12:11:54 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AGCBrcj003794; Wed, 16 Nov 2022 12:11:53 GMT Received: from mmythri-7410.in.oracle.com (dhcp-10-191-207-105.vpn.oracle.com [10.191.207.105]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3kuk1x5kn9-1; Wed, 16 Nov 2022 12:11:52 +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 17:41:21 +0530 Message-Id: <20221116121121.1969-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-16_03,2022-11-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160085 X-Proofpoint-ORIG-GUID: A0TbscYifggoJnhVSQ1_wQ94XTKlmOXq X-Proofpoint-GUID: A0TbscYifggoJnhVSQ1_wQ94XTKlmOXq 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 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 --- 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);