#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_io.h>
return 0;
}
-static void
+static int
ipn3ke_rpst_dev_stop(struct rte_eth_dev *dev)
{
struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev);
/* Disable the RX path */
ipn3ke_xmac_rx_disable(hw, rpst->port_id, 0);
}
+
+ return 0;
}
-static void
+static int
ipn3ke_rpst_dev_close(struct rte_eth_dev *dev)
{
struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev);
struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) {
/* Disable the TX path */
ipn3ke_xmac_tx_disable(hw, rpst->port_id, 0);
/* Disable the RX path */
ipn3ke_xmac_rx_disable(hw, rpst->port_id, 0);
}
+
+ return 0;
}
/*
&tmp,
IPN3KE_25G_TX_STATISTICS_STATUS,
port_id,
- 1);
+ 0);
if (tmp & IPN3KE_25G_TX_STATISTICS_STATUS_SHADOW_REQUEST_MASK) {
tmp = 0x00000000;
(*hw->f_mac_read)(hw,
int ret;
if (ipn3ke_rpst_scan_num == 1) {
- ret = pthread_create(&ipn3ke_rpst_scan_thread,
+ ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
+ "ipn3ke scanner",
NULL,
ipn3ke_rpst_scan_handle_request, NULL);
if (ret) {
return -EBUSY;
}
- if (frame_size > RTE_ETHER_MAX_LEN)
+ if (frame_size > IPN3KE_ETH_MAX_LEN)
dev_data->dev_conf.rxmode.offloads |=
(uint64_t)(DEV_RX_OFFLOAD_JUMBO_FRAME);
else
if (representor_param->port_id >= representor_param->hw->port_num)
return -ENODEV;
+ if (ipn3ke_bridge_func.set_i40e_sw_dev == NULL)
+ return -ENOMEM;
+
rpst->ethdev = ethdev;
rpst->switch_domain_id = representor_param->switch_domain_id;
rpst->port_id = representor_param->port_id;
rpst->hw = representor_param->hw;
- rpst->i40e_pf_eth = NULL;
- rpst->i40e_pf_eth_port_id = 0xFFFF;
+ rpst->i40e_pf_eth = representor_param->i40e_pf_eth;
+ rpst->i40e_pf_eth_port_id = representor_param->i40e_pf_eth_port_id;
+ if (rpst->i40e_pf_eth)
+ ipn3ke_bridge_func.set_i40e_sw_dev(rpst->i40e_pf_eth_port_id,
+ rpst->ethdev);
ethdev->data->mac_addrs = rte_zmalloc("ipn3ke", RTE_ETHER_ADDR_LEN, 0);
if (!ethdev->data->mac_addrs) {
return -ENODEV;
}
- ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
+ ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
+ RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
rte_spinlock_lock(&ipn3ke_link_notify_list_lk);
TAILQ_INSERT_TAIL(&ipn3ke_rpst_list, rpst, next);