From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECD91C433ED for ; Tue, 18 May 2021 11:19:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAED461001 for ; Tue, 18 May 2021 11:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348794AbhERLVK (ORCPT ); Tue, 18 May 2021 07:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348785AbhERLVI (ORCPT ); Tue, 18 May 2021 07:21:08 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7722C061573 for ; Tue, 18 May 2021 04:19:50 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1lixlL-00AmfT-Ge; Tue, 18 May 2021 13:19:47 +0200 Message-ID: Subject: Re: [PATCH 1/2] mac80211: do not use low data rates for data frames with no ack flag From: Johannes Berg To: Felix Fietkau , Philipp Borgers Cc: linux-wireless@vger.kernel.org Date: Tue, 18 May 2021 13:19:46 +0200 In-Reply-To: References: <20210518110755.43077-1-borgers@mi.fu-berlin.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2021-05-18 at 13:17 +0200, Felix Fietkau wrote: > > Frames with IEEE80211_TX_CTL_HW_80211_ENCAP set have no 802.11 header, > so please change the check something like this: > > if ((info->flags & IEEE80211_TX_CTL_NO_ACK) && > ((info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) || > ieee80211_is_data(hdr->frame_control))) Maybe we should consider some kind of inline helper? static inline bool ieee80211_is_tx_data(struct sk_buff *skb) { ... *info = ... ... *hdr = (void *)skb->data; return (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) || ieee80211_is_data(hdr->frame_control); } or so? johannes