From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [RFC PATCH net-next 2/3] net: add __netdev_xmit_{only,flush} helpers
Date: Sun, 24 Aug 2014 15:42:17 +0200 [thread overview]
Message-ID: <1408887738-7661-3-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1408887738-7661-1-git-send-email-dborkman@redhat.com>
This adds two helpers to use xmit and flushing separately from
each other as opposed to netdev_start_xmit().
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
include/linux/netdevice.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1d05932..33faa33 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3393,6 +3393,21 @@ static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_devi
return __netdev_start_xmit(ops, skb, dev);
}
+static inline netdev_tx_t __netdev_xmit_only(struct sk_buff *skb, struct net_device *dev)
+{
+ const struct net_device_ops *ops = dev->netdev_ops;
+
+ return ops->ndo_start_xmit(skb, dev);
+}
+
+static inline void __netdev_xmit_flush(struct net_device *dev, u16 queue)
+{
+ const struct net_device_ops *ops = dev->netdev_ops;
+
+ if (ops->ndo_xmit_flush)
+ ops->ndo_xmit_flush(dev, queue);
+}
+
int netdev_class_create_file_ns(struct class_attribute *class_attr,
const void *ns);
void netdev_class_remove_file_ns(struct class_attribute *class_attr,
--
1.7.11.7
next prev parent reply other threads:[~2014-08-24 13:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-24 13:42 [RFC PATCH net-next 0/3] Some deferred TX queue follow-ups Daniel Borkmann
2014-08-24 13:42 ` [RFC PATCH net-next 1/3] ixgbe: support netdev_ops->ndo_xmit_flush() Daniel Borkmann
2014-08-25 5:55 ` David Miller
2014-08-25 12:07 ` Jesper Dangaard Brouer
2014-08-25 22:32 ` David Miller
2014-08-25 23:31 ` David Miller
2014-08-26 6:13 ` Daniel Borkmann
2014-08-25 22:51 ` Alexander Duyck
2014-08-26 6:44 ` Jesper Dangaard Brouer
2014-08-27 11:34 ` Jesper Dangaard Brouer
2014-08-24 13:42 ` Daniel Borkmann [this message]
2014-08-24 13:42 ` [RFC PATCH net-next 3/3] packet: make use of deferred TX queue flushing Daniel Borkmann
2014-08-25 5:57 ` David Miller
2014-08-25 6:40 ` Daniel Borkmann
2014-08-25 13:54 ` Jesper Dangaard Brouer
2014-08-25 15:16 ` Jesper Dangaard Brouer
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=1408887738-7661-3-git-send-email-dborkman@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).