X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ether%2Frte_ethdev.h;h=5b51fe6bc7b2766eed49e52380c9567de1205f2a;hb=719dbebceb81;hp=c835a2f5652b1283715d060d7008207659ae347c;hpb=80a1deb4c77aca0ddc402c888f3c67216373f5e0;p=dpdk.git diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index c835a2f565..5b51fe6bc7 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -195,27 +195,29 @@ struct rte_eth_stats { uint64_t ibytes; /**< Total number of successfully received bytes. */ uint64_t obytes; /**< Total number of successfully transmitted bytes. */ uint64_t imissed; - /**< Deprecated; Total of RX missed packets (e.g full FIFO). */ - uint64_t ibadcrc; + /**< Total of RX packets dropped by the HW, + * because there are no available mbufs (i.e. RX queues are full). + */ + uint64_t ibadcrc __rte_deprecated; /**< Deprecated; Total of RX packets with CRC error. */ - uint64_t ibadlen; + uint64_t ibadlen __rte_deprecated; /**< Deprecated; Total of RX packets with bad length. */ uint64_t ierrors; /**< Total number of erroneous received packets. */ uint64_t oerrors; /**< Total number of failed transmitted packets. */ uint64_t imcasts; /**< Deprecated; Total number of multicast received packets. */ uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */ - uint64_t fdirmatch; + uint64_t fdirmatch __rte_deprecated; /**< Deprecated; Total number of RX packets matching a filter. */ - uint64_t fdirmiss; + uint64_t fdirmiss __rte_deprecated; /**< Deprecated; Total number of RX packets not matching any filter. */ - uint64_t tx_pause_xon; + uint64_t tx_pause_xon __rte_deprecated; /**< Deprecated; Total nb. of XON pause frame sent. */ - uint64_t rx_pause_xon; + uint64_t rx_pause_xon __rte_deprecated; /**< Deprecated; Total nb. of XON pause frame received. */ - uint64_t tx_pause_xoff; + uint64_t tx_pause_xoff __rte_deprecated; /**< Deprecated; Total nb. of XOFF pause frame sent. */ - uint64_t rx_pause_xoff; + uint64_t rx_pause_xoff __rte_deprecated; /**< Deprecated; Total nb. of XOFF pause frame received. */ uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]; /**< Total number of queue RX packets. */ @@ -917,6 +919,12 @@ struct rte_eth_dcb_info { struct rte_eth_dcb_tc_queue_mapping tc_queue; }; +/** + * RX/TX queue states + */ +#define RTE_ETH_QUEUE_STATE_STOPPED 0 +#define RTE_ETH_QUEUE_STATE_STARTED 1 + struct rte_eth_dev; struct rte_eth_dev_callback; @@ -1551,8 +1559,21 @@ struct rte_eth_dev_data { all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */ dev_started : 1, /**< Device state: STARTED(1) / STOPPED(0). */ lro : 1; /**< RX LRO is ON(1) / OFF(0) */ + uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT]; + /** Queues state: STARTED(1) / STOPPED(0) */ + uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT]; + /** Queues state: STARTED(1) / STOPPED(0) */ + uint32_t dev_flags; /**< Capabilities */ + enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */ + int numa_node; /**< NUMA node connection */ + const char *drv_name; /**< Driver name */ }; +/** Device supports hotplug detach */ +#define RTE_ETH_DEV_DETACHABLE 0x0001 +/** Device supports link state interrupt */ +#define RTE_ETH_DEV_INTR_LSC 0x0002 + /** * @internal * The pool of *rte_eth_dev* structures. The size of the pool @@ -3101,7 +3122,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * @param queue_idx * The queue id. * @param tx_rate - * The tx rate allocated from the total link speed for this queue. + * The tx rate in Mbps. Allocated from the total port link speed. * @return * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support this feature. @@ -3733,6 +3754,44 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp); +/** + * Copy pci device info to the Ethernet device data. + * + * @param eth_dev + * The *eth_dev* pointer is the address of the *rte_eth_dev* structure. + * @param pci_dev + * The *pci_dev* pointer is the address of the *rte_pci_device* structure. + * + * @return + * - 0 on success, negative on error + */ +extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev); + + +/** + * Create memzone for HW rings. + * malloc can't be used as the physical address is needed. + * If the memzone is already created, then this function returns a ptr + * to the old one. + * + * @param eth_dev + * The *eth_dev* pointer is the address of the *rte_eth_dev* structure + * @param name + * The name of the memory zone + * @param queue_id + * The index of the queue to add to name + * @param size + * The sizeof of the memory area + * @param align + * Alignment for resulting memzone. Must be a power of 2. + * @param socket_id + * The *socket_id* argument is the socket identifier in case of NUMA. + */ +const struct rte_memzone * +rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, + uint16_t queue_id, size_t size, + unsigned align, int socket_id); + #ifdef __cplusplus } #endif