From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 396BEC77B70 for ; Mon, 17 Apr 2023 14:25:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbjDQOZd (ORCPT ); Mon, 17 Apr 2023 10:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjDQOZa (ORCPT ); Mon, 17 Apr 2023 10:25:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D02118A74 for ; Mon, 17 Apr 2023 07:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681741478; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ih22A54IlQcIcpW8AJafH3qjCniWddl0rR6pTvOIfYU=; b=AxKbK0DfkZDmb1L1zhuJJLKIRnDzBnONFip8TNqQFsHjNE2z/80oib8S6z/fPJX21I7UcL wyrJljXoXr2RxtEQhg8KaJn8PezECluv+7V+OQUixEttER5RhoLSt4+6RWQJ9UZpNyk/qI XI9Si2wyWv7eS4cymmjYilWTVXwiC94= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-_nuF1o_lMVmG3RO59CFnfg-1; Mon, 17 Apr 2023 10:24:37 -0400 X-MC-Unique: _nuF1o_lMVmG3RO59CFnfg-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-505149e1a4eso10600268a12.1 for ; Mon, 17 Apr 2023 07:24:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681741476; x=1684333476; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ih22A54IlQcIcpW8AJafH3qjCniWddl0rR6pTvOIfYU=; b=ALRCLAEt6cVzmmvI0VeGfcTFkD6lCpbVLuQLo2ObSXwQMYWN6+N408P9DI2i3qYZNO duRT/eg1qPI6Z+gkBNJ247DroDMCUyzLFa9mDwPDybB8gurPX/w6CewLQ+7WvJ8q2J6t yqk+Fmrvv2P10ZJJ+d3uw3F3u3Nu1iww2N2EdxAZx4Nu5ximXQZJfHiSPqMbZwk04urZ 8wkOy6lH/q+vz/NtkycVnodRLUbQ58Sv2jpf2zeWIZx/Chw2qyvAInaPX/1BAnd27Z1W +gBl8F6FLoA4JkixbKw53k7y9fcE4N6GXOdv/Hd9wUphK1b3QYiwmyx8YPSjzLGVMQqx j/+g== X-Gm-Message-State: AAQBX9cqnYqs2BUS9Eb09D0L2ASkQ/oGNBzP9MfJ5NQh4XgfhTltPdFZ tLGt4/iqd2YLbLqupurhYJtI4rSaiVCRJr0ScWI6OWOsE3TLIfWlRcudPFoQ8vQFZWjNmI+bOzb 3kBfsBKqQP+j+nQDuwwvdKp/G X-Received: by 2002:a05:6402:510a:b0:504:a336:22d5 with SMTP id m10-20020a056402510a00b00504a33622d5mr18020036edd.15.1681741476377; Mon, 17 Apr 2023 07:24:36 -0700 (PDT) X-Google-Smtp-Source: AKy350ZzCTM4iTY4cjU7RvpTj9V6B1opCLDxjF2En5J3oVG+O+Xu2rEAPmG7p+piBgCrXtL93dXnUA== X-Received: by 2002:a05:6402:510a:b0:504:a336:22d5 with SMTP id m10-20020a056402510a00b00504a33622d5mr18020003edd.15.1681741476043; Mon, 17 Apr 2023 07:24:36 -0700 (PDT) Received: from [192.168.42.222] (194-45-78-10.static.kviknet.net. [194.45.78.10]) by smtp.gmail.com with ESMTPSA id n6-20020aa7db46000000b00504b203c4f1sm5879091edt.40.2023.04.17.07.24.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Apr 2023 07:24:35 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: Date: Mon, 17 Apr 2023 16:24:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Cc: brouer@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, xdp-hints@xdp-project.net, stable@vger.kernel.org Subject: Re: [PATCH net v3 1/1] igc: read before write to SRRCTL register Content-Language: en-US To: Song Yoong Siang , "Bezdeka, Florian" , Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Maciej Fijalkowski , Vedang Patel , Jithu Joseph , Andre Guedes , Stanislav Fomichev , Jacob Keller , David Laight References: <20230414154902.2950535-1-yoong.siang.song@intel.com> <934a4204-1920-f5e1-bcde-89429554d0d6@redhat.com> In-Reply-To: <934a4204-1920-f5e1-bcde-89429554d0d6@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/04/2023 22.05, Jesper Dangaard Brouer wrote: > > On 14/04/2023 17.49, Song Yoong Siang wrote: >> igc_configure_rx_ring() function will be called as part of XDP program >> setup. If Rx hardware timestamp is enabled prio to XDP program setup, >> this timestamp enablement will be overwritten when buffer size is >> written into SRRCTL register. >> >> Thus, this commit read the register value before write to SRRCTL >> register. This commit is tested by using xdp_hw_metadata bpf selftest >> tool. The tool enables Rx hardware timestamp and then attach XDP program >> to igc driver. It will display hardware timestamp of UDP packet with >> port number 9092. Below are detail of test steps and results. >> [...] >> >> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") >> Cc: # 5.14+ >> Signed-off-by: Song Yoong Siang >> Reviewed-by: Jacob Keller >> Reviewed-by: Jesper Dangaard Brouer >> --- > > LGTM, thank for the adjustments :-) > > Acked-by: Jesper Dangaard Brouer > Tested-by: Jesper Dangaard Brouer I can confirm that this patch fix the issue I experienced with igc. This patch clearly fixes a bug in igc when writing the SRRCTL register. (as bit 30 in register is "Timestamp Received Packet" which got cleared before). Florian might have found another bug around RX timestamps, but this patch should be safe and sane to apply as is. >> v2 -> v3: Refactor SRRCTL definitions to more human readable definitions >> v1 -> v2: Fix indention >> --- >>   drivers/net/ethernet/intel/igc/igc_base.h | 11 ++++++++--- >>   drivers/net/ethernet/intel/igc/igc_main.c |  7 +++++-- >>   2 files changed, 13 insertions(+), 5 deletions(-)