#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
RTE_ETH_QUEUE_STATE_STOPPED;
}
-static void
+static int
fs_dev_stop(struct rte_eth_dev *dev)
{
struct sub_device *sdev;
uint8_t i;
+ int ret;
fs_lock(dev, 0);
PRIV(dev)->state = DEV_STARTED - 1;
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_STARTED) {
- rte_eth_dev_stop(PORT_ID(sdev));
+ ret = rte_eth_dev_stop(PORT_ID(sdev));
+ if (fs_err(sdev, ret) < 0) {
+ ERROR("Failed to stop device %u",
+ PORT_ID(sdev));
+ PRIV(dev)->state = DEV_STARTED + 1;
+ fs_unlock(dev, 0);
+ return ret;
+ }
failsafe_rx_intr_uninstall_subdevice(sdev);
sdev->state = DEV_STARTED - 1;
}
failsafe_rx_intr_uninstall(dev);
fs_set_queues_state_stop(dev);
fs_unlock(dev, 0);
+
+ return 0;
}
static int
fs_lock(dev, 0);
failsafe_hotplug_alarm_cancel(dev);
- if (PRIV(dev)->state == DEV_STARTED)
- dev->dev_ops->dev_stop(dev);
+ if (PRIV(dev)->state == DEV_STARTED) {
+ ret = dev->dev_ops->dev_stop(dev);
+ if (ret != 0) {
+ fs_unlock(dev, 0);
+ return ret;
+ }
+ }
PRIV(dev)->state = DEV_ACTIVE - 1;
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
DEBUG("Closing sub_device %d", i);
fs_dev_merge_info(struct rte_eth_dev_info *info,
const struct rte_eth_dev_info *sinfo)
{
+ info->min_mtu = RTE_MAX(info->min_mtu, sinfo->min_mtu);
+ info->max_mtu = RTE_MIN(info->max_mtu, sinfo->max_mtu);
info->max_rx_pktlen = RTE_MIN(info->max_rx_pktlen, sinfo->max_rx_pktlen);
info->max_rx_queues = RTE_MIN(info->max_rx_queues, sinfo->max_rx_queues);
info->max_tx_queues = RTE_MIN(info->max_tx_queues, sinfo->max_tx_queues);
int ret;
/* Use maximum upper bounds by default */
+ infos->min_mtu = RTE_ETHER_MIN_MTU;
+ infos->max_mtu = UINT16_MAX;
infos->max_rx_pktlen = UINT32_MAX;
infos->max_rx_queues = RTE_MAX_QUEUES_PER_PORT;
infos->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;
DEV_RX_OFFLOAD_JUMBO_FRAME |
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_TIMESTAMP |
- DEV_RX_OFFLOAD_SECURITY;
+ DEV_RX_OFFLOAD_SECURITY |
+ DEV_RX_OFFLOAD_RSS_HASH;
infos->rx_queue_offload_capa =
DEV_RX_OFFLOAD_VLAN_STRIP |
DEV_RX_OFFLOAD_JUMBO_FRAME |
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_TIMESTAMP |
- DEV_RX_OFFLOAD_SECURITY;
+ DEV_RX_OFFLOAD_SECURITY |
+ DEV_RX_OFFLOAD_RSS_HASH;
infos->tx_offload_capa =
DEV_TX_OFFLOAD_MULTI_SEGS |