diff mbox

[RFC,net-next,2/3] net: add __netdev_xmit_{only,flush} helpers

Message ID 1408887738-7661-3-git-send-email-dborkman@redhat.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Daniel Borkmann Aug. 24, 2014, 1:42 p.m. UTC
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 mbox

Patch

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,