Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp960845pxb; Thu, 30 Sep 2021 23:33:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvnzHTvvUg+aZhTN8Ay//67t01Jj0DekXwmjvyx0oB8/s7RP5NY6hHpKp0oz49AHn+jXRM X-Received: by 2002:a05:6a00:d6f:b0:44c:5c1:7852 with SMTP id n47-20020a056a000d6f00b0044c05c17852mr4891637pfv.13.1633070009775; Thu, 30 Sep 2021 23:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633070009; cv=none; d=google.com; s=arc-20160816; b=XoejXRAaHuHeaaFHjut8PHiieyCfxViprYkRvgeHDDcq0WJVXirdDOIgaCauZiRQKZ Yxrd82McneqMWV3kU6nbU/ZeIn4vy2TXMQOSzyuyikC8i/GmcNB/ZquD7ksqwpt6+13o 0SW2OM9ZQl7yWPhBJEFfGT8P3WEqTlz6qD4Ro231Rkc19DqGtnbwJFOAwD4RcP5kjdX/ M2nA9BUiaem02OqIAfJugujDwpl3aVOAEiNKXvbYwf4/RRrZqS5d9VZdqYVCP5e2mmvX TkJ3MD3yuU0ygJAjoLtNhw6Hg4fiVGpZOWnak78CQ0ukJgtGJ2j8e1/UQdxO1hEGylbh vpig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=yngI8d9kE9NDRbOqrv6sx2IfRNF26J+yF9N7nFydqCA=; b=dcO5c+b0XDq7V8lgnDHKMpLC0plQmeoaySc2QGG3p8YreAh3IwIz0v9/Nz8hNskzhQ sk+88L++vyYtLp/S02RY8K/qt+pWAHGFbo3eApDYINuVJ+L5ygIPs2zQ/cvzcmdN7eHC +Uwg00ifMb13/zn9YwEWTexQ2upKGpxhpFNKwDuggbBRmpZ//PItx1d8v+omwROYCWAJ QA1VgQ9wT+zjtZ0wj1J27jIcL0TfkbkdukVPby9cPdAAFIlhKLJcYFtZL/XzYCxIf00q mCwcW7TIBN9Bj+/NHubHUnn2rDmu8eOGt1DgbunOEy3vqRzOfyrTzOQxwpkC9ORVWdep k5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=g1KHl1dg; 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 u5si9193330pji.123.2021.09.30.23.33.17; Thu, 30 Sep 2021 23:33:29 -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=pass header.i=@mg.codeaurora.org header.s=smtp header.b=g1KHl1dg; 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 S1352148AbhJAGei (ORCPT + 78 others); Fri, 1 Oct 2021 02:34:38 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:23243 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352084AbhJAGeg (ORCPT ); Fri, 1 Oct 2021 02:34:36 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633069973; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=yngI8d9kE9NDRbOqrv6sx2IfRNF26J+yF9N7nFydqCA=; b=g1KHl1dgCvS61/ru3+iNbYoEfJZqqWTqdbszcRy4VQ+OmXgIDLV72RYjavHYoeNy0WDTJblM 5ffAVmGlUBAgszkSPpwLxJhNQYGx+uoRNHCDVKZ/vIQSrDIzO0XqSi0Wd/3EMhU798Ft4t24 2GyAVJLJYluUAbqbQKC1GXT95VQ= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 6156ab9363b1f186582a527d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 01 Oct 2021 06:32:51 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7187EC4360C; Fri, 1 Oct 2021 06:32:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from tykki (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id E6926C4338F; Fri, 1 Oct 2021 06:32:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org E6926C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Wen Gong Cc: Johannes Berg , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v3 2/2] mac80211: do intersection with he mcs and nss set of peer and own References: <1609816120-9411-1-git-send-email-wgong@codeaurora.org> <1609816120-9411-3-git-send-email-wgong@codeaurora.org> Date: Fri, 01 Oct 2021 09:32:45 +0300 In-Reply-To: (Wen Gong's message of "Wed, 29 Sep 2021 11:20:01 +0800") Message-ID: <87bl49mf02.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Wen Gong writes: > On 2021-09-28 21:02, Johannes Berg wrote: >> Hi, >> >> >> I had done a bunch of fixups to this patch, but the zero-day build >> robot >> correctly reports that: >> >>> + ieee80211_he_mcs_intersection(&own_he_cap.he_mcs_nss_supp.rx_mcs_80, >>> + &he_cap->he_mcs_nss_supp.rx_mcs_80, >>> + &own_he_cap.he_mcs_nss_supp.tx_mcs_80, >>> + &he_cap->he_mcs_nss_supp.tx_mcs_80); >> >> the &own_he_cap... parts here will take an __le16 pointer to a possibly >> unaligned variable - any thoughts how we could fix that? >> > Hi Johannes, > > Add "__packed" before the "__le16 *" should solve this warning by my > understand like this: > > diff --git a/net/mac80211/he.c b/net/mac80211/he.c > index c05af7018f79..960fea9646b0 100644 > --- a/net/mac80211/he.c > +++ b/net/mac80211/he.c > @@ -52,7 +52,7 @@ ieee80211_update_from_he_6ghz_capa(const struct > ieee80211_he_6ghz_capa *he_6ghz_ > sta->sta.he_6ghz_capa = *he_6ghz_capa; > } > > -static void ieee80211_he_mcs_disable(__le16 *he_mcs) > +static void ieee80211_he_mcs_disable(__packed __le16 *he_mcs) > { > u32 i; > > @@ -60,8 +60,8 @@ static void ieee80211_he_mcs_disable(__le16 *he_mcs) > *he_mcs |= cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED > << i * 2); > } > > -static void ieee80211_he_mcs_intersection(__le16 *he_own_rx, __le16 > *he_peer_rx, > - __le16 *he_own_tx, __le16 > *he_peer_tx) > +static void ieee80211_he_mcs_intersection(__packed __le16 *he_own_rx, > __packed __le16 *he_peer_rx, > + __packed __le16 *he_own_tx, > __packed __le16 *he_peer_tx) > { > u32 i; > u16 own_rx, own_tx, peer_rx, peer_tx; > > > > net/mac80211/he.c:158:33: warning: taking address of packed member > 'rx_mcs_80' of class or structure 'ieee80211_he_mcs_nss_supp' may > result in an unaligned pointer value [-Waddress-of-packed-member] I don't know what Johannes thinks, but to me that looks like an ugly hack. Wouldn't use get_unaligned() or similar be cleaner? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches