Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp920304rwr; Thu, 20 Apr 2023 07:52:28 -0700 (PDT) X-Google-Smtp-Source: AKy350YiRnc3GhidbUMvqXsL83CYr5m9hRr9ayq+AFboyyUXPqdKYbPkQMYMO9bn0Ratq7ly1o1y X-Received: by 2002:a05:6a20:7345:b0:db:22dc:23d with SMTP id v5-20020a056a20734500b000db22dc023dmr2872150pzc.5.1682002348268; Thu, 20 Apr 2023 07:52:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682002348; cv=pass; d=google.com; s=arc-20160816; b=tNjBSatLccFOO+as3/pUuPgYPWWfE82CnwoVOVQhhOR100MHF6A4fxaaO4wwOQAWh0 7NrcHb26JWMWEEHWb67Tjpx52LL67lWk9fA2NkdaCrJYeCRid1flGuFaCaa/2uj/QlIM jw01pzO8MnnmZWBBfyNkpNx6IWtF0Ktittz/Ebu2yTFwlj+IJhQ0kdLR0HB54MTODiay zLdfjjummco/LL7kpg/vE0+mie/cidyATOhKFBqTh+wbIHFzCk8jJTlrDLAplnZAoavC dozbqt/rKRSZxurmWbqatpk7mFqe3oPJcCE9sPpPIHgWP3JVpIa0LKdpI5NP2hJm147s bvqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jUUJbHcZopKoE0EpeVspzvNU6Yu3A8vzgKnkQad+wa8=; b=JxTk9R+6dfP0gqFb2Pw/CidZnkOGc6wdqYV4A0lmRYyzjFVXsQlkmdZpjobjb/S8Cp jMjb1dliwtAyclA/faa9iUhViWHcof5yTpvGnEQd4zXDZllLV/GUK6FdaNtng0pcz9vO SjHsOp4X4HS8FAyP2cEgQUuNAxODaX6Fqe1SpEseuV41sUSTPcSWVV9NHDpS6bELXPQ3 Agm6e68so0foJ2G3hwJG+ImKNzzpqGzapQfjZP+HRDDmweCTBV9Rssc/J9W3UgYP/jca q7FMhsZW9+uCDWlmfCILVn9qDGchLSBsrPZefYNKndoRtG+AqhgdHHZ6ot6AQOTZB8L4 dQVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=PiMoLxFr; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c71-20020a624e4a000000b0063b52a43898si1816094pfb.155.2023.04.20.07.51.58; Thu, 20 Apr 2023 07:52:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=PiMoLxFr; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbjDTOlQ (ORCPT + 99 others); Thu, 20 Apr 2023 10:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232222AbjDTOlN (ORCPT ); Thu, 20 Apr 2023 10:41:13 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2098.outbound.protection.outlook.com [40.107.93.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0A355FCF; Thu, 20 Apr 2023 07:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F7ip0VL2iotHQ/AyiVVfIU/7K16MlcmZLGprlhEk+PYMUOL+9hGheB3qJiwn59KaW960zh1zdbYNgkIO9TvR+rsB56llYkUi/kWm0L4zwiDTzyeC1U7ukqS1b9erSUta/HtY1vRUTIPgy/N0sSrbs1spECNdMy6bVtFwakT+jvv+6KfmrN2vzDcLw+Ho+BmBVs6K5QvIIF8JfbdD/LCoGwVcI8D9IQJqiCbBZN/EtH5nJEq8r1rYRgpsYx0wNn9EpTsHmYg+JhR7ivgBvifm7gS72trElMbfa42RZql8kTpkWgqcyr7lYLFRfLvOZPeeCeuqeFqeFKjpw+y6dAlRFA== 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=jUUJbHcZopKoE0EpeVspzvNU6Yu3A8vzgKnkQad+wa8=; b=hAGqfQI4J825+5Vs9Itfu+AcUnkomfdRV0cayWE9j9ICExZu+9u/ea6KOAJ/PYx5pjFGsgnCqmkHX0CLFB0zZ9fkg2HWLNBbqbuqiGm1shGL8OkoY2SlBj7FEOJkmhqwAtK2/KJNSc9XYhubty7ZOni+QTD1X5DBaWG1XJZ85k3pnlci5Tofpcx2UC95+jA4YGjQ1zzKAp/vg8MRg5acNxoSlSWMYet3jGSdPlTDt9jsTcWH7pHNkkKaNS8cdYunZKGxvw9qI4GW3riDgUg/RVq7ul9IdNAtNRrMSrrva+y2x0mstRjnTQdk2Eem7Gna9bzUCaFU/ECMp6utbQv3Vw== 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=jUUJbHcZopKoE0EpeVspzvNU6Yu3A8vzgKnkQad+wa8=; b=PiMoLxFr33W1zMkf0tNbIelazNfGp9EyNSrE9EqIj5iJ4ZTAhKIHfGtL7SggLB46QbTObut7+i9zl7a6ynyhHGGl4TTci8b1F9SAKE93SM8xlR02QY8ahDqbsDgut+A1icPIBuwOjd+0NfVsOzop0a882b9yv6VULRQSrp3AG9k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SN4PR13MB5792.namprd13.prod.outlook.com (2603:10b6:806:21b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20; Thu, 20 Apr 2023 14:41:08 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%4]) with mapi id 15.20.6319.022; Thu, 20 Apr 2023 14:41:08 +0000 Date: Thu, 20 Apr 2023 16:40:59 +0200 From: Simon Horman To: Vladimir Oltean Cc: netdev@vger.kernel.org, "David S. Miller" , Michal Kubecek , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Xiaoliang Yang , Petr Machata , Danielle Ratson , Pranavi Somisetty , Harini Katakam , Vinicius Costa Gomes , Kurt Kanzenbach , Gerhard Engleder , Ferenc Fejes , Aaron Conole , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 net-next 2/9] net: enetc: report mm tx-active based on tx-enabled and verify-status Message-ID: References: <20230418111459.811553-1-vladimir.oltean@nxp.com> <20230418111459.811553-3-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230418111459.811553-3-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P195CA0009.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5e2::17) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SN4PR13MB5792:EE_ X-MS-Office365-Filtering-Correlation-Id: fd9da178-8ba7-4573-1698-08db41ad46ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VGgO5STTLNmbJs/0Sd8kmcYd64a1lrLSaKNMLtTovrZ9JXHEmesncFSRUEziuZkpq7sz79+Ps7BGdWxnBPMspyOTXFyu4Rj7mj/GcJiaykiRtRb7UJ4avVtyTadGc4FJPUpm5+PXOjfSKEkOSposXZvCvMJtaBBfzQ/UtubECruKCLyhm+OsD2ZyeaFarrQ4VVVUfumVQVt/LVsrJ75ut3LgLKZGAklBkN6MO1OrPzXsU1H9T67BNB7M6NiyZYdDNZDfOukUPDXJV4h3USAUYM5pUj661guAMrKSCcrzaAMdUXRxPEvJ57OfChFC6MXSd32lb9PcRaSdiqsFyGTUBbLWIlUinMhngOFaCeXf4ifNK2/GEjfgpFiR/GKvtim6C+JcKH8Pn4J1qskWWrX5DQ3ki7laxV50mSJeZ7T0jXh9kgyJ3w5BzZ7gq7zcOwxk+S4zO4X8fVt+VUKXUvL1xe1G6bZC64Fyi4e1QH7m1312UDzWC1AVJxyPV7JFjlvz/PwXfOMYIg0Jdcpo5oOJhPRxdB+hWo/7HdN3HbtEXuP2LuS2pUk5oUxbDc28HfvtePYDr8ovwVOMh0l41ReIoEhZ3GCohS6nrd67VnkB/ZU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(39840400004)(136003)(366004)(451199021)(6512007)(6506007)(4326008)(6916009)(41300700001)(316002)(15650500001)(2616005)(83380400001)(86362001)(186003)(6666004)(6486002)(478600001)(36756003)(66899021)(8676002)(5660300002)(8936002)(2906002)(66946007)(66476007)(66556008)(38100700002)(54906003)(7416002)(44832011)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pkNHUi9ySC/2lcW8ajP9gB1t4vnjb/o5id09Q7bUDJRp2ybI+ueQHOD2A9Ia?= =?us-ascii?Q?ATTrdID/4th3+r5e7rxT1b26r0Idjnj49M3NiVcxMLInt9h/zjvz65UodTwm?= =?us-ascii?Q?6Sbp1yWJyL/13gZI8m09IgLXR4txFI3vSnbQtqe1oLwEb3ubxD4FyGV6E4AP?= =?us-ascii?Q?+Y5uL8FOsHagH8HPplJ10U8v1cxF0y1o/nmxDbjDx92zyu4K7CjRAH6+8HHC?= =?us-ascii?Q?tqx6V7cbApp2lyrnYS+cL/EPgZSKhjCAezvKaVmuq+hbWYKFBj6Na33ciIVR?= =?us-ascii?Q?0sZT8zbGMwqu9U4vj5ClT24p2ER7B6wynBM+zYZH33ZoliMvvHli4eslP21B?= =?us-ascii?Q?9DdZPoeR101PDCkZZn4A9vpyDlse8/bHRepvvC3jeNMD2xwIJi0JsCNkqxam?= =?us-ascii?Q?hXR3tadrEsRyp3wugFHV/I5fF2QRKaAi85kAmRGBAWw2hDXZN/VqAZ85ChB/?= =?us-ascii?Q?g2rwSaQodhGUvtiXv9Qdt6TYgD8s1wi0Sx8hNFKm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cmML7hCFZALVn+9cPsD5kHP+76m/C3/ZYeuT1yR+k7IsIfwvdAeu3d?= =?us-ascii?Q?IQiVCK0xwCxHNGh+jpOiN9itVb24iI5yI5y4mJFXNgPWgnoGFexgs6iEihTh?= =?us-ascii?Q?nzbmDQ8HpNe38lWiqp3VNTgpKi5dQ5YZFv3+LHRfoJ3hSPLD6Jh08CI5f9yv?= =?us-ascii?Q?2GA1/idnUYj0aVWT7LTBUfTkneVqKxejTn+4Y+TyHSne/nAOO3fpi4zXVNNl?= =?us-ascii?Q?2uKvxiW84aVaLX96r9P+YYUIEb1GGb1VLwjG7GXJKiMY2rGDEmM67/YBIcY4?= =?us-ascii?Q?79/GsA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd9da178-8ba7-4573-1698-08db41ad46ea X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 14:41:08.3378 (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: uRjFdk922btCDVHofvRxPZgUfd7+G+9NNGFzhDDI6moDjaLbYfPzzKfGI7EbZmhVXc1Jqikgn18pznUVRr8jUxbJw19M5Qc6tatIiedeXlM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5792 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 18, 2023 at 02:14:52PM +0300, Vladimir Oltean wrote: > The MMCSR register contains 2 fields with overlapping meaning: > > - LPA (Local preemption active): > This read-only status bit indicates whether preemption is active for > this port. This bit will be set if preemption is both enabled and has > completed the verification process. > - TXSTS (Merge status): > This read-only status field provides the state of the MAC Merge sublayer > transmit status as defined in IEEE Std 802.3-2018 Clause 99. > 00 Transmit preemption is inactive > 01 Transmit preemption is active > 10 Reserved > 11 Reserved > > However none of these 2 fields offer reliable reporting to software. > > When connecting ENETC to a link partner which is not capable of Frame > Preemption, the expectation is that ENETC's verification should fail > (VSTS=4) and its MM TX direction should be inactive (LPA=0, TXSTS=00) > even though the MM TX is enabled (ME=1). But surprise, the LPA bit of > MMCSR stays set even if VSTS=4 and ME=1. > > OTOH, the TXSTS field has the opposite problem. I cannot get its value > to change from 0, even when connecting to a link partner capable of > frame preemption, which does respond to its verification frames (ME=1 > and VSTS=3, "SUCCEEDED"). > > The only option with such buggy hardware seems to be to reimplement the > formula for calculating tx-active in software, which is for tx-enabled > to be true, and for the verify-status to be either SUCCEEDED, or > DISABLED. > > Without reliable tx-active reporting, we have no good indication when > to commit the preemptible traffic classes to hardware, which makes it > possible (but not desirable) to send preemptible traffic to a link > partner incapable of receiving it. However, currently we do not have the > logic to wait for TX to be active yet, so the impact is limited. > > Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman