Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3866545ybl; Tue, 20 Aug 2019 03:33:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQSyMxDkW4h0GiYRRrhtpR8ms61dXM/+rGmq8g0Es4kwfDDAs42w6KZANTtv/yaXUtv2RJ X-Received: by 2002:a65:6497:: with SMTP id e23mr23262661pgv.89.1566297191375; Tue, 20 Aug 2019 03:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566297191; cv=none; d=google.com; s=arc-20160816; b=ymvPG+dJhiUxb9J69OAEJaxFvBD/1rV+xHexVssDBglbWuCR9AjY2vkmZCouQ3JgX2 hNs8VLY974JP5m09VYwOssQEc6AYWdB0N3Hdwe9Zud07CFshUOMa+MWF0kFZP9mNhCzH ia71mRFcQS2Xf6jF3hoK0kc0JrY4CLWN3nxEZM5LPeL3Mp6utYHJR4EFq6DvhjEovTJx w0Ywg3dXw6K+Zl6af06EcyFrw7gkUga2UT2aTI4hjJt30qzQYM/5ILiNIthWnpnxnd3R 0aM6NMbv7Ta+5whGo7YSSHsLvRS+gpGpbnNMGuuzj0Fta5wZQJMOYIT1YvhaBFz8Fhyn E99g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=G12kepHNo4d/aWlX/r6KKesBBnEBpcHlYG9XPxPrp/c=; b=SkX4qaZvabbfMMfkAKBlZEI0Wi2DJ9ZY+lJ2xotbPsbcxmlK1qp+7WR6Z2iwbYgnzd b9CEdoBQiD38OrZHz/ftcRN4T9ttk/b4nEIwtUcOpo+4XF/0G2CRwD77ARyFAkrmP9Fi 8Q0IOrlxLCb4JQ0h7AMZiOQfGTgxkbU8OM6M4IwQ94/9hMll27r0DzhwnSpJPsmik1/X h1R+7fWjfOyBLBJ9+RndDn1iEkRsU8xVPT+JOk/Kii68gH+Rz0BFfGApESxw5MB5Feoi LqaPFu6rdlPTVsU7C+yajZQP+rxrS/TRNf1BMZg/7eykW+1NNBg6Vo0dOekpn8oKhYvv dLuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=h6p7VoBQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si12047299plb.337.2019.08.20.03.32.48; Tue, 20 Aug 2019 03:33:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=h6p7VoBQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729686AbfHTKcD (ORCPT + 99 others); Tue, 20 Aug 2019 06:32:03 -0400 Received: from nbd.name ([46.4.11.11]:37280 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729589AbfHTKcD (ORCPT ); Tue, 20 Aug 2019 06:32:03 -0400 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:From:References:Cc:To:Subject: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=G12kepHNo4d/aWlX/r6KKesBBnEBpcHlYG9XPxPrp/c=; b=h6p7VoBQI0mLtHlnnOo+zHrdl0 YOGsuB6x1hWAyxaOGPh9rI2Tq6QkJkq/LvF4B1jCEnB6CsdVPF4bqxbadRr/AZrvLt7G5LHfhJwQc e/d6VqDpkA6ZVHm7IoUC4NIX9jB1q6HR2UZFErsfnNiLY9nP+EnStCDps/642QjiwHz0=; Received: from p54ae9443.dip0.t-ipconnect.de ([84.174.148.67] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i01Qj-0006Hs-36; Tue, 20 Aug 2019 12:31:57 +0200 Subject: Re: [PATCH 5.3] mt76: mt76x0e: don't use hw encryption for MT7630E To: Stanislaw Gruszka Cc: Lorenzo Bianconi , linux-wireless , Ryder Lee , Roy Luo References: <1565703400-10623-1-git-send-email-sgruszka@redhat.com> <20190815100936.GA21775@redhat.com> <727fd528-16c1-e3b3-e1a9-2edbcbdddee7@nbd.name> <20190819110639.GA6037@redhat.com> From: Felix Fietkau Openpgp: preference=signencrypt Autocrypt: addr=nbd@nbd.name; prefer-encrypt=mutual; keydata= mQGiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pE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-245cbe11c7b7@nbd.name> Date: Tue, 20 Aug 2019 12:31:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190819110639.GA6037@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2019-08-19 13:06, Stanislaw Gruszka wrote: > On Thu, Aug 15, 2019 at 12:20:54PM +0200, Felix Fietkau wrote: >> On 2019-08-15 12:09, Stanislaw Gruszka wrote: >> >> Hi Stanislaw, >> >> >> >> Can you please try if disabling/enabling the tx tasklet during hw key >> >> configuration fixes the issue? >> >> Doing something like: >> >> >> >> tasklet_disable(tx_tasklet) >> >> mt76x02_set_key() >> >> tasklet_enable(tx_tasklet) >> > >> > It does not help with the problem. >> > >> >> Moreover, have you double checked if there is any performance impact >> >> of not using hw encryption? >> > >> > I didn't observe any, but realized on this machine I have >> > aesni_intel encryption accelerator. After rebuild kernel without >> > CONFIG_CRYPTO_AES_NI_INTEL, 'perf top' showed extra 20% of cpu usage >> > in aes_encrypt() when sending data with HW encryption disabled. >> > >> >> If so, I guess it is better to just redefine mt76_wake_tx_queue for >> >> mt76x0e and run mt76_txq_schedule for 7630e: >> >> >> >> void mt76x0e_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) >> >> { >> >> if (is_mt7630(dev)) { >> >> mt76_txq_schedule(dev, txq->ac); >> >> } else { >> >> tasklet_schedule(&dev->tx_tasklet); >> >> } >> >> } >> > >> > Not sure about reduction of lock contention for which the tx_tasklet >> > was introduced here, but looks ok for me as fix. >> I think if we work around the bug like this, it can easily come back to >> bite us again later. > > I'm not into workarounds any kind, but this is really strange issue, > maybe FW bug that triggers just by slightly different driver behaviour. > >> I don't see any logical explanation as to how this >> makes a difference with hardware encryption. >> Also, I think it would be helpful to figure out what key operation (if >> any) triggers this, adding or removing keys. > > Seems not to be related with set_key operation at all. We set 2 HW > keys at the beginning and hang happen after some tx/rx traffic > without any re-keyring. > > I'm not sure why disabling HW encryption helps. Maybe it is due to > ordering or timing. With SW encryption we spend more time in mac80211 > before pass skb's to the driver. Or maybe we just mix some HW keys > and SW (group) keys in way that FW does not like. > >> Maybe it could also help if we change the order in which the WCID table >> entries are updated, i.e. changing MT_WCID_ATTR first when removing keys. >> >> Maybe temporarily clearing MT_MAC_SYS_CTRL_ENABLE_TX before the key >> update and setting it again afterwards could also help. > > I tested below patch and it did not help. Can you test if disabling hw encryption only for shared or only for pairwise keys makes any difference? - Felix