Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp12021pxj; Thu, 10 Jun 2021 13:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiZy74cljYtPzKyMlMKpGQJ55M0CDmfbdhLf5kE1goB9swgFilnVBJhcLQems/T6c8ag6l X-Received: by 2002:a17:907:d92:: with SMTP id go18mr308563ejc.317.1623356185953; Thu, 10 Jun 2021 13:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623356185; cv=none; d=google.com; s=arc-20160816; b=EHXdt+5HPpkM17Zn7WWt39g9PO3JSryC7cWeJ3Ka1uDQ3raXzq3OA8mhCBXFFGV/n4 hn29NWsc0t0MNlWjfYKN73kOdb58FBouDLT6WVUNZW8Katf5pXX+EemeiRuYKuAMvs4/ FpTdSvLox6MaPiX6yOls5O7F1lf7b5WOmegt2+X4wKTlwuWMGj4IRDd25jkOdPZCSEuP 8Vg8nl+qKJTi3B7qhS6IljtGs8mQl6Tqr+6gcXI2fcWTMdn6l2eSErqwmRPTVfNwbGvA hrSWrQs/b3ttGPISegzChTcKZGvrSRjRAzGVBZlfQ3dzPPSiAZ5QEUSyFx5IBOAIn/SR T76A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=0kSljBKY/xEZblhOKlX5xqol/5fPc3MsYBh1JJ4yjCo=; b=iOAeAF6FxbogD50/CdY8WFkzjNaT1Ssg7TWoAQJqKqgHUzCNjolFe7PZdxTANzLs+5 9rFgVwwurBZym3QolhhpwBBVGRzoMaiEhTFdLqeXXpeMgJo19QiO/9tkTp94Q98pYXFd vFS3EwXMvUNXTUyfib0CyzXT6wt+8FkdywdfDKyTX7fY2H6trOlT+Y0aWR5msE7Uo6AU BWPaPwOZXuzvdNwqkGTaNK+YxdD5u6hLMakBNfzGvBThn9Wiv45zwXpCP6TKuYKrvgPa v868Sc+rDbPuxVjG21VurxPdj6R4D6pbJpvkWBYs9aeE1Ee9f3l4ODO+rzh7vG9ePFaU c2hA== ARC-Authentication-Results: i=1; mx.google.com; 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 g20si3590745ejz.520.2021.06.10.13.15.27; Thu, 10 Jun 2021 13:16:25 -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; 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 S230245AbhFJUQ3 (ORCPT + 99 others); Thu, 10 Jun 2021 16:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbhFJUQ3 (ORCPT ); Thu, 10 Jun 2021 16:16:29 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80473C061574 for ; Thu, 10 Jun 2021 13:14:31 -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 1lrR4O-0050UP-TU; Thu, 10 Jun 2021 22:14:29 +0200 Message-ID: Subject: Re: Is the extra_tx_headroom guarenteed ? From: Johannes Berg To: Steven Ting Cc: "linux-wireless@vger.kernel.org" Date: Thu, 10 Jun 2021 22:14:28 +0200 In-Reply-To: (sfid-20210607_051714_758886_6CCCA7F4) References: (sfid-20210607_051714_758886_6CCCA7F4) 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 Hi, > We encountered a problem that we use the extra_tx_headroom to reserve the headroom > which we put the txdesc in. > > Current workaround is that we check our needed headroom size by skb_headroom() > in the driver layer. > > Is extra_tx_headroom in struct ieee80211_hw always guaranteed? It _should_ be, IMHO. Having the check in all the drivers would be pointless. > The header file describes: > * @extra_tx_headroom: headroom to reserve in each transmit skb > * for use by the driver (e.g. for transmit headers.) > > But when the skb goes through the ieee80211_amsdu_realloc_pad(), it does not > take care of the extra_tx_headroom, i.e. the original reserved headroom might be > eaten. OK, so I guess that's a bug there. > Does the ieee80211_amsdu_realloc_pad() lacks some check for extra_tx_headroom > or the extra_tx_headroom in mac80211 is not guaranteed? I would say it lacks the checks - want to send a patch? > Furthermore, for the packet that would not be aggregate in A-MSDU and ndev->needed_headroom > is not guaranteed, in this case whether mac80211 layer still guarantee the extra_tx_headroom ? Yes, this case should be handled. johannes