From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Jan Sokolowski <jan.sokolowski@intel.com>,
<intel-wired-lan@lists.osuosl.org>
Cc: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>,
Kamil Maziarz <kamil.maziarz@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next v4 2/2] i40e: Only MACs from host must be preserved
Date: Thu, 2 Feb 2023 14:30:56 -0800 [thread overview]
Message-ID: <0b919f58-b80a-6766-c583-dd645cbdea49@intel.com> (raw)
In-Reply-To: <20230131074951.2664690-2-jan.sokolowski@intel.com>
On 1/30/2023 11:49 PM, Jan Sokolowski wrote:
> Only MACs assigned from host must be preserved after VF reset/reload.
> Added vm MAC list to filter vm MAC request from others then
Please use imperative mood
> vm MACs do not preserved by host during VF reset/reload.
> This list is used to filter the MAC addresses list restored after reset.
> Without this patch host automatically restore all the MAC addresses
> after VF reset/reload.
How is the code doing what's described here?
Also, patch #1 is allocating/adding to the list, but it's not being
freed until this patch? There should be no leaking memory in-between
patches; each one should be able to stand alone without any issues.
> Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
> Co-developed-by: Kamil Maziarz <kamil.maziarz@intel.com>
> Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com>
> Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
> ---
> v4: Moved some functions to earlier patch to fix compilation errors
> ---
> .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> index f6b5d61cc9a7..b9ebfd724f54 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> @@ -1085,6 +1085,25 @@ static void i40e_del_vmmac_from_list(struct i40e_vf *vf, const u8 *macaddr)
> }
> }
>
> +/**
> + * i40e_free_vmmac_list
> + * @vf: pointer to the VF info
> + *
> + * remove whole list of MAC addresses for VM
> + **/
> +static void i40e_free_vmmac_list(struct i40e_vf *vf)
> +{
> + struct i40e_vm_mac *entry, *tmp;
> +
> + if (list_empty(&vf->vm_mac_list))
> + return;
> +
> + list_for_each_entry_safe(entry, tmp, &vf->vm_mac_list, list) {
> + list_del(&entry->list);
> + kfree(entry);
> + }
> +}
> +
> /**
> * i40e_free_vf_res
> * @vf: pointer to the VF info
> @@ -1160,6 +1179,9 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
> wr32(hw, reg_idx, reg);
> i40e_flush(hw);
> }
> +
> + i40e_free_vmmac_list(vf);
> +
> /* reset some of the state variables keeping track of the resources */
> vf->num_queue_pairs = 0;
> clear_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states);
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-02-02 22:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-31 7:49 [Intel-wired-lan] [PATCH net-next v4 1/2] i40e: Add ability to change VFs default MAC address Jan Sokolowski
2023-01-31 7:49 ` [Intel-wired-lan] [PATCH net-next v4 2/2] i40e: Only MACs from host must be preserved Jan Sokolowski
2023-02-02 22:30 ` Tony Nguyen [this message]
2023-02-02 22:30 ` [Intel-wired-lan] [PATCH net-next v4 1/2] i40e: Add ability to change VFs default MAC address Tony Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b919f58-b80a-6766-c583-dd645cbdea49@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=grzegorzx.szczurek@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jan.sokolowski@intel.com \
--cc=kamil.maziarz@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox