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 4B350A0548; Fri, 3 Jun 2022 00:52:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A0C940691; Fri, 3 Jun 2022 00:52:31 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by mails.dpdk.org (Postfix) with ESMTP id 610634021E for ; Fri, 3 Jun 2022 00:52:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iF4IttkUZnjJXJZlY+p6t58qlkCT/TCdy9xpGMebP9Qi9vSHsF9pHyZ91j7KrNHkQVZ6qe1krLFlsBrLTEiADDSGQkPJhOm4EfBWTFV9apc2BImJqQpxltCqZ6wZ3A7/NLEE9kTtoot82gPRWCBf6npGNPEgjDUrcAWa1e5rsmtJmMD0CXdZAHbhwywxz8Hwg+ZvbaDvV9zap3GbdEhmuBfViXsBYe4yg387RNO0oLa9I1mP4FRPtdPS7D2CFtMW65KohGNgTb+a9vmDeNp4gEBgmOiyZf9TrNBPq+ZZaOUz3B7YftGkBk/fyI3cfid3aVrFRO9je/GS1KqG08JVLQ== 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=JCJ+I96APuBDdHN9Yo2aZ6mTHQzBFgJR9a5jwZ+rl70=; b=FprTjR+h58ZNTpMhN9dTvUSCBRJ93aV+eer8xa2LPo/eLfJCKpnkDh0CtPQ6o+AoXqmQCIJgDTlJYG2hk6LfXloEPWEOcNB61h4xMW6HFdOPU2mKp4y8Kuby20gvs/uTxiv38LwjvoMV0FHQGePocxj528l7VcFLe1yxfmrrOnf3uCTqkz7e6lbOScmZbXb7DOIYStWLVGUVMGY5cGOe8vvheQuspD03X4nNZkC4jwvObFKXVtLhBENADAKEmGhtGixzR0EEvvQSNuWkYepY5q8XHmsPU9rKsF7/aFThlBZk9KXdvPnUOGGYdo77MfAiVtQPXjJZkuk1J7tO4rnhhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=corigine.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JCJ+I96APuBDdHN9Yo2aZ6mTHQzBFgJR9a5jwZ+rl70=; b=n1R8xsLID1pPP/NcW5VExwSKGM74xvZpvUU5K5LvxRjlaTc0gzsjZSLR3O7G72VfZjpGgW79s6vUOIECjTVBfu3QV13/knmKmwcsQfRZMBsVIyoTuVrWmviUcA5dtFACbk6v2Q3tyAPHlTR4kzu9Ni9IK+D+DgTtkocKNIhwsHU= Received: from SA0PR12CA0014.namprd12.prod.outlook.com (2603:10b6:806:6f::19) by MN2PR02MB6815.namprd02.prod.outlook.com (2603:10b6:208:1d8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 22:52:25 +0000 Received: from SN1NAM02FT0057.eop-nam02.prod.protection.outlook.com (2603:10b6:806:6f:cafe::6) by SA0PR12CA0014.outlook.office365.com (2603:10b6:806:6f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12 via Frontend Transport; Thu, 2 Jun 2022 22:52:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; pr=C Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0057.mail.protection.outlook.com (10.97.4.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5314.12 via Frontend Transport; Thu, 2 Jun 2022 22:52:24 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 2 Jun 2022 23:52:23 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 2 Jun 2022 23:52:23 +0100 Envelope-to: jin.liu@corigine.com, dev@dpdk.org, niklas.soderlund@corigine.com, chaoyong.he@corigine.com Received: from [10.71.116.16] (port=63087) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nwtfz-0000ID-3d; Thu, 02 Jun 2022 23:52:23 +0100 Message-ID: Date: Thu, 2 Jun 2022 23:52:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 01/14] net/nfp: change the coding style Content-Language: en-US To: Jin Liu , CC: , Chaoyong He References: <20220602015304.710197-1-jin.liu@corigine.com> <20220602015304.710197-2-jin.liu@corigine.com> From: Ferruh Yigit In-Reply-To: <20220602015304.710197-2-jin.liu@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a6c0944-a862-4483-4c2e-08da44ea8fcb X-MS-TrafficTypeDiagnostic: MN2PR02MB6815:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wf6dX/Q1laeLyNxX8LH0c8Z8y05c5/7quH1+7EdyAEPkkFS0zTEFDt86ku+jPg/874c85gHbDdKeKBUn+QiJrPcwyCGcfR1lETsAfmfPlvbkdmiedvFyQv6MQNVeYpaEUbrb2WO6TStrnq9yZgeF+/ITlDQ7soBV/PnyBP/omfSIaq08K1jhLaUaRmBL9tzZTC9tFcAC5M4qYgmgTv93nQikbkkfwe4fjw+DQym/T7YE5ob2jOt7gu8qpxde+vS5l4nGSF3v69nJPG/5Dq49fgll1xY5qkPcwyrsWvWscj5rrE3ELisvU9S7W1Ikm686GnmLbGQP///+DPIlYTPIyWQnO6pSp+v9cSsPQMd8gQ2ETb0XlEEHkZqBMd8TIGGDp4Cm92+WGPok0JbZx4FTc5kx2R4HOoIqU/MEQBN2ULYq+kgqf0aUeZz1uu+X+1ULVXoNB17fnqnjmDB8EXfOKmo9XmuaLDECd4mzWb3KXruUTeG8vsGJp0HEtdXRwMBWhYNLvrZ+0UenoHVXvZfOZ/MRwA5dCd0iLI3FAl7Yj40ryue+0od9NFWGEGyah4D2vL4CvzwVI6bIpeuc37Spk3CecUg0151E3XrRL5Sulqo3AXELh2uq4/nAxLkXVVFBstcC9Rhrjk+9NF3lAIhaXZ0VAP9WQe70UHioIcF3cpHA06g+kAVNoS2BJFNFbRnk+xHHHwruvX887WQvMuqmw56p5dE1TB3GcTfb72MfdFE= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(2616005)(47076005)(426003)(336012)(82310400005)(2906002)(66574015)(186003)(31686004)(110136005)(54906003)(70586007)(8676002)(316002)(70206006)(36756003)(4326008)(31696002)(9786002)(53546011)(5660300002)(508600001)(44832011)(7636003)(36860700001)(356005)(26005)(40460700003)(8936002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 22:52:24.9035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a6c0944-a862-4483-4c2e-08da44ea8fcb X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0057.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6815 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 On 6/2/2022 2:52 AM, Jin Liu wrote: > From: Chaoyong He > > Change the coding style of some logics, to make it more > compatible with the DPDK coding style. > > Signed-off-by: Chaoyong He > Signed-off-by: Jin Liu > Signed-off-by: Niklas Söderlund <...> > @@ -404,9 +403,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev) > > /* NFP can not handle DMA addresses requiring more than 40 bits */ > if (rte_mem_check_dma_mask(40)) { > - RTE_LOG(ERR, PMD, "device %s can not be used:", > - pci_dev->device.name); > - RTE_LOG(ERR, PMD, "\trestricted dma mask to 40 bits!\n"); > + RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma " > + "mask to 40 bits!\n", pci_dev->device.name); Since you are updating this part, it may be better to not break the string, like: RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma mask to 40 bits!\n", pci_dev->device.name); <...> > -static int nfp_init_phyports(struct nfp_pf_dev *pf_dev) > +static int > +nfp_init_phyports(struct nfp_pf_dev *pf_dev) > { > + int i; > + int ret = 0; > struct nfp_net_hw *hw; > struct rte_eth_dev *eth_dev; > - struct nfp_eth_table *nfp_eth_table = NULL; > - int ret = 0; > - int i; > + struct nfp_eth_table *nfp_eth_table; > + char port_name[RTE_ETH_NAME_MAX_LEN]; > > nfp_eth_table = nfp_eth_read_ports(pf_dev->cpp); > - if (!nfp_eth_table) { > + if (nfp_eth_table == NULL) { > PMD_INIT_LOG(ERR, "Error reading NFP ethernet table"); > - ret = -EIO; > - goto error; > + return -EIO; > } > > /* Loop through all physical ports on PF */ > for (i = 0; i < pf_dev->total_phyports; i++) { > const unsigned int numa_node = rte_socket_id(); > - char port_name[RTE_ETH_NAME_MAX_LEN]; > No need to increase the scope of the variable 'port_name', above is valid for the coding convention. <...> > @@ -989,13 +984,11 @@ static int nfp_pf_secondary_init(struct rte_pci_device *pci_dev) > snprintf(port_name, sizeof(port_name), "%s_port%d", > pci_dev->device.name, i); > > - PMD_DRV_LOG(DEBUG, "Secondary attaching to port %s", > - port_name); > + PMD_DRV_LOG(DEBUG, "Secondary attaching to port %s", port_name); > eth_dev = rte_eth_dev_attach_secondary(port_name); > - if (!eth_dev) { > - RTE_LOG(ERR, EAL, > - "secondary process attach failed, " > - "ethdev doesn't exist"); > + if (eth_dev == NULL) { > + RTE_LOG(ERR, EAL, "secondary process attach failed, " > + "ethdev doesn't exist"); Same here. <...> > @@ -296,9 +296,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) > > /* NFP can not handle DMA addresses requiring more than 40 bits */ > if (rte_mem_check_dma_mask(40)) { > - RTE_LOG(ERR, PMD, "device %s can not be used:", > - pci_dev->device.name); > - RTE_LOG(ERR, PMD, "\trestricted dma mask to 40 bits!\n"); > + RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma " > + "mask to 40 bits!\n", pci_dev->device.name); ditto