ethdev: remove rte_pmd_init_all function
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 0bcfa79..d5ea46b 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without
@@ -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];
@@ -540,6 +544,7 @@ struct rte_eth_fc_conf {
        uint16_t pause_time;  /**< Pause quota in the Pause frame */
        uint16_t send_xon;    /**< Is XON frame need be sent */
        enum rte_eth_fc_mode mode;  /**< Link flow control mode */
+       uint8_t mac_ctrl_frame_fwd; /**< Forward MAC control frames */
 };
 
 /**
@@ -724,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;
@@ -753,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. */
@@ -765,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;
@@ -1280,121 +1315,6 @@ 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
- * Ethernet devices.
- * Invoked once at EAL start time.
- * @return
- *   0 on success
- */
-extern int rte_igbvf_pmd_init(void);
-
-/**
- * The initialization function of the driver for 10Gbps Intel IXGBE
- * Ethernet devices.
- * Invoked once at EAL start time.
- * @return
- *   0 on success
- */
-extern int rte_ixgbe_pmd_init(void);
-
-/**
- * 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_ixgbevf_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.
- * Right now, the following PMDs are supported:
- *  - igb
- *  - igbvf
- *  - em
- *  - ixgbe
- *  - ixgbevf
- * This function is invoked once at EAL start time.
- * @return
- *   0 on success.
- *   Error code of the device initialization failure,
- *   -ENODEV if there are no drivers available
- *   (e.g. if all driver config options are = n).
- */
-static inline
-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);
-       }
-#endif /* RTE_LIBRTE_IXGBE_PMD */
-
-#ifdef RTE_LIBRTE_VIRTIO_PMD
-       if ((ret = rte_virtio_pmd_init()) != 0) {
-               RTE_LOG(ERR, PMD, "Cannot init virtio PMD\n");
-               return (ret);
-       }
-#endif /* RTE_LIBRTE_VIRTIO_PMD */
-
-       if (ret == -ENODEV)
-               RTE_LOG(ERR, PMD, "No PMD(s) are configured\n");
-       return (ret);
-}
-
 /**
  * Configure an Ethernet device.
  * This function must be invoked first before any other function in the