ethdev: add security context API documentation
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index a5ba564..2729e2b 100644 (file)
@@ -946,6 +946,11 @@ struct rte_eth_conf {
                             DEV_RX_OFFLOAD_VLAN_FILTER | \
                             DEV_RX_OFFLOAD_VLAN_EXTEND)
 
+/*
+ * If new Rx offload capabilities are defined, they also must be
+ * mentioned in rte_rx_offload_names in rte_ethdev.c file.
+ */
+
 /**
  * TX offload capabilities of a device.
  */
@@ -976,6 +981,11 @@ struct rte_eth_conf {
  */
 #define DEV_TX_OFFLOAD_SECURITY         0x00020000
 
+/*
+ * If new Tx offload capabilities are defined, they also must be
+ * mentioned in rte_tx_offload_names in rte_ethdev.c file.
+ */
+
 struct rte_pci_device;
 
 /**
@@ -1721,9 +1731,6 @@ struct rte_eth_dev {
        void *security_ctx; /**< Context for security ops */
 } __rte_cache_aligned;
 
-void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
-
 struct rte_eth_dev_sriov {
        uint8_t active;               /**< SRIOV is active with 16, 32 or 64 pools */
        uint8_t nb_q_per_pool;        /**< rx queue number per pool */
@@ -1922,6 +1929,32 @@ int rte_eth_dev_detach(uint16_t port_id, char *devname);
  */
 uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Get DEV_RX_OFFLOAD_* flag name.
+ *
+ * @param offload
+ *   Offload flag.
+ * @return
+ *   Offload name or 'UNKNOWN' if the flag cannot be recognised.
+ */
+const char *rte_eth_dev_rx_offload_name(uint64_t offload);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Get DEV_TX_OFFLOAD_* flag name.
+ *
+ * @param offload
+ *   Offload flag.
+ * @return
+ *   Offload name or 'UNKNOWN' if the flag cannot be recognised.
+ */
+const char *rte_eth_dev_tx_offload_name(uint64_t offload);
+
 /**
  * Configure an Ethernet device.
  * This function must be invoked first before any other function in the
@@ -4582,6 +4615,18 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
 int
 rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
 
+/**
+ * Get the security context for the Ethernet device.
+ *
+ * @param port_id
+ *   Port identifier of the Ethernet device
+ * @return
+ *   - NULL on error.
+ *   - pointer to security context on success.
+ */
+void *
+rte_eth_dev_get_sec_ctx(uint8_t port_id);
+
 #ifdef __cplusplus
 }
 #endif