From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98BB01C3F for ; Wed, 23 Aug 2023 20:56:32 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1272510EC for ; Wed, 23 Aug 2023 13:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692824185; x=1724360185; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=IoNMHdXToSkdNV/P+Ls0j6WvSu4gX+qouzOVvkzW4t8=; b=H//Xhrku+b5AyLl1q3O6CcC2WeJbW+wZL4a+b5IYJbFJrZWz1rBsUt0/ h4HTxdtfOBT53n3C7sVn3ac4l9mUkQrRkcnSdOXIh6wiElDkHA2sw+MI9 JQ/mh+kMTCE+8Ff3Fpo0Uwt35EEhuSDyq9O/eEybw2TWRfG6ahIpz5/fc lZ6fAcC7xyt8PkVLewCgOddHWzzI1U6VG13O2z/gcZzYOgOYzRfcbxGea cq054hGWeCZ8U9mGpozNLV6sgswwqfOoF5mpxW8IpGK7TlqEHJoIOK1MB vfuR7Oj+5BLglGCeI7JTaaNzphGYrdjDje36i9HzGAmJrKq1FgTmPdlUJ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10811"; a="378023033" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="378023033" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2023 13:56:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10811"; a="802281180" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="802281180" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 23 Aug 2023 13:56:17 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 23 Aug 2023 13:56:17 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 23 Aug 2023 13:56:17 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 23 Aug 2023 13:56:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gkHCatr7gFI20rqWdvuaFLHwX/+eB1s7mYmGCi2OIib7oOXrYZXVgBlWP4ZVAzjoxIAb7DanADvtJNxlAb8xoowC1P5qUW9yUF1cSNrXKu5x4YzOcNiYPmqyC+HXsa4CUN/Ib/cNPRpAMdaNQ3EGcZ3IKtDAL6gvcHMEEjRaS7MHX3KcUNuixR45w3npAhn36flKH8yGO/j+edSugr3O0Fnpxwd5ZZemhbZhNe/f9LLoPuKLQAUFM17C/78VjSX/HSkToAU7woZApqAu6W9kuvQC0UUxuYZUKy/C5kNY4qR1qq7DHXERDM8Pk1QXsicCWQqXLj5YLtXLofEwN1LP9w== 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=SSaFOMNyuHurPNfr+3cNqwYOw6I2DAdLBDXBe2+Xggc=; b=CMMKKJQk9LHY8TIy4MkXCg6bq6SW44fPkTscW23PTU6m3WUmIiUX8tKfSsxYgq1blkboNbYbaPf130/TOPBH7ru09IZEB0Ue4zisWr1C0qudzMsWUEewASXr7zGNqGsKrIZEHjppPpRMZOrdTtOOpArNQgCkILZ3LUweSairrZPTW2BrvKASahbPYoFIGmrPGemul2uY5T8c+jb7+bQFDNP+CpVwMq2cuPu0WcCjtMIN/6y3y+lw+ADfBg2onU74Jhvf8ZTl3rRkck5CjLFkJBtXx0c0W41ElD0rk4DCm1tVINC5PFG0AbCZpswXxpXkUIInM5Xm4VLy8hvH4Xp5Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) by IA0PR11MB7185.namprd11.prod.outlook.com (2603:10b6:208:432::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26; Wed, 23 Aug 2023 20:56:13 +0000 Received: from CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::6a23:786d:65f7:ef0b]) by CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::6a23:786d:65f7:ef0b%6]) with mapi id 15.20.6699.022; Wed, 23 Aug 2023 20:56:13 +0000 Message-ID: <54a53056-8217-bf67-155f-ab5569df71e1@intel.com> Date: Wed, 23 Aug 2023 13:56:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v3 iwl-next 4/9] ice: rename PTP functions and fields Content-Language: en-US To: Karol Kolacinski , CC: , , References: <20230822124044.301654-1-karol.kolacinski@intel.com> <20230822124044.301654-5-karol.kolacinski@intel.com> From: Jacob Keller In-Reply-To: <20230822124044.301654-5-karol.kolacinski@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR02CA0003.namprd02.prod.outlook.com (2603:10b6:303:16d::30) To CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB5089:EE_|IA0PR11MB7185:EE_ X-MS-Office365-Filtering-Correlation-Id: d45d23db-4cc9-451d-3040-08dba41b62eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3VudAyUaCEebbF5C2c5Rgz4UpORoY1eKcXQWHmGh0b4cDE1JU3asWRM2+C7PiA6F/41OPIN9X6yK8kf32Cdrvvk6Zbz9JZNTI8SWvGaJgEMgSFrA0afWRrN9+ZwGwwl9U2BnFbigPkkoTuGvC13Mz9sVazH24aDnfofdaUhD3vUwe9QQjmWDVxjIbqGbbTclROx1sEksTQR1TEdvGTzpBp0gZHBYqLPeU4tCTPlQ1cu6/E4d3CCFIa8KPD9+q/fu3BX+ShzE4U72ONU1VgPt8l+dHIRHaL8mU7tWYo2cJ+zNBIdzCzE4ZuF9dj796YsH69qE8QjuzbtY3005mWFbM6Im9BevaDW5JPB4V7AoEJlKtaSPg0jqxOb5k2aAuLXcuZ66su2Bw5Yf80VEVxXhjIUfJ+dWh6QIJ8ujLcteS6khN4ZJswVxH3evoERP/nyG44fOGd1nFGXurujcbwXlFSXJAGeGWaBgqqR3kwayJMZtqL2Ld3U+7nd0ltzR4CvZVdKJsQLTTekBEQgtIJHAQIc+jLQwK0cPYudFQrDg5jE6iWlIdQAxgaWwQChIHtF1CFZ5tA5BRI0IeqaE0uxKLhYFghNjIg+1Lk4Hmcj8rlfAiwWmUmB5CQckqn3kNUKBtJrDte4oVs1sLzcwDsdCcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5089.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199024)(186009)(1800799009)(31686004)(478600001)(86362001)(36756003)(6486002)(6506007)(66476007)(66556008)(316002)(66946007)(53546011)(41300700001)(31696002)(6512007)(38100700002)(82960400001)(8676002)(4326008)(8936002)(5660300002)(107886003)(26005)(2616005)(83380400001)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q05ValZRR0k5M2hRV3JYVWdoQVNEQzRybzBsaFlyQUJZS0FRVlZZb2pzQVBi?= =?utf-8?B?NkViZkdDNkZhWHJhVjIyb1pkMlo2dVZOQnNqbkJBTmh0M2lNdzVKeFdnNUhV?= =?utf-8?B?alJmazRsUm9UbTliMC9vZ1g5YVBZekhVUnJORlZSQTcyYWdCcnBVZWdFY1o5?= =?utf-8?B?U0FYeFBwbG0yTjMzMmlYTjZ5cUI2SnZDZFRGblloZEphUnRXbnNvWEEvdTE5?= =?utf-8?B?cC9MSlQzeVpOSU5GckNPNXlGK050TWw5SXlUaGlIeTl1RUZnQ1BUb0lGcytq?= =?utf-8?B?V1ZKQ2ZLN2JTdVpVbjV4WXJlMnc4V1NsUHRISkV0N3JXM3QwdnZIczI4Um41?= =?utf-8?B?ZmFvZ3RkNWNuNWRzQzlJSGFEQzd5QVQ0cFpkMXJjbnl5VURXdHZ0Q2J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-Network-Message-Id: d45d23db-4cc9-451d-3040-08dba41b62eb X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5089.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2023 20:56:13.4773 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oVDyFfoTOZQCT3SHa4VQXgCZktisqUIlc9AW+01nPPX+E9tQp9GwEBXmbZz72WwsrtfG7EvZ0wHuiin+Y5FQd9U/Mx7VMGDeHbc4ezxrGIs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7185 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On 8/22/2023 5:40 AM, Karol Kolacinski wrote: > From: Jacob Keller > > The tx->verify_cached flag is used to inform the Tx timestamp tracking > code whether it needs to verify the cached Tx timestamp value against > a previous captured value. This is necessary on E810 hardware which does > not have a Tx timestamp ready bitmap. > > In addition, we currently rely on the fact that the > ice_get_phy_tx_tstamp_ready() function returns all 1s for E810 hardware. > Instead of introducing a brand new flag, rename and verify_cached to > has_ready_bitmap, inverting the relevant checks. > > The ice_ptp_tx_cfg_intr() function sends a control queue message to > configure the PHY timestamp interrupt block. This is a very similar name > to a function which is used to configure the MAC Other Interrupt Cause > Enable register. > > Rename this function to ice_ptp_cfg_phy_interrupt in order to make it > more obvious to the reader what action it performs, and distinguish it > from other similarly named functions. > > The ice_ptp_configure_tx_tstamp function writes to PFINT_OICR_ENA to > configure it with the PFINT_OICR_TX_TSYN_M bit. The name of this > function is confusing because there are multiple other functions with > almost identical names. > > Rename it to ice_ptp_cfg_tx_interrupt in order to make it more obvious > to the reader what action it performs. > > Signed-off-by: Jacob Keller > Signed-off-by: Karol Kolacinski > --- > drivers/net/ethernet/intel/ice/ice_ptp.c | 41 +++++++++++++----------- > drivers/net/ethernet/intel/ice/ice_ptp.h | 6 +++- > 2 files changed, 27 insertions(+), 20 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c > index bd94b42e19dd..393156b9b426 100644 > --- a/drivers/net/ethernet/intel/ice/ice_ptp.c > +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c > @@ -281,11 +281,11 @@ static const char *ice_ptp_state_str(enum ice_ptp_state state) > } > > /** > - * ice_ptp_configure_tx_tstamp - Enable or disable Tx timestamp interrupt > - * @pf: The PF pointer to search in > + * ice_ptp_cfg_tx_interrupt - Configure Tx timestamp interrupt for the device > + * @pf: Board private structure > * @on: bool value for whether timestamp interrupt is enabled or disabled > */ > -static void ice_ptp_configure_tx_tstamp(struct ice_pf *pf, bool on) > +static void ice_ptp_cfg_tx_interrupt(struct ice_pf *pf, bool on) > { > u32 val; > > @@ -320,7 +320,7 @@ static void ice_set_tx_tstamp(struct ice_pf *pf, bool on) > } > > if (pf->ptp.tx_interrupt_mode == ICE_PTP_TX_INTERRUPT_SELF) > - ice_ptp_configure_tx_tstamp(pf, on); > + ice_ptp_cfg_tx_interrupt(pf, on); > > pf->ptp.tstamp_config.tx_type = on ? HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; > } > @@ -591,9 +591,11 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) > hw = &pf->hw; > > /* Read the Tx ready status first */ > - err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready); > - if (err) > - return; > + if (tx->has_ready_bitmap) { > + err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready); > + if (err) > + return; > + } > > /* Drop packets if the link went down */ > link_up = ptp_port->link_up; > @@ -621,7 +623,8 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) > * If we do not, the hardware logic for generating a new > * interrupt can get stuck on some devices. > */ > - if (!(tstamp_ready & BIT_ULL(phy_idx))) { > + if (tx->has_ready_bitmap && > + !(tstamp_ready & BIT_ULL(phy_idx))) { > if (drop_ts) > goto skip_ts_read; > > @@ -641,7 +644,7 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) > * from the last cached timestamp. If it is not, skip this for > * now assuming it hasn't yet been captured by hardware. > */ > - if (!drop_ts && tx->verify_cached && > + if (!drop_ts && !tx->has_ready_bitmap && > raw_tstamp == tx->tstamps[idx].cached_tstamp) > continue; > > @@ -651,7 +654,7 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) > > skip_ts_read: > spin_lock(&tx->lock); > - if (tx->verify_cached && raw_tstamp) > + if (!tx->has_ready_bitmap && raw_tstamp) > tx->tstamps[idx].cached_tstamp = raw_tstamp; > clear_bit(idx, tx->in_use); > skb = tx->tstamps[idx].skb; > @@ -895,7 +898,7 @@ ice_ptp_init_tx_e822(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) > tx->block = port / ICE_PORTS_PER_QUAD; > tx->offset = (port % ICE_PORTS_PER_QUAD) * INDEX_PER_PORT_E822; > tx->len = INDEX_PER_PORT_E822; > - tx->verify_cached = 0; > + tx->has_ready_bitmap = 1; > > return ice_ptp_alloc_tx_tracker(tx); > } > @@ -918,7 +921,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) > * verify new timestamps against cached copy of the last read > * timestamp. > */ > - tx->verify_cached = 1; > + tx->has_ready_bitmap = 0; > > return ice_ptp_alloc_tx_tracker(tx); > } > @@ -1338,14 +1341,14 @@ void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup) > } > > /** > - * ice_ptp_tx_ena_intr - Enable or disable the Tx timestamp interrupt > + * ice_ptp_cfg_phy_interrupt - Configure PHY interrupt settings This should be in a separate patch, it looks like it got accidentally squashed into this when rebasing. > * @pf: PF private structure > * @ena: bool value to enable or disable interrupt > * @threshold: Minimum number of packets at which intr is triggered > * > * Utility function to enable or disable Tx timestamp interrupt and threshold > */ > -static int ice_ptp_tx_ena_intr(struct ice_pf *pf, bool ena, u32 threshold) > +static int ice_ptp_cfg_phy_interrupt(struct ice_pf *pf, bool ena, u32 threshold) > { > struct ice_hw *hw = &pf->hw; > int err = 0; > @@ -2507,8 +2510,8 @@ void ice_ptp_reset(struct ice_pf *pf, enum ice_reset_req reset_type) > struct ice_ptp *ptp = &pf->ptp; > struct ice_hw *hw = &pf->hw; > struct timespec64 ts; > - int err, itr = 1; > u64 time_diff; > + int err; > > if (ptp->state != ICE_PTP_RESETTING) { > if (ptp->state == ICE_PTP_READY) { > @@ -2561,7 +2564,7 @@ void ice_ptp_reset(struct ice_pf *pf, enum ice_reset_req reset_type) > > if (!ice_is_e810(hw)) { > /* Enable quad interrupts */ > - err = ice_ptp_tx_ena_intr(pf, true, itr); > + err = ice_ptp_cfg_phy_interrupt(pf, true, 1); > if (err) > goto err; > } > @@ -2847,13 +2850,13 @@ static int ice_ptp_init_owner(struct ice_pf *pf) > /* The clock owner for this device type handles the timestamp > * interrupt for all ports. > */ > - ice_ptp_configure_tx_tstamp(pf, true); > + ice_ptp_cfg_tx_interrupt(pf, true); This looks like a change that got accidentally squashed into this patch. > > /* React on all quads interrupts for E82x */ > wr32(hw, PFINT_TSYN_MSK + (0x4 * hw->pf_id), (u32)0x1f); > > /* Enable quad interrupts */ > - err = ice_ptp_tx_ena_intr(pf, true, itr); > + err = ice_ptp_cfg_phy_interrupt(pf, true, itr); > if (err) > goto err_exit; > } > @@ -2925,7 +2928,7 @@ static int ice_ptp_init_port(struct ice_pf *pf, struct ice_ptp_port *ptp_port) > * neither on own quad nor on others > */ > if (!ice_ptp_pf_handles_tx_interrupt(pf)) { > - ice_ptp_configure_tx_tstamp(pf, false); > + ice_ptp_cfg_tx_interrupt(pf, false);> wr32(hw, PFINT_TSYN_MSK + (0x4 * hw->pf_id), (u32)0x0); > } > kthread_init_delayed_work(&ptp_port->ov_work, > diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h > index 48c0d56c0568..30ad714a2a21 100644 > --- a/drivers/net/ethernet/intel/ice/ice_ptp.h > +++ b/drivers/net/ethernet/intel/ice/ice_ptp.h > @@ -100,7 +100,7 @@ struct ice_perout_channel { > * the last timestamp we read for a given index. If the current timestamp > * value is the same as the cached value, we assume a new timestamp hasn't > * been captured. This avoids reporting stale timestamps to the stack. This is > - * only done if the verify_cached flag is set in ice_ptp_tx structure. > + * only done if the has_ready_bitmap flag is not set in ice_ptp_tx structure. > */ > struct ice_tx_tstamp { > struct sk_buff *skb; > @@ -131,6 +131,9 @@ enum ice_tx_tstamp_work { > * @calibrating: if true, the PHY is calibrating the Tx offset. During this > * window, timestamps are temporarily disabled. > * @verify_cached: if true, verify new timestamp differs from last read value We're using has_ready_bitmap instead, but we still kept verify_cached in the structure. Oops. > + * @has_ready_bitmap: if true, the hardware has a valid Tx timestamp ready > + * bitmap register. If false, fall back to verifying new > + * timestamp values against previously cached copy. > */ > struct ice_ptp_tx { > spinlock_t lock; /* lock protecting in_use bitmap */ > @@ -143,6 +146,7 @@ struct ice_ptp_tx { > u8 init : 1; > u8 calibrating : 1; > u8 verify_cached : 1; > + u8 has_ready_bitmap : 1; > }; > > /* Quad and port information for initializing timestamp blocks */