From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next] mac802154: tx: make worker information static
Date: Sun, 26 Oct 2014 18:15:34 +0100 [thread overview]
Message-ID: <1414343734-7367-1-git-send-email-alex.aring@gmail.com> (raw)
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>
---
net/mac802154/tx.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 74882c7..fe2e17e 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -37,13 +37,7 @@ struct ieee802154_xmit_cb {
struct ieee802154_local *local;
};
-static inline struct 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 struct ieee802154_xmit_cb ieee802154_xmit_cb;
static void ieee802154_xmit_worker(struct work_struct *work)
{
@@ -84,7 +78,6 @@ err_tx:
static netdev_tx_t
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;
int ret;
@@ -113,11 +106,11 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
} else {
- INIT_WORK(&cb->work, ieee802154_xmit_worker);
- cb->skb = skb;
- cb->local = local;
+ INIT_WORK(&ieee802154_xmit_cb.work, ieee802154_xmit_worker);
+ ieee802154_xmit_cb.skb = skb;
+ ieee802154_xmit_cb.local = local;
- queue_work(local->workqueue, &cb->work);
+ queue_work(local->workqueue, &ieee802154_xmit_cb.work);
}
return NETDEV_TX_OK;
--
2.1.2
next reply other threads:[~2014-10-26 17:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-26 17:15 Alexander Aring [this message]
2014-10-26 18:20 ` [PATCH bluetooth-next] mac802154: tx: make worker information static Marcel Holtmann
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=1414343734-7367-1-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox