aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154/tx.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-26 13:15:34 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-26 14:18:35 -0400
commitf81f466ca588a5bd868008154050305481f241d4 (patch)
tree9509b8cbac028903597f9d48a43211fdda57a627 /net/mac802154/tx.c
parent955aee8b5c69594b9fb38a4f65e77db343b43a38 (diff)
mac802154: tx: make worker information static
This patch moves the worker information struct out of skb control block. Instead control block we declare it static inside of tx.c file. We can do that, because the worker can't be used twice at the same time. It's protected by stop and wake netdev queue. This patch fix an issue that the "struct ieee802154_xmit_cb" doesn't fit into the skb control block on some kernel configuartion reported by kbuild test robot. It was introduced by commit fe24371d6645b766c59ec664c59d0a9c310ad455 ("mac802154: tx: remove kmalloc in xmit hotpath"). Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/tx.c')
-rw-r--r--net/mac802154/tx.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 74882c72b6c3..fe2e17e6fee3 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -37,13 +37,7 @@ struct ieee802154_xmit_cb {
37 struct ieee802154_local *local; 37 struct ieee802154_local *local;
38}; 38};
39 39
40static inline struct ieee802154_xmit_cb * 40static struct ieee802154_xmit_cb ieee802154_xmit_cb;
41ieee802154_xmit_cb(const struct sk_buff *skb)
42{
43 BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ieee802154_xmit_cb));
44
45 return (struct ieee802154_xmit_cb *)skb->cb;
46}
47 41
48static void ieee802154_xmit_worker(struct work_struct *work) 42static void ieee802154_xmit_worker(struct work_struct *work)
49{ 43{
@@ -84,7 +78,6 @@ err_tx:
84static netdev_tx_t 78static netdev_tx_t
85ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) 79ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
86{ 80{
87 struct ieee802154_xmit_cb *cb = ieee802154_xmit_cb(skb);
88 struct net_device *dev = skb->dev; 81 struct net_device *dev = skb->dev;
89 int ret; 82 int ret;
90 83
@@ -113,11 +106,11 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
113 dev->stats.tx_packets++; 106 dev->stats.tx_packets++;
114 dev->stats.tx_bytes += skb->len; 107 dev->stats.tx_bytes += skb->len;
115 } else { 108 } else {
116 INIT_WORK(&cb->work, ieee802154_xmit_worker); 109 INIT_WORK(&ieee802154_xmit_cb.work, ieee802154_xmit_worker);
117 cb->skb = skb; 110 ieee802154_xmit_cb.skb = skb;
118 cb->local = local; 111 ieee802154_xmit_cb.local = local;
119 112
120 queue_work(local->workqueue, &cb->work); 113 queue_work(local->workqueue, &ieee802154_xmit_cb.work);
121 } 114 }
122 115
123 return NETDEV_TX_OK; 116 return NETDEV_TX_OK;