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 D69AB42E3B; Mon, 10 Jul 2023 12:42:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6205140C35; Mon, 10 Jul 2023 12:42:33 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2055.outbound.protection.outlook.com [40.107.237.55]) by mails.dpdk.org (Postfix) with ESMTP id BCF5140698 for ; Mon, 10 Jul 2023 12:42:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=evE4FHkFfuzUPYmrj0Jb7psmklKfhaSfRQImCYlHlgOm1I+vmiQeX7wJDdK31GFhfVGaG29o94LwGB0PVn0TMYEfPnP48rOR088P06TOrLC5IuDcEZV/wN2PEjScAmcWQlRxIj0UDrhe/pLMx5/gTJfeadd+bn3jCe6IMLerg+yORolqK2Y+Xa75LnCl7cwV983T2uwUF2MxLnSzE0UZZ3oAbV9XjaamyCiz5J3CXJR8OFzzu8AvFP5+g8K89nCdRRul0Z9t2v3fCvNzKOlwUYzHvpNXnn1OdCyKaegJqUJjhSoONYvGVKvMkhkvMH3lPxhBOfd63tbeRInoTr6nBg== 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=J5rfwmzBK70yjTtSoe11g7NuOc9PYXARN7ppy/SDvdQ=; b=MECoZHVeWkeo5Ks8WsFFEfx+dJVoRwUn8tY6VvQuZ7odwU1TmOvoQvcK9MLoh/nUqtg6YhwDqxnbjicnPh4Oar6fx273HMSNlNIJ528FFNNi/L+reQ5IRuVLoy4Xfb5v0eI+hQ+cbixfeNKaHy33OwCJTgfLa858ORFsb6/ZEgsVDQKht4jm6r6mS7zjqlGauLuL4N/o8kPvA3AtjrXUXV+o19pQ9hUiFHZYnWZVYpMwxp2Q3AJryOBdn2WeS4IH5Yhz20YX5e+oklns8ERSx+BY7zncYQDvEPej2saBk2vs4dUVr1HhsnPZs0wMMRHaXylHWcKJwW2qFspg2mck4w== 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=J5rfwmzBK70yjTtSoe11g7NuOc9PYXARN7ppy/SDvdQ=; b=4K1UPpKIhcB+gwOVBz4RMS55QcowZ4p7uw+zn/XTlnRYCOmk+PFSyubKdVf5ivp/7rDBLM2boeiROg5ZLzTsXucnYbRO2DCWep/++lU7lWYeBADJ1nteb4DFBiRLKBBIwP3d/hX2U6WVMubwnW0rRDPy4//SWCbKdu/cqK/vJOQ= 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 SJ2PR12MB8979.namprd12.prod.outlook.com (2603:10b6:a03:548::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Mon, 10 Jul 2023 10:42:28 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::369d:5f05:aaba:ebd8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::369d:5f05:aaba:ebd8%3]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 10:42:27 +0000 Message-ID: <1b728fbf-4f44-582a-4326-cb056721dd23@amd.com> Date: Mon, 10 Jul 2023 11:42:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] net/mana: fix wrong indexing on CQE error when coalescing is used Content-Language: en-US To: Long Li , "longli@linuxonhyperv.com" , Andrew Rybchenko Cc: "dev@dpdk.org" , Ajay Sharma References: <1688689077-5557-1-git-send-email-longli@linuxonhyperv.com> <718d5b7e-d315-d935-8cae-5ed0a8d31872@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0040.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ2PR12MB8979:EE_ X-MS-Office365-Filtering-Correlation-Id: ba566b7f-0aec-4fa4-370f-08db81325ae2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nw96GWsSx/HQzFPLHR80ZF0Q0l2sUrBSh8KbQmO1N+m4cM7VH3OuOgrf31tNormOZsd/ZH4i7NyGNcOrnisfkhoY53ZZ6IiLSx30XGjhBW4nzzpYNZv+zE/nl9y7JDy1h/8McF5w5hlEN3aKHSWj8jAVgCaisETnpfi63qIMaj+7pqdJbuBiY8qKeU1/Dr3fclnqRPgoT9/t7+/tljQMwcvc+uJMd7tQsKRrni9PuirPVsBzEKYISo4X/lZTY39yuW2Iemgv057dyX3BWcOC65LJanKvhQICpz2cpHQxOrbuR0DgVX6XIgihG85a7inAvXjq+zpKT8ePz6Yh94FAdd8bUJVO7WkQtx9YjA7qCXxKPjaGF+tJI6AxCE6QAJqQI0Fru00XVLrD2zNIRdKpawZsbMJNlnQN1xB96lqLyAmVkferSBXPPGoSuZbzvVhGMQTfOdjq1wWoAFyjxZN5eJU0xe6J45baYnYCii5pjeamzeDWgROV3YGVYCuTxl8+uTKSkCP/lNzgxHMNL7LuQldUIsUtfLXGCGntd6/y3wN84Mp0aYAWDjUqFrXETWw8wDIeLBcpu2r2HJKSMqGvU9UAEMmkBKMggASpCI+Yz0Sb5+rZAaPo/WPM2SOAwCgAk0PAXGCYmou0dqbSVi+48Q== 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)(396003)(366004)(136003)(39860400002)(376002)(346002)(451199021)(31686004)(86362001)(31696002)(38100700002)(36756003)(478600001)(6666004)(54906003)(110136005)(66946007)(53546011)(186003)(6486002)(6506007)(6512007)(26005)(316002)(44832011)(2906002)(66556008)(45080400002)(66476007)(5660300002)(8936002)(8676002)(4326008)(2616005)(41300700001)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MExWaXI2a1EwTWp5dmNzM01VQkx3SjgvZCtRenBFT1doczEybEh2VVIxZDhT?= =?utf-8?B?Vk1GM0tsTk5mc2RXb242ejFpRzZ4VDBhaTlWTzR0UUFPd0tyOC91WFc2VjhT?= =?utf-8?B?bFdoWWU2dEdJUld0c01hNWRaVmppZGVQUzdnZHFMdlEwN1dlenRaUXRaOTBp?= =?utf-8?B?Uksya3pEWTlUM2tIRkF4RUZRODdibE9QdzVaalJ4ZGhvL1pRQmY1M1REcFNP?= =?utf-8?B?SXpxVVdHdFpuUWxvQlN0WSs0ODJiT2JVblB4NEpSN2J2WXhVYTRNRi9aWWpz?= =?utf-8?B?eTAwdnJIRm40Nnl2WmtxRSsvRWkzWXJJd2RpeHlTd1MwVVVNL05tamt5SHdZ?= =?utf-8?B?dVRMZU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Exchange-CrossTenant-Network-Message-Id: ba566b7f-0aec-4fa4-370f-08db81325ae2 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 10:42:27.8242 (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: mfK6FigcBTIZdA0SOfpfR0/S5wRuKEeZ8hjNQiM8OJ4P6ISDLdu+Nch9Nd8oUnaw X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8979 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 7/7/2023 7:01 PM, Long Li wrote: >> Subject: Re: [PATCH] net/mana: fix wrong indexing on CQE error when coalescing >> is used >> >> On 7/7/2023 1:17 AM, longli@linuxonhyperv.com wrote: >>> From: Long Li >>> >>> On a fatal CQE error when coalescing is used, update the correct index >>> and allow proceeding to the next CQE. >>> >>> Fixes: 3409e0f172f6 ("net/mana: implement Rx CQE coalescing") >>> >> >> Is above fixes commit correct? >> Logic for 'CQE_RX_COALESCED_4' is not changed with this commit, in above >> commit and in this commit both does breaks the loop. > > Yes, the "Fixes" tag is correct. Here CQE_RX_COALESCED_4 is rearranged to make it easier to read, but it doesn't change the behavior. > >> >> This commit changes logic for 'CQE_RX_TRUNCATED' and 'default' cases, which >> are added with different commits, not the one in fixes line. >> >> "fatal CQE error when coalescing" mentioned in the commit log, to which switch >> case does this corresponds to? > > The previous patch (3409e0f172f6 ) introduced variable "i", an index to completion CQEs. But both 'default' and 'CQE_RX_TRUNCATED' cases don't advance "i", hence not advance to next CQE on error. > Right, thanks for clarification, I was checking from CQE_RX_COALESCED_4 perspective. > The fatal CQE error means the "default" case. On 'CQE_RX_TRUNCATED' the code can recover when all CQEs are read. But on "default", it's a dead loop. > ack. >> >> >>> Signed-off-by: Long Li >>> --- >>> drivers/net/mana/rx.c | 18 ++++++++---------- >>> 1 file changed, 8 insertions(+), 10 deletions(-) >>> >>> diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c index >>> cacfd9ae1b..220b372b15 100644 >>> --- a/drivers/net/mana/rx.c >>> +++ b/drivers/net/mana/rx.c >>> @@ -416,23 +416,21 @@ mana_rx_burst(void *dpdk_rxq, struct rte_mbuf >>> **pkts, uint16_t pkts_n) >>> >>> switch (oob->cqe_hdr.cqe_type) { >>> case CQE_RX_OKAY: >>> + case CQE_RX_COALESCED_4: >>> /* Proceed to process mbuf */ >>> break; >>> >>> case CQE_RX_TRUNCATED: >>> - DP_LOG(DEBUG, "Drop a truncated packet"); >>> + default: >>> + DP_LOG(ERR, "RX CQE type %d client %d vendor %d", >>> + oob->cqe_hdr.cqe_type, oob->cqe_hdr.client_type, >>> + oob->cqe_hdr.vendor_err); >>> + >>> rxq->stats.errors++; >>> rte_pktmbuf_free(mbuf); >>> - goto drop; >>> - >>> - case CQE_RX_COALESCED_4: >>> - /* Proceed to process mbuf */ >>> - break; >>> >>> - default: >>> - DP_LOG(ERR, "Unknown RX CQE type %d", >>> - oob->cqe_hdr.cqe_type); >>> - continue; >>> + i++; >>> + goto drop; >>> } >>> >>> DP_LOG(DEBUG, "mana_rx_comp_oob type %d rxq %p", >