Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp341570ybe; Wed, 4 Sep 2019 00:04:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1t43amRW5gWyMymFpjqOEaTNh3ZlJtiPLqVWJ6W/1o/4mYQeovuALyA9WV9z1xKbqU9Iu X-Received: by 2002:a62:8142:: with SMTP id t63mr7204271pfd.246.1567580673948; Wed, 04 Sep 2019 00:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567580673; cv=none; d=google.com; s=arc-20160816; b=lsIuNmOKn+mQcp4BJOiGYmtLpio9Ca1CONjkXp9W4V3zpPbjm2+scvxobf5we+suyD ZM1W8H4AzA1sQlwPneUr5F2a29gyXAl8/+5xFn/4xyMMcnnSisceIBC/QXuzv0+7Aadv t4kYHq7F/a7HlzSe+vRFN+r1eL8QRhEyrYDCfCxu2k9rw/E2hIuy7uq1/bg5uFMiUWxx HNYtOHy0YUgWAfDuhMiyQc8O+J/JZ3RAvyhYgQClNx2tS0FkjMyYMn0Xlm4FH7lfKcaD hncCsRc1f1Y7yi/PqVqpeTIon5YR2oLvAZG7ZhfxyNpVQpMHsrYB6YPaMshUJx3uBgdZ Vf/Q== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=ZkCFX7lY2aG0YWzTZaq8wfmIvx5lKpvhuS12ykWiXo4=; b=Th0kSZ2dtXIauBCqPwuyiF23JI0cG3aspWRueBQzDZiBgj3wpFzQIrUL4SEn0btPVn eIkOAODoOFFWPcnsGUKYNi/IHp+I2MnFqiDVyzNwqhvbnb/koSFqAP/dls3cFusbBm3c 4bHccfT+Py6JbGeK40tVh5GdZ/N/fvKbuIlzRm/mH73o4JqTsnqz0a18DmGhno+7eqVe QHgV7RCzHEIjkGuXshy0SmCKFvbKqPehWPGnm1t0JxiFYVa7693JiJcLJ5dGMIe+QWZX d+bDHRzSQQo6X4nSkibJo/0hU/obVtn7nT6ZHXt9L1XA6IFQdk915+9+K1FfpYFNTpj+ PWtA== ARC-Authentication-Results: i=1; mx.google.com; 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 65si16680855plf.222.2019.09.04.00.04.14; Wed, 04 Sep 2019 00:04:33 -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; 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 S1728532AbfIDHEA (ORCPT + 99 others); Wed, 4 Sep 2019 03:04:00 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:33860 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbfIDHEA (ORCPT ); Wed, 4 Sep 2019 03:04:00 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.1) (envelope-from ) id 1i5PKd-0008GG-Mb; Wed, 04 Sep 2019 09:03:55 +0200 Message-ID: <582e0a7eef96bb7d97fee4bae340ded97fda86a2.camel@sipsolutions.net> Subject: Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw From: Johannes Berg To: Wen Gong , ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Date: Wed, 04 Sep 2019 09:03:54 +0200 In-Reply-To: <1567577743-27684-1-git-send-email-wgong@codeaurora.org> References: <1567577743-27684-1-git-send-email-wgong@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2019-09-04 at 14:15 +0800, Wen Gong wrote: > Make it possibly for drivers to adjust the default mat_mtu > by storing it in the hardware struct. > > +++ b/net/mac80211/iface.c > @@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, > > /* MTU range: 256 - 2304 */ > ndev->min_mtu = 256; > - ndev->max_mtu = IEEE80211_MAX_DATA_LEN; > + if (local->hw.max_mtu) > + ndev->max_mtu = local->hw.max_mtu; > + else > + ndev->max_mtu = IEEE80211_MAX_DATA_LEN; It seems (slightly) preferable to me to just initialize the value in local->hw.max_mtu in alloc_hw(), so the driver can override it before register_hw(), and then use it here unconditionally. Any particular reason for it being this way? johannes