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 2CA2C42A3F for ; Tue, 2 May 2023 20:23:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 251AB42B8E; Tue, 2 May 2023 20:23:34 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2054.outbound.protection.outlook.com [40.107.96.54]) by mails.dpdk.org (Postfix) with ESMTP id 7378040ED8; Tue, 2 May 2023 20:23:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fz4HrX1mHt0Fzoa8Dm9Swkp6DaSEgZR6Vz2+abS0seiMzX1jnr1MO9A7LsEH9WqSzgRLEM6yp9dUJndaJCgW6Wj/tMsiXYN3qrKJKSKj1IJawNRRCmLdY6ivAw1yKIhvfXZo9lyUb5pZbmIqRniRAX9Txyh1g2vUb1erKm+uDsd9fFp9qInkVtEMws5pPzwLJmZEiAVdKXfMn5jf7jpqdely7vaO2lLiYHgljxgmpUDLNppeNslvxG58napnA9tBXX5JQxcg95xHS2XRYfpNrVMzjr+Mpuc/DRmDGi5B37kpgJ5OP3fbQv3C7wGHj+MfIzf1log9wJDqcwwk1LCpxQ== 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=GkIBZwOcFc3kp0ccIjJTJjueawyckzhpJ3CX4cZWTa8=; b=SamSeEvsoq5IdBXqpzahqyU0mFw2l7GTDl3Edz+SFuHUAjohIkTMUT9j50MipFYvAno1HdpyVNrWl3JRXjEbY4A566L87P+sRoPBU5dIIPoVVkxyK/eYizf1WJAbdhPAPFyuCXluvdk6IHVhs3yCa1H2Ync7e0zU0QTfJ3sihsJRLtJeRgxRrlB4hRAPIx+AfnP02fM4MeDSq9PNdZDkv7wgSZ7hAfJjNc25Erkr4RuO5hSZ6YEQdPzSyb6cpkyUFMuRLZv8gl5dzn9c1JAlWLAHpVavTagK5hEUj5R50zcaxmzPoLi+E3qwNUOL5TUsgiQSXx6u+fMR8fR+BYf2Rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GkIBZwOcFc3kp0ccIjJTJjueawyckzhpJ3CX4cZWTa8=; b=3zbNFcEb1KrSdJTBxI3K61ubPoQjH+jfkDNtBqXGa2nAXKhvgyZmK4s3vMWY5mvlC/BZnRRop0CY+9vll42SWmn+otEAQkbOZ4m19xJQ2PNZHl1aUVEkci6BFLFg6RbumKkmt+07MGMICor7Xek3NoP19vWaOiN20Gg0u6SJEvk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by BL1PR12MB5349.namprd12.prod.outlook.com (2603:10b6:208:31f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.31; Tue, 2 May 2023 18:23:29 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc%5]) with mapi id 15.20.6340.031; Tue, 2 May 2023 18:23:29 +0000 Message-ID: <7e8a7552-c707-9579-59ef-248c1ee45443@amd.com> Date: Tue, 2 May 2023 19:23:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: longli@linuxonhyperv.com Cc: dev@dpdk.org, Ajay Sharma , Long Li , stable@dpdk.org, Thomas Monjalon , David Marchand References: <1679095964-18532-1-git-send-email-longli@linuxonhyperv.com> <1679095964-18532-2-git-send-email-longli@linuxonhyperv.com> From: Ferruh Yigit Subject: Re: [PATCH 2/2] net/mana: optimize completion queue polling by processing a batch at a time In-Reply-To: <1679095964-18532-2-git-send-email-longli@linuxonhyperv.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0225.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BL1PR12MB5349:EE_ X-MS-Office365-Filtering-Correlation-Id: 33b62179-247d-40c3-65fa-08db4b3a53d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pV5fAZYi2c4jhDz8WxGxrwaVMrDRo2eevkoeGVJVrlMsPf5TwmLSG0TSKvLkfmixIqtbtREJu3cjKreOn8LkcmrHDg60TCzAiavdb5fBmqnWS1Nk100B1rse6gEIvEWlwFZye1NTRQhZkmcYpx023OqH0/xgDRU4saVTVUhbGKiJmwmrSul5bvfyRxt1J4MzfRM5cQwGdwfGg8RoBy2C2PnENQssTEqBRa/F2Bg56NCW5GUnvAnDivPwVK/UQMQCqeOd8qpsd2FZf/gQpZ0m33zNMu2ND/tyrkvI1iWmzeWNjG0fw98WqxV+DApIi9RyPMFrICj3lYYkQqKj+vbP0aVlONZHNrppc0JBR3GFyoM5DHC38sxP01OA+mFQinnu/mDcU9ixP4KQpQ0Ded8sZKiuIOAMruUGvY+wqNz5R5sL6Q6tAbDyQC45fMtgLV9+a2lnmpXX+F++F5zNmO5ecm14uFzq5lQgwG3Mpf76gqT5KB1AEKp8iZHUK6nS6wEzWINuw3tx+YL7641bDL5d5Isgw2vrEWmyEfAWHozas+fy5aDiK6G/Yx2jMkBOzf2VUH8FDDxoxEtWpKKg6tcIeK+QtcBPEf2QR/0z8WiC5KqZidh1lRsKizrINJZWXEPKmQzYv8QuB3mnO4788HCf3A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(376002)(39860400002)(366004)(346002)(396003)(451199021)(6666004)(36756003)(31686004)(41300700001)(186003)(6506007)(6512007)(53546011)(66556008)(8936002)(8676002)(6916009)(4326008)(5660300002)(66946007)(66476007)(316002)(44832011)(478600001)(2906002)(54906003)(2616005)(83380400001)(26005)(6486002)(86362001)(38100700002)(31696002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QVZkc2d3eUNOa0tvRjU2S0JQRUJqSUFhUloyb0dRYTF3aGRMQ3l4Vzh2ZTJn?= =?utf-8?B?Y1JETXAxbFRvamdSRVk2ZXdYZ241RUk5dmdGclNJYTlQK2diU0VQd0RRb0tC?= =?utf-8?B?ZDdjM25OaGxtOHZNbnFqL3k3WUY1Umoxd1RubHRscm1McnlENXpnWGdZdmZ0?= =?utf-8?B?Qm1JbDhRdTQ0QzBWM2RET0FjN2U4VnpSc1FqRVM2ckdPYUcrQS90ck5URzlh?= =?utf-8?B?ZG5mUC9wYWZaQnRObktRR3EydEM2aHFnSDZzd2hRVHVTVEhmbi96SkxURkZM?= =?utf-8?B?U1JwRzhnOVZwTXYvS0l5REN5cXVJSWwrajltMnJ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-8?Q?HfGsZg6dVHc+8qRgAOQ94vxzt?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33b62179-247d-40c3-65fa-08db4b3a53d0 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2023 18:23:29.2781 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l5np5YryDx6/fb3XbqJd1uzHXnf18ZYSST4d8RSfeJ6irQGgjfx592RmXJMLS/Al X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5349 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 3/17/2023 11:32 PM, longli@linuxonhyperv.com wrote: > - while (pkt_received < pkts_n && > - gdma_poll_completion_queue(&rxq->gdma_cq, &comp) == 1) { > - struct mana_rxq_desc *desc; > - struct mana_rx_comp_oob *oob = > - (struct mana_rx_comp_oob *)&comp.completion_data[0]; > - > - if (comp.work_queue_number != rxq->gdma_rq.id) { > - DRV_LOG(ERR, "rxq comp id mismatch wqid=0x%x rcid=0x%x", > - comp.work_queue_number, rxq->gdma_rq.id); > - rxq->stats.errors++; > - break; > - } > + num_pkts = gdma_poll_completion_queue(&rxq->gdma_cq, rxq->gdma_comp_buf, pkts_n); > + for (uint32_t i = 0; i < num_pkts; i++) { > + struct mana_rx_comp_oob *oob = (struct mana_rx_comp_oob *) > + rxq->gdma_comp_buf[i].cqe_data; > + struct mana_rxq_desc *desc = > + &rxq->desc_ring[rxq->desc_ring_tail]; Checkpatch complains about defining variable inside for() [1], but as we are switching to C99 standard, I don't see any reason to prevent this usage. I can see relevant checkpatch commit mentions about compiler warning [2] but not sure if that is still valid with C99 switch, I will send a patch to discuss this on. [1] Warning in drivers/net/mana/rx.c: Declaring a variable inside for() [2] 43e73483a4b8 ("devtools: forbid variable declaration inside for")