ixgbe: convert to use of PMD_REGISTER_DRIVER and fix linking
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 01b93bb..9621be7 100644 (file)
@@ -192,6 +192,10 @@ struct rte_eth_stats {
        uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */
        uint64_t fdirmatch; /**< Total number of RX packets matching a filter. */
        uint64_t fdirmiss;  /**< Total number of RX packets not matching any filter. */
+       uint64_t tx_pause_xon;  /**< Total nb. of XON pause frame sent. */
+       uint64_t rx_pause_xon;  /**< Total nb. of XON pause frame received. */
+       uint64_t tx_pause_xoff; /**< Total nb. of XOFF pause frame sent. */
+       uint64_t rx_pause_xoff; /**< Total nb. of XOFF pause frame received. */
        uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
        /**< Total number of queue RX packets. */
        uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
@@ -725,6 +729,11 @@ struct rte_eth_conf {
        /**< ETH_LINK_[HALF_DUPLEX|FULL_DUPLEX], or 0 for autonegotation */
        struct rte_eth_rxmode rxmode; /**< Port RX configuration. */
        struct rte_eth_txmode txmode; /**< Port TX configuration. */
+       uint32_t lpbk_mode; /**< Loopback operation mode. By default the value
+                                is 0, meaning the loopback mode is disabled.
+                                Read the datasheet of given ethernet controller
+                                for details. The possible values of this field
+                                are defined in implementation of each driver. */
        union {
                struct rte_eth_rss_conf rss_conf; /**< Port RSS configuration */
                struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;
@@ -754,9 +763,32 @@ struct rte_eth_conf {
  * an Ethernet device, such as the controlling driver of the device,
  * its PCI context, etc...
  */
+
+/**
+ * RX offload capabilities of a device.
+ */
+#define DEV_RX_OFFLOAD_VLAN_STRIP  0x00000001
+#define DEV_RX_OFFLOAD_IPV4_CKSUM  0x00000002
+#define DEV_RX_OFFLOAD_UDP_CKSUM   0x00000004
+#define DEV_RX_OFFLOAD_TCP_CKSUM   0x00000008
+#define DEV_RX_OFFLOAD_TCP_LRO     0x00000010
+
+/**
+ * TX offload capabilities of a device.
+ */
+#define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
+#define DEV_TX_OFFLOAD_IPV4_CKSUM  0x00000002
+#define DEV_TX_OFFLOAD_UDP_CKSUM   0x00000004
+#define DEV_TX_OFFLOAD_TCP_CKSUM   0x00000008
+#define DEV_TX_OFFLOAD_SCTP_CKSUM  0x00000010
+#define DEV_TX_OFFLOAD_TCP_TSO     0x00000020
+#define DEV_TX_OFFLOAD_UDP_TSO     0x00000040
+
 struct rte_eth_dev_info {
        struct rte_pci_device *pci_dev; /**< Device PCI information. */
        const char *driver_name; /**< Device Driver name. */
+       unsigned int if_index; /**< Index to bound host interface, or 0 if none.
+               Use if_indextoname() to translate into an interface name. */
        uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */
        uint32_t max_rx_pktlen; /**< Maximum configurable length of RX pkt. */
        uint16_t max_rx_queues; /**< Maximum number of RX queues. */
@@ -766,6 +798,8 @@ struct rte_eth_dev_info {
        /** Maximum number of hash MAC addresses for MTA and UTA. */
        uint16_t max_vfs; /**< Maximum number of VFs. */
        uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */
+       uint32_t rx_offload_capa; /**< Device RX offload capabilities. */
+       uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
 };
 
 struct rte_eth_dev;
@@ -1282,58 +1316,32 @@ struct eth_driver {
 extern void rte_eth_driver_register(struct eth_driver *eth_drv);
 
 /**
- * The initialization function of the driver for
- * Intel(r) IGB Gigabit Ethernet Controller devices.
- * This function is invoked once at EAL start time.
- * @return
- *   0 on success
- */
-extern int rte_igb_pmd_init(void);
-
-/**
- * The initialization function of the driver for
- * Intel(r) EM Gigabit Ethernet Controller devices.
- * This function is invoked once at EAL start time.
- * @return
- *   0 on success
- */
-extern int rte_em_pmd_init(void);
-
-/**
- * The initialization function of the driver for 1Gbps Intel IGB_VF
+ * The initialization function of the driver for 10Gbps Intel IXGBE_VF
  * Ethernet devices.
  * Invoked once at EAL start time.
  * @return
  *   0 on success
  */
-extern int rte_igbvf_pmd_init(void);
+extern int rte_ixgbevf_pmd_init(void);
 
 /**
- * The initialization function of the driver for 10Gbps Intel IXGBE
+ * The initialization function of the driver for Qumranet virtio-net
  * Ethernet devices.
  * Invoked once at EAL start time.
  * @return
  *   0 on success
  */
-extern int rte_ixgbe_pmd_init(void);
+extern int rte_virtio_pmd_init(void);
 
 /**
- * The initialization function of the driver for 10Gbps Intel IXGBE_VF
+ * The initialization function of the driver for VMware VMXNET3
  * Ethernet devices.
  * Invoked once at EAL start time.
  * @return
  *   0 on success
  */
-extern int rte_ixgbevf_pmd_init(void);
+extern int rte_vmxnet3_pmd_init(void);
 
-/**
- * The initialization function of the driver for Qumranet virtio-net
- * Ethernet devices.
- * Invoked once at EAL start time.
- * @return
- *   0 on success
- */
-extern int rte_virtio_pmd_init(void);
 
 /**
  * The initialization function of *all* supported and enabled drivers.
@@ -1343,6 +1351,8 @@ extern int rte_virtio_pmd_init(void);
  *  - em
  *  - ixgbe
  *  - ixgbevf
+ *  - virtio
+ *  - vmxnet3
  * This function is invoked once at EAL start time.
  * @return
  *   0 on success.
@@ -1355,29 +1365,7 @@ int rte_pmd_init_all(void)
 {
        int ret = -ENODEV;
 
-#ifdef RTE_LIBRTE_IGB_PMD
-       if ((ret = rte_igb_pmd_init()) != 0) {
-               RTE_LOG(ERR, PMD, "Cannot init igb PMD\n");
-               return (ret);
-       }
-       if ((ret = rte_igbvf_pmd_init()) != 0) {
-               RTE_LOG(ERR, PMD, "Cannot init igbvf PMD\n");
-               return (ret);
-       }
-#endif /* RTE_LIBRTE_IGB_PMD */
-
-#ifdef RTE_LIBRTE_EM_PMD
-       if ((ret = rte_em_pmd_init()) != 0) {
-               RTE_LOG(ERR, PMD, "Cannot init em PMD\n");
-               return (ret);
-       }
-#endif /* RTE_LIBRTE_EM_PMD */
-
 #ifdef RTE_LIBRTE_IXGBE_PMD
-       if ((ret = rte_ixgbe_pmd_init()) != 0) {
-               RTE_LOG(ERR, PMD, "Cannot init ixgbe PMD\n");
-               return (ret);
-       }
        if ((ret = rte_ixgbevf_pmd_init()) != 0) {
                RTE_LOG(ERR, PMD, "Cannot init ixgbevf PMD\n");
                return (ret);
@@ -1391,6 +1379,13 @@ int rte_pmd_init_all(void)
        }
 #endif /* RTE_LIBRTE_VIRTIO_PMD */
 
+#ifdef RTE_LIBRTE_VMXNET3_PMD
+       if ((ret = rte_vmxnet3_pmd_init()) != 0) {
+               RTE_LOG(ERR, PMD, "Cannot init vmxnet3 PMD\n");
+               return (ret);
+       }
+#endif /* RTE_LIBRTE_VMXNET3_PMD */
+
        if (ret == -ENODEV)
                RTE_LOG(ERR, PMD, "No PMD(s) are configured\n");
        return (ret);