Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4067680rwe; Mon, 17 Apr 2023 07:32:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZmKj0TBSks67WHX8hUo+t7x1F3CsB/4koMO5caNJsq+x4WoWocSOdLJY6WBsMIUEyKNgdo X-Received: by 2002:a05:6a20:a814:b0:ea:fa7f:f879 with SMTP id cb20-20020a056a20a81400b000eafa7ff879mr16577270pzb.42.1681741942102; Mon, 17 Apr 2023 07:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681741942; cv=none; d=google.com; s=arc-20160816; b=mvDAuGs5dgoBGMEhq2wphk2fvR7G6imGyd1qEh4zEWJ8p1X8456OeiexriwXvrxvAe Js9EvBoQdJMPHGkFhsL/HmvunN0aJ+cK2vdZRHyxLtUZ8RgEjJ3RT6WQtR2jaz79ACkB 2d/w5p2De+tWVsY9LVCqOl0WHCeIdB3yYD3FaB/oI0+0dQ/NhmmRDsrvSTrQjbJzqb/I ExsXCzNYs/45jdGLY6eI+X3Kv3v0s1tpVrEa3fHrFneIJA1rRItNQ31Nc6fE1O6TtKlx RSciXb5vL7ISM2ZJ0BDtq7MM193A3DDylOm36oygM0pYm2Xh2rI8JvoAqLdpaMlN9v82 cT+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :to:content-language:subject:cc:user-agent:mime-version:date :message-id:from:dkim-signature; bh=Ih22A54IlQcIcpW8AJafH3qjCniWddl0rR6pTvOIfYU=; b=CufCaG2+0djN/+Jgix6nqXHkrLfL5LkzSihqhKooe71G8fAUGHs5b4aLsz49jS1bWp xItez7Qz8kjGrRCNx0PIA2OdfSviYrIALoUpInaL87j2XKF2luSkLoIYaasdo+j1nXTu XRKFjGaa+wMka+LEtNSVSfhje+KtviAxcQaJDUMBX+DuesCxTSVQ0OEsa9U1vflf3Em6 t9wVupHCkP9u9pwDuWHnzriqOVhqqg/1LtvSEhResgEZ2iQ6w7oPIoLD3Uwjuk/irFwq mfbg9QPiRczVXfqnilqeoww3Kr8Z/qxNdxENYcFERerSgRNHOhAvEbW/UunmpGKogVYG 9CjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AxKbK0Df; 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 f1-20020a63de01000000b0051372ec9316si11672457pgg.166.2023.04.17.07.32.07; Mon, 17 Apr 2023 07:32:22 -0700 (PDT) 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=AxKbK0Df; 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 S230093AbjDQOZb (ORCPT + 99 others); Mon, 17 Apr 2023 10:25:31 -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-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 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,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 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(-)