src/drivers/trex_i40e_fdir.c
static int
trex_i40e_ethertype_filter_handle(struct rte_eth_dev *dev,
				enum trex_rte_filter_op filter_op,
				void *arg)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	int ret = 0;

	if (filter_op == TREX_RTE_ETH_FILTER_NOP)
		return ret;

	if (arg == NULL) {
		PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u",
			    filter_op);
		return -EINVAL;
	}

	switch (filter_op) {
	case TREX_RTE_ETH_FILTER_ADD:
		ret = i40e_ethertype_filter_set(pf,
			(struct rte_eth_ethertype_filter *)arg,
			TRUE);
		break;
	case TREX_RTE_ETH_FILTER_DELETE:
		ret = i40e_ethertype_filter_set(pf,
			(struct rte_eth_ethertype_filter *)arg,
			FALSE);
		break;
	default:
		PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op);
		ret = -ENOSYS;
		break;
	}
	return ret;
}
/*
 * Handle operations for ethertype filter.
 */
Handle operations for ethertype filter.
Handle operations for ethertype filter .
static int
trex_i40e_ethertype_filter_handle(struct rte_eth_dev *dev,
				enum trex_rte_filter_op filter_op,
				void *arg)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	int ret = 0;
	if (filter_op == TREX_RTE_ETH_FILTER_NOP)
		return ret;
	if (arg == NULL) {
		PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u",
			    filter_op);
		return -EINVAL;
	}
	switch (filter_op) {
	case TREX_RTE_ETH_FILTER_ADD:
		ret = i40e_ethertype_filter_set(pf,
			(struct rte_eth_ethertype_filter *)arg,
			TRUE);
		break;
	case TREX_RTE_ETH_FILTER_DELETE:
		ret = i40e_ethertype_filter_set(pf,
			(struct rte_eth_ethertype_filter *)arg,
			FALSE);
		break;
	default:
		PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op);
		ret = -ENOSYS;
		break;
	}
	return ret;
}
static int trex_i40e_ethertype_filter_handle ( struct rte_eth_dev * dev , enum trex_rte_filter_op filter_op , void * arg ) { struct i40e_pf * pf = I40E_DEV_PRIVATE_TO_PF ( dev -> data -> dev_private ) ; int ret = 0 ; if ( filter_op == TREX_RTE_ETH_FILTER_NOP ) return ret ; if ( arg == NULL ) { PMD_DRV_LOG ( ERR , " " , filter_op ) ; return - EINVAL ; } switch ( filter_op ) { case TREX_RTE_ETH_FILTER_ADD : ret = i40e_ethertype_filter_set ( pf , ( struct rte_eth_ethertype_filter * ) arg , TRUE ) ; break ; case TREX_RTE_ETH_FILTER_DELETE : ret = i40e_ethertype_filter_set ( pf , ( struct rte_eth_ethertype_filter * ) arg , FALSE ) ; break ; default : PMD_DRV_LOG ( ERR , " " , filter_op ) ; ret = - ENOSYS ; break ; } return ret ; }
Handle operations for ethertype filter.
Handle operations for ethertype filter .