X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_ethdev%2Frte_ethdev_driver.h;h=99d4cd6cd0fc22362b820b5f5c504359181f485d;hb=0fc601af3a722ca3ed8bc7cba4c01e377513cdb3;hp=3821f0b1dbe872ea0dadcb15666144a0367b6cc6;hpb=fbe90cdd776c3ac99c4c56d1b5318a90fcf01602;p=dpdk.git diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 3821f0b1db..99d4cd6cd0 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -21,6 +21,41 @@ extern "C" { #endif +/** + * RX/TX queue states + */ +#define RTE_ETH_QUEUE_STATE_STOPPED 0 +#define RTE_ETH_QUEUE_STATE_STARTED 1 +#define RTE_ETH_QUEUE_STATE_HAIRPIN 2 + +/** + * @internal + * Check if the selected Rx queue is hairpin queue. + * + * @param dev + * Pointer to the selected device. + * @param queue_id + * The selected queue. + * + * @return + * - (1) if the queue is hairpin queue, 0 otherwise. + */ +int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); + +/** + * @internal + * Check if the selected Tx queue is hairpin queue. + * + * @param dev + * Pointer to the selected device. + * @param queue_id + * The selected queue. + * + * @return + * - (1) if the queue is hairpin queue, 0 otherwise. + */ +int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); + /** * @internal * Returns a ethdev slot specified by the unique identifier name. @@ -38,7 +73,6 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name); * to that slot for the driver to use. * * @param name Unique identifier name for each Ethernet device - * @param type Device type of this Ethernet device * @return * - Slot in the rte_dev_devices array for a new device; */ @@ -59,10 +93,17 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); /** * @internal - * Release the specified ethdev port. + * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port. + * + * The following PMD-managed data fields will be freed: + * - dev_private + * - mac_addrs + * - hash_mac_addrs + * If one of these fields should not be freed, + * it must be reset to NULL by the PMD, typically in dev_close method. * * @param eth_dev - * The *eth_dev* pointer is the address of the *rte_eth_dev* structure. + * Device to be detached. * @return * - 0 on success, negative on error */ @@ -106,6 +147,10 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * This is the last step of device probing. * It must be called after a port is allocated and initialized successfully. * + * The notification RTE_ETH_EVENT_NEW is sent to other entities + * (libraries and applications). + * The state is set as RTE_ETH_DEV_ATTACHED. + * * @param dev * New ethdev port. */ @@ -215,7 +260,8 @@ rte_eth_linkstatus_get(const struct rte_eth_dev *dev, * @return * Negative errno value on error, 0 on success. */ -int __rte_experimental +__rte_experimental +int rte_eth_switch_domain_alloc(uint16_t *domain_id); /** @@ -233,7 +279,8 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id); * @return * Negative errno value on error, 0 on success. */ -int __rte_experimental +__rte_experimental +int rte_eth_switch_domain_free(uint16_t domain_id); /** Generic Ethernet device arguments */ @@ -262,7 +309,8 @@ struct rte_eth_devargs { * @return * Negative errno value on error, 0 on success. */ -int __rte_experimental +__rte_experimental +int rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs); @@ -294,7 +342,8 @@ typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev, * @return * Negative errno value on error, 0 on success. */ -int __rte_experimental +__rte_experimental +int rte_eth_dev_create(struct rte_device *device, const char *name, size_t priv_data_size, ethdev_bus_specific_init bus_specific_init, void *bus_init_params, @@ -307,7 +356,7 @@ typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev); * @warning * @b EXPERIMENTAL: this API may change without prior notice. * - * PMD helper function for cleaing up the resources of a ethdev port on it's + * PMD helper function for cleaning up the resources of a ethdev port on it's * destruction. * * @param ethdev @@ -318,7 +367,8 @@ typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev); * @return * Negative errno value on error, 0 on success. */ -int __rte_experimental +__rte_experimental +int rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit); #ifdef __cplusplus