Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2475143pxf; Sat, 27 Mar 2021 12:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzLsZNoqZ6hzTLJpNGtZuJJ0mA736ccXsXllIh58CZKL18p6fjfz2wASS8w+aIwXlbwixu X-Received: by 2002:a05:6402:26c3:: with SMTP id x3mr22330642edd.126.1616873384932; Sat, 27 Mar 2021 12:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616873384; cv=none; d=google.com; s=arc-20160816; b=Wk0t5YKYimFwfuqSnGaLEPw/b7yP9673NFoa7kIYKwI3uew/aZ8llAc8c2i7rI3uRL /4+Um40tKP+BkUwgstSpPBlP56NKZ3o1lAIrDalInWBYCY4KsIOdzXj4LjOSYT/jYxpU KyIXyayaUoEtYaW/fsi69JhQqoNzlAaU2cbqeAq7ndk/U68dBTdBPKotXDfk0e+F3YsZ 7IvPK0i2lMkVc6QzONCIO/pCwcnebSnPK2j2rjSf+r7FOHpphSrRWx5b28/sv7QjPErz 2cUX1d66yPoofZGP9NfJwCG9eSyoow5VNti5MdZZpGUStlQT8QN2iS+BaNp6JEL3unAe g0gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=uYnf1IKlMCYCPygSlBm3j96oJ03ojNQFUX944rUctNw=; b=vSk6W6UcyfEpCUeoOmTc0XVaAdT4n6lDwEKRCWfIXllsDXn1lZEQFTMnV2lkBe8/4m E24Uc3q44jTHYsfZbYYmTNyY3J7wBoiKhPV6NlDWRla4ZHRLFUsNd/+VzJr5fknnebFI QZyhFB3qdyyOPVQ1U633eXPhgs0durHKtqagxqblfd69whtX816YKKvnaJ4uRSIskGkZ xYrSvzJ2FvEvqJY8jaZTMpuMXbUTRUKCT58o0tUhuDV9acJXp4x5Y0RKm/14G2WPtAd9 I+e6Rsgl/+a4Ge0bZnuiAJ5tmefDRUzFnf9hAkm1N0hR1WRM1gWC/m+4LGq/uJo23FMY x8nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IW12M+Cv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si9626153edv.220.2021.03.27.12.29.18; Sat, 27 Mar 2021 12:29:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IW12M+Cv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbhC0T2i (ORCPT + 99 others); Sat, 27 Mar 2021 15:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbhC0T21 (ORCPT ); Sat, 27 Mar 2021 15:28:27 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9106DC0613B1 for ; Sat, 27 Mar 2021 12:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uYnf1IKlMCYCPygSlBm3j96oJ03ojNQFUX944rUctNw=; b=IW12M+Cv33RD8bzqVwkwQIDqwz PvPnwJ7Si+XyPxRZs5cEZpgA2iscMX3oYHhz2Axv5wu8onXGiN+KiXIfhzlWeQVGBvJnJTCOdILzV LOCpKHal6HGiPjq+uZNIK4DqJIFoMJvy2FdZjNtfIOBa1zZyxNRYWOk3GroNY0+QdIUE=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lQEbd-0003V0-7C; Sat, 27 Mar 2021 20:28:21 +0100 To: Ryder Lee , Lorenzo Bianconi Cc: Shayne Chen , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org References: From: Felix Fietkau Subject: Re: [PATCH] mt76: report Rx timestamp Message-ID: <41727e36-e165-5b8e-4d76-be96f61bc83e@nbd.name> Date: Sat, 27 Mar 2021 20:28:20 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-03-27 08:55, Ryder Lee wrote: > Frame reception timestamp (low 32-bits) that indicates the value of the > local TSF timer value at the time the first bit of the MAC header in the > received frame (PPDU unit) arriving at the MAC. > > Signed-off-by: Ryder Lee > --- > drivers/net/wireless/mediatek/mt76/agg-rx.c | 2 +- > drivers/net/wireless/mediatek/mt76/mac80211.c | 1 + > drivers/net/wireless/mediatek/mt76/mt76.h | 3 +- > .../net/wireless/mediatek/mt76/mt7603/mac.c | 31 ++++++++++-------- > .../wireless/mediatek/mt76/mt7603/mt7603.h | 2 +- > .../net/wireless/mediatek/mt76/mt7615/mac.c | 32 ++++++++++--------- > .../wireless/mediatek/mt76/mt7615/mt7615.h | 2 +- > .../net/wireless/mediatek/mt76/mt7915/mac.c | 29 +++++++++-------- > .../wireless/mediatek/mt76/mt7915/mt7915.h | 2 +- > .../net/wireless/mediatek/mt76/mt7921/mac.c | 29 +++++++++-------- > .../wireless/mediatek/mt76/mt7921/mt7921.h | 2 +- > 11 files changed, 74 insertions(+), 61 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c > index 144e8a8910ba..a37b8db979c6 100644 > --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c > +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c > @@ -77,7 +77,7 @@ mt76_rx_aggr_check_release(struct mt76_rx_tid *tid, struct sk_buff_head *frames) > nframes--; > status = (struct mt76_rx_status *)skb->cb; > if (!time_after(jiffies, > - status->reorder_time + > + (unsigned long)status->reorder_time + > mt76_aggr_tid_to_timeo(tid->num))) > continue; This doesn't work, you need to replace the time_after with a function that takes u32 wraparound into account. - Felix