net/tap: add link status notification
[dpdk.git] / drivers / net / tap / rte_eth_tap.h
index 741ec53..f1496dc 100644 (file)
 #define _RTE_ETH_TAP_H_
 
 #include <sys/queue.h>
+#include <sys/uio.h>
 #include <inttypes.h>
 
+#include <linux/if_tun.h>
+
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 
@@ -48,6 +51,8 @@ struct pkt_stats {
        uint64_t obytes;                /* Number of bytes on output */
        uint64_t ibytes;                /* Number of bytes on input */
        uint64_t errs;                  /* Number of TX error packets */
+       uint64_t ierrors;               /* Number of RX error packets */
+       uint64_t rx_nombuf;             /* Nb of RX mbuf alloc failures */
 };
 
 struct rx_queue {
@@ -56,25 +61,36 @@ struct rx_queue {
        uint16_t in_port;               /* Port ID */
        int fd;
        struct pkt_stats stats;         /* Stats for this RX queue */
+       uint16_t nb_rx_desc;            /* max number of mbufs available */
+       struct rte_eth_rxmode *rxmode;  /* RX features */
+       struct rte_mbuf *pool;          /* mbufs pool for this queue */
+       struct iovec (*iovecs)[];       /* descriptors for this queue */
+       struct tun_pi pi;               /* packet info for iovecs */
 };
 
 struct tx_queue {
        int fd;
+       uint16_t *mtu;                  /* Pointer to MTU from dev_data */
        struct pkt_stats stats;         /* Stats for this TX queue */
 };
 
 struct pmd_internals {
+       char remote_iface[RTE_ETH_NAME_MAX_LEN]; /* Remote netdevice name */
        char name[RTE_ETH_NAME_MAX_LEN];  /* Internal Tap device name */
        uint16_t nb_queues;               /* Number of queues supported */
        struct ether_addr eth_addr;       /* Mac address of the device port */
+       int remote_if_index;              /* remote netdevice IF_INDEX */
        int if_index;                     /* IF_INDEX for the port */
        int ioctl_sock;                   /* socket for ioctl calls */
        int nlsk_fd;                      /* Netlink socket fd */
        int flower_support;               /* 1 if kernel supports, else 0 */
        int flower_vlan_support;          /* 1 if kernel supports, else 0 */
        LIST_HEAD(tap_flows, rte_flow) flows;        /* rte_flow rules */
+       /* implicit rte_flow rules set when a remote device is active */
+       LIST_HEAD(tap_implicit_flows, rte_flow) implicit_flows;
        struct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES]; /* List of RX queues */
        struct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES]; /* List of TX queues */
+       struct rte_intr_handle intr_handle;          /* LSC interrupt handle. */
 };
 
 #endif /* _RTE_ETH_TAP_H_ */