From: Michael Chan <michael.chan@broadcom.com>
To: YueHaibing <yuehaibing@huawei.com>,
Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Cc: David Miller <davem@davemloft.net>,
open list <linux-kernel@vger.kernel.org>,
Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] bnxt_en: Fix logic of forward the VF MAC address to PF in bnxt_vf_validate_set_mac
Date: Tue, 24 Jul 2018 00:31:06 -0700 [thread overview]
Message-ID: <CACKFLini64_5N7aVtPAVH3CBYCSsdHAJv35jimR18PJXeV6j5g@mail.gmail.com> (raw)
In-Reply-To: <20180724052454.21524-1-yuehaibing@huawei.com>
On Mon, Jul 23, 2018 at 10:24 PM, YueHaibing <yuehaibing@huawei.com> wrote:
> Based on the comments,req->l2addr must match the VF MAC address
> if firmware spec >= 1.2.2, mac_ok can be true.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> index a649108..7925964 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> @@ -954,12 +954,9 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
> if (ether_addr_equal((const u8 *)req->l2_addr, vf->mac_addr))
> mac_ok = true;
> } else if (is_valid_ether_addr(vf->vf_mac_addr)) {
> - if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr))
> + if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr) &&
> + bp->hwrm_spec_code >= 0x10202)
> mac_ok = true;
I'm not sure if this is correct. If firmware spec < 0x10202, the VF
MAC address is not forwarded to the PF and so it doesn't have to match
and mac_ok should still be true. I think we are missing that
condition with this patch.
I need to let my colleague Vasundhara comment on this. She is more
familiar with this logic.
> - } else if (bp->hwrm_spec_code < 0x10202) {
> - mac_ok = true;
> - } else {
> - mac_ok = true;
> }
> if (mac_ok)
> return bnxt_hwrm_exec_fwd_resp(bp, vf, msg_size);
> --
> 2.7.0
>
>
next prev parent reply other threads:[~2018-07-24 7:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 5:24 YueHaibing
2018-07-24 7:31 ` Michael Chan [this message]
2018-07-24 16:01 ` Vasundhara Volam
2018-07-24 21:48 ` Michael Chan
2018-07-25 10:18 ` YueHaibing
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=CACKFLini64_5N7aVtPAVH3CBYCSsdHAJv35jimR18PJXeV6j5g@mail.gmail.com \
--to=michael.chan@broadcom.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vasundhara-v.volam@broadcom.com \
--cc=yuehaibing@huawei.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
all inboxes | Powered by JetHome®