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 C16D0A0543; Tue, 25 Oct 2022 09:59:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1CDA42836; Tue, 25 Oct 2022 09:59:55 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2133.outbound.protection.outlook.com [40.107.220.133]) by mails.dpdk.org (Postfix) with ESMTP id 6E14F4282F for ; Tue, 25 Oct 2022 09:59:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KM9ZKo6g3rbUgNv25Vh6j72oQeGUvVY5EDqfnGhWHrJi4X9uevsAihWYkl4mPtHmS4N3ouQJ30RDWt/ESBPUFHleJG6JGla5RX0zbKlvJ9x2AtTMK1hsxXQUzcWG/SH56kCmDkurT027ctaljAoQXK0WiT3ef08puwg5b0zwAEomtuzHT5IAnPzrgatv1oM+74FXul+6UQ+tfdWoQnYv47lUFYLQvps2hBw734tjna1iaqJasgCWSnT12Vn15yz0M16OeOS8xx0IFc6sMHVNimpGkHPbIRN0t4EjdHFFVD0NQ/9jhb/I7F/GVFPCrhzlTVlf6l/B+Vyo95aOunstkg== 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=LjL4A0uNF3fy4xK764sL9QlZUHOjn3oYKQ4q9LCtu/Q=; b=FJGpG/Ofv2sdcqe3tsAW/DY4dbtSZQYD27KLZ8B+lVcnMLe6w3Sv/5Z63WVp9KXNer1LgR6rl67Ti70A5mYZxazRChG82sHd5OtDnbG9yDLWM2W/pmtQdupRDnqGU7v6Oxqpj6FgskXM8LJBCrBu7sUfoxKuBPR9OoWAHvTAf/9ViCWxXoti6P9Jc+HoZVk3kRNHP/8PSGatiQpuBW/SXsYjuD6W59JaPp0eTMuSsP6laGoTofOMrGoWyu+iRdjipYXxGlDr3VVRzTtK1W0F1TUwFanYmaBwWP1hjLNNUNdcJWUIfZ/1mMCCooRxNTNxSjfq6X6WAe3sXlZLKc06vw== 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=LjL4A0uNF3fy4xK764sL9QlZUHOjn3oYKQ4q9LCtu/Q=; b=TIUBoIXxnHwPHRLkYK7DedqFOM2e5gH/yMliJrZ8Pvh4tfgNbSeVLWXPX2iMcKL5hPzkFyr7l5ASzMJAbupIK9Zr7P/q1+e+V/fMmMTdsO/R73BGmjJei1vxGex+4GKksbwbwJMsjX8GaIDhG3cjlFC8svVPJGkoykLpTEAOeI8= 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 MW5PR13MB5439.namprd13.prod.outlook.com (2603:10b6:303:196::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Tue, 25 Oct 2022 07:59:53 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b%4]) with mapi id 15.20.5723.014; Tue, 25 Oct 2022 07:59:53 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v3 01/26] net/nfp: fix the app stuck by CPP bridge service Date: Tue, 25 Oct 2022 15:58:53 +0800 Message-Id: <20221025075918.7778-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20221025075918.7778-1-chaoyong.he@corigine.com> References: <1666427069-10553-1-git-send-email-chaoyong.he@corigine.com> <20221025075918.7778-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW5PR13MB5439:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b444e0f-6586-43ef-4e7d-08dab65ee60b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IiSOLmmdIZn66n06kV/gH3HsEiI+m9vocfjUQQMj+0gI4tfmIUmCwf6BqWnsjO7qLHhouamZ4Pl1NxaBym+A38qgqjwCDLOeuo6ZWUGCHvwUYqJi8Z26YkNffc119CRYVoT7jjhSSV1/h3chk86GEbeVmM2lfTaEfkl51RV92or9U7MF8YdIYmTbzTkj2XwVkG2VJc+Q5OLZbfTFGYioRSHbbVfnT1MWswMnhNJmdzp/q/hXyGZzCqt4qbGD1LJp+G0y7FXPFC/9Bu5493ESDQQboyJKYPmd9FL+w+7/fXoEyxrdEPDjlf42U3K+yUP/kr/9mFervuke/saVuYBSA1zRwJ7UZtZAnqBqFjqnFkSlV7gZa+J1PTOn7a4UEpOga4+ioWoHdgyRlte64wJhHQdP17uSr+vxFuyjM7SvzwEwtnyk2pBMp3w+wQXIuHZoEbVghjrbQWMmhbiHTozjWAplELSJ14rbbdr97HscEDVpFJnm+3dLPD3dnjADTOgdljRYcrTUip26p6nhzCpaRbDApOPIS3dkA+bfnRDkNDEy34z7mAnC1w9MJl9hgRDfiviD08okUWzoGxkxj6Q1IKLV+658GNCHV3YzyN8BAHxsyIT6hX9B4y4vAQz/jBjTlpsqxdgqaYQbLJQO9XnLcAgiEYZLArjog0zX4x70b4rEz2qzKkURpA1UKRKWE9f99VrvrF+3rgOysZnJq3Y49pDvdeos83QypW2iOabNrkUiz62kadXKVI8fd/ltv8DzhO4XLtpjtyTHTMYWhvEyDA== 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:(13230022)(4636009)(39850400004)(366004)(396003)(346002)(376002)(136003)(451199015)(83380400001)(6506007)(478600001)(316002)(38100700002)(52116002)(38350700002)(2906002)(41300700001)(5660300002)(6486002)(44832011)(66946007)(66476007)(4326008)(66556008)(8676002)(6916009)(1076003)(8936002)(6512007)(86362001)(2616005)(26005)(107886003)(36756003)(186003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?VNW3uetRWG5Hm7P3xzOX3+rI8GhS9OQSF13dm1ZIvrQqBD1SNZqXhD+RXKLi?= =?us-ascii?Q?tvlK8pi7ADirrlK0BZxO+ySypoh4+WEvEF6Ht2EVeAiRGu0xMNTE/kTiwgUl?= =?us-ascii?Q?iMYYQtOR4CUQSpTbXUN+cPJ20k2psz8ZK2F9mUpxwJjyJ/KHU/95dCEncf8t?= =?us-ascii?Q?oV3Y055swPwPtdChdAfKW1Fot+UHu8AzR8NExm3f+AVNJ/gN6lHnaHQBgp0N?= =?us-ascii?Q?wCOYLGk1/z/g15/QwHbKmm8Fwudwpj+PvdmclaQTq7HOOEmq59SSlD3lkweC?= =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7rS4CMgiI4R?= =?us-ascii?Q?wOHSrYNmlpb9B7XbGkdBhl5w9BdPX9Zj+AEeY0vlDM5Op02M8+dxttfugRYp?= =?us-ascii?Q?rUvSJn1rpGOqiIX9/Ti+yOHBMko+DImgpiiPP+r+61WDaXy9twzXesTZMYA+?= =?us-ascii?Q?UkW7DQ1PHREijZK8JBhtDB8yWj0q7/rx/J7V8O7WNoDpkrPxyFknjdfULuyT?= =?us-ascii?Q?QTXjkfwy3LntdVgLuHkSADQEl1AsM20zmVxy6D1NpTe6yOsOG57Lmkgkh+jz?= =?us-ascii?Q?zTptsLTQ0Hf7+PMxuUxxPRHrXpoKCllQ2RaC2BOh7hfzwEur5Sw7mWhcBI9R?= =?us-ascii?Q?Pr1ByOvGJmG4T6c4Vqmh3Yy/JVCk4xCNntWgjqS3NlIgknfOCJaN6X6vZxAQ?= =?us-ascii?Q?uL9X/4PVBpu6cMI9sruO8wk1ffSsTaDqbi4x3lbMzPvo31oLGWx1g2W6KhuZ?= =?us-ascii?Q?xg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b444e0f-6586-43ef-4e7d-08dab65ee60b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 07:59:53.0902 (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: ylul3x9RfXcSBhOxloLId0YyGLQM2o+ih6LrpY65XbSOOo0LtHD6vReZrOZR1w47duMD+hNBmviT1AHJ7wT5CAZF/kSBC7DUHkRrUIFZfqw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR13MB5439 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 The CPP (Command Pull Push) bridge service is needed for some debug tools, but if no debug tools has ever been run, the initial logic of CPP bridge service will block in accept() function call, and the DPDK app can't exit normally. Fixes: 678648abc64c ("net/nfp: fix service stuck on application exit") Signed-off-by: Chaoyong He --- drivers/net/nfp/nfp_cpp_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c index db4b781302..e650fe9930 100644 --- a/drivers/net/nfp/nfp_cpp_bridge.c +++ b/drivers/net/nfp/nfp_cpp_bridge.c @@ -379,6 +379,7 @@ nfp_cpp_bridge_service_func(void *args) struct nfp_cpp *cpp; struct nfp_pf_dev *pf_dev; int sockfd, datafd, op, ret; + struct timeval timeout = {1, 0}; unlink("/tmp/nfp_cpp"); sockfd = socket(AF_UNIX, SOCK_STREAM, 0); @@ -388,6 +389,8 @@ nfp_cpp_bridge_service_func(void *args) return -EIO; } + setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout)); + memset(&address, 0, sizeof(struct sockaddr)); address.sa_family = AF_UNIX; @@ -415,6 +418,9 @@ nfp_cpp_bridge_service_func(void *args) while (rte_service_runstate_get(pf_dev->cpp_bridge_id) != 0) { datafd = accept(sockfd, NULL, NULL); if (datafd < 0) { + if (errno == EAGAIN || errno == EWOULDBLOCK) + continue; + RTE_LOG(ERR, PMD, "%s: accept call error (%d)\n", __func__, errno); RTE_LOG(ERR, PMD, "%s: service failed\n", __func__); -- 2.29.3