#define RTE_NB_TXQ_STATS (sizeof(rte_txq_stats_strings) / \
sizeof(rte_txq_stats_strings[0]))
+#define RTE_RX_OFFLOAD_BIT2STR(_name) \
+ { DEV_RX_OFFLOAD_##_name, #_name }
+
+static const struct {
+ uint64_t offload;
+ const char *name;
+} rte_rx_offload_names[] = {
+ RTE_RX_OFFLOAD_BIT2STR(VLAN_STRIP),
+ RTE_RX_OFFLOAD_BIT2STR(IPV4_CKSUM),
+ RTE_RX_OFFLOAD_BIT2STR(UDP_CKSUM),
+ RTE_RX_OFFLOAD_BIT2STR(TCP_CKSUM),
+ RTE_RX_OFFLOAD_BIT2STR(TCP_LRO),
+ RTE_RX_OFFLOAD_BIT2STR(QINQ_STRIP),
+ RTE_RX_OFFLOAD_BIT2STR(OUTER_IPV4_CKSUM),
+ RTE_RX_OFFLOAD_BIT2STR(MACSEC_STRIP),
+ RTE_RX_OFFLOAD_BIT2STR(HEADER_SPLIT),
+ RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
+ RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
+ RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
+ RTE_RX_OFFLOAD_BIT2STR(CRC_STRIP),
+ RTE_RX_OFFLOAD_BIT2STR(SCATTER),
+ RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
+ RTE_RX_OFFLOAD_BIT2STR(SECURITY),
+};
+
+#undef RTE_RX_OFFLOAD_BIT2STR
/**
* The user application callback description.
rxmode->security = 0;
}
+const char *
+rte_eth_dev_rx_offload_name(uint64_t offload)
+{
+ const char *name = "UNKNOWN";
+ unsigned int i;
+
+ for (i = 0; i < RTE_DIM(rte_rx_offload_names); ++i) {
+ if (offload == rte_rx_offload_names[i].offload) {
+ name = rte_rx_offload_names[i].name;
+ break;
+ }
+ }
+
+ return name;
+}
+
int
rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
const struct rte_eth_conf *dev_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.
*/
*/
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);
+
/**
* Configure an Ethernet device.
* This function must be invoked first before any other function in the