From patchwork Mon Oct 25 08:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 516149 Delivered-To: patch@linaro.org Received: by 2002:ad5:4292:0:0:0:0:0 with SMTP id z18csp780165imn; Mon, 25 Oct 2021 01:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6a9GhmQ03lwUp49lTqx19TemfUimkPaBVLWVh3qZYEbnfL4VRt8peRmH5k68m2rXVb+4a X-Received: by 2002:a63:ed4f:: with SMTP id m15mr12536527pgk.471.1635149655975; Mon, 25 Oct 2021 01:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635149655; cv=none; d=google.com; s=arc-20160816; b=qsHOrwCc1/IfglLYbViVmuUAZM9OU4JoUWiVJ9NCCq9Zpjesj6Aej1nwCkBThOvHi2 uckn2cHTelA6jhe4chhdpU+vhW/2lBr3KgqLpZocCxPztnvurqWyRYlrU4an5TDbVRlw MGyYXrXjwoWn3rInrvmuwnLczH2sT3snSehWCoArm3Ei3c1oIEkdNSJqP3Tah5HVK4wr jznoJBqm/V0J1QZAh1hO+7anLCSr35OpcWJZt7UDwBHzheGJVa/NYZj2n3KkW/AcdLt6 TQe1o00K7Q5lFZElQ76ELSdCDW52ot8nZ1tQ47VxHBtX2w0Oux6wHyESJEXZ8CS/klpv Bm4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=POQVC8QZ4u0leM7Pc+c4f0IAI6AaNpczqaS8rBqPf0M=; b=XpJWBvmyRtgck23riUF6xbRMsrttNaeN8yJvwYTM7vg0zOPPjdAtVoF/gOdoLS4E00 n5fnq8rzGNZJ7vv934buLs9i7hwlwNE4FHzKXreZphJfIcXbak6b3KevfYZQj9ZlvThP DunpMJjvLDkCmcI9hkbX+V0tbs09j41nhrIC0TsV+yTBwRIREf13MuW51FH7FlER8qIy nCohZvku3crXU2ev0HsOTefVECNpUQ+5KORXfkE0awTwcvMgwmj468OmGVNI+7uj4wMj 3VF3LKrxf2RinAzIxh7prq2UkwuL69ayok7cBHY+Ix2xieYm9u4P6ypLSs2jFTYeF6Tt h/Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=34LiM1RX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="GyKzU0E/"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id nn7si31242681pjb.104.2021.10.25.01.14.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 01:14:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=34LiM1RX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="GyKzU0E/"; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=POQVC8QZ4u0leM7Pc+c4f0IAI6AaNpczqaS8rBqPf0M=; b=34LiM1RXrr52GY ZFO/kSiK/HCx8DPaH85pW+wKayqp5amkceQ+gnLvUFzr43iupqrS7lDIhdIwy20QFfE9ZBomfNYPJ 5urgk/pXS/pLXeW/kPG0D2c7uD7fgQtstBlXCYs7P/dM+HF4dnzS6d23v2AEcx9kBNeZ4gN7vb5Qq PyNc1nscJ1zBpf7sTtU9wzXT2B2fmOgNyA7HkKPFQnf35iwMmaFYzwzGZj+ROAxDVbWfsBkKsa/xS B05QuLa8qlg8EP0syTQh72FYx0mjCPi68p/u3QJ2EBGcqg3mWthZMj9C1CvWr7HiEmRPN6/mQ9v18 uWRnE5Cf0pgMQBoDsSIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mev7W-00Fksc-EW; Mon, 25 Oct 2021 08:14:14 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mev7T-00FkqZ-PS for wcn36xx@lists.infradead.org; Mon, 25 Oct 2021 08:14:13 +0000 Received: by mail-wr1-x42c.google.com with SMTP id m22so7952253wrb.0 for ; Mon, 25 Oct 2021 01:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+hNUpViVOWM+kQGVZ8OCPBbFBkkztmAA/6VLjx/j7DQ=; b=GyKzU0E/RinCdAIH7eRkenDlUrnAD3aQZf0EGaMe9X0wvhX3sYZ8CEA2ETxOugxF09 z4bf+XBpWbbORnyEirRzwOHHqQkJNVACF7EDqBGEu1uH2vc0/VNzU7qTUOrXlvfHeCD4 zyVolhL+4ex+BzdQHKuZnP85vjdkcTfY+ipM9qGUSWbyqX2ygGWYT6E9uWl/40Xp34DF 6is4BX7fyOa+/yQ9r4uBw/fOat/PDFSgTTHDsh1YCHtatKpSTGMKJWz29bvWuH+J+8PV EEAlZoXJKfKA7rn4jgXdSpVQnCjilwI2eQnFYLWJS5djRPKtK+QvetvjRUmHwS1fB0HB UpoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+hNUpViVOWM+kQGVZ8OCPBbFBkkztmAA/6VLjx/j7DQ=; b=Yw+1s6j6SZUJD1K5/AKKwOcIDzjNjy46aa7hxfHtqGOfMbdgVJCktaPtYIyn+zHGr9 flvLWV/ZolTbQDUuHue3bXP0ieqx1fwPtFbPBBaCcAc1HCvvr7hlxtGY71YJy16Ucehw DcL1hzGgCvT5F6TXc5pNkhL9wy4GARB1UaqqrVpBUBCfm5h6I40NOjOtCAMzMTDZ0u5Y 9VSXCP6JGioulYvi2jovkt0BTJiCA1yhENAMIw7BeQFRZeUaB8LTUkoH2OQPW19mqpW8 rGQwjPN1s7nAZzNI1FPbjAXBvA9FvjfR8rIqNopQND2Zte+H/QROA6wcNVlzYKbqsnYh /hfw== X-Gm-Message-State: AOAM5330wwdviOAo2D6x7FBjmuua2neh1j71ju2dL2j7XRFVEvhHml0w NkppO7gC5VUQA7PZ6Zy8CpRvjQ== X-Received: by 2002:a5d:6481:: with SMTP id o1mr21356262wri.60.1635149649676; Mon, 25 Oct 2021 01:14:09 -0700 (PDT) Received: from localhost.localdomain ([88.160.176.23]) by smtp.gmail.com with ESMTPSA id w10sm10956630wrq.88.2021.10.25.01.14.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 01:14:09 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, Loic Poulain Subject: [PATCH] wcn36xx: Fix discarded frames due to wrong sequence number Date: Mon, 25 Oct 2021 10:25:36 +0200 Message-Id: <1635150336-18736-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_011411_849757_3DF50BA7 X-CRM114-Status: GOOD ( 13.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The firmware is offering features such as ARP offload, for which firmware crafts its own (QoS)packets without waking up the host. Point is that the sequence numbers generated by the firmware are not i [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org The firmware is offering features such as ARP offload, for which firmware crafts its own (QoS)packets without waking up the host. Point is that the sequence numbers generated by the firmware are not in sync with the host mac80211 layer and can cause packets such as firmware ARP reponses to be dropped by the AP (too old SN). To fix this we need to let the firmware manages the sequence numbers by its own (except for QoS null frames). There is a SN counter for each QoS queue and one global/baseline counter for Non-QoS. Fixes: 84aff52e4f57 ("wcn36xx: Use sequence number allocated by mac80211") Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/txrx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Tested-by: Bryan O'Donoghue diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 81db90f..75951cc 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -427,8 +427,6 @@ static void wcn36xx_set_tx_pdu(struct wcn36xx_tx_bd *bd, bd->pdu.mpdu_header_off; bd->pdu.mpdu_len = len; bd->pdu.tid = tid; - /* Use seq number generated by mac80211 */ - bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_HOST; } static inline struct wcn36xx_vif *get_vif_by_addr(struct wcn36xx *wcn, @@ -525,6 +523,9 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, tid = ieee80211_get_tid(hdr); /* TID->QID is one-to-one mapping */ bd->queue_id = tid; + bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_QOS; + } else { + bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_NON_QOS; } if (info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT || @@ -536,6 +537,8 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, /* Don't use a regular queue for null packet (no ampdu) */ bd->queue_id = WCN36XX_TX_U_WQ_ID; bd->bd_rate = WCN36XX_BD_RATE_CTRL; + if (ieee80211_is_qos_nullfunc(hdr->frame_control)) + bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_HOST; } if (bcast) { @@ -595,6 +598,8 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd, bd->queue_id = WCN36XX_TX_U_WQ_ID; *vif_priv = __vif_priv; + bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_NON_QOS; + wcn36xx_set_tx_pdu(bd, ieee80211_is_data_qos(hdr->frame_control) ? sizeof(struct ieee80211_qos_hdr) :