From patchwork Tue Oct 16 18:41:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4032A157A for ; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30DC428ECB for ; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24FC42915F; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A8CAC28ECB for ; Tue, 16 Oct 2018 18:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FGZ3tVc+rJPedlkCxtjcbwe94ZHgh5et22JnTB+ydqI=; b=a6LGaEivRsPB9i3IKnWMDABeI7 nt9uDGl1kM5eqKLceKVXp9/weNlMOX2UKL77K8i3jo7GKEb8a6/owAh7KnZ8nk1/wmEVBcA1XJk2w CF5ocRdXIN84bHNaCHfy5wgV9a6NdVhSPX15hmmnZ48101DfODHuLBgCrX0goWwhTDNihwoO7Atqs O0vCOfVWjUccSjE4t+TDNlPI2zp/qEGbkRSO7z0jVGwWsfn/OiRDWwgBkndlfLTMFnuz4p4/ifuA8 B35vprv0csEH7cOAsHChC7x2DoQpoy/VGQ5l0a7MJS+nbtggBvAw0T3zzkyNOP6ZdT+MkAyZhvD02 zG8I5VwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJp-0001D1-Vz; Tue, 16 Oct 2018 18:43:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJ5-0000rW-87 for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:07 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4676F61310; Tue, 16 Oct 2018 18:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715374; bh=eL9qDZzXrcvzVKCRlFObzeWGXEZrr2Z17WzpMrK3Ufg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HkoEv0puCIKrIvyVeA7mwNqU8XjZd5Y+M8rpG2BnxZhsO4OjPaHqI3zKRYuC69I5A WKekv0BiqeQ4VR8yQg5mwJuwW+XDKkM4y4LwQkD+w37RKatjFX6ZfqFmmo9lr963cp xH/WssRDOq5vAsB1ddpO0WVX1PyXXGlVNGGXPs3Q= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E447F61308; Tue, 16 Oct 2018 18:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715373; bh=eL9qDZzXrcvzVKCRlFObzeWGXEZrr2Z17WzpMrK3Ufg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SeJUinsWdlK9ScCmOWVfzT2tkAnjPOlfs/VAvkbnsQY5g54DwFr3O5XkhLwvsgfLH klrQuz718NQ7rXEgP8baSv2/1cXkt6tX5P61MLZZjHRD1FCuv2UALho2oU9uzeM4w6 F9iZyvwiSWbolFB1Ta0gi5b2UZx7R1L3Y5HsRlH8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E447F61308 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 1/6] mac80211: Add NoAck policy functionality offload infrastructure Date: Wed, 17 Oct 2018 00:11:06 +0530 Message-Id: <1539715271-14325-2-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114303_373606_BD3046E0 X-CRM114-Status: GOOD ( 15.13 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasanthakumar Thiagarajan Add infrastructure for drivers to implement NoAck policy functionlity. Driver like ath10k does not use the per-packet TID NoAck policy configuration. Instead NoAck map is sent to the firmware/hardware in control path. Firmware takes care of setting up QOS header with NoAck policy based on the TID NoAck map. Drivers having this support should implement callback set_noack_tid_bitmap(). Supporting drivers would receive TID NoAck map through set_noack_tid_bitmap() instead of receiving as part of every tx skb. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 7 +++++++ net/mac80211/cfg.c | 10 ++++++++-- net/mac80211/driver-ops.h | 21 +++++++++++++++++++++ net/mac80211/iface.c | 4 ++++ net/mac80211/trace.h | 25 +++++++++++++++++++++++++ net/mac80211/tx.c | 2 +- net/mac80211/wme.c | 3 ++- 7 files changed, 68 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 71985e9..7da9d30 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3623,6 +3623,10 @@ enum ieee80211_reconfig_type { * skb is always a real frame, head may or may not be an A-MSDU. * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. * Statistics should be cumulative, currently no way to reset is provided. + * + * @set_noack_tid_bitmap: Set NoAck policy TID bitmap for a virtual interface. + * Drivers mplementing this callback must take care of setting NoAck policy + * in QOS control field based on the configured TID bitmap. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3911,6 +3915,9 @@ struct ieee80211_ops { int (*get_ftm_responder_stats)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_ftm_responder_stats *ftm_stats); + + int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, u16 noack_map); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5162233..4d8cc8d 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -346,9 +346,15 @@ static int ieee80211_set_noack_map(struct wiphy *wiphy, sdata->noack_map = noack_map; - ieee80211_check_fast_xmit_iface(sdata); + if (!sdata->local->ops->set_noack_tid_bitmap) { + ieee80211_check_fast_xmit_iface(sdata); + return 0; + } - return 0; + if (!ieee80211_sdata_running(sdata)) + return 0; + + return drv_set_noack_tid_bitmap(sdata->local, sdata, noack_map); } static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 0b1747a..a6dcef5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1278,4 +1278,25 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, trace_drv_return_void(local); } +static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 noack_map) +{ + int ret; + + might_sleep(); + if (!check_sdata_in_driver(sdata)) + return -EIO; + + if (!local->ops->set_noack_tid_bitmap) + return -EOPNOTSUPP; + + trace_drv_set_noack_tid_bitmap(local, sdata, noack_map); + ret = local->ops->set_noack_tid_bitmap(&local->hw, &sdata->vif, + noack_map); + trace_drv_return_int(local, ret); + + return ret; +} + #endif /* __MAC80211_DRIVER_OPS */ diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5836dde..06106f2 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -633,6 +633,10 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) ieee80211_vif_type_p2p(&sdata->vif)); if (res) goto err_del_interface; + + if (sdata->noack_map) + drv_set_noack_tid_bitmap(local, sdata, + sdata->noack_map); } if (sdata->vif.type == NL80211_IFTYPE_AP) { diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 588c51a..a563904 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -1882,6 +1882,31 @@ struct trace_switch_entry { ) ); +TRACE_EVENT(drv_set_noack_tid_bitmap, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 noack_map), + + TP_ARGS(local, sdata, noack_map), + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + __field(u16, noack_map) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + VIF_ASSIGN; + __entry->noack_map = noack_map; + ), + + TP_printk( + LOCAL_PR_FMT VIF_PR_FMT + ", noack_map: %u", + LOCAL_PR_ARG, VIF_PR_ARG, __entry->noack_map + ) +); + /* * Tracing for API calls that drivers call. */ diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e0ccee2..d744c4b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2872,7 +2872,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) goto out; - if (sdata->noack_map) + if (sdata->noack_map && !local->ops->set_noack_tid_bitmap) goto out; /* fast-xmit doesn't handle fragmentation at all */ diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 5f7c963..11c14b9 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -256,7 +256,8 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, IEEE80211_QOS_CTL_ACK_POLICY_MASK); if (is_multicast_ether_addr(hdr->addr1) || - sdata->noack_map & BIT(tid)) { + (!sdata->local->ops->set_noack_tid_bitmap && + sdata->noack_map & BIT(tid))) { flags |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK; info->flags |= IEEE80211_TX_CTL_NO_ACK; }