Commit f81f466c authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

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 fe24371d
("mac802154: tx: remove kmalloc in xmit hotpath").
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 955aee8b
...@@ -37,13 +37,7 @@ struct ieee802154_xmit_cb { ...@@ -37,13 +37,7 @@ struct ieee802154_xmit_cb {
struct ieee802154_local *local; struct ieee802154_local *local;
}; };
static inline struct ieee802154_xmit_cb * static struct ieee802154_xmit_cb ieee802154_xmit_cb;
ieee802154_xmit_cb(const struct sk_buff *skb)
{
BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ieee802154_xmit_cb));
return (struct ieee802154_xmit_cb *)skb->cb;
}
static void ieee802154_xmit_worker(struct work_struct *work) static void ieee802154_xmit_worker(struct work_struct *work)
{ {
...@@ -84,7 +78,6 @@ static void ieee802154_xmit_worker(struct work_struct *work) ...@@ -84,7 +78,6 @@ static void ieee802154_xmit_worker(struct work_struct *work)
static netdev_tx_t static netdev_tx_t
ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
{ {
struct ieee802154_xmit_cb *cb = ieee802154_xmit_cb(skb);
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
int ret; int ret;
...@@ -113,11 +106,11 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -113,11 +106,11 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
dev->stats.tx_packets++; dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
} else { } else {
INIT_WORK(&cb->work, ieee802154_xmit_worker); INIT_WORK(&ieee802154_xmit_cb.work, ieee802154_xmit_worker);
cb->skb = skb; ieee802154_xmit_cb.skb = skb;
cb->local = local; ieee802154_xmit_cb.local = local;
queue_work(local->workqueue, &cb->work); queue_work(local->workqueue, &ieee802154_xmit_cb.work);
} }
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment