[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee877b4f-5894-69f8-5d70-2d2f137cf66e@oracle.com>
Date: Tue, 7 Nov 2017 10:20:29 -0800
From: Tushar Dave <tushar.n.dave@...cle.com>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>,
jeffrey.t.kirsher@...el.com
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Zijie Pan <zijie.pan@...nd.com>,
Anjali Singhai Jain <anjali.singhai@...el.com>,
Andrew Bowers <andrewx.bowers@...el.com>
Subject: Re: [PATCH net] i40e: fix the calculation of VFs mac addresses
On 11/07/2017 08:32 AM, Nicolas Dichtel wrote:
> From: Zijie Pan <zijie.pan@...nd.com>
>
> num_mac should be increased only after the call to i40e_add_mac_filter().
>
> Fixes: 5f527ba962e2 ("i40e: Limit the number of MAC and VLAN addresses that can be added for VFs")
> CC: Anjali Singhai Jain <anjali.singhai@...el.com>
> CC: Andrew Bowers <andrewx.bowers@...el.com>
> Signed-off-by: Zijie Pan <zijie.pan@...nd.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 21 +++++++++++----------
> 1 file changed, 11 insertions(+), 10 deletions(-)
>
Thanks for fix.
Reviewed-by: Tushar Dave <tushar.n.dave@...cle.com>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> index 4d1e670f490e..2d1f3dbe67f1 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> @@ -2115,18 +2115,19 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
> struct i40e_mac_filter *f;
>
> f = i40e_find_mac(vsi, al->list[i].addr);
> - if (!f)
> + if (!f) {
> f = i40e_add_mac_filter(vsi, al->list[i].addr);
>
> - if (!f) {
> - dev_err(&pf->pdev->dev,
> - "Unable to add MAC filter %pM for VF %d\n",
> - al->list[i].addr, vf->vf_id);
> - ret = I40E_ERR_PARAM;
> - spin_unlock_bh(&vsi->mac_filter_hash_lock);
> - goto error_param;
> - } else {
> - vf->num_mac++;
> + if (!f) {
> + dev_err(&pf->pdev->dev,
> + "Unable to add MAC filter %pM for VF %d\n",
> + al->list[i].addr, vf->vf_id);
> + ret = I40E_ERR_PARAM;
> + spin_unlock_bh(&vsi->mac_filter_hash_lock);
> + goto error_param;
> + } else {
> + vf->num_mac++;
> + }
> }
> }
> spin_unlock_bh(&vsi->mac_filter_hash_lock);
>
Powered by blists - more mailing lists