Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp352821iob; Wed, 18 May 2022 03:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr2s/7iALRZX+kirI2p1l+AMTs9cleQYdWcc+p+Le7v+EJdVofC9sdsdSZYfu8FsVp7cEf X-Received: by 2002:a17:902:f607:b0:161:5f47:b213 with SMTP id n7-20020a170902f60700b001615f47b213mr18204173plg.4.1652870707411; Wed, 18 May 2022 03:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652870707; cv=none; d=google.com; s=arc-20160816; b=I5s/5L6NmF5/tYMs55PjU4MoEwzszmboEFB1TgTXGdTVdFGsPEfCZMLyzbCf6s3/H5 SHifS74K65RYxEuo5L+0pJO2fYlmmJIJ5lyWc5VWFEGJJfEXkM0i3Eoc6jaFyVi1RkaK plVdbj6yaH5+yY198Bwc+eAYwvN7ec0NH3jMYIdTkIb6NPtK7ADjNh9lcVoT2G9wAZQ/ 9475VmB7UrhGBikBHowvhcK17A4OBKQixXNMJMYSPfmeSRUHqzE9NVQbfGEOyVFtJ2O/ 6FBPftw3RN2KEYUYhV3RXgOEQGqoUMPhGd1LX/mK8+h0QahLnFbFNjVslMEfLZg4+h5V hjgw== 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; bh=Eg50Z55dIlImdG91r9MKVZYSO4VE8hp0Z0PI1gXalc4=; b=ULzGlGGGF1RjBWk6siwhd0Rk9FO+dE4oiG8jO/gZkK9aYS+i2BFACijWFjN1TWy2Oo TFfTDCbTivo78ysVzysOH9lPbnRaJdHsGpvXgtIctWcgbD46icIJ7LDOVDPihOsvRF8R Kp/8Zir9Fk1qYRa7FmTotcl76zMc1L6NUttM8ut3aikLGQIbtree/xARyCAr0GLhJTRR T1PZiUYBK3mGRn2nFVIyih63pRKdwNyl2HhrIAtIICwu8MeU556cX+Jmvg6d4XtE5KJF NvanOrFCB6b11U7QKvWRi0Kejdc66yGn3G+AsYqKsguDoAW65ovXLc1sq+90XbTUg3ey jBDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x2-20020a655382000000b003f25adfff22si2172582pgq.664.2022.05.18.03.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 03:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 299D31EEC7; Wed, 18 May 2022 03:32:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235144AbiERKb5 (ORCPT + 99 others); Wed, 18 May 2022 06:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235131AbiERKby (ORCPT ); Wed, 18 May 2022 06:31:54 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1786813D31; Wed, 18 May 2022 03:31:52 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id j24so2081728wrb.1; Wed, 18 May 2022 03:31:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Eg50Z55dIlImdG91r9MKVZYSO4VE8hp0Z0PI1gXalc4=; b=17GhCUPB6gzydg59s66OzUrr1Zoxx5DDbNgqWvRHniESqu/LeRsEsUJeriOWT/cH6+ UB1Pbxx6maO4TbrEDtpu/2Ll4WAy3tPw1khXUbtmQd88aM0sWwV4pEA4zyNvbxDsHmiy Gp8ykJwSAePBafZB1N0MN2IX6ekB2DUoA4P6aU/4Dspcr7nrr2uVipjmwNSQeJvDsflC wsDOGKV9lgwrhToOTYwLHijq/2stqHzX20gGC5JDE6HuVVJj+OVo+WEQgaaxqBkAzZ4f JcEJ+GeqxhEHXMIVSiUBSf4+JbLP3QVIb1AojKcmAm4j4d66Seni3ENTquq4LXnagLTe dZdQ== X-Gm-Message-State: AOAM532E4jUf/ngr9gGB90f92HP34L5elGDS/PlUdo7Rxe12EWZzMMhI rkTE6jRYUuc5KjqKVa6f3wxRosY3J1FV+VvS4avvUToKv8oGDw== X-Received: by 2002:a5d:48c1:0:b0:20c:52e9:6c5b with SMTP id p1-20020a5d48c1000000b0020c52e96c5bmr21414633wrs.233.1652869910631; Wed, 18 May 2022 03:31:50 -0700 (PDT) MIME-Version: 1.0 References: <20220517073259.23476-1-harini.katakam@xilinx.com> <20220517073259.23476-2-harini.katakam@xilinx.com> <20220517194254.015e87f3@kernel.org> <20220517220603.36eec66e@kernel.org> In-Reply-To: <20220517220603.36eec66e@kernel.org> From: Harini Katakam Date: Wed, 18 May 2022 16:01:39 +0530 Message-ID: Subject: Re: [PATCH 1/3] net: macb: Fix PTP one step sync support To: Jakub Kicinski Cc: Harini Katakam , Nicolas Ferre , David Miller , Richard Cochran , Claudiu Beznea , Paolo Abeni , netdev , Linux Kernel Mailing List , Michal Simek , Radhey Shyam Pandey Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Jakub, > > > > > @@ -1158,13 +1192,14 @@ static int macb_tx_complete(struct macb_queue *queue, int budget) > > > > > > > > /* First, update TX stats if needed */ > > > > if (skb) { > > > > - if (unlikely(skb_shinfo(skb)->tx_flags & > > > > - SKBTX_HW_TSTAMP) && > > > > - gem_ptp_do_txstamp(queue, skb, desc) == 0) { > > > > - /* skb now belongs to timestamp buffer > > > > - * and will be removed later > > > > - */ > > > > - tx_skb->skb = NULL; > > > > + if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && > > > > > > ptp_oss already checks if HW_TSTAMP is set. > > > > The check for SKBTX_HW_TSTAMP is required here universally and not > > just inside ptp_oss. > > I will remove the redundant check in ptp_oss instead. Please see the > > reply below. > > But then you need to add this check in the padding/fcs call site and > the place where NOCRC is set. If you wrap the check for SKBTX_HW_TSTAMP > in the helper with likely() and remove the inline - will the compiler > not split the function and inline just that check? And leave the rest > as a functionname.part... thing? Yes, I checked the disassembly and this is what's happening. This should be good for the non-PTP packet (going to "likely" branch) and the rest of ptp_oss is evaluated for PTP packets. Regards, Harini