src/dpdk/lib/librte_kni/rte_kni.c
static int
kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
{
	int ret;

	if (!rte_eth_dev_is_valid_port(port_id)) {
		RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
		return -EINVAL;
	}

	RTE_LOG(INFO, KNI, "Configure promiscuous mode of %d to %d\n",
		port_id, to_on);

	if (to_on)
		ret = rte_eth_promiscuous_enable(port_id);
	else
		ret = rte_eth_promiscuous_disable(port_id);

	if (ret != 0)
		RTE_LOG(ERR, KNI,
			"Failed to %s promiscuous mode for port %u: %s\n",
			to_on ? "enable" : "disable", port_id,
			rte_strerror(-ret));

	return ret;
}
/* default callback for request of configuring promiscuous mode */
default callback for request of configuring promiscuous mode
default callback for request of configuring promiscuous mode
static int
kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
{
	int ret;
	if (!rte_eth_dev_is_valid_port(port_id)) {
		RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
		return -EINVAL;
	}
	RTE_LOG(INFO, KNI, "Configure promiscuous mode of %d to %d\n",
		port_id, to_on);
	if (to_on)
		ret = rte_eth_promiscuous_enable(port_id);
	else
		ret = rte_eth_promiscuous_disable(port_id);
	if (ret != 0)
		RTE_LOG(ERR, KNI,
			"Failed to %s promiscuous mode for port %u: %s\n",
			to_on ? "enable" : "disable", port_id,
			rte_strerror(-ret));
	return ret;
}
static int kni_config_promiscusity ( uint16_t port_id , uint8_t to_on ) { int ret ; if ( ! rte_eth_dev_is_valid_port ( port_id ) ) { RTE_LOG ( ERR , KNI , " \n " , port_id ) ; return - EINVAL ; } RTE_LOG ( INFO , KNI , " \n " , port_id , to_on ) ; if ( to_on ) ret = rte_eth_promiscuous_enable ( port_id ) ; else ret = rte_eth_promiscuous_disable ( port_id ) ; if ( ret != 0 ) RTE_LOG ( ERR , KNI , " \n " , to_on ? " " : " " , port_id , rte_strerror ( - ret ) ) ; return ret ; }
default callback for request of configuring promiscuous mode
default callback for request of configuring promiscuous mode