All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Sara Sharon <sara.sharon@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 25/28] mac80211: add an option for drivers to check if packets can be aggregated
Date: Fri, 31 Aug 2018 11:31:27 +0300	[thread overview]
Message-ID: <20180831083130.15525-26-luca@coelho.fi> (raw)
In-Reply-To: <20180831083130.15525-1-luca@coelho.fi>

)

From: Sara Sharon <sara.sharon@intel.com>

Some hardwares have limitations on the packets' type in AMSDU.
Add an optional driver callback to determine if two skbs can
be used in the same AMSDU or not.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 include/net/mac80211.h    |  7 +++++++
 net/mac80211/driver-ops.h | 10 ++++++++++
 net/mac80211/tx.c         |  3 +++
 3 files changed, 20 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e448a633a242..95b0b3421ff6 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3581,6 +3581,10 @@ enum ieee80211_reconfig_type {
  * @del_nan_func: Remove a NAN function. The driver must call
  *	ieee80211_nan_func_terminated() with
  *	NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
+ * @can_aggregate_in_amsdu: Called in order to determine if HW supports
+ *	aggregating two specific frames in the same A-MSDU. The relation
+ *	between the skbs should be symmetric and transitive. Note that while
+ *	skb is always a real frame, head may or may not be an A-MSDU.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3863,6 +3867,9 @@ struct ieee80211_ops {
 	void (*del_nan_func)(struct ieee80211_hw *hw,
 			    struct ieee80211_vif *vif,
 			    u8 instance_id);
+	bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *hw,
+				       struct sk_buff *head,
+				       struct sk_buff *skb);
 };
 
 /**
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 8f6998091d26..e42c641b6190 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1173,6 +1173,16 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
 	local->ops->wake_tx_queue(&local->hw, &txq->txq);
 }
 
+static inline int drv_can_aggregate_in_amsdu(struct ieee80211_local *local,
+					     struct sk_buff *head,
+					     struct sk_buff *skb)
+{
+	if (!local->ops->can_aggregate_in_amsdu)
+		return true;
+
+	return local->ops->can_aggregate_in_amsdu(&local->hw, head, skb);
+}
+
 static inline int drv_start_nan(struct ieee80211_local *local,
 				struct ieee80211_sub_if_data *sdata,
 				struct cfg80211_nan_conf *conf)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index a2cc33652f2a..4efed4ac16eb 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3242,6 +3242,9 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,
 	if (skb->len + head->len > max_amsdu_len)
 		goto out;
 
+	if (!drv_can_aggregate_in_amsdu(local, head, skb))
+		goto out;
+
 	if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
 		goto out;
 
-- 
2.18.0

  parent reply	other threads:[~2018-08-31 12:47 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  8:31 [PATCH 00/28] cfg80211/mac80211 patches from our internal tree 2018-08-31 Luca Coelho
2018-08-31  8:31 ` [PATCH 01/28] mac80211: Add he_capa debugfs entry Luca Coelho
2018-08-31  8:31 ` [PATCH 02/28] mac80211: fix WMM TXOP calculation Luca Coelho
2018-08-31  8:31 ` [PATCH 03/28] mac80211: remove pointless 'params' NULL checks Luca Coelho
2018-08-31  8:31 ` [PATCH 04/28] mac80211: fix a race between restart and CSA flows Luca Coelho
2018-08-31  8:31 ` [PATCH 05/28] mac80211: use le16_encode_bits() instead of open-coding Luca Coelho
2018-08-31  8:31 ` [PATCH 06/28] mac80211: add an optional TXQ for other PS-buffered frames Luca Coelho
2018-08-31  8:31 ` [PATCH 07/28] ieee80211: remove redundant leading zeroes Luca Coelho
2018-08-31  8:31 ` [PATCH 08/28] mac80211: Fix station bandwidth setting after channel switch Luca Coelho
2018-08-31  8:31 ` [PATCH 09/28] mac80211: pass the TWT support bits in extended caps to the driver Luca Coelho
2018-09-03  8:52   ` Johannes Berg
2018-09-03  9:28     ` Grumbach, Emmanuel
2018-09-03  9:31       ` Johannes Berg
2018-09-03  9:38         ` Grumbach, Emmanuel
2018-08-31  8:31 ` [PATCH 10/28] mac80211: don't Tx a deauth frame if the AP forbade Tx Luca Coelho
2018-08-31  8:31 ` [PATCH 11/28] mac80211: shorten the IBSS debug messages Luca Coelho
2018-08-31  8:31 ` [PATCH 12/28] cfg80211: add he_capabilities (ext) IE to AP settings Luca Coelho
2018-09-03  8:56   ` Johannes Berg
2018-09-04 10:43     ` Luca Coelho
2018-09-04 11:03       ` Johannes Berg
2018-08-31  8:31 ` [PATCH 13/28] mac80211: in AP mode, set bss_conf::he_supported Luca Coelho
2018-08-31  8:31 ` [PATCH 14/28] ieee80211: add new VHT capability fields/parsing Luca Coelho
2018-08-31  8:31 ` [PATCH 15/28] mac80211: introduce capability flags for VHT EXT NSS support Luca Coelho
2018-08-31  8:31 ` [PATCH 16/28] mac80211: add ability to parse CCFS2 Luca Coelho
2018-08-31  8:31 ` [PATCH 17/28] mac80211: copy VHT EXT NSS BW Support/Capable data to station Luca Coelho
2018-08-31  8:31 ` [PATCH 18/28] mac80211: support radiotap L-SIG data Luca Coelho
2018-08-31  8:31 ` [PATCH 19/28] mac80211: support reporting 0-length PSDU in radiotap Luca Coelho
2018-09-01  7:37   ` kbuild test robot
2018-08-31  8:31 ` [PATCH 20/28] mac80211: fix saving a few HE values Luca Coelho
2018-08-31  8:31 ` [PATCH 21/28] wireless: align to draft 11ax D3.0 Luca Coelho
2018-08-31 11:18   ` Kalle Valo
2018-08-31 11:21     ` Kalle Valo
2018-08-31 13:58       ` Luca Coelho
2018-08-31  8:31 ` [PATCH 22/28] mac80211: avoid kernel panic when building AMSDU from non-linear SKB Luca Coelho
2018-08-31  8:31 ` [PATCH 23/28] mac80211: add an option for station management TXQ Luca Coelho
2018-08-31  8:31 ` [PATCH 24/28] mac80211: allow AMSDU size limitation per-TID Luca Coelho
2018-08-31  8:31 ` Luca Coelho [this message]
2018-08-31  8:31 ` [PATCH 26/28] cfg80211: reg: Init wiphy_idx in regulatory_hint_core() Luca Coelho
2018-08-31  8:31 ` [PATCH 27/28] mac80211: Always report TX status Luca Coelho
2018-08-31  8:31 ` [PATCH 28/28] mac80211: Don't wake up from PS for offchannel TX Luca Coelho
2018-08-31 18:21   ` Peter Oh
2018-08-31 19:02     ` Luca Coelho
2018-09-03  8:59 ` [PATCH 00/28] cfg80211/mac80211 patches from our internal tree 2018-08-31 Johannes Berg
2018-09-04 11:40 ` [PATCH v2 0/9] cfg80211/mac80211: reworked " Luca Coelho
2018-09-04 11:40   ` [PATCH v2 1/9] mac80211: support reporting 0-length PSDU in radiotap Luca Coelho
2018-09-04 11:40   ` [PATCH v2 2/9] mac80211: fix saving a few HE values Luca Coelho
2018-09-04 11:40   ` [PATCH v2 3/9] wireless: align to draft 11ax D3.0 Luca Coelho
2018-09-04 11:40   ` [PATCH v2 4/9] mac80211: add an option for station management TXQ Luca Coelho
2018-09-04 11:40   ` [PATCH v2 5/9] mac80211: allow AMSDU size limitation per-TID Luca Coelho
2018-09-04 11:40   ` [PATCH v2 6/9] mac80211: add an option for drivers to check if packets can be aggregated Luca Coelho
2018-09-04 11:40   ` [PATCH v2 7/9] cfg80211: reg: Init wiphy_idx in regulatory_hint_core() Luca Coelho
2018-09-04 11:40   ` [PATCH v2 8/9] mac80211: Always report TX status Luca Coelho
2018-09-04 11:40   ` [PATCH v2 9/9] mac80211: Don't wake up from PS for offchannel TX Luca Coelho
2018-09-04 12:07     ` Sven Eckelmann
2018-09-04 12:10       ` Johannes Berg
2018-09-04 12:13         ` Luca Coelho
2018-09-04 12:16       ` Sven Eckelmann
2018-09-05  5:06 ` [RESEND PATCH v2 0/9] cfg80211/mac80211: reworked patches from our internal tree 2018-08-31 Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 1/9] mac80211: support reporting 0-length PSDU in radiotap Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 2/9] mac80211: fix saving a few HE values Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 3/9] wireless: align to draft 11ax D3.0 Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 4/9] mac80211: add an option for station management TXQ Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 5/9] mac80211: allow AMSDU size limitation per-TID Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 6/9] mac80211: add an option for drivers to check if packets can be aggregated Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 7/9] cfg80211: reg: Init wiphy_idx in regulatory_hint_core() Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 8/9] mac80211: Always report TX status Luca Coelho
2018-09-05  5:06   ` [RESEND PATCH v2 9/9] mac80211: Don't wake up from PS for offchannel TX Luca Coelho

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=20180831083130.15525-26-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sara.sharon@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.