Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7570922rwb; Wed, 23 Nov 2022 08:05:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf5umGfmjVZ4Zfhjt3Udh1+pQw8XLWx8AjvG+MSAGnGwn0T13vkCSpmq3/A5dN4xYGOLUcr+ X-Received: by 2002:a17:902:76c7:b0:186:880c:167a with SMTP id j7-20020a17090276c700b00186880c167amr9676325plt.165.1669219510792; Wed, 23 Nov 2022 08:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669219510; cv=none; d=google.com; s=arc-20160816; b=v49RFIlXYZaBR7TQkYq9NJWO1WGjhp8wkLBeg2lplWWHLvKYWFF0TbNO2kz2JpJPBm WJE7yG1p4NtIkHGIUVSgUdECBEQPgfWPxd7cVJMfLYadTzWYX7S4LbHONo7WTA0NdoJy rGUrHqDYpjzR7vbfjdl5XjfrKSCd9+1B/Xyl1B1RYxfbkeFNwQ9LY2MUFJ49sbMZPtf+ 2FsCI1yMAwWLk4mB9Kubo9BcGGPGCbadXDbqm6RzgoCk1TFLJ88Je1YjDpHVOnRbdXDh Ckrah6Qk8dIW622AjAeuW4VtKmW7TUepVO7JbTDkH76jNjkciU7Orb/Se9FxteeGPo3t K9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bPC4e+QyKn6CwJxdBglGVxurShKRN684Z+FgJSTPCNw=; b=RpHGzMxqN/sWULi354hX2aQEQg88BiRmeU36dvRQ70OCafPS7ArjMi6UzQkUWZBdvf hTO7b5UexZea5emuvoUKJ9U2DqFLt0JPD5dQU0sX7nMGk+jUKnoUH/Je7kF234I1Kp+W vkzl5o7k9kui9CJkJVNSIuFV2Vj15qHnRODmMp5WGKXydAa6BcC+XR4Gm/eUVfEAd6nF zeFoWBXYlPEgp+50q0198NxXwoLz2OhwvKG1h+M1tVs3ZTtodW7g0LoRnjxXa/XrI24L ZTx+FE3elzX1Y7ONo3eyt01SblfWKRo1enHkvmWWHva7MoKe9A4BZ1qWpaF/eGfql//P o/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hS8aUoNV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a63fb14000000b0046f6afe556bsi17408977pgh.651.2022.11.23.08.04.56; Wed, 23 Nov 2022 08:05:10 -0800 (PST) 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=@intel.com header.s=Intel header.b=hS8aUoNV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236917AbiKWPxB (ORCPT + 88 others); Wed, 23 Nov 2022 10:53:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239098AbiKWPwY (ORCPT ); Wed, 23 Nov 2022 10:52:24 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B83D4C72EA; Wed, 23 Nov 2022 07:52:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669218721; x=1700754721; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6ne8ydE7pKzkiu7r3g05XpgU2xo+eR0YxTixzH5yqn8=; b=hS8aUoNVybqnS+6/tmzJCP1kxknWFAB+fxaqAoraSdYRGZJ4aCoWbPr5 EZgMb1L1Bfwzx4HF4F5D2wPtbcPdDsU16DxxgxQeNxc45l8NeDCgEfzxz mRxrMGzOG361ShTBiJHTpRPlDoLn0UjJyGbkJTn/7l9d6fs606U8tNSuE fkDv+FiywGhCgQycMgltDBm7MXxw9TUnQXmpmG6LGPAULwLT7varWEaKD Qw2eIGLKnvcwyyEpLl/9dIkUaOMKgctRxLFlvb9/1W3BG42/2XZVjAQqd 4I3noQ7Tir+mKB0WowgSs/i7KIZrg65/XZacvxJ/qlmgegwyaGNwSSDKv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="294483609" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="294483609" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2022 07:51:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="747840614" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="747840614" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga002.fm.intel.com with ESMTP; 23 Nov 2022 07:51:49 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 2ANFpm4I000385; Wed, 23 Nov 2022 15:51:48 GMT From: Alexander Lobakin To: Vladimir Oltean Cc: Alexander Lobakin , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: enetc: preserve TX ring priority across reconfiguration Date: Wed, 23 Nov 2022 16:51:16 +0100 Message-Id: <20221123155116.484163-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221122130936.1704151-1-vladimir.oltean@nxp.com> References: <20221122130936.1704151-1-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 From: Vladimir Oltean Date: Tue, 22 Nov 2022 15:09:36 +0200 > In the blamed commit, a rudimentary reallocation procedure for RX buffer > descriptors was implemented, for the situation when their format changes > between normal (no PTP) and extended (PTP). > > enetc_hwtstamp_set() calls enetc_close() and enetc_open() in a sequence, > and this sequence loses information which was previously configured in > the TX BDR Mode Register, specifically via the enetc_set_bdr_prio() call. > The TX ring priority is configured by tc-mqprio and tc-taprio, and > affects important things for TSN such as the TX time of packets. The > issue manifests itself most visibly by the fact that isochron --txtime > reports premature packet transmissions when PTP is first enabled on an > enetc interface. > > Save the TX ring priority in a new field in struct enetc_bdr (occupies a > 2 byte hole on arm64) in order to make this survive a ring reconfiguration. > > Fixes: 434cebabd3a2 ("enetc: Add dynamic allocation of extended Rx BD rings") > Signed-off-by: Vladimir Oltean > --- > drivers/net/ethernet/freescale/enetc/enetc.c | 8 ++++--- > drivers/net/ethernet/freescale/enetc/enetc.h | 1 + > .../net/ethernet/freescale/enetc/enetc_qos.c | 21 ++++++++++++------- > 3 files changed, 19 insertions(+), 11 deletions(-) [...] > err = enetc_setup_taprio(ndev, taprio); > - > - if (err) > - for (i = 0; i < priv->num_tx_rings; i++) > - enetc_set_bdr_prio(hw, priv->tx_ring[i]->index, > - taprio->enable ? 0 : i); > + if (err) { > + for (i = 0; i < priv->num_tx_rings; i++) { > + tx_ring = priv->tx_ring[i]; > + tx_ring->prio = taprio->enable ? 0 : i; Side note: is that `taprio ? 0 : i` correct? It's an error path IIUC, why not just unconditional 0? I guess it is, so Reviewed-by: Alexander Lobakin > + enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio); > + } > + } > > return err; > } > -- > 2.34.1 Thanks, Olek