[dpdk-dev] [PATCH 1/4] net/i40e: support replace filter type

Ferruh Yigit ferruh.yigit at intel.com
Wed Mar 8 16:50:15 CET 2017


On 3/3/2017 9:31 AM, Beilei Xing wrote:
> Add new admin queue function and extended fields
> in DCR 288:
>  - Add admin queue function for Replace filter
>    command (Opcode: 0x025F)
>  - Add General fields for Add/Remove Cloud filters
>    command
> 
> This patch will be removed to base driver in future.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com>
> Signed-off-by: Stroe Laura <laura.stroe at intel.com>
> Signed-off-by: Jingjing Wu <jingjing.wu at intel.com>
> Signed-off-by: Beilei Xing <beilei.xing at intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.h | 106 ++++++++++++++++++++++++++++
>  drivers/net/i40e/i40e_flow.c   | 152 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 258 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index f545850..3a49865 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -729,6 +729,100 @@ struct i40e_valid_pattern {
>  	parse_filter_t parse_filter;
>  };
>  
> +/* Support replace filter */
> +
> +/* i40e_aqc_add_remove_cloud_filters_element_big_data is used when
> + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. refer to
> + * DCR288

Please do not refer to DCR, unless you can provide a public link for it.

> + */
> +struct i40e_aqc_add_remove_cloud_filters_element_big_data {
> +	struct i40e_aqc_add_remove_cloud_filters_element_data element;

What is the difference between
"i40e_aqc_add_remove_cloud_filters_element_big_data" and
"i40e_aqc_add_remove_cloud_filters_element_data", why need big_data one?

> +	uint16_t     general_fields[32];

Not very useful variable name.

<...>

> +/* Replace filter Command 0x025F
> + * uses the i40e_aqc_replace_cloud_filters,
> + * and the generic indirect completion structure
> + */
> +struct i40e_filter_data {
> +	uint8_t filter_type;
> +	uint8_t input[3];
> +};
> +
> +struct i40e_aqc_replace_cloud_filters_cmd {

Is replace does something different than remove old and add new cloud
filter?

<...>

> +enum i40e_status_code i40e_aq_add_cloud_filters_big_buffer(struct i40e_hw *hw,
> +	   uint16_t seid,
> +	   struct i40e_aqc_add_remove_cloud_filters_element_big_data *filters,
> +	   uint8_t filter_count);
> +enum i40e_status_code i40e_aq_remove_cloud_filters_big_buffer(
> +	struct i40e_hw *hw, uint16_t seid,
> +	struct i40e_aqc_add_remove_cloud_filters_element_big_data *filters,
> +	uint8_t filter_count);
> +enum i40e_status_code i40e_aq_replace_cloud_filters(struct i40e_hw *hw,
> +		    struct i40e_aqc_replace_cloud_filters_cmd *filters,
> +		    struct i40e_aqc_replace_cloud_filters_cmd_buf *cmd_buf);
> +

Do you need these function declarations?

>  #define I40E_DEV_TO_PCI(eth_dev) \
>  	RTE_DEV_TO_PCI((eth_dev)->device)
>  
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index f163ce5..3c49228 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -1874,3 +1874,155 @@ i40e_flow_flush_tunnel_filter(struct i40e_pf *pf)
>  
>  	return ret;
>  }
> +
> +#define i40e_aqc_opc_replace_cloud_filters 0x025F
> +#define I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1
> +/**
> + * i40e_aq_add_cloud_filters_big_buffer
> + * @hw: pointer to the hardware structure
> + * @seid: VSI seid to add cloud filters from
> + * @filters: Buffer which contains the filters in big buffer to be added
> + * @filter_count: number of filters contained in the buffer
> + *
> + * Set the cloud filters for a given VSI.  The contents of the
> + * i40e_aqc_add_remove_cloud_filters_element_big_data are filled
> + * in by the caller of the function.
> + *
> + **/
> +enum i40e_status_code i40e_aq_add_cloud_filters_big_buffer(

There are already non big_buffer versions of these functions, like
"i40e_aq_add_cloud_filters()" why big_data version required, what it
does differently?

And is there a reason that these functions are not static? (For this
patch they are not used at all and will cause build error, but my
question is after they started to be used)

<...>


More information about the dev mailing list