Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp153739rdb; Thu, 30 Nov 2023 00:40:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuVABhU4WhuX4XgdDQ/+XtNilp98kC25xLjiKhhM0d19uPyS/OM6EUmQFCfjPmHGHdAo2c X-Received: by 2002:aa7:9304:0:b0:6be:18a9:8f60 with SMTP id cz4-20020aa79304000000b006be18a98f60mr20098266pfb.16.1701333642082; Thu, 30 Nov 2023 00:40:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701333642; cv=pass; d=google.com; s=arc-20160816; b=sb1wFLWinArYpY6uUWaoYFVFbSlHE3ezDv899+BZIJKb0mnxWMYwBq48+kRem6PRsV zFNyQrOth0kz4AedaYd+4AvfhNs4Vd0hltU+CsxgFmvk6mM1mxCXHuTkHBkrCUQNj/rA YxUwAZR0lnW0Vob0pfBRGd2JILL01O1n3WQjA1qAYo+1S7/9LevaCE6CUTn1ivdKFgHR UpBY0UXxPgDUry3H972MKDpsX6Fg63QTXHCeekSIQ3sHrgZxJwGE6SGsdNitsCY22rjL p0oBne5QLoSutBBbmP7R//d3V52mTRMh7E3g398h0PUhXf+6Y6Sx44KjB4Q/zbJheHra bCEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=yV/F29IfBt/gtR2BrPHsqcXTL1lajfnG9dJh+c70JEY=; fh=J5t2kRpuOmzjPJWd2t2MK10YOk9mOjPOa1d3/Z7ZF34=; b=oee/gl/w1MfFl/z0jV2eJSD86viGBJSmsFaKbuJity2hSfN4fkHDV30RGasDxEhf5m jCPuM9yMV1RAcXYZpQGAT3+TgsXHpyRK85ROlcqH5bloo3BixkT1pXKGNqLGC5WCEyQh qPPkQ/leKdwwVxe4NH09I4iLEZDNzCRmzYdgDuzuhdYg1OwPGYOZsznvBAqa8PEdZ4Gn t2zV1gXKAHE3D/5pVjNFtMAHCvo4bhWp/Le13BbVGCJgXniubPgEF20nuBNMF4StCkBL Ds99I1HJMyoYkk84/H5b/XUadyJuFHdazmRlsnxwWH4rlHfKh+ZAUJmYgT2Uno6hL3mI K62g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=LSsjtRFi; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d15-20020a056a00198f00b006c4d5ca7fe7si784775pfl.366.2023.11.30.00.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 00:40:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=LSsjtRFi; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DB7A28029579; Thu, 30 Nov 2023 00:40:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344973AbjK3Ijz (ORCPT + 99 others); Thu, 30 Nov 2023 03:39:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344954AbjK3Ijx (ORCPT ); Thu, 30 Nov 2023 03:39:53 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2100.outbound.protection.outlook.com [40.107.94.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFD779A; Thu, 30 Nov 2023 00:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mkouRmxDG7nDv6VJZM5IP3OhX9EgBSHEnjxIjH15ng6JxRsdsiLxgX5qVvhSiX7nGQchd9i7bB4qyzsXoc5RmtAccT0O/O1ArCgFlb+88pa4bk5dMuDylVfg/9xLy07xQE+7iVwp1k36IHbO3HV454bYmNt61C9ufSXtggWTDhkfl/mvSM/Mwe4Xkrpf/Lk4/NjiJWPU9M42dNRkA4rMKCx8tcvwaHPBOdDFOj10tN9eYxBlT8ZSCyCsAwoebXjTAktmdgq0ivsK2sGJwX/7e+Q1JHsOdxiDCYK03Ok7UXIOuLVU/Crc93K1C/Ht4x+vLg8R0RX2ZIRu5BT5kyIHow== 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=yV/F29IfBt/gtR2BrPHsqcXTL1lajfnG9dJh+c70JEY=; b=BmbmFvA4WUAleonWLrv9ZDM0mhvx3texp3AgvyjYdaIqbEkffnRMDSizlryB6uxft+Gzgs3NjPlwN3l1ud7AtCCBaXznOB/14OL5k0v4dwJL3R3F7jX+sY+5SPWlivRTl2aY7uiAdXQHK1//jRoLsl8ZNKaoXAvXUfmKFdzg60bpN5uep9H4Is1MWm+gpoV067txItxq1W66uGyAD5tL+BwbHn3ZnbX620DjD1D3KAzPoZ+skR9yepCVLxZUN5hP8SfpoU1gt/Ex2RQkpQwBZikMsbFmuu1JqaX4bqmiaUcWaPZoImBSiSP8s1ThOaIshU5wXpsm27Ies3hALzR6Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yV/F29IfBt/gtR2BrPHsqcXTL1lajfnG9dJh+c70JEY=; b=LSsjtRFin/HjufzxrKUA4bOEhzQ8qa5r89fiIHUkb82DiozA6kTPej+0gatnr7zI0ZPfMG49cVascfp4GHHshegEvBO/9cbBFRHStx5DlOqNABSNAaqZcnD8yZ7IWQMns2LRrX5iG1ESrUFgAn8nxXQD0bSqdfxc29ZHVm0Qrho= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) by SA1PR01MB6560.prod.exchangelabs.com (2603:10b6:806:1aa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Thu, 30 Nov 2023 08:39:56 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::5682:1d84:171a:1d68]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::5682:1d84:171a:1d68%3]) with mapi id 15.20.7025.022; Thu, 30 Nov 2023 08:39:56 +0000 Message-ID: <706506b7-a89c-4dfc-b233-be7822eb056e@os.amperecomputing.com> Date: Thu, 30 Nov 2023 15:39:45 +0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mctp i2c: Requeue the packet when arbitration is lost Content-Language: en-CA To: Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission Cc: Phong Vo , Thang Nguyen , Dung Cao References: <20231130075247.3078931-1-quan@os.amperecomputing.com> <473048522551f1cae5273eb4cd31b732d6e33e53.camel@codeconstruct.com.au> From: Quan Nguyen In-Reply-To: <473048522551f1cae5273eb4cd31b732d6e33e53.camel@codeconstruct.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2P153CA0018.APCP153.PROD.OUTLOOK.COM (2603:1096::28) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|SA1PR01MB6560:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ba9933a-9f55-4a36-d22b-08dbf17fee39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YZF71IwKkXVJfZW1t3qAnEyI0rYCVaCICKrjyfCYfpyAMo1Q7UCjOvQjwl7yYH7FXN+KZg7umrrf28sRkW2Om4cs81Jo6+dw8dabBVaVs3pkSlyAggoe2GZZqHgY2bSdwUJNOI3Cs/WPYtPEwBsNEBYPBeGS9gpSzjweh+p4+VxocTTd3xU8rHwTPzV+JLq+AQb4fXUY0FjVezRT9RV+L5c2emkY8uyzwmsK4E5I++T6DenslMtli3Psvc+FSdFPoKpCp51x3imZZnr7A3ppVLmfDvnjUziOSNhupaUwnYIDANogNm8hnnJpCdHyDlGM4b7971Aabn3oW9Q9W+LmafI1CLoTaGHu8UxiaGDG4JyTS1r/eoYa0v4bvFw504kJ5QJJ1Jl1RMX3++UWcPh0m7rDY01tFXHG9VVlCzuzUdbDpqzLuPxmwipelsb773v6xiSNmvNEXsHqRccWxbiKrX/KdncH2o1g/3XvWSiJMFeckgNuvL4SlJ0zgypcHzQq8WeWK5MP/9IQMQgi9yJdiIVTtdHN/04j9Re9hoGFbeOOpNj4S+/LFao/UdhPylqnLnwogRopbzLj0Km++hVEEMlhvTVoMrQoDg+VRBe50qOGIEG5pNVdHJxmiH8mCGyWnC+NyeqrN2MNn3ygxeO2Gmg/vf8mPtdMBQjK/LRP/V8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR01MB7455.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(136003)(396003)(39850400004)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(5660300002)(2906002)(6506007)(6666004)(966005)(6486002)(478600001)(4326008)(8676002)(8936002)(86362001)(31696002)(316002)(54906003)(110136005)(66476007)(66556008)(66946007)(26005)(107886003)(921008)(31686004)(83380400001)(2616005)(6512007)(202311291699003)(53546011)(38100700002)(41300700001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?clArZ2hvOUlmNXl4bEhVYkk3RjhweDVYWHZzMnNzYi92UGROb2c3R2hTNFlN?= =?utf-8?B?L1VieWtFMDNtWk9WZm1sT3M3OGo5U1BNK2hoOUhueUNUSE8za1hZWXhVZ08z?= =?utf-8?B?S1ZSUDdpV1hyc0w1ZFUwNDhoamhhTkZweDJWcjIyemJ1NE9hZ0ZJVnFUOThv?= =?utf-8?B?Zk9LY2NMS1d6ZnVMaEtFU0x3WW9TRUIrMDRrVWFxOXR4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MmlvK0lEdE93bFpNRmtYNkxGWCsvTm9sdDkrODZjTDZU?= =?utf-8?B?L3Y4ZW1UdnBGWWVlSmU0Ry9OeXFvY0J4bHJuOVBoaEp0YkhRTkJxTmVrWnV1?= =?utf-8?B?V3lZS2RMVkY2NUVVQXd5MjUvU3Qyci84Vm4rUXpQMTFmYUM3eGR0SUxBWGtH?= =?utf-8?Q?7/2spUU9rCg9a4vnEONCFJs=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ba9933a-9f55-4a36-d22b-08dbf17fee39 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 08:39:56.8262 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yS0FznNfA++d7BvfiXnhfp0xhbnZx4MwDb2837VqOiM+LdJXu1pphfZ4o/hr92kzBwK64huNxtqNvx4JZyvUcDNdhJ3/pwCQ91xppJ6/rt8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR01MB6560 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 00:40:17 -0800 (PST) On 30/11/2023 15:03, Jeremy Kerr wrote: > Hi Quan, > >> If arbitration is lost, __i2c_transfer() returns -EAGAIN and the >> packet should be resent. >> >> Requeue the packet and increase collisions count on this case. > > Are you sure you want to re-queue the packet here? The i2c core would > have already retried on arbitration loss: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/i2c/i2c-core-base.c#n2223 > > With this change, we would be disregarding the limits in adap->retries > and/or adap->timeout. > Yes, the __i2c_transfer() does try its best to send the packet but if it still fail with -EAGAIN, that means it still unable to win the arbitration. Without this patch we usually see the error below. The consequence is it stop and need the PLDM layer to retry when timed out, which takes time. "[ 61.616210] i2c i2c-3: __i2c_transfer failed -11" With this commit, we all see the packets go through peacefully just by requeueing the packets at MCTP layer and eliminated the need to retry in PLDM layer which would need more time. The result in our test is as below (Note: would needs some addition debug print code). I also think it is worth noting that in our setup there are multiple Masters. [73183.511487] i2c i2c-3: Arbitration loss, re-queue the packet [73192.550519] i2c i2c-3: __i2c_transfer failed -11 [73192.555734] i2c i2c-3: Arbitration loss, re-queue the packet [73207.250036] i2c i2c-3: __i2c_transfer failed -11 [73207.255247] i2c i2c-3: Arbitration loss, re-queue the packet [73429.499875] i2c i2c-3: __i2c_transfer failed -11 [73429.505116] i2c i2c-3: Arbitration loss, re-queue the packet [73504.672065] i2c i2c-3: __i2c_transfer failed -11 [73504.677317] i2c i2c-3: Arbitration loss, re-queue the packet [73540.762984] i2c i2c-3: __i2c_transfer failed -11 [73540.768242] i2c i2c-3: Arbitration loss, re-queue the packet [73631.040049] i2c i2c-3: __i2c_transfer failed -11 [73631.045333] i2c i2c-3: Arbitration loss, re-queue the packet [73648.538967] i2c i2c-3: __i2c_transfer failed -11 Thanks, - Quan