From: "Yuval Mintz" <yuvalmin@broadcom.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: eilong@broadcom.com, ariele@broadcom.com,
"Yaniv Rosner" <yanivr@broadcom.com>,
"Yuval Mintz" <yuvalmin@broadcom.com>
Subject: [PATCH net 1/2] bnx2x: correct reading of speed capabilities
Date: Wed, 1 May 2013 17:27:57 +0300 [thread overview]
Message-ID: <1367418478-7416-2-git-send-email-yuvalmin@broadcom.com> (raw)
In-Reply-To: <1367418478-7416-1-git-send-email-yuvalmin@broadcom.com>
From: Yaniv Rosner <yanivr@broadcom.com>
When the bnx2x driver reads the port configuration - mask irrelevant bits.
Without this change, the unintended bits may cause the driver to needlessly
toggle the link, as a comparison in the link flap avoidance flow will show
that the old link did not advertise the same capabilities and thus cannot
be retained.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a8f1ee3..9cc39f1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10575,10 +10575,12 @@ static void bnx2x_get_port_hwinfo(struct bnx2x *bp)
bp->link_params.speed_cap_mask[0] =
SHMEM_RD(bp,
- dev_info.port_hw_config[port].speed_capability_mask);
+ dev_info.port_hw_config[port].speed_capability_mask) &
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
bp->link_params.speed_cap_mask[1] =
SHMEM_RD(bp,
- dev_info.port_hw_config[port].speed_capability_mask2);
+ dev_info.port_hw_config[port].speed_capability_mask2) &
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
bp->port.link_config[0] =
SHMEM_RD(bp, dev_info.port_feature_config[port].link_config);
--
1.8.1.227.g44fe835
next prev parent reply other threads:[~2013-05-01 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 14:27 [PATCH net 0/2] bnx2x: Bug patch series Yuval Mintz
2013-05-01 14:27 ` Yuval Mintz [this message]
2013-05-01 14:27 ` [PATCH net 2/2] bnx2x: Prevent memory leak when cnic is absent Yuval Mintz
2013-05-01 19:08 ` [PATCH net 0/2] bnx2x: Bug patch series David Miller
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=1367418478-7416-2-git-send-email-yuvalmin@broadcom.com \
--to=yuvalmin@broadcom.com \
--cc=ariele@broadcom.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=yanivr@broadcom.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;
as well as URLs for NNTP newsgroup(s).