Skip to content

Commit

Permalink
i40e: Add zero-initialization of AQ command structures
Browse files Browse the repository at this point in the history
[ Upstream commit d2c788f ]

Zero-initialize AQ command data structures to comply with
API specifications.

Fixes: 2f4b411 ("i40e: Enable cloud filters via tc-flower")
Fixes: f4492db ("i40e: Add NPAR BW get and set functions")
Signed-off-by: Andrzej Sawuła <andrzej.sawula@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
mpalczew96 authored and gregkh committed Mar 4, 2021
1 parent 42dc67d commit b57d0f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Expand Up @@ -7667,6 +7667,8 @@ int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
if (filter->flags >= ARRAY_SIZE(flag_table))
return I40E_ERR_CONFIG;

memset(&cld_filter, 0, sizeof(cld_filter));

/* copy element needed to add cloud filter from filter */
i40e_set_cld_element(filter, &cld_filter);

Expand Down Expand Up @@ -7734,6 +7736,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
!ipv6_addr_any(&filter->ip.v6.src_ip6))
return -EOPNOTSUPP;

memset(&cld_filter, 0, sizeof(cld_filter));

/* copy element needed to add cloud filter from filter */
i40e_set_cld_element(filter, &cld_filter.element);

Expand Down Expand Up @@ -11709,6 +11713,8 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf)
struct i40e_aqc_configure_partition_bw_data bw_data;
i40e_status status;

memset(&bw_data, 0, sizeof(bw_data));

/* Set the valid bit for this PF */
bw_data.pf_valid_bits = cpu_to_le16(BIT(pf->hw.pf_id));
bw_data.max_bw[pf->hw.pf_id] = pf->max_bw & I40E_ALT_BW_VALUE_MASK;
Expand Down

0 comments on commit b57d0f5

Please sign in to comment.