public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 01/13] mac80211: rework tx encapsulation offload API
Date: Thu, 27 Aug 2020 14:42:07 +0200	[thread overview]
Message-ID: <ba50a77e7503b226cf01a3d71a87bc968e695eac.camel@sipsolutions.net> (raw)
In-Reply-To: <20200821084926.10650-2-nbd@nbd.name>


I was going to not worry about it, but now that I'm replying anyway ...

> +++ b/net/mac80211/iface.c
> @@ -43,6 +43,7 @@
>   */
>  
>  static void ieee80211_iface_work(struct work_struct *work);
> +static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata);

Do we really need that, can can't reorder things?

> +static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype)
> +{
> +	switch (iftype) {
> +	case NL80211_IFTYPE_AP:
> +	case NL80211_IFTYPE_P2P_GO:
> +	case NL80211_IFTYPE_P2P_CLIENT:

The P2P ones cannot happen here due to the iftype munging that mac80211
does, suggest you add a comment about that and remove them.

> +		list_for_each_entry(key, &sdata->key_list, list) {
> +			if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
> +			    key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
> +			    key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 ||
> +			    key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256)
> +				continue;

I had to read that a few times to understand it ... maybe add a comment
that the management frame keys aren't relevant? :)


But anyway, what I was really not sure about is this function:

> +static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata)
> +{
> +	struct ieee80211_local *local = sdata->local;
> +	struct ieee80211_sub_if_data *bss = sdata;
> +	struct ieee80211_key *key;
> +	bool enabled;
> +
> +	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
> +		if (!sdata->bss)
> +			return;
> +
> +		bss = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
> +	}
> +
> +	if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
> +	    !ieee80211_iftype_supports_encap_offload(bss->vif.type))
> +		return;

There are a lot of returns here, some of which make sense, but the
sdata->bss one seems dynamic and doesn't really make sense? Could it
change?

Or maybe we don't care because if it's not linked to a BSS it cannot be
transmitting?

johannes


  reply	other threads:[~2020-08-27 12:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  8:49 [PATCH v3 00/13] mac80211 encapsulation offload / performance patches Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 01/13] mac80211: rework tx encapsulation offload API Felix Fietkau
2020-08-27 12:42   ` Johannes Berg [this message]
2020-08-27 14:41     ` Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 02/13] mac80211: reduce duplication in tx status functions Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 03/13] mac80211: remove tx status call to ieee80211_sta_register_airtime Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 04/13] mac80211: optimize station connection monitor Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 05/13] mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx flags Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 06/13] mac80211: unify 802.3 (offload) and 802.11 tx status codepath Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 07/13] mac80211: add missing queue/hash initialization to 802.3 xmit Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 08/13] mac80211: check and refresh aggregation session in encap offload tx Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 09/13] mac80211: support using ieee80211_tx_status_ext to free skbs without status info Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 10/13] mac80211: extend ieee80211_tx_status_ext to support bulk free Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 11/13] mac80211: notify the driver when a sta uses 4-address mode Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 12/13] mac80211: skip encap offload for tx multicast/control packets Felix Fietkau
2020-08-21  8:49 ` [PATCH v3 13/13] mac80211: set info->control.hw_key for encap offload packets Felix Fietkau
2020-08-27 12:48 ` [PATCH v3 00/13] mac80211 encapsulation offload / performance patches Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba50a77e7503b226cf01a3d71a87bc968e695eac.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox