vdev->free_consistent(vdev->priv,
sizeof(struct vnic_devcmd_fw_info),
vdev->fw_info, vdev->fw_info_pa);
- kfree(vdev);
+ rte_free(vdev);
}
}
unsigned int num_bars)
{
if (!vdev) {
- vdev = kzalloc(sizeof(struct vnic_dev), GFP_ATOMIC);
+ char name[NAME_MAX];
+ snprintf((char *)name, sizeof(name), "%s-vnic",
+ pdev->device.name);
+ vdev = (struct vnic_dev *)rte_zmalloc_socket(name,
+ sizeof(struct vnic_dev),
+ RTE_CACHE_LINE_SIZE,
+ pdev->device.numa_node);
if (!vdev)
return NULL;
}
static void enicpmd_dev_tx_queue_release(void *txq)
{
ENICPMD_FUNC_TRACE();
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
enic_free_wq(txq);
}
int ret;
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
ENICPMD_FUNC_TRACE();
if (queue_idx >= ENIC_WQ_MAX) {
dev_err(enic,
static void enicpmd_dev_rx_queue_release(void *rxq)
{
ENICPMD_FUNC_TRACE();
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
enic_free_rq(rxq);
}
struct enic *enic = pmd_priv(eth_dev);
ENICPMD_FUNC_TRACE();
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
/* With Rx scatter support, two RQs are now used on VIC per RQ used
* by the application.
*/
int ret;
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
ENICPMD_FUNC_TRACE();
ret = enic_set_vnic_res(enic);
if (ret) {
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
ENICPMD_FUNC_TRACE();
return enic_enable(enic);
}
struct rte_eth_link link;
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
enic_disable(enic);
memset(&link, 0, sizeof(link));
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
+
enic->promisc = 1;
enic_add_packet_filter(enic);
}
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
enic->promisc = 0;
enic_add_packet_filter(enic);
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
enic->allmulti = 1;
enic_add_packet_filter(enic);
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
enic->allmulti = 0;
enic_add_packet_filter(enic);
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
ENICPMD_FUNC_TRACE();
return enic_set_mac_address(enic, mac_addr->addr_bytes);
}
{
struct enic *enic = pmd_priv(eth_dev);
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
ENICPMD_FUNC_TRACE();
enic_del_mac_address(enic, index);
}
old_mtu = eth_dev->data->mtu;
config_mtu = enic->config.mtu;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
if (new_mtu > enic->max_mtu) {
dev_err(enic,
"MTU not updated: requested (%u) greater than max (%u)\n",
dev_debug(enic, " Initializing ENIC PMD\n");
+ /* if this is a secondary process the hardware is already initialized */
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr;
enic->bar0.len = pdev->mem_resource[0].len;