Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1590326rwb; Thu, 19 Jan 2023 12:42:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvqEGUrlYQDQ80DE+5VnjMO3p46gzAcXJqzwbjr6HTzkwhJ1r6eEpynwLmMppEX9NGzFb+7 X-Received: by 2002:a05:6a20:8ba5:b0:b8:93b8:ee2f with SMTP id m37-20020a056a208ba500b000b893b8ee2fmr11458088pzh.45.1674160960815; Thu, 19 Jan 2023 12:42:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674160960; cv=none; d=google.com; s=arc-20160816; b=ILwI6szRYkqf8GX1Uhq/biBJn4ANlnjgQOzuXCzfZSYiuwWmXQmtsU22fXirBisntb jym9zrWzOoRM9eGtIVPukPupXeDAzhhskAUJSqdY3ey7AShhS3rMwLMyxUHoUmXZei/g Klsbk5Rk/OPjo9Q7TmVlxRPAdX0P3IAGQcCGFg4/t4yf4kbE4ldTo71hZfL05d9t1Iq6 HKEHqtFpHwZUbCOd8QPpzbSDUY7JRb/7yFyX00nNCCTmsqB3rVVSL4GHFv54tajbJu/n W5Fxi8rdHlS0UMO+ztl0Tls84jvU5sjgueZP1i59dbO0Qm0RIL+ez5gh3dg/gCW/YBAY Rw/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PggIzfygRD9QgTxjyyjnr/C8VTVpVGfqEDvg752Zp0M=; b=Ys+EO5UMiuNvzjHtPUaOa+sjCmn7lkUdZqc22JK7o5UJRzUnskICITw2RTEji7s+cy 85/nuN4X8AQeeI+TBF9vyxoFM/bs8eaoEeOtGJo85f9uhCdmOiaYeL/PeLaG16oIM9i+ jXLWnWlctfRfAeeeYnlA7MKybfQ4twtb3RtcMMKHq3Sxm/cEHuG+PVz9wnFBW5a+RBmu XZSgandsMMMKR7SQJdbtekvIPcC77G8IesoFHZ3Jg5eDj9gDYFNuMTNcf4b2IeL+G4lQ 2xKW5eXfipjv4+9WpYrVafNf9p9nctn8rli/eAfDjaD93TRHybCI0jB7oat2GuhXyyW7 1lsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eJSV+lBK; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 33-20020a631461000000b0046f5808167asi41300480pgu.812.2023.01.19.12.42.35; Thu, 19 Jan 2023 12:42:40 -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=@redhat.com header.s=mimecast20190719 header.b=eJSV+lBK; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjASUJb (ORCPT + 46 others); Thu, 19 Jan 2023 15:09:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbjASUJ2 (ORCPT ); Thu, 19 Jan 2023 15:09:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1DAC94C91 for ; Thu, 19 Jan 2023 12:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674158920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PggIzfygRD9QgTxjyyjnr/C8VTVpVGfqEDvg752Zp0M=; b=eJSV+lBKb0BrTqp7ePQaetMiF4Hn8xErHrzIdDk3sA7jIoWYpPJRBpMBQn1qT+45VM1zhV fykm9tjU83RAdp+DFW3fNRv6ALbcbN2FBoqCgDVgAQwX1p6GcVO8cbTrx8WpWrVxFvpAju zqxB1w4/dfKEww8WHv4mgXBB1JVKrKc= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-180-e94RbOI9Mu-g354tMHVgkQ-1; Thu, 19 Jan 2023 15:08:39 -0500 X-MC-Unique: e94RbOI9Mu-g354tMHVgkQ-1 Received: by mail-pg1-f199.google.com with SMTP id f132-20020a636a8a000000b00473d0b600ebso1491830pgc.14 for ; Thu, 19 Jan 2023 12:08:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PggIzfygRD9QgTxjyyjnr/C8VTVpVGfqEDvg752Zp0M=; b=tGrx/pP6Le70TDL4YNEWhvq9U2ATXbadZYihGcXFrSF5dwjLktM/PvwV43bOXwDYGh 4dz5Bj/SVYk/2LyA5JLKPzSQ3vt1Q1+tstIMy6ARsedkSrIP6DHAL+wpzC2QkF2nQLZZ hV9+3QYpntSeRibnt6Xh/KiowzvT27Ui/VGaMW5ITDAmqnoE78wUeMxQi/2NgR6WhKhw fM9IlwKIH7Bs82pQFUQQZNq7LV1FFRI1UnkPH1GM9TPM293kGFi3KE1DGJoUSJs+T/TS cM2VUerxPvjVtTHgiaVX1qlIJgX1ATAiutz4G2zSvig/EMfd7TRkrRu7jO04/orrqTDw Lhaw== X-Gm-Message-State: AFqh2kqJneAS44a5Ig1z9enAbUvgqf4DFCgkEhVrCUVl1A0lcB8cTsOR KFtBs86A9xneb8+dMVzjb/ORmEyMshbFFSka9KB/rpZFHtZo8+ANctm6eccIcBEGB6hF+6hDbhB 8wVpGeMuxsHPd5z9bTjYhooP1rjYoDLLRzO50wrqy X-Received: by 2002:a17:90b:187:b0:226:f8dc:b230 with SMTP id t7-20020a17090b018700b00226f8dcb230mr1387628pjs.227.1674158918002; Thu, 19 Jan 2023 12:08:38 -0800 (PST) X-Received: by 2002:a17:90b:187:b0:226:f8dc:b230 with SMTP id t7-20020a17090b018700b00226f8dcb230mr1387616pjs.227.1674158917773; Thu, 19 Jan 2023 12:08:37 -0800 (PST) MIME-Version: 1.0 References: <20230117181533.2350335-1-neelx@redhat.com> <2bdeb975-6d45-67bb-3017-f19df62fe7af@intel.com> <42e74619-f2d0-1079-28b1-61e9e17ae953@intel.com> <820cf397-a99e-44d4-cf9e-3ad6876e4d06@intel.com> <423a29e2-886d-2c41-16d4-a8fca5537c2e@intel.com> In-Reply-To: <423a29e2-886d-2c41-16d4-a8fca5537c2e@intel.com> From: Daniel Vacek Date: Thu, 19 Jan 2023 21:08:01 +0100 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH] ice/ptp: fix the PTP worker retrying indefinitely if the link went down To: Jacob Keller Cc: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , "Kolacinski, Karol" , Siddaraju , "Michalik, Michal" , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Thu, Jan 19, 2023 at 8:25 PM Jacob Keller wrote: > On 1/19/2023 1:38 AM, Daniel Vacek wrote: > > On Wed, Jan 18, 2023 at 11:22 PM Jacob Keller wrote: > >> On 1/18/2023 2:11 PM, Daniel Vacek wrote: > >>> On Wed, Jan 18, 2023 at 9:59 PM Jacob Keller wrote: > >>>> On 1/18/2023 7:14 AM, Daniel Vacek wrote: > >>>> 1) request tx timestamp > >>>> 2) timestamp occurs > >>>> 3) link goes down while processing > >>> > >>> I was thinking this is the case we got reported. But then again, I'm > >>> not really experienced in this field. > >>> > >> > >> I think it might be, or at least something similar to this. > >> > >> I think that can be fixed with the link check you added. I think we > >> actually have a copy of the current link status in the ice_ptp or > >> ice_ptp_tx structure which could be used instead of having to check back > >> to the other structure. > > > > If you're talking about ptp_port->link_up that one is always false no > > matter the actual NIC link status. First I wanted to use it but > > checking all the 8 devices available in the dump data it just does not > > match the net_dev->state or the port_info->phy.link_info.link_info > > > > crash> net_device.name,state 0xff48df6f0c553000 > > name = "ens1f1", > > state = 0x7, // DOWN > > crash> ice_port_info.phy.link_info.link_info 0xff48df6f05dca018 > > phy.link_info.link_info = 0xc0, // DOWN > > crash> ice_ptp_port.port_num,link_up 0xff48df6f05dd44e0 > > port_num = 0x1 > > link_up = 0x0, // False > > > > crash> net_device.name,state 0xff48df6f25e3f000 > > name = "ens1f0", > > state = 0x3, // UP > > crash> ice_port_info.phy.link_info.link_info 0xff48df6f070a3018 > > phy.link_info.link_info = 0xe1, // UP > > crash> ice_ptp_port.port_num,link_up 0xff48df6f063184e0 > > port_num = 0x0 > > link_up = 0x0, // False > > > > crash> ice_ptp_port.port_num,link_up 0xff48df6f25b844e0 > > port_num = 0x2 > > link_up = 0x0, // False even this device is UP > > crash> ice_ptp_port.port_num,link_up 0xff48df6f140384e0 > > port_num = 0x3 > > link_up = 0x0, // False even this device is UP > > crash> ice_ptp_port.port_num,link_up 0xff48df6f055044e0 > > port_num = 0x0 > > link_up = 0x0, // False even this device is UP > > crash> ice_ptp_port.port_num,link_up 0xff48df6f251cc4e0 > > port_num = 0x1 > > link_up = 0x0, > > crash> ice_ptp_port.port_num,link_up 0xff48df6f33a9c4e0 > > port_num = 0x2 > > link_up = 0x0, > > crash> ice_ptp_port.port_num,link_up 0xff48df6f3bb7c4e0 > > port_num = 0x3 > > link_up = 0x0, > > > > In other words, the ice_ptp_port.link_up is always false and cannot be > > used. That's why I had to fall back to > > hw->port_info->phy.link_info.link_info > > > > Hmm. We call ice_ptp_link_change in ice_link_event which is called from > ice_handle_link_event... > > In ice_link_event, a local link_up field is set based on > phy_info->link_info.link_info & ICE_AQ_LINK_UP > > What kernel are you testing on? Does it include 6b1ff5d39228 ("ice: > always call ice_ptp_link_change and make it void")? > > Prior to this commit the field was only valid for E822 devices, but I > fixed that as it was used for other checks as well. > > I am guessing that the Red Hat kernel you are using lacks several of > these clean ups and fixes. Yeah, makes perfect sense. We don't have that commit in 8.4. All the data I have and present here are from 4.18.0-305.49.1.rt7.121.el8_4.x86_64 > For the current code in the net-next kernel I believe we can safely use > the ptp_port->link_up field. I'll fix that up and drop you a v3. Thank you for the review. --nX > Thanks, > Jake