src/dpdk/drivers/net/i40e/i40e_fdir.c
void
i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
	uint16_t num_flex_set = 0;
	uint16_t num_flex_mask = 0;
	uint16_t i;

	if (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_PERFECT)
		fdir->mode = RTE_FDIR_MODE_PERFECT;
	else
		fdir->mode = RTE_FDIR_MODE_NONE;

	fdir->guarant_spc =
		(uint32_t)hw->func_caps.fd_filters_guaranteed;
	fdir->best_spc =
		(uint32_t)hw->func_caps.fd_filters_best_effort;
	fdir->max_flexpayload = I40E_FDIR_MAX_FLEX_LEN;
	fdir->flow_types_mask[0] = I40E_FDIR_FLOWS;
	for (i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
		fdir->flow_types_mask[i] = 0ULL;
	fdir->flex_payload_unit = sizeof(uint16_t);
	fdir->flex_bitmask_unit = sizeof(uint16_t);
	fdir->max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED;
	fdir->flex_payload_limit = I40E_MAX_FLX_SOURCE_OFF;
	fdir->max_flex_bitmask_num = I40E_FDIR_BITMASK_NUM_WORD;

	i40e_fdir_info_get_flex_set(pf,
				fdir->flex_conf.flex_set,
				&num_flex_set);
	i40e_fdir_info_get_flex_mask(pf,
				fdir->flex_conf.flex_mask,
				&num_flex_mask);

	fdir->flex_conf.nb_payloads = num_flex_set;
	fdir->flex_conf.nb_flexmasks = num_flex_mask;
}
/*
 * i40e_fdir_info_get - get information of Flow Director
 * @pf: ethernet device to get info from
 * @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
 *    the flow director information.
 */
get information of Flow Director
@pf: ethernet device to get info from
@fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
the flow director information.
get information of Flow Director @pf : ethernet device to get info from @fdir : a pointer to a structure of type * rte_eth_fdir_info * to be filled with the flow director information .
void
i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
	uint16_t num_flex_set = 0;
	uint16_t num_flex_mask = 0;
	uint16_t i;
	if (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_PERFECT)
		fdir->mode = RTE_FDIR_MODE_PERFECT;
	else
		fdir->mode = RTE_FDIR_MODE_NONE;
	fdir->guarant_spc =
		(uint32_t)hw->func_caps.fd_filters_guaranteed;
	fdir->best_spc =
		(uint32_t)hw->func_caps.fd_filters_best_effort;
	fdir->max_flexpayload = I40E_FDIR_MAX_FLEX_LEN;
	fdir->flow_types_mask[0] = I40E_FDIR_FLOWS;
	for (i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
		fdir->flow_types_mask[i] = 0ULL;
	fdir->flex_payload_unit = sizeof(uint16_t);
	fdir->flex_bitmask_unit = sizeof(uint16_t);
	fdir->max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED;
	fdir->flex_payload_limit = I40E_MAX_FLX_SOURCE_OFF;
	fdir->max_flex_bitmask_num = I40E_FDIR_BITMASK_NUM_WORD;
	i40e_fdir_info_get_flex_set(pf,
				fdir->flex_conf.flex_set,
				&num_flex_set);
	i40e_fdir_info_get_flex_mask(pf,
				fdir->flex_conf.flex_mask,
				&num_flex_mask);
	fdir->flex_conf.nb_payloads = num_flex_set;
	fdir->flex_conf.nb_flexmasks = num_flex_mask;
}
void i40e_fdir_info_get ( struct rte_eth_dev * dev , struct rte_eth_fdir_info * fdir ) { struct i40e_pf * pf = I40E_DEV_PRIVATE_TO_PF ( dev -> data -> dev_private ) ; struct i40e_hw * hw = I40E_PF_TO_HW ( pf ) ; uint16_t num_flex_set = 0 ; uint16_t num_flex_mask = 0 ; uint16_t i ; if ( dev -> data -> dev_conf . fdir_conf . mode == RTE_FDIR_MODE_PERFECT ) fdir -> mode = RTE_FDIR_MODE_PERFECT ; else fdir -> mode = RTE_FDIR_MODE_NONE ; fdir -> guarant_spc = ( uint32_t ) hw -> func_caps . fd_filters_guaranteed ; fdir -> best_spc = ( uint32_t ) hw -> func_caps . fd_filters_best_effort ; fdir -> max_flexpayload = I40E_FDIR_MAX_FLEX_LEN ; fdir -> flow_types_mask [ 0 ] = I40E_FDIR_FLOWS ; for ( i = 1 ; i < RTE_FLOW_MASK_ARRAY_SIZE ; i ++ ) fdir -> flow_types_mask [ i ] = 0ULL ; fdir -> flex_payload_unit = sizeof ( uint16_t ) ; fdir -> flex_bitmask_unit = sizeof ( uint16_t ) ; fdir -> max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED ; fdir -> flex_payload_limit = I40E_MAX_FLX_SOURCE_OFF ; fdir -> max_flex_bitmask_num = I40E_FDIR_BITMASK_NUM_WORD ; i40e_fdir_info_get_flex_set ( pf , fdir -> flex_conf . flex_set , & num_flex_set ) ; i40e_fdir_info_get_flex_mask ( pf , fdir -> flex_conf . flex_mask , & num_flex_mask ) ; fdir -> flex_conf . nb_payloads = num_flex_set ; fdir -> flex_conf . nb_flexmasks = num_flex_mask ; }
i40e_fdir_info_get - get information of Flow Director
 @pf: ethernet device to get info from
 @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
    the flow director information.
i40e_fdir_info_get - get information of Flow Director @pf : ethernet device to get info from @fdir : a pointer to a structure of type * rte_eth_fdir_info * to be filled with the flow director information .