Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: Maximum and minimum MTU values vary between hardware devices. In
- hardware agnostic DPDK applications access to such information would allow
- a more accurate way of validating and setting supported MTU values on a per
- device basis rather than using a defined default for all devices. To
- resolve this, the following members will be added to ``rte_eth_dev_info``.
- Note: these can be added to fit a hole in the existing structure for amd64
- but not for 32-bit, as such ABI change will occur as size of the structure
- will increase.
-
- - Member ``uint16_t min_mtu`` the minimum MTU allowed.
- - Member ``uint16_t max_mtu`` the maximum MTU allowed.
-
* kni: remove KNI ethtool support. To clarify, this is not to remove the KNI,
but only to remove ethtool support of it that is disabled by default and
can be enabled via ``CONFIG_RTE_KNI_KMOD_ETHTOOL`` config option.
Also, make sure to start the actual text at the margin.
=========================================================
+* ethdev: Additional fields in rte_eth_dev_info.
+
+ The ``rte_eth_dev_info`` structure has had two extra fields
+ added: ``min_mtu`` and ``max_mtu``. Each of these are of type ``uint16_t``.
+ The values of these fields can be set specifically by the PMD drivers as
+ supported values can vary from device to device.
+
* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
defined as cache-line aligned that caused unintended changes in
librte_distributor.so.1
+ librte_eal.so.10
librte_efd.so.1
- librte_ethdev.so.11
+ + librte_ethdev.so.12
librte_eventdev.so.6
librte_flow_classify.so.1
librte_gro.so.1
EXPORT_MAP := rte_ethdev_version.map
-LIBABIVER := 11
+LIBABIVER := 12
SRCS-y += ethdev_private.c
SRCS-y += rte_ethdev.c
# Copyright(c) 2017 Intel Corporation
name = 'ethdev'
-version = 11
+version = 12
allow_experimental_apis = true
sources = files('ethdev_private.c',
'ethdev_profile.c',
dev_info->rx_desc_lim = lim;
dev_info->tx_desc_lim = lim;
dev_info->device = dev->device;
+ dev_info->min_mtu = ETHER_MIN_MTU;
+ dev_info->max_mtu = UINT16_MAX;
RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
(*dev->dev_ops->dev_infos_get)(dev, dev_info);
rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)
{
int ret;
+ struct rte_eth_dev_info dev_info;
struct rte_eth_dev *dev;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mtu_set, -ENOTSUP);
+ /*
+ * Check if the device supports dev_infos_get, if it does not
+ * skip min_mtu/max_mtu validation here as this requires values
+ * that are populated within the call to rte_eth_dev_info_get()
+ * which relies on dev->dev_ops->dev_infos_get.
+ */
+ if (*dev->dev_ops->dev_infos_get != NULL) {
+ rte_eth_dev_info_get(port_id, &dev_info);
+ if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)
+ return -EINVAL;
+ }
+
ret = (*dev->dev_ops->mtu_set)(dev, mtu);
if (!ret)
dev->data->mtu = mtu;
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. */
+ uint16_t min_mtu; /**< Minimum MTU allowed */
+ uint16_t max_mtu; /**< Maximum MTU allowed */
const uint32_t *dev_flags; /**< Device flags */
uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */
uint32_t max_rx_pktlen; /**< Maximum configurable length of RX pkt. */
/**
* Retrieve the contextual information of an Ethernet device.
*
+ * As part of this function, a number of of fields in dev_info will be
+ * initialized as follows:
+ *
+ * rx_desc_lim = lim
+ * tx_desc_lim = lim
+ *
+ * Where lim is defined within the rte_eth_dev_info_get as
+ *
+ * const struct rte_eth_desc_lim lim = {
+ * .nb_max = UINT16_MAX,
+ * .nb_min = 0,
+ * .nb_align = 1,
+ * };
+ *
+ * device = dev->device
+ * min_mtu = ETHER_MIN_MTU
+ * max_mtu = UINT16_MAX
+ *
+ * The following fields will be populated if support for dev_infos_get()
+ * exists for the device and the rte_eth_dev 'dev' has been populated
+ * successfully with a call to it:
+ *
+ * driver_name = dev->device->driver->name
+ * nb_rx_queues = dev->data->nb_rx_queues
+ * nb_tx_queues = dev->data->nb_tx_queues
+ * dev_flags = &dev->data->dev_flags
+ *
* @param port_id
* The port identifier of the Ethernet device.
* @param dev_info
* - (-ENOTSUP) if operation is not supported.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if *mtu* invalid.
+ * - (-EINVAL) if *mtu* invalid, validation of mtu can occur within
+ * rte_eth_dev_set_mtu if dev_infos_get is supported by the device or
+ * when the mtu is set using dev->dev_ops->mtu_set.
* - (-EBUSY) if operation is not allowed when the port is running
*/
int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu);