* [ath9k-devel] [PATCH 1/7] ath10k: flatten htt_tx_info
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 2/7] ath10k: share htc tx completion for data/mgmt tx Michal Kazior
` (6 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
This prepares for unified tx completion handling.
With this we will be able to treat mgmt tx and
data tx almost the same with the exception of
txfrag pointer which is only relevant/present
during data tx.
The main idea is to kill of the htt_tx_info
though it probably is a better idea to do it
step-by-step.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt.h | 14 ++----
drivers/net/wireless/ath/ath10k/htt_tx.c | 80 +++++++++++++++---------------
drivers/net/wireless/ath/ath10k/txrx.c | 20 ++++----
3 files changed, 53 insertions(+), 61 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 96178ea..11a9894 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1124,17 +1124,9 @@ struct htt_tx_info {
bool htc_tx_completed;
bool htt_tx_completed;
- union {
- struct {
- struct sk_buff *txdesc;
- struct sk_buff *txfrag;
- struct sk_buff *msdu;
- } data;
- struct {
- struct sk_buff *txdesc;
- struct sk_buff *msdu;
- } mgmt;
- } u;
+ struct sk_buff *txdesc;
+ struct sk_buff *txfrag; /* not used for mgmt tx */
+ struct sk_buff *msdu;
};
struct htt_struct {
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a55862e..dd75c01 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -252,11 +252,11 @@ static void ath10k_htt_mgmt_tx_htc_complete(struct sk_buff *skb)
if (!txi->htt_tx_completed) {
txi->htt_tx_completed = true;
- ret = ath10k_skb_unmap(dev, txi->u.mgmt.msdu);
+ ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
ath10k_warn("mgmt skb unmap failed (%d)\n", ret);
- ieee80211_free_txskb(htt->ar->hw, txi->u.mgmt.msdu);
+ ieee80211_free_txskb(htt->ar->hw, txi->msdu);
}
}
@@ -280,10 +280,10 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
len += sizeof(cmd->hdr);
len += sizeof(cmd->mgmt_tx);
- txi->u.mgmt.txdesc = ath10k_htc_alloc_skb(len);
- txi->u.mgmt.msdu = msdu;
+ txi->txdesc = ath10k_htc_alloc_skb(len);
+ txi->msdu = msdu;
- if (!txi->u.mgmt.txdesc) {
+ if (!txi->txdesc) {
res = -ENOMEM;
goto err;
}
@@ -292,8 +292,8 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
if (res)
goto err;
- skb_put(txi->u.mgmt.txdesc, len);
- cmd = (struct htt_cmd *)txi->u.mgmt.txdesc->data;
+ skb_put(txi->txdesc, len);
+ cmd = (struct htt_cmd *)txi->txdesc->data;
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_MGMT_TX;
cmd->mgmt_tx.msdu_paddr = __cpu_to_le32(ATH10K_SKB_CB(msdu)->paddr);
cmd->mgmt_tx.len = __cpu_to_le32(msdu->len);
@@ -302,11 +302,11 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->mgmt_tx.hdr, msdu->data,
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
- skb_cb = ATH10K_SKB_CB(txi->u.mgmt.txdesc);
+ skb_cb = ATH10K_SKB_CB(txi->txdesc);
skb_cb->htc.complete = ath10k_htt_mgmt_tx_htc_complete;
skb_cb->htc.priv = txi;
- res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->u.mgmt.txdesc);
+ res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
goto err;
@@ -315,8 +315,8 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
err:
ath10k_skb_unmap(dev, msdu);
- if (txi->u.mgmt.txdesc)
- dev_kfree_skb_any(txi->u.mgmt.txdesc);
+ if (txi->txdesc)
+ dev_kfree_skb_any(txi->txdesc);
ath10k_htt_tx_info_free(htt, txi);
return res;
@@ -341,16 +341,16 @@ static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
if (!txi->htt_tx_completed) {
txi->htt_tx_completed = true;
- ret = ath10k_skb_unmap(dev, txi->u.data.txfrag);
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
if (ret)
ath10k_warn("txfrag unmap failed (%d)\n", ret);
- ret = ath10k_skb_unmap(dev, txi->u.data.msdu);
+ ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
ath10k_warn("data skb unmap failed (%d)\n", ret);
- dev_kfree_skb_any(txi->u.data.txfrag);
- ieee80211_free_txskb(htt->ar->hw, txi->u.data.msdu);
+ dev_kfree_skb_any(txi->txfrag);
+ ieee80211_free_txskb(htt->ar->hw, txi->msdu);
}
}
@@ -383,21 +383,21 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
desc_len = sizeof(cmd->hdr) + sizeof(cmd->data_tx) + prefetch_len;
frag_len = sizeof(*tx_frags) * 2;
- txi->u.data.txdesc = ath10k_htc_alloc_skb(desc_len);
- if (!txi->u.data.txdesc) {
+ txi->txdesc = ath10k_htc_alloc_skb(desc_len);
+ if (!txi->txdesc) {
res = -ENOMEM;
goto err;
}
- txi->u.data.txfrag = dev_alloc_skb(frag_len);
- if (!txi->u.data.txfrag) {
+ txi->txfrag = dev_alloc_skb(frag_len);
+ if (!txi->txfrag) {
res = -ENOMEM;
goto err;
}
- txi->u.data.msdu = msdu;
+ txi->msdu = msdu;
- if ((unsigned long)txi->u.data.txdesc->data & 0x3) {
+ if ((unsigned long)txi->txdesc->data & 0x3) {
ath10k_warn("htt alignment check failed. dropping packet.\n");
res = -EIO;
goto err;
@@ -408,29 +408,29 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
goto err;
/* tx fragment list must be terminated with zero-entry */
- skb_put(txi->u.data.txfrag, frag_len);
- tx_frags = (struct htt_data_tx_desc_frag *)txi->u.data.txfrag->data;
+ skb_put(txi->txfrag, frag_len);
+ tx_frags = (struct htt_data_tx_desc_frag *)txi->txfrag->data;
tx_frags[0].paddr = __cpu_to_le32(ATH10K_SKB_CB(msdu)->paddr);
tx_frags[0].len = __cpu_to_le32(msdu->len);
tx_frags[1].paddr = __cpu_to_le32(0);
tx_frags[1].len = __cpu_to_le32(0);
- res = ath10k_skb_map(dev, txi->u.data.txfrag);
+ res = ath10k_skb_map(dev, txi->txfrag);
if (res)
goto err;
ath10k_dbg(ATH10K_DBG_HTT, "txfrag 0x%llx msdu 0x%llx\n",
- (unsigned long long) ATH10K_SKB_CB(txi->u.data.txfrag)->paddr,
- (unsigned long long) ATH10K_SKB_CB(txi->u.data.msdu)->paddr);
+ (unsigned long long) ATH10K_SKB_CB(txi->txfrag)->paddr,
+ (unsigned long long) ATH10K_SKB_CB(txi->msdu)->paddr);
ath10k_dbg_dump(ATH10K_DBG_HTT, NULL, "txfrag: ",
- txi->u.data.txfrag->data,
+ txi->txfrag->data,
frag_len);
ath10k_dbg_dump(ATH10K_DBG_HTT, NULL, "msdu: ",
- txi->u.data.msdu->data,
- txi->u.data.msdu->len);
+ txi->msdu->data,
+ txi->msdu->len);
- skb_put(txi->u.data.txdesc, desc_len);
- cmd = (struct htt_cmd *)txi->u.data.txdesc->data;
+ skb_put(txi->txdesc, desc_len);
+ cmd = (struct htt_cmd *)txi->txdesc->data;
memset(cmd, 0, desc_len);
tid = HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
@@ -453,7 +453,7 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID);
flags1 |= SM((u16)tid, HTT_DATA_TX_DESC_FLAGS1_EXT_TID);
- frags_paddr = ATH10K_SKB_CB(txi->u.data.txfrag)->paddr;
+ frags_paddr = ATH10K_SKB_CB(txi->txfrag)->paddr;
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_TX_FRM;
cmd->data_tx.flags0 = flags0;
@@ -465,22 +465,22 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
- skb_cb = ATH10K_SKB_CB(txi->u.data.txdesc);
+ skb_cb = ATH10K_SKB_CB(txi->txdesc);
skb_cb->htc.complete = ath10k_htt_tx_htc_complete;
skb_cb->htc.priv = txi;
- res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->u.data.txdesc);
+ res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
goto err;
return 0;
err:
- if (txi->u.data.txfrag)
- ath10k_skb_unmap(dev, txi->u.data.txfrag);
- if (txi->u.data.txdesc)
- dev_kfree_skb_any(txi->u.data.txdesc);
- if (txi->u.data.txfrag)
- dev_kfree_skb_any(txi->u.data.txfrag);
+ if (txi->txfrag)
+ ath10k_skb_unmap(dev, txi->txfrag);
+ if (txi->txdesc)
+ dev_kfree_skb_any(txi->txdesc);
+ if (txi->txfrag)
+ dev_kfree_skb_any(txi->txfrag);
ath10k_htt_tx_info_free(htt, txi);
ath10k_skb_unmap(dev, msdu);
return res;
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index 683f4e1..7755d27 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -62,19 +62,19 @@ void ath10k_data_tx_completed(struct htt_struct *htt,
return;
}
- ret = ath10k_skb_unmap(dev, txi->u.data.txfrag);
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
if (ret)
ath10k_warn("txfrag unmap failed (%d)\n", ret);
- ret = ath10k_skb_unmap(dev, txi->u.data.msdu);
+ ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
ath10k_warn("data skb unmap failed (%d)\n", ret);
- dev_kfree_skb_any(txi->u.data.txfrag);
+ dev_kfree_skb_any(txi->txfrag);
- ath10k_report_offchan_tx(htt->ar, txi->u.data.msdu);
+ ath10k_report_offchan_tx(htt->ar, txi->msdu);
- info = IEEE80211_SKB_CB(txi->u.data.msdu);
+ info = IEEE80211_SKB_CB(txi->msdu);
memset(&info->status, 0, sizeof(info->status));
switch (ev->status) {
@@ -83,19 +83,19 @@ void ath10k_data_tx_completed(struct htt_struct *htt,
info->flags |= IEEE80211_TX_STAT_ACK;
/* fall through */
case HTT_DATA_TX_STATUS_NO_ACK:
- ieee80211_tx_status_irqsafe(htt->ar->hw, txi->u.data.msdu);
+ ieee80211_tx_status_irqsafe(htt->ar->hw, txi->msdu);
break;
case HTT_DATA_TX_STATUS_DISCARD:
/* fall through */
case HTT_DATA_TX_STATUS_POSTPONE:
/* fall through */
case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
- ieee80211_free_txskb(htt->ar->hw, txi->u.data.msdu);
+ ieee80211_free_txskb(htt->ar->hw, txi->msdu);
break;
}
txi->htt_tx_completed = true;
- ath10k_htt_tx_info_unref(htt, txi, txi->u.data.txdesc);
+ ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
}
static u8 rx_legacy_rate_idx[] = {
@@ -281,7 +281,7 @@ void ath10k_mgmt_tx_completed(struct htt_struct *htt,
if (WARN_ON(!txi))
return;
- msdu = txi->u.mgmt.msdu;
+ msdu = txi->msdu;
ret = ath10k_skb_unmap(dev, msdu);
if (ret)
@@ -307,7 +307,7 @@ void ath10k_mgmt_tx_completed(struct htt_struct *htt,
}
txi->htt_tx_completed = true;
- ath10k_htt_tx_info_unref(htt, txi, txi->u.mgmt.txdesc);
+ ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
}
struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 2/7] ath10k: share htc tx completion for data/mgmt tx
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 1/7] ath10k: flatten htt_tx_info Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 3/7] ath10k: move htt completion handler up in the code Michal Kazior
` (5 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
This reduces code reduncancy and should make
further refactoring easier and less error-prone.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt_tx.c | 49 +++++++-----------------------
1 file changed, 11 insertions(+), 38 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index dd75c01..d20c918 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -233,7 +233,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
return 0;
}
-static void ath10k_htt_mgmt_tx_htc_complete(struct sk_buff *skb)
+static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct htt_tx_info *txi = skb_cb->htc.priv;
@@ -252,9 +252,17 @@ static void ath10k_htt_mgmt_tx_htc_complete(struct sk_buff *skb)
if (!txi->htt_tx_completed) {
txi->htt_tx_completed = true;
+ if (txi->txfrag) {
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
+ if (ret)
+ ath10k_warn("txfrag unmap failed (%d)\n", ret);
+
+ dev_kfree_skb_any(txi->txfrag);
+ }
+
ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
- ath10k_warn("mgmt skb unmap failed (%d)\n", ret);
+ ath10k_warn("data skb unmap failed (%d)\n", ret);
ieee80211_free_txskb(htt->ar->hw, txi->msdu);
}
@@ -303,7 +311,7 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_mgmt_tx_htc_complete;
+ skb_cb->htc.complete = ath10k_htt_tx_htc_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
@@ -322,41 +330,6 @@ err:
return res;
}
-static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
-{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- struct htt_tx_info *txi = skb_cb->htc.priv;
- struct htt_struct *htt = txi->htt;
- struct device *dev = htt->ar->dev;
- int ret;
-
- txi->htc_tx_completed = true;
-
- if (skb_cb->is_aborted) {
- /*
- * if a packet gets cancelled we need to make sure
- * to free skbs since htt mgmt tx completion indication
- * may have not came in yet
- */
- if (!txi->htt_tx_completed) {
- txi->htt_tx_completed = true;
-
- ret = ath10k_skb_unmap(dev, txi->txfrag);
- if (ret)
- ath10k_warn("txfrag unmap failed (%d)\n", ret);
-
- ret = ath10k_skb_unmap(dev, txi->msdu);
- if (ret)
- ath10k_warn("data skb unmap failed (%d)\n", ret);
-
- dev_kfree_skb_any(txi->txfrag);
- ieee80211_free_txskb(htt->ar->hw, txi->msdu);
- }
- }
-
- ath10k_htt_tx_info_unref(htt, txi, skb);
-}
-
int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
{
struct device *dev = htt->ar->dev;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 3/7] ath10k: move htt completion handler up in the code
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 1/7] ath10k: flatten htt_tx_info Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 2/7] ath10k: share htc tx completion for data/mgmt tx Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 4/7] ath10k: share a single htc tx completion for htt data/mgmt/conf tx Michal Kazior
` (4 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
The function will soon be reused by a function
that is located above.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt_tx.c | 76 +++++++++++++++---------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index d20c918..f4c52a4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -117,6 +117,44 @@ static void ath10k_htt_conf_complete(struct sk_buff *skb)
dev_kfree_skb_any(skb);
}
+static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
+{
+ struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
+ struct htt_tx_info *txi = skb_cb->htc.priv;
+ struct htt_struct *htt = txi->htt;
+ struct device *dev = htt->ar->dev;
+ int ret;
+
+ txi->htc_tx_completed = true;
+
+ if (skb_cb->is_aborted) {
+ /*
+ * if a packet gets cancelled we need to make sure
+ * to free skbs since htt mgmt tx completion indication
+ * may have not came in yet
+ */
+ if (!txi->htt_tx_completed) {
+ txi->htt_tx_completed = true;
+
+ if (txi->txfrag) {
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
+ if (ret)
+ ath10k_warn("txfrag unmap failed (%d)\n", ret);
+
+ dev_kfree_skb_any(txi->txfrag);
+ }
+
+ ret = ath10k_skb_unmap(dev, txi->msdu);
+ if (ret)
+ ath10k_warn("data skb unmap failed (%d)\n", ret);
+
+ ieee80211_free_txskb(htt->ar->hw, txi->msdu);
+ }
+ }
+
+ ath10k_htt_tx_info_unref(htt, txi, skb);
+}
+
int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
{
struct ath10k_skb_cb *skb_cb;
@@ -233,44 +271,6 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
return 0;
}
-static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
-{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- struct htt_tx_info *txi = skb_cb->htc.priv;
- struct htt_struct *htt = txi->htt;
- struct device *dev = htt->ar->dev;
- int ret;
-
- txi->htc_tx_completed = true;
-
- if (skb_cb->is_aborted) {
- /*
- * if a packet gets cancelled we need to make sure
- * to free skbs since htt mgmt tx completion indication
- * may have not came in yet
- */
- if (!txi->htt_tx_completed) {
- txi->htt_tx_completed = true;
-
- if (txi->txfrag) {
- ret = ath10k_skb_unmap(dev, txi->txfrag);
- if (ret)
- ath10k_warn("txfrag unmap failed (%d)\n", ret);
-
- dev_kfree_skb_any(txi->txfrag);
- }
-
- ret = ath10k_skb_unmap(dev, txi->msdu);
- if (ret)
- ath10k_warn("data skb unmap failed (%d)\n", ret);
-
- ieee80211_free_txskb(htt->ar->hw, txi->msdu);
- }
- }
-
- ath10k_htt_tx_info_unref(htt, txi, skb);
-}
-
int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
{
struct device *dev = htt->ar->dev;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 4/7] ath10k: share a single htc tx completion for htt data/mgmt/conf tx
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
` (2 preceding siblings ...)
2013-04-17 11:51 ` [ath9k-devel] [PATCH 3/7] ath10k: move htt completion handler up in the code Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 5/7] ath10k: remove per-packet completion handling Michal Kazior
` (3 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
This patch virtually eliminates the need to have
per-packet completions. Having per-packet
completion is very costly (a pointer on 64bit arch
takes up 8 bytes of ath10k_skb_cb's precious
space).
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 3 ++-
drivers/net/wireless/ath/ath10k/htt_tx.c | 31 +++++++++++++++++-------------
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 53bfb8b..2556362 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -57,6 +57,7 @@ struct ath10k_skb_cb {
struct {
u8 vdev_id;
bool is_offchan;
+ bool is_conf;
} __packed htt;
struct {
@@ -65,7 +66,7 @@ struct ath10k_skb_cb {
void *priv;
} __packed htc;
- /* 11 bytes left on 64bit arch */
+ /* 10 bytes left on 64bit arch */
} __packed;
static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index f4c52a4..327d031 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -112,19 +112,22 @@ struct htt_tx_info *ath10k_htt_tx_info_lookup(struct htt_struct *htt,
return &htt->txi_pool[msdu_id];
}
-static void ath10k_htt_conf_complete(struct sk_buff *skb)
-{
- dev_kfree_skb_any(skb);
-}
-
-static void ath10k_htt_tx_htc_complete(struct sk_buff *skb)
+static void ath10k_htt_htc_tx_complete(struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- struct htt_tx_info *txi = skb_cb->htc.priv;
- struct htt_struct *htt = txi->htt;
- struct device *dev = htt->ar->dev;
+ struct htt_tx_info *txi;
+ struct htt_struct *htt;
+ struct device *dev;
int ret;
+ if (skb_cb->htt.is_conf) {
+ dev_kfree_skb_any(skb);
+ return;
+ }
+
+ txi = skb_cb->htc.priv;
+ htt = txi->htt;
+ dev = htt->ar->dev;
txi->htc_tx_completed = true;
if (skb_cb->is_aborted) {
@@ -175,7 +178,8 @@ int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_VERSION_REQ;
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_conf_complete;
+ skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
+ skb_cb->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -260,7 +264,8 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
#undef rx_desc_offset
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_conf_complete;
+ skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
+ skb_cb->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -311,7 +316,7 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_tx_htc_complete;
+ skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
@@ -439,7 +444,7 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_tx_htc_complete;
+ skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 5/7] ath10k: remove per-packet completion handling
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
` (3 preceding siblings ...)
2013-04-17 11:51 ` [ath9k-devel] [PATCH 4/7] ath10k: share a single htc tx completion for htt data/mgmt/conf tx Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 6/7] ath10k: remove `priv` from ath10k_skb_cb Michal Kazior
` (2 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
Having a tx completion handler in the
ath10k_skb_cb is very costly (memory wise). The
saved space will be used to merge htt_tx_info.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 1 +
drivers/net/wireless/ath/ath10k/core.h | 3 +--
drivers/net/wireless/ath/ath10k/htc.c | 11 ++++-------
drivers/net/wireless/ath/ath10k/htc.h | 1 +
drivers/net/wireless/ath/ath10k/htt.c | 1 +
drivers/net/wireless/ath/ath10k/htt.h | 1 +
drivers/net/wireless/ath/ath10k/htt_tx.c | 14 +++-----------
drivers/net/wireless/ath/ath10k/wmi.c | 6 +++---
8 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 213c851..39bc54c 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -111,6 +111,7 @@ static int ath10k_init_connect_htc(struct ath10k *ar)
memset(&connect, 0, sizeof(connect));
connect.ep_callbacks.context = ar;
+ connect.ep_callbacks.ep_tx_complete = NULL;
connect.ep_callbacks.ep_rx_complete = NULL;
status = ath10k_wmi_connect_htc_service(ar);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 2556362..3a27e05 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -62,11 +62,10 @@ struct ath10k_skb_cb {
struct {
u8 credits_used;
- void (*complete)(struct sk_buff *);
void *priv;
} __packed htc;
- /* 10 bytes left on 64bit arch */
+ /* 18 bytes left on 64bit arch */
} __packed;
static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index cc75063..27b73a1 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -74,7 +74,7 @@ static inline void ath10k_htc_send_complete_check(struct htc_endpoint *ep,
ath10k_hif_send_complete_check(ep->target->ar, ep->ul_pipe_id, force);
}
-static void ath10k_htc_control_tx_complete(struct sk_buff *skb)
+static void ath10k_htc_control_tx_complete(void *context, struct sk_buff *skb)
{
kfree_skb(skb);
}
@@ -110,20 +110,18 @@ static inline void ath10k_htc_restore_tx_skb(struct htc_target *target,
static void ath10k_htc_notify_tx_completion(struct htc_endpoint *ep,
struct sk_buff *skb)
{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
-
ath10k_dbg(ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__,
ep->ep_id, skb);
ath10k_htc_restore_tx_skb(ep->target, skb);
- if (!skb_cb->htc.complete) {
+ if (!ep->ep_callbacks.ep_tx_complete) {
ath10k_warn("no tx handler for eid %d\n", ep->ep_id);
dev_kfree_skb_any(skb);
return;
}
- skb_cb->htc.complete(skb);
+ ep->ep_callbacks.ep_tx_complete(ep->ep_callbacks.context, skb);
}
/* assumes htc_tx_lock is held */
@@ -741,6 +739,7 @@ int ath10k_htc_wait_target(struct htc_target *target)
memset(&connect, 0, sizeof(connect));
memset(&resp, 0, sizeof(resp));
connect.ep_callbacks.context = target;
+ connect.ep_callbacks.ep_tx_complete = ath10k_htc_control_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_htc_control_rx_complete;
connect.max_send_queue_depth = NUM_CONTROL_TX_BUFFERS;
connect.service_id = HTC_SVC_RSVD_CTRL;
@@ -809,7 +808,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
}
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htc_control_tx_complete;
skb_cb->htc.priv = target;
INIT_COMPLETION(target->ctl_resp);
@@ -953,7 +951,6 @@ int ath10k_htc_start(struct htc_target *target)
ath10k_dbg(ATH10K_DBG_HTC, "HTC is using TX credit flow control\n");
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htc_control_tx_complete;
skb_cb->htc.priv = target;
status = ath10k_htc_send(target, HTC_EP_0, skb);
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index 2c231db..4601aff 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -80,6 +80,7 @@ struct htc_target_cb {
struct htc_ep_callbacks {
void *context;
+ void (*ep_tx_complete)(void *context, struct sk_buff *);
void (*ep_rx_complete)(void *context, struct sk_buff *);
void (*stop_queue)(void *context);
void (*wake_queue)(void *context);
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 0820b5a..1828dd8 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -43,6 +43,7 @@ static int ath10k_htt_htc_attach(struct htt_struct *htt)
memset(&response, 0, sizeof(response));
connect.ep_callbacks.context = htt;
+ connect.ep_callbacks.ep_tx_complete = ath10k_htt_htc_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_htt_t2h_msg_handler;
connect.ep_callbacks.stop_queue = ath10k_htt_stop_queue;
connect.ep_callbacks.wake_queue = ath10k_htt_wake_queue;
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 11a9894..9f4a03f 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1295,6 +1295,7 @@ void ath10k_htt_tx_attach(struct htt_struct *htt);
void ath10k_htt_tx_detach(struct htt_struct *htt);
int ath10k_htt_rx_attach(struct htt_struct *htt);
void ath10k_htt_rx_detach(struct htt_struct *htt);
+void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb);
void ath10k_htt_t2h_msg_handler(void *context, struct sk_buff *skb);
int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt);
int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt);
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 327d031..02a42a4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -112,7 +112,7 @@ struct htt_tx_info *ath10k_htt_tx_info_lookup(struct htt_struct *htt,
return &htt->txi_pool[msdu_id];
}
-static void ath10k_htt_htc_tx_complete(struct sk_buff *skb)
+void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct htt_tx_info *txi;
@@ -160,7 +160,6 @@ static void ath10k_htt_htc_tx_complete(struct sk_buff *skb)
int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
struct htt_cmd *cmd;
int len = 0;
@@ -177,9 +176,7 @@ int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
cmd = (struct htt_cmd *)skb->data;
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_VERSION_REQ;
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
- skb_cb->htt.is_conf = true;
+ ATH10K_SKB_CB(skb)->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -192,7 +189,6 @@ int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
struct htt_cmd *cmd;
struct htt_rx_ring_setup_ring *ring;
@@ -263,9 +259,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
ring->frag_info_offset = __cpu_to_le16(rx_desc_offset(frag_info));
#undef rx_desc_offset
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
- skb_cb->htt.is_conf = true;
+ ATH10K_SKB_CB(skb)->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -316,7 +310,6 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
@@ -444,7 +437,6 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 7f7c265..2c2cf9f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -73,10 +73,10 @@ static struct sk_buff *ath10k_wmi_alloc_skb(u32 len)
return skb;
}
-static void ath10k_wmi_htc_tx_complete(struct sk_buff *skb)
+static void ath10k_wmi_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- struct ath10k *ar = skb_cb->htc.priv;
+ struct ath10k *ar = context;
dev_kfree_skb(skb);
@@ -109,7 +109,6 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
}
memset(skb_cb, 0, sizeof(*skb_cb));
- skb_cb->htc.complete = ath10k_wmi_htc_tx_complete;
skb_cb->htc.priv = ar;
trace_ath10k_wmi_cmd(cmd_id, skb->data, skb->len);
@@ -1117,6 +1116,7 @@ int ath10k_wmi_connect_htc_service(struct ath10k *ar)
/* these fields are the same for all service endpoints */
connect.ep_callbacks.context = ar;
+ connect.ep_callbacks.ep_tx_complete = ath10k_wmi_htc_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_wmi_process_rx;
/* connect to control service */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 6/7] ath10k: remove `priv` from ath10k_skb_cb
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
` (4 preceding siblings ...)
2013-04-17 11:51 ` [ath9k-devel] [PATCH 5/7] ath10k: remove per-packet completion handling Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-17 11:51 ` [ath9k-devel] [PATCH 7/7] ath10k: share htt tx completion for data/mgmt tx Michal Kazior
2013-04-22 7:57 ` [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Kalle Valo
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
Introduce msdu_id into ath10k_skb_cb to keep track
of htt-related metadata.
This frees up 8 bytes of space in ath10k_skb_cb
making it easier to merge htt_tx_info.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 4 ++--
drivers/net/wireless/ath/ath10k/htc.c | 7 -------
drivers/net/wireless/ath/ath10k/htt_tx.c | 18 +++++++++++-------
drivers/net/wireless/ath/ath10k/wmi.c | 2 --
4 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 3a27e05..1aef940 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -56,16 +56,16 @@ struct ath10k_skb_cb {
struct {
u8 vdev_id;
+ u16 msdu_id;
bool is_offchan;
bool is_conf;
} __packed htt;
struct {
u8 credits_used;
- void *priv;
} __packed htc;
- /* 18 bytes left on 64bit arch */
+ /* 24 bytes left on 64bit arch */
} __packed;
static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index 27b73a1..75e46d2 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -762,7 +762,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
enum htc_endpoint_id assigned_ep = HTC_EP_COUNT;
struct htc_endpoint *ep;
struct sk_buff *skb;
- struct ath10k_skb_cb *skb_cb;
unsigned int max_msg_size = 0;
int length, status;
bool disable_credit_flow_ctrl = false;
@@ -807,9 +806,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
disable_credit_flow_ctrl = true;
}
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.priv = target;
-
INIT_COMPLETION(target->ctl_resp);
status = ath10k_htc_send(target, HTC_EP_0, skb);
@@ -933,7 +929,6 @@ struct sk_buff *ath10k_htc_alloc_skb(int size)
int ath10k_htc_start(struct htc_target *target)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
int status = 0;
struct htc_msg *msg;
@@ -950,8 +945,6 @@ int ath10k_htc_start(struct htc_target *target)
ath10k_dbg(ATH10K_DBG_HTC, "HTC is using TX credit flow control\n");
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.priv = target;
status = ath10k_htc_send(target, HTC_EP_0, skb);
return status;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 02a42a4..a4f1072 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -115,9 +115,9 @@ struct htt_tx_info *ath10k_htt_tx_info_lookup(struct htt_struct *htt,
void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
+ struct htt_struct *htt = (struct htt_struct *)context;
+ struct device *dev = htt->ar->dev;
struct htt_tx_info *txi;
- struct htt_struct *htt;
- struct device *dev;
int ret;
if (skb_cb->htt.is_conf) {
@@ -125,9 +125,13 @@ void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
return;
}
- txi = skb_cb->htc.priv;
- htt = txi->htt;
- dev = htt->ar->dev;
+ txi = ath10k_htt_tx_info_lookup(htt, skb_cb->htt.msdu_id);
+ if (!txi) {
+ ath10k_warn("tx completion failure, wrong htt msdu_id %d\n",
+ skb_cb->htt.msdu_id);
+ return;
+ }
+
txi->htc_tx_completed = true;
if (skb_cb->is_aborted) {
@@ -310,7 +314,7 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.priv = txi;
+ skb_cb->htt.msdu_id = txi->msdu_id;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
@@ -437,7 +441,7 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.priv = txi;
+ skb_cb->htt.msdu_id = txi->msdu_id;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2c2cf9f..ae30be3 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -75,7 +75,6 @@ static struct sk_buff *ath10k_wmi_alloc_skb(u32 len)
static void ath10k_wmi_htc_tx_complete(void *context, struct sk_buff *skb)
{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct ath10k *ar = context;
dev_kfree_skb(skb);
@@ -109,7 +108,6 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
}
memset(skb_cb, 0, sizeof(*skb_cb));
- skb_cb->htc.priv = ar;
trace_ath10k_wmi_cmd(cmd_id, skb->data, skb->len);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 7/7] ath10k: share htt tx completion for data/mgmt tx
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
` (5 preceding siblings ...)
2013-04-17 11:51 ` [ath9k-devel] [PATCH 6/7] ath10k: remove `priv` from ath10k_skb_cb Michal Kazior
@ 2013-04-17 11:51 ` Michal Kazior
2013-04-22 7:57 ` [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Kalle Valo
7 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-17 11:51 UTC (permalink / raw)
To: ath9k-devel
Removes code redundancy and eases future
refactoring up.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt.h | 14 ++---
drivers/net/wireless/ath/ath10k/htt_rx.c | 49 +++++++++++----
drivers/net/wireless/ath/ath10k/txrx.c | 96 ++++++++----------------------
drivers/net/wireless/ath/ath10k/txrx.h | 5 +-
4 files changed, 69 insertions(+), 95 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 9f4a03f..e98f079 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1080,16 +1080,10 @@ struct htt_resp {
/*** host side structures follow ***/
-struct htt_mgmt_tx_done {
- u32 desc_id;
- u32 status;
-};
-
-struct htt_data_tx_done {
- enum htt_data_tx_status status;
- u8 tid;
- bool tid_invalid;
- u16 msdu_id;
+struct htt_tx_done {
+ u32 msdu_id;
+ bool discard;
+ bool no_ack;
};
struct htt_peer_map_event {
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index faf3685..6fe273d 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -984,27 +984,54 @@ void ath10k_htt_t2h_msg_handler(void *context, struct sk_buff *skb)
break;
}
case HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION: {
- struct htt_mgmt_tx_done arg = {
- .desc_id = __le32_to_cpu(resp->mgmt_tx_completion.desc_id),
- .status = __le32_to_cpu(resp->mgmt_tx_completion.status),
+ struct htt_tx_done tx_done = {
+ .msdu_id = __le32_to_cpu(resp->mgmt_tx_completion.desc_id),
};
- ath10k_mgmt_tx_completed(htt, &arg);
+ int status = __le32_to_cpu(resp->mgmt_tx_completion.status);
+
+ switch (status) {
+ case HTT_MGMT_TX_STATUS_OK:
+ tx_done.discard = false;
+ break;
+ case HTT_MGMT_TX_STATUS_RETRY:
+ case HTT_MGMT_TX_STATUS_DROP:
+ tx_done.discard = true;
+ break;
+ }
+
+ ath10k_txrx_tx_completed(htt, &tx_done);
break;
}
case HTT_T2H_MSG_TYPE_TX_COMPL_IND: {
- struct htt_data_tx_done ev = {
- .status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS),
- .tid = MS(resp->data_tx_completion.flags, HTT_DATA_TX_TID),
- .tid_invalid = !!(resp->data_tx_completion.flags & HTT_DATA_TX_TID_INVALID),
- };
+ struct htt_tx_done tx_done = {};
+ int status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS);
int i;
+ switch (status) {
+ case HTT_DATA_TX_STATUS_NO_ACK:
+ tx_done.no_ack = true;
+ tx_done.discard = false;
+ break;
+ case HTT_DATA_TX_STATUS_OK:
+ tx_done.discard = false;
+ break;
+ case HTT_DATA_TX_STATUS_DISCARD:
+ case HTT_DATA_TX_STATUS_POSTPONE:
+ case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
+ tx_done.discard = true;
+ break;
+ default:
+ ath10k_warn("unhandled tx completion status %d\n", status);
+ tx_done.discard = true;
+ break;
+ }
+
ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion num_msdus %d\n",
resp->data_tx_completion.num_msdus);
for (i = 0; i < resp->data_tx_completion.num_msdus; i++) {
- ev.msdu_id = __le16_to_cpu(resp->data_tx_completion.msdus[i]);
- ath10k_data_tx_completed(htt, &ev);
+ tx_done.msdu_id = __le16_to_cpu(resp->data_tx_completion.msdus[i]);
+ ath10k_txrx_tx_completed(htt, &tx_done);
}
break;
}
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index 7755d27..488216a 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -44,56 +44,55 @@ out:
spin_unlock_bh(&ar->data_lock);
}
-void ath10k_data_tx_completed(struct htt_struct *htt,
- struct htt_data_tx_done *ev)
+void ath10k_txrx_tx_completed(struct htt_struct *htt,
+ const struct htt_tx_done *tx_done)
{
struct device *dev = htt->ar->dev;
- struct htt_tx_info *txi;
struct ieee80211_tx_info *info;
+ struct htt_tx_info *txi;
int ret;
- ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion "
- "msdu_id %d tid %d tid_invalid %d status %d\n",
- ev->msdu_id, ev->tid, ev->tid_invalid, ev->status);
+ ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n",
+ tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack);
- txi = ath10k_htt_tx_info_lookup(htt, ev->msdu_id);
+ txi = ath10k_htt_tx_info_lookup(htt, tx_done->msdu_id);
if (!txi) {
ath10k_dbg(ATH10K_DBG_HTT, "htt txi lookup fail\n");
return;
}
- ret = ath10k_skb_unmap(dev, txi->txfrag);
- if (ret)
- ath10k_warn("txfrag unmap failed (%d)\n", ret);
+ if (txi->txfrag) {
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
+ if (ret)
+ ath10k_warn("txfrag unmap failed (%d)\n", ret);
+
+ dev_kfree_skb_any(txi->txfrag);
+ }
ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
ath10k_warn("data skb unmap failed (%d)\n", ret);
- dev_kfree_skb_any(txi->txfrag);
-
ath10k_report_offchan_tx(htt->ar, txi->msdu);
info = IEEE80211_SKB_CB(txi->msdu);
memset(&info->status, 0, sizeof(info->status));
- switch (ev->status) {
- case HTT_DATA_TX_STATUS_OK:
- if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
- info->flags |= IEEE80211_TX_STAT_ACK;
- /* fall through */
- case HTT_DATA_TX_STATUS_NO_ACK:
- ieee80211_tx_status_irqsafe(htt->ar->hw, txi->msdu);
- break;
- case HTT_DATA_TX_STATUS_DISCARD:
- /* fall through */
- case HTT_DATA_TX_STATUS_POSTPONE:
- /* fall through */
- case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
+ if (tx_done->discard) {
ieee80211_free_txskb(htt->ar->hw, txi->msdu);
- break;
+ goto exit;
}
+ if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
+ info->flags |= IEEE80211_TX_STAT_ACK;
+
+ if (tx_done->no_ack)
+ info->flags &= ~IEEE80211_TX_STAT_ACK;
+
+ ieee80211_tx_status_irqsafe(htt->ar->hw, txi->msdu);
+ /* we do not own the msdu anymore */
+
+exit:
txi->htt_tx_completed = true;
ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
}
@@ -265,51 +264,6 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info)
ieee80211_rx_irqsafe(ar->hw, info->skb);
}
-void ath10k_mgmt_tx_completed(struct htt_struct *htt,
- struct htt_mgmt_tx_done *arg)
-{
- struct device *dev = htt->ar->dev;
- struct ieee80211_tx_info *info;
- struct sk_buff *msdu;
- struct htt_tx_info *txi;
- int ret;
-
- ath10k_dbg(ATH10K_DBG_HTT, "%s called(), status: %d, msdu_id: %d\n",
- __func__, arg->status, arg->desc_id);
-
- txi = ath10k_htt_tx_info_lookup(htt, arg->desc_id);
- if (WARN_ON(!txi))
- return;
-
- msdu = txi->msdu;
-
- ret = ath10k_skb_unmap(dev, msdu);
- if (ret)
- ath10k_warn("mgmt skb unmap failed (%d)\n", ret);
-
- ath10k_report_offchan_tx(htt->ar, msdu);
-
- info = IEEE80211_SKB_CB(msdu);
- memset(&info->status, 0, sizeof(info->status));
-
- switch (arg->status) {
- case HTT_MGMT_TX_STATUS_OK:
- if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
- info->flags |= IEEE80211_TX_STAT_ACK;
-
- ieee80211_tx_status_irqsafe(htt->ar->hw, msdu);
- break;
- case HTT_MGMT_TX_STATUS_RETRY:
- /* fall through */
- case HTT_MGMT_TX_STATUS_DROP:
- ieee80211_free_txskb(htt->ar->hw, msdu);
- break;
- }
-
- txi->htt_tx_completed = true;
- ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
-}
-
struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
const u8 *addr)
{
diff --git a/drivers/net/wireless/ath/ath10k/txrx.h b/drivers/net/wireless/ath/ath10k/txrx.h
index c837d47..c80a472 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.h
+++ b/drivers/net/wireless/ath/ath10k/txrx.h
@@ -19,9 +19,8 @@
#include "htt.h"
-void ath10k_data_tx_completed(struct htt_struct *htt,
- struct htt_data_tx_done *ev);
-void ath10k_mgmt_tx_completed(struct htt_struct *, struct htt_mgmt_tx_done *);
+void ath10k_txrx_tx_completed(struct htt_struct *htt,
+ const struct htt_tx_done *tx_done);
void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info);
struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup
2013-04-17 11:51 [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Michal Kazior
` (6 preceding siblings ...)
2013-04-17 11:51 ` [ath9k-devel] [PATCH 7/7] ath10k: share htt tx completion for data/mgmt tx Michal Kazior
@ 2013-04-22 7:57 ` Kalle Valo
2013-04-22 8:05 ` Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Michal Kazior
7 siblings, 2 replies; 15+ messages in thread
From: Kalle Valo @ 2013-04-22 7:57 UTC (permalink / raw)
To: ath9k-devel
Michal Kazior <michal.kazior@tieto.com> writes:
> My plan is to remove htt_tx_info wrapper. Before
> the wrapper can be actually killed off htt tx code
> needs a cleanup.
>
> The cleanup seems like a generally good idea as
> it merges and simplifies tx completion code.
Awesome! This makes it so much easier to handle packets inside ath10k.
Do we have any other per packet structs left in ath10k after your patches?
> Michal Kazior (7):
> ath10k: flatten htt_tx_info
> ath10k: share htc tx completion for data/mgmt tx
> ath10k: move htt completion handler up in the code
> ath10k: share a single htc tx completion for htt data/mgmt/conf tx
I applied these four.
> ath10k: remove per-packet completion handling
> ath10k: remove `priv` from ath10k_skb_cb
> ath10k: share htt tx completion for data/mgmt tx
These three I wasn't able to apply as there were conflicts which were
not that simple to fix. Can you rebase there three and resend, please?
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup
2013-04-22 7:57 ` [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Kalle Valo
@ 2013-04-22 8:05 ` Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Michal Kazior
1 sibling, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-22 8:05 UTC (permalink / raw)
To: ath9k-devel
On 22/04/13 09:57, Kalle Valo wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> My plan is to remove htt_tx_info wrapper. Before
>> the wrapper can be actually killed off htt tx code
>> needs a cleanup.
>>
>> The cleanup seems like a generally good idea as
>> it merges and simplifies tx completion code.
>
> Awesome! This makes it so much easier to handle packets inside ath10k.
>
> Do we have any other per packet structs left in ath10k after your patches?
I don't think so.
>> ath10k: remove per-packet completion handling
>> ath10k: remove `priv` from ath10k_skb_cb
>> ath10k: share htt tx completion for data/mgmt tx
>
> These three I wasn't able to apply as there were conflicts which were
> not that simple to fix. Can you rebase there three and resend, please?
Sure thing.
-- Pozdrawiam / Best regards, Michal Kazior.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling
2013-04-22 7:57 ` [ath9k-devel] [PATCH 0/7] ath10k: htt tx cleanup Kalle Valo
2013-04-22 8:05 ` Michal Kazior
@ 2013-04-22 8:08 ` Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 2/3] ath10k: remove `priv` from ath10k_skb_cb Michal Kazior
` (2 more replies)
1 sibling, 3 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-22 8:08 UTC (permalink / raw)
To: ath9k-devel
Having a tx completion handler in the
ath10k_skb_cb is very costly (memory wise). The
saved space will be used to merge htt_tx_info.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
rebased on top of latest master
drivers/net/wireless/ath/ath10k/core.c | 1 +
drivers/net/wireless/ath/ath10k/core.h | 3 +--
drivers/net/wireless/ath/ath10k/htc.c | 11 ++++-------
drivers/net/wireless/ath/ath10k/htc.h | 1 +
drivers/net/wireless/ath/ath10k/htt.c | 1 +
drivers/net/wireless/ath/ath10k/htt.h | 1 +
drivers/net/wireless/ath/ath10k/htt_tx.c | 14 +++-----------
drivers/net/wireless/ath/ath10k/wmi.c | 6 +++---
8 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 8cbdc04..b46d1f1 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -106,6 +106,7 @@ static int ath10k_init_connect_htc(struct ath10k *ar)
memset(&connect, 0, sizeof(connect));
connect.ep_callbacks.context = ar;
+ connect.ep_callbacks.ep_tx_complete = NULL;
connect.ep_callbacks.ep_rx_complete = NULL;
status = ath10k_wmi_connect_htc_service(ar);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 07525a5..9ab081c 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -61,11 +61,10 @@ struct ath10k_skb_cb {
struct {
u8 credits_used;
- void (*complete)(struct sk_buff *);
void *priv;
} __packed htc;
- /* 10 bytes left on 64bit arch */
+ /* 18 bytes left on 64bit arch */
} __packed;
static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index c151b3d..598a0aa 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -74,7 +74,7 @@ static inline void ath10k_htc_send_complete_check(struct htc_endpoint *ep,
ath10k_hif_send_complete_check(ep->target->ar, ep->ul_pipe_id, force);
}
-static void ath10k_htc_control_tx_complete(struct sk_buff *skb)
+static void ath10k_htc_control_tx_complete(void *context, struct sk_buff *skb)
{
kfree_skb(skb);
}
@@ -110,20 +110,18 @@ static inline void ath10k_htc_restore_tx_skb(struct htc_target *target,
static void ath10k_htc_notify_tx_completion(struct htc_endpoint *ep,
struct sk_buff *skb)
{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
-
ath10k_dbg(ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__,
ep->ep_id, skb);
ath10k_htc_restore_tx_skb(ep->target, skb);
- if (!skb_cb->htc.complete) {
+ if (!ep->ep_callbacks.ep_tx_complete) {
ath10k_warn("no tx handler for eid %d\n", ep->ep_id);
dev_kfree_skb_any(skb);
return;
}
- skb_cb->htc.complete(skb);
+ ep->ep_callbacks.ep_tx_complete(ep->ep_callbacks.context, skb);
}
/* assumes htc_tx_lock is held */
@@ -742,6 +740,7 @@ int ath10k_htc_wait_target(struct htc_target *target)
memset(&connect, 0, sizeof(connect));
memset(&resp, 0, sizeof(resp));
connect.ep_callbacks.context = target;
+ connect.ep_callbacks.ep_tx_complete = ath10k_htc_control_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_htc_control_rx_complete;
connect.max_send_queue_depth = NUM_CONTROL_TX_BUFFERS;
connect.service_id = HTC_SVC_RSVD_CTRL;
@@ -810,7 +809,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
}
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htc_control_tx_complete;
skb_cb->htc.priv = target;
INIT_COMPLETION(target->ctl_resp);
@@ -952,7 +950,6 @@ int ath10k_htc_start(struct htc_target *target)
ath10k_dbg(ATH10K_DBG_HTC, "HTC is using TX credit flow control\n");
skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htc_control_tx_complete;
skb_cb->htc.priv = target;
status = ath10k_htc_send(target, HTC_EP_0, skb);
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index 070f648..721964d 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -79,6 +79,7 @@ struct htc_target_cb {
struct htc_ep_callbacks {
void *context;
+ void (*ep_tx_complete)(void *context, struct sk_buff *);
void (*ep_rx_complete)(void *context, struct sk_buff *);
void (*stop_queue)(void *context);
void (*wake_queue)(void *context);
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 0820b5a..1828dd8 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -43,6 +43,7 @@ static int ath10k_htt_htc_attach(struct htt_struct *htt)
memset(&response, 0, sizeof(response));
connect.ep_callbacks.context = htt;
+ connect.ep_callbacks.ep_tx_complete = ath10k_htt_htc_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_htt_t2h_msg_handler;
connect.ep_callbacks.stop_queue = ath10k_htt_stop_queue;
connect.ep_callbacks.wake_queue = ath10k_htt_wake_queue;
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index f9218d7..e955a5b 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1295,6 +1295,7 @@ void ath10k_htt_tx_attach(struct htt_struct *htt);
void ath10k_htt_tx_detach(struct htt_struct *htt);
int ath10k_htt_rx_attach(struct htt_struct *htt);
void ath10k_htt_rx_detach(struct htt_struct *htt);
+void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb);
void ath10k_htt_t2h_msg_handler(void *context, struct sk_buff *skb);
int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt);
int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt);
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 327d031..02a42a4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -112,7 +112,7 @@ struct htt_tx_info *ath10k_htt_tx_info_lookup(struct htt_struct *htt,
return &htt->txi_pool[msdu_id];
}
-static void ath10k_htt_htc_tx_complete(struct sk_buff *skb)
+void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct htt_tx_info *txi;
@@ -160,7 +160,6 @@ static void ath10k_htt_htc_tx_complete(struct sk_buff *skb)
int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
struct htt_cmd *cmd;
int len = 0;
@@ -177,9 +176,7 @@ int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
cmd = (struct htt_cmd *)skb->data;
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_VERSION_REQ;
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
- skb_cb->htt.is_conf = true;
+ ATH10K_SKB_CB(skb)->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -192,7 +189,6 @@ int ath10k_htt_h2t_ver_req_msg(struct htt_struct *htt)
int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
struct htt_cmd *cmd;
struct htt_rx_ring_setup_ring *ring;
@@ -263,9 +259,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt)
ring->frag_info_offset = __cpu_to_le16(rx_desc_offset(frag_info));
#undef rx_desc_offset
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
- skb_cb->htt.is_conf = true;
+ ATH10K_SKB_CB(skb)->htt.is_conf = true;
ret = ath10k_htc_send(htt->htc_target, htt->ep_id, skb);
if (ret) {
@@ -316,7 +310,6 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
@@ -444,7 +437,6 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.complete = ath10k_htt_htc_tx_complete;
skb_cb->htc.priv = txi;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index df78ec7..b68bc99 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -74,10 +74,10 @@ static struct sk_buff *ath10k_wmi_alloc_skb(u32 len)
return skb;
}
-static void ath10k_wmi_htc_tx_complete(struct sk_buff *skb)
+static void ath10k_wmi_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- struct ath10k *ar = skb_cb->htc.priv;
+ struct ath10k *ar = context;
dev_kfree_skb(skb);
@@ -110,7 +110,6 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
}
memset(skb_cb, 0, sizeof(*skb_cb));
- skb_cb->htc.complete = ath10k_wmi_htc_tx_complete;
skb_cb->htc.priv = ar;
trace_ath10k_wmi_cmd(cmd_id, skb->data, skb->len);
@@ -1119,6 +1118,7 @@ int ath10k_wmi_connect_htc_service(struct ath10k *ar)
/* these fields are the same for all service endpoints */
connect.ep_callbacks.context = ar;
+ connect.ep_callbacks.ep_tx_complete = ath10k_wmi_htc_tx_complete;
connect.ep_callbacks.ep_rx_complete = ath10k_wmi_process_rx;
/* connect to control service */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 2/3] ath10k: remove `priv` from ath10k_skb_cb
2013-04-22 8:08 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Michal Kazior
@ 2013-04-22 8:08 ` Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 3/3] ath10k: share htt tx completion for data/mgmt tx Michal Kazior
2013-04-22 9:25 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Kalle Valo
2 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-22 8:08 UTC (permalink / raw)
To: ath9k-devel
Introduce msdu_id into ath10k_skb_cb to keep track
of htt-related metadata.
This frees up 8 bytes of space in ath10k_skb_cb
making it easier to merge htt_tx_info.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
rebased on top of latest master
drivers/net/wireless/ath/ath10k/core.h | 4 ++--
drivers/net/wireless/ath/ath10k/htc.c | 7 -------
drivers/net/wireless/ath/ath10k/htt_tx.c | 18 +++++++++++-------
drivers/net/wireless/ath/ath10k/wmi.c | 2 --
4 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 9ab081c..7cbf7df 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -55,16 +55,16 @@ struct ath10k_skb_cb {
struct {
u8 vdev_id;
+ u16 msdu_id;
bool is_offchan;
bool is_conf;
} __packed htt;
struct {
u8 credits_used;
- void *priv;
} __packed htc;
- /* 18 bytes left on 64bit arch */
+ /* 24 bytes left on 64bit arch */
} __packed;
static inline struct ath10k_skb_cb *ATH10K_SKB_CB(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index 598a0aa..2dbdbd6 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -763,7 +763,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
enum htc_endpoint_id assigned_ep = HTC_EP_COUNT;
struct htc_endpoint *ep;
struct sk_buff *skb;
- struct ath10k_skb_cb *skb_cb;
unsigned int max_msg_size = 0;
int length, status;
bool disable_credit_flow_ctrl = false;
@@ -808,9 +807,6 @@ int ath10k_htc_connect_service(struct htc_target *target,
disable_credit_flow_ctrl = true;
}
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.priv = target;
-
INIT_COMPLETION(target->ctl_resp);
status = ath10k_htc_send(target, HTC_EP_0, skb);
@@ -932,7 +928,6 @@ struct sk_buff *ath10k_htc_alloc_skb(int size)
int ath10k_htc_start(struct htc_target *target)
{
- struct ath10k_skb_cb *skb_cb;
struct sk_buff *skb;
int status = 0;
struct htc_msg *msg;
@@ -949,8 +944,6 @@ int ath10k_htc_start(struct htc_target *target)
ath10k_dbg(ATH10K_DBG_HTC, "HTC is using TX credit flow control\n");
- skb_cb = ATH10K_SKB_CB(skb);
- skb_cb->htc.priv = target;
status = ath10k_htc_send(target, HTC_EP_0, skb);
return status;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 02a42a4..a4f1072 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -115,9 +115,9 @@ struct htt_tx_info *ath10k_htt_tx_info_lookup(struct htt_struct *htt,
void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
+ struct htt_struct *htt = (struct htt_struct *)context;
+ struct device *dev = htt->ar->dev;
struct htt_tx_info *txi;
- struct htt_struct *htt;
- struct device *dev;
int ret;
if (skb_cb->htt.is_conf) {
@@ -125,9 +125,13 @@ void ath10k_htt_htc_tx_complete(void *context, struct sk_buff *skb)
return;
}
- txi = skb_cb->htc.priv;
- htt = txi->htt;
- dev = htt->ar->dev;
+ txi = ath10k_htt_tx_info_lookup(htt, skb_cb->htt.msdu_id);
+ if (!txi) {
+ ath10k_warn("tx completion failure, wrong htt msdu_id %d\n",
+ skb_cb->htt.msdu_id);
+ return;
+ }
+
txi->htc_tx_completed = true;
if (skb_cb->is_aborted) {
@@ -310,7 +314,7 @@ int ath10k_htt_mgmt_tx(struct htt_struct *htt, struct sk_buff *msdu)
min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.priv = txi;
+ skb_cb->htt.msdu_id = txi->msdu_id;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
@@ -437,7 +441,7 @@ int ath10k_htt_tx(struct htt_struct *htt, struct sk_buff *msdu)
memcpy(cmd->data_tx.prefetch, msdu->data, prefetch_len);
skb_cb = ATH10K_SKB_CB(txi->txdesc);
- skb_cb->htc.priv = txi;
+ skb_cb->htt.msdu_id = txi->msdu_id;
res = ath10k_htc_send(htt->htc_target, htt->ep_id, txi->txdesc);
if (res)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index b68bc99..420fb0f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -76,7 +76,6 @@ static struct sk_buff *ath10k_wmi_alloc_skb(u32 len)
static void ath10k_wmi_htc_tx_complete(void *context, struct sk_buff *skb)
{
- struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct ath10k *ar = context;
dev_kfree_skb(skb);
@@ -110,7 +109,6 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
}
memset(skb_cb, 0, sizeof(*skb_cb));
- skb_cb->htc.priv = ar;
trace_ath10k_wmi_cmd(cmd_id, skb->data, skb->len);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 3/3] ath10k: share htt tx completion for data/mgmt tx
2013-04-22 8:08 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 2/3] ath10k: remove `priv` from ath10k_skb_cb Michal Kazior
@ 2013-04-22 8:08 ` Michal Kazior
2013-04-22 9:25 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Kalle Valo
2 siblings, 0 replies; 15+ messages in thread
From: Michal Kazior @ 2013-04-22 8:08 UTC (permalink / raw)
To: ath9k-devel
Removes code redundancy and eases future
refactoring up.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
rebased on top of latest master
drivers/net/wireless/ath/ath10k/htt.h | 14 ++---
drivers/net/wireless/ath/ath10k/htt_rx.c | 49 +++++++++++----
drivers/net/wireless/ath/ath10k/txrx.c | 96 ++++++++----------------------
drivers/net/wireless/ath/ath10k/txrx.h | 5 +-
4 files changed, 69 insertions(+), 95 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index e955a5b..cd90770 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1080,16 +1080,10 @@ struct htt_resp {
/*** host side structures follow ***/
-struct htt_mgmt_tx_done {
- u32 desc_id;
- u32 status;
-};
-
-struct htt_data_tx_done {
- enum htt_data_tx_status status;
- u8 tid;
- bool tid_invalid;
- u16 msdu_id;
+struct htt_tx_done {
+ u32 msdu_id;
+ bool discard;
+ bool no_ack;
};
struct htt_peer_map_event {
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 2f298c8..7c90a2c 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -991,27 +991,54 @@ void ath10k_htt_t2h_msg_handler(void *context, struct sk_buff *skb)
break;
}
case HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION: {
- struct htt_mgmt_tx_done arg = {
- .desc_id = __le32_to_cpu(resp->mgmt_tx_completion.desc_id),
- .status = __le32_to_cpu(resp->mgmt_tx_completion.status),
+ struct htt_tx_done tx_done = {
+ .msdu_id = __le32_to_cpu(resp->mgmt_tx_completion.desc_id),
};
- ath10k_mgmt_tx_completed(htt, &arg);
+ int status = __le32_to_cpu(resp->mgmt_tx_completion.status);
+
+ switch (status) {
+ case HTT_MGMT_TX_STATUS_OK:
+ tx_done.discard = false;
+ break;
+ case HTT_MGMT_TX_STATUS_RETRY:
+ case HTT_MGMT_TX_STATUS_DROP:
+ tx_done.discard = true;
+ break;
+ }
+
+ ath10k_txrx_tx_completed(htt, &tx_done);
break;
}
case HTT_T2H_MSG_TYPE_TX_COMPL_IND: {
- struct htt_data_tx_done ev = {
- .status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS),
- .tid = MS(resp->data_tx_completion.flags, HTT_DATA_TX_TID),
- .tid_invalid = !!(resp->data_tx_completion.flags & HTT_DATA_TX_TID_INVALID),
- };
+ struct htt_tx_done tx_done = {};
+ int status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS);
int i;
+ switch (status) {
+ case HTT_DATA_TX_STATUS_NO_ACK:
+ tx_done.no_ack = true;
+ tx_done.discard = false;
+ break;
+ case HTT_DATA_TX_STATUS_OK:
+ tx_done.discard = false;
+ break;
+ case HTT_DATA_TX_STATUS_DISCARD:
+ case HTT_DATA_TX_STATUS_POSTPONE:
+ case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
+ tx_done.discard = true;
+ break;
+ default:
+ ath10k_warn("unhandled tx completion status %d\n", status);
+ tx_done.discard = true;
+ break;
+ }
+
ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion num_msdus %d\n",
resp->data_tx_completion.num_msdus);
for (i = 0; i < resp->data_tx_completion.num_msdus; i++) {
- ev.msdu_id = __le16_to_cpu(resp->data_tx_completion.msdus[i]);
- ath10k_data_tx_completed(htt, &ev);
+ tx_done.msdu_id = __le16_to_cpu(resp->data_tx_completion.msdus[i]);
+ ath10k_txrx_tx_completed(htt, &tx_done);
}
break;
}
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index 716f21c..e1317e3 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -44,56 +44,55 @@ out:
spin_unlock_bh(&ar->data_lock);
}
-void ath10k_data_tx_completed(struct htt_struct *htt,
- struct htt_data_tx_done *ev)
+void ath10k_txrx_tx_completed(struct htt_struct *htt,
+ const struct htt_tx_done *tx_done)
{
struct device *dev = htt->ar->dev;
- struct htt_tx_info *txi;
struct ieee80211_tx_info *info;
+ struct htt_tx_info *txi;
int ret;
- ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion "
- "msdu_id %d tid %d tid_invalid %d status %d\n",
- ev->msdu_id, ev->tid, ev->tid_invalid, ev->status);
+ ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n",
+ tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack);
- txi = ath10k_htt_tx_info_lookup(htt, ev->msdu_id);
+ txi = ath10k_htt_tx_info_lookup(htt, tx_done->msdu_id);
if (!txi) {
ath10k_dbg(ATH10K_DBG_HTT, "htt txi lookup fail\n");
return;
}
- ret = ath10k_skb_unmap(dev, txi->txfrag);
- if (ret)
- ath10k_warn("txfrag unmap failed (%d)\n", ret);
+ if (txi->txfrag) {
+ ret = ath10k_skb_unmap(dev, txi->txfrag);
+ if (ret)
+ ath10k_warn("txfrag unmap failed (%d)\n", ret);
+
+ dev_kfree_skb_any(txi->txfrag);
+ }
ret = ath10k_skb_unmap(dev, txi->msdu);
if (ret)
ath10k_warn("data skb unmap failed (%d)\n", ret);
- dev_kfree_skb_any(txi->txfrag);
-
ath10k_report_offchan_tx(htt->ar, txi->msdu);
info = IEEE80211_SKB_CB(txi->msdu);
memset(&info->status, 0, sizeof(info->status));
- switch (ev->status) {
- case HTT_DATA_TX_STATUS_OK:
- if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
- info->flags |= IEEE80211_TX_STAT_ACK;
- /* fall through */
- case HTT_DATA_TX_STATUS_NO_ACK:
- ieee80211_tx_status(htt->ar->hw, txi->msdu);
- break;
- case HTT_DATA_TX_STATUS_DISCARD:
- /* fall through */
- case HTT_DATA_TX_STATUS_POSTPONE:
- /* fall through */
- case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
+ if (tx_done->discard) {
ieee80211_free_txskb(htt->ar->hw, txi->msdu);
- break;
+ goto exit;
}
+ if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
+ info->flags |= IEEE80211_TX_STAT_ACK;
+
+ if (tx_done->no_ack)
+ info->flags &= ~IEEE80211_TX_STAT_ACK;
+
+ ieee80211_tx_status(htt->ar->hw, txi->msdu);
+ /* we do not own the msdu anymore */
+
+exit:
txi->htt_tx_completed = true;
ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
}
@@ -265,51 +264,6 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info)
ieee80211_rx(ar->hw, info->skb);
}
-void ath10k_mgmt_tx_completed(struct htt_struct *htt,
- struct htt_mgmt_tx_done *arg)
-{
- struct device *dev = htt->ar->dev;
- struct ieee80211_tx_info *info;
- struct sk_buff *msdu;
- struct htt_tx_info *txi;
- int ret;
-
- ath10k_dbg(ATH10K_DBG_HTT, "%s called(), status: %d, msdu_id: %d\n",
- __func__, arg->status, arg->desc_id);
-
- txi = ath10k_htt_tx_info_lookup(htt, arg->desc_id);
- if (WARN_ON(!txi))
- return;
-
- msdu = txi->msdu;
-
- ret = ath10k_skb_unmap(dev, msdu);
- if (ret)
- ath10k_warn("mgmt skb unmap failed (%d)\n", ret);
-
- ath10k_report_offchan_tx(htt->ar, msdu);
-
- info = IEEE80211_SKB_CB(msdu);
- memset(&info->status, 0, sizeof(info->status));
-
- switch (arg->status) {
- case HTT_MGMT_TX_STATUS_OK:
- if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
- info->flags |= IEEE80211_TX_STAT_ACK;
-
- ieee80211_tx_status(htt->ar->hw, msdu);
- break;
- case HTT_MGMT_TX_STATUS_RETRY:
- /* fall through */
- case HTT_MGMT_TX_STATUS_DROP:
- ieee80211_free_txskb(htt->ar->hw, msdu);
- break;
- }
-
- txi->htt_tx_completed = true;
- ath10k_htt_tx_info_unref(htt, txi, txi->txdesc);
-}
-
struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
const u8 *addr)
{
diff --git a/drivers/net/wireless/ath/ath10k/txrx.h b/drivers/net/wireless/ath/ath10k/txrx.h
index c837d47..c80a472 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.h
+++ b/drivers/net/wireless/ath/ath10k/txrx.h
@@ -19,9 +19,8 @@
#include "htt.h"
-void ath10k_data_tx_completed(struct htt_struct *htt,
- struct htt_data_tx_done *ev);
-void ath10k_mgmt_tx_completed(struct htt_struct *, struct htt_mgmt_tx_done *);
+void ath10k_txrx_tx_completed(struct htt_struct *htt,
+ const struct htt_tx_done *tx_done);
void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info);
struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling
2013-04-22 8:08 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 2/3] ath10k: remove `priv` from ath10k_skb_cb Michal Kazior
2013-04-22 8:08 ` [ath9k-devel] [PATCH 3/3] ath10k: share htt tx completion for data/mgmt tx Michal Kazior
@ 2013-04-22 9:25 ` Kalle Valo
2013-04-22 9:27 ` Kalle Valo
2 siblings, 1 reply; 15+ messages in thread
From: Kalle Valo @ 2013-04-22 9:25 UTC (permalink / raw)
To: ath9k-devel
Michal Kazior <michal.kazior@tieto.com> writes:
> Having a tx completion handler in the
> ath10k_skb_cb is very costly (memory wise). The
> saved space will be used to merge htt_tx_info.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
> rebased on top of latest master
Thanks, all three applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread
* [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling
2013-04-22 9:25 ` [ath9k-devel] [PATCH 1/3] ath10k: remove per-packet completion handling Kalle Valo
@ 2013-04-22 9:27 ` Kalle Valo
0 siblings, 0 replies; 15+ messages in thread
From: Kalle Valo @ 2013-04-22 9:27 UTC (permalink / raw)
To: ath9k-devel
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> Having a tx completion handler in the
>> ath10k_skb_cb is very costly (memory wise). The
>> saved space will be used to merge htt_tx_info.
>>
>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>> ---
>> rebased on top of latest master
>
> Thanks, all three applied.
Oh, but there were conflicts. Please check extra carefully that I didn't
break anything.
Also the "xx bytes left" in ath10k_skb_cb is most likely wrong. BTW, I
think we have to remove that comment in the future. It causes conflicts
very easily.
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread