From: Magnus Karlsson <magnus.karls...@intel.com>

Two new ndo ops are added. One for enabling/disabling AF_PACKET V4
zerocopy, and one for kicking the egress ring.

Signed-off-by: Magnus Karlsson <magnus.karls...@intel.com>
---
 include/linux/netdevice.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5e02f79b2110..1421206bf243 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -833,6 +833,8 @@ struct dev_ifalias {
        char ifalias[];
 };
 
+struct tp4_netdev_parms;
+
 /*
  * This structure defines the management hooks for network devices.
  * The following hooks can be defined; unless noted otherwise, they are
@@ -1133,6 +1135,15 @@ struct dev_ifalias {
  * void (*ndo_xdp_flush)(struct net_device *dev);
  *     This function is used to inform the driver to flush a particular
  *     xdp tx queue. Must be called on same CPU as xdp_xmit.
+ * int (*ndo_tp4_zerocopy)(struct net_device *dev,
+ *                        struct tp4_netdev_parms *parms);
+ *     This function is used to enable and disable the AF_PACKET V4
+ *     PACKET_ZEROCOPY support. See definition of enum tp4_netdev_command
+ *     in tpacket4.h for details.
+ * int (*ndo_tp4_xmit)(struct net_device *dev, int queue_pair);
+ *     This function is used to send packets when the PACKET_ZEROCOPY
+ *     option is set. The rtnl lock is not held when entering this
+ *     function.
  */
 struct net_device_ops {
        int                     (*ndo_init)(struct net_device *dev);
@@ -1320,6 +1331,11 @@ struct net_device_ops {
        int                     (*ndo_xdp_xmit)(struct net_device *dev,
                                                struct xdp_buff *xdp);
        void                    (*ndo_xdp_flush)(struct net_device *dev);
+       int                     (*ndo_tp4_zerocopy)(
+                                       struct net_device *dev,
+                                       struct tp4_netdev_parms *parms);
+       int                     (*ndo_tp4_xmit)(struct net_device *dev,
+                                               int queue_pair);
 };
 
 /**
-- 
2.11.0

Reply via email to