From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1370F41BB9; Fri, 3 Feb 2023 08:58:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8328410D7; Fri, 3 Feb 2023 08:58:02 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2112.outbound.protection.outlook.com [40.107.100.112]) by mails.dpdk.org (Postfix) with ESMTP id 1D5A64014F for ; Fri, 3 Feb 2023 08:58:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oFLqvAv6dO9RD5zZh7hnBAqSxVb29snWs7cUQe+SJWPXmFShYSslaRDGOMnjpauxhTDTXgoJVsP3OmnguMfg/KrLPWv9HMwy5x9wnBexTQuQA/zY2v/0asPQFXw0THahUBwkrCyjMn2iR+3wjhoLzQtSDSx1pEsfzb94eYujwCv8zUKpfyl1pmG5cm60LDvFZKbHt4gFVPFeZbtnLULyWMzhALuF1Ov5Hm0cJONT9C6QQ0Fhc8JpfwOC8jlFx7Qp9ETxtTVewffxK5dSx+4bFRYklsX7Strb1iIU1YuPApM1umGJGmpzugwlkMZwRxfUcu+qahmcI6HSPA7m7JD3fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b8j3wqzu7kxS5gZkqLqq7q0RIiVMfwB/asQbtfd5jkI=; b=afOfNElmJFPOpzThAKuPrqk+ingX7/e29LKHEWb1mJqUG+1zpENE1CBZYXp5+y8iSiQEFoKixkAD23XTlcX+dMfsCQvck1BFyo7jxP/sX39fily1FU0FuJ4eoRj9M31NYN+RhsLSR9dG6W+dtJxr5eODiEMvosOT7eMzxq5zJXiXOrnzgMwjznJkrPY3RQ4HcTFI5crJhP1M0/JLb5ndzEez/ib/Jaypbk5g0fQq7HZkUCJOxarWcjD/83RHkE/vVzHUmCYMso7UOH4UGoILYuxQu4uV3qooHlKr21Mc5oCVDMVxKOUIIjhHrnHbG8Zg806muD4SkkEEyCTf0VMWXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b8j3wqzu7kxS5gZkqLqq7q0RIiVMfwB/asQbtfd5jkI=; b=m89htRMtXFeiXiU8taOQ32t/jcY7nNCbq7XF81wFNKcjqdmkUWQb49lwNB1n6uC5aDpt15tOPnPJCKh2FsdA/AvaI4fmP/14VKjP5l1cXCvKiPHNchMZf5ksPv3c2s6CrpDdcH4k9rHeEmPFyMLh/0kaAiLXSp/P6x3T08K3MRE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH8PR13MB6292.namprd13.prod.outlook.com (2603:10b6:510:257::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Fri, 3 Feb 2023 07:57:59 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%4]) with mapi id 15.20.6064.027; Fri, 3 Feb 2023 07:57:59 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, James Hershaw , Chaoyong He Subject: [PATCH 1/3] net/nfp: remove panic usage during reconfig Date: Fri, 3 Feb 2023 15:57:34 +0800 Message-Id: <20230203075736.18616-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20230203075736.18616-1-chaoyong.he@corigine.com> References: <20230203075736.18616-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0014.apcprd01.prod.exchangelabs.com (2603:1096:4:191::17) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH8PR13MB6292:EE_ X-MS-Office365-Filtering-Correlation-Id: 9044f897-351a-4c5c-4ac6-08db05bc5e31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0fzOHcLZt/M2y/q1m33f5VfpglINnCJoiAM4Mm+IfzwNevzlvpJro7p4Bh30qSyAXBfSFIxKRc4hW2UBxN74zmHg/cpnDmYzZobn5aKZpa+aI+RfT2927h9/Du/GB+ytYHLA/+YkuwSOgYiqJegk308Z+98Mt/+ozbfPYzdFAsCkN6ClnAlgR5HWN7dqKIng8FdUwlX7jSJj1Q+6GxB88ynVJviiv3W/lo4tOz+v3sxEN02KZZ40v26PYJgsQsDG65slodIdEsidMxJfWuOMFp+4pyLNXfe6SDvCGmCMEl8EE/2lDBz836pdr+PHU12l+sCybqwvK1gz2M+bTkrEMuQmLLr6bFNSKrw6BtkZbwHCyEtM5la8Exmq8tj+UiwBybBsBBShtcc+ukjtdzwakYorZ5mEIpXy9cqEUURZXu9jXUSaflCXHUYrrjwi2zme+h+H7b5T+9Qj5AtsqU2CeI8yXtAtXKR1NLc/09gTHJmSehEO952XPmhE8zWn6+q36h6ZzoX6WXwwGYulIfufGsKvBBwVKt7RGyexnwfbLYI+WetuIF6DKoMmuyqt12VbPqUjMQauZhSs213vWY9b6CcvInzawCie95eEgSfutZ8f1aYrkdQ4WD8rbq1f22yCoC51NHdiKGrh3AHao7ucw3sALEUNWcjh6/9AXckHbGDd//Mr/jIkg8Bo8TpNI9LmsL7Xn9KXz9my6Khvc22m5dFlZomky5/cROXv4l485ceZTbmzMYs6aApYZEFQo99g X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(366004)(39840400004)(136003)(376002)(396003)(451199018)(26005)(186003)(86362001)(6512007)(6506007)(1076003)(107886003)(6666004)(478600001)(6486002)(38100700002)(38350700002)(52116002)(2616005)(36756003)(2906002)(8936002)(5660300002)(44832011)(41300700001)(83380400001)(66556008)(66946007)(4326008)(66476007)(6916009)(8676002)(54906003)(316002)(66574015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEZaT0I2Q0tXc09FaXJzWUl5djJiWW5Da09QYXBkLzQwREEwMjdEem1ObkpH?= =?utf-8?B?WGRXNzRTMFlNdXMrSDd5ZFR1L3dEMlVsMnJMNzJicFNKNFR3Q1RnNXZTeHhx?= =?utf-8?B?NU5SbnJyanU4NFlJUTRoMjdKTHIxeE9PNUxjL3lETjUrM3FaeERxclU1OTZk?= =?utf-8?B?VndzWmlzTnlBOTREMmhabEVrd1E0UXB5Y0ZCWkpWTFVyNzhVZlUxeHRCdVRh?= =?utf-8?B?cFQxMGZPNysySEpkYXVzelJVODVRdkQyMDNkUFFFSjdQZUR1WGh3c1labjdD?= =?utf-8?B?Wi9PTW95bDdLRVZaMDZCdExYajNMUW8zR2ZCZ0R2aGx0eWtiZlFQ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HlxWkNBZnEvcFhWSlVaWGtpbUZCNTNpd1paQXl3MnlZQ3FuTGNuSXlF?= =?utf-8?B?VEE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9044f897-351a-4c5c-4ac6-08db05bc5e31 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 07:57:59.6898 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /HdOXVybSF7JrPAxNWSczWDjXTWu3obeXn7mD9a7eEIo+7Xa5ZerZei7vhUZh1fvlx8KXOq3vHmr6hznKKlAggt4TGYSp8vD1zi4Rwz2GlI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR13MB6292 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: James Hershaw Remove usage of the rte_panic() function from the nfp PMD. It is better to return error values and allow the application to handle the error. Signed-off-by: James Hershaw Reviewed-by: Niklas Söderlund Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_common.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 4f21d9978d..7a60add3a6 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -63,8 +63,10 @@ __nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t update) PMD_DRV_LOG(DEBUG, "Writing to the configuration queue (%p)...", hw->qcp_cfg); - if (hw->qcp_cfg == NULL) - rte_panic("Bad configuration queue pointer\n"); + if (hw->qcp_cfg == NULL) { + PMD_INIT_LOG(ERR, "Bad configuration queue pointer"); + return -ENXIO; + } nfp_qcp_ptr_add(hw->qcp_cfg, NFP_QCP_WRITE_PTR, 1); @@ -85,7 +87,7 @@ __nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t update) if (cnt >= NFP_NET_POLL_TIMEOUT) { PMD_INIT_LOG(ERR, "Reconfig timeout for 0x%08x after" " %dms", update, cnt); - rte_panic("Exiting\n"); + return -EIO; } nanosleep(&wait, 0); /* waiting for a 1ms */ } @@ -121,16 +123,14 @@ nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t ctrl, uint32_t update) rte_spinlock_unlock(&hw->reconfig_lock); - if (!err) - return 0; + if (err != 0) { + PMD_INIT_LOG(ERR, "Error nfp_net reconfig for ctrl: %x update: %x", + ctrl, update); + return -EIO; + } + + return 0; - /* - * Reconfig errors imply situations where they can be handled. - * Otherwise, rte_panic is called inside __nfp_net_reconfig - */ - PMD_INIT_LOG(ERR, "Error nfp_net reconfig for ctrl: %x update: %x", - ctrl, update); - return -EIO; } /* -- 2.29.3