* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2016-11-11 5:11 Michael Chan
2016-11-11 5:11 ` [PATCH net 1/2] bnxt_en: Fix ring arithmetic in bnxt_setup_tc() Michael Chan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Michael Chan @ 2016-11-11 5:11 UTC (permalink / raw)
To: davem; +Cc: netdev
Bug fixes in bnxt_setup_tc() and VF vitual link state.
Michael Chan (2):
bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
bnxt_en: Fix VF virtual link state.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 ++++++-----
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
2016-11-11 5:11 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
@ 2016-11-11 5:11 ` Michael Chan
2016-11-11 5:11 ` [PATCH net 2/2] bnxt_en: Fix VF virtual link state Michael Chan
2016-11-13 17:37 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2016-11-11 5:11 UTC (permalink / raw)
To: davem; +Cc: netdev
The logic is missing the check on whether the tx and rx rings are sharing
completion rings or not.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index a9f9f37..c690966 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6309,6 +6309,7 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
struct tc_to_netdev *ntc)
{
struct bnxt *bp = netdev_priv(dev);
+ bool sh = false;
u8 tc;
if (ntc->type != TC_SETUP_MQPRIO)
@@ -6325,12 +6326,11 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
if (netdev_get_num_tc(dev) == tc)
return 0;
+ if (bp->flags & BNXT_FLAG_SHARED_RINGS)
+ sh = true;
+
if (tc) {
int max_rx_rings, max_tx_rings, rc;
- bool sh = false;
-
- if (bp->flags & BNXT_FLAG_SHARED_RINGS)
- sh = true;
rc = bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, sh);
if (rc || bp->tx_nr_rings_per_tc * tc > max_tx_rings)
@@ -6348,7 +6348,8 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
bp->tx_nr_rings = bp->tx_nr_rings_per_tc;
netdev_reset_tc(dev);
}
- bp->cp_nr_rings = max_t(int, bp->tx_nr_rings, bp->rx_nr_rings);
+ bp->cp_nr_rings = sh ? max_t(int, bp->tx_nr_rings, bp->rx_nr_rings) :
+ bp->tx_nr_rings + bp->rx_nr_rings;
bp->num_stat_ctxs = bp->cp_nr_rings;
if (netif_running(bp->dev))
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] bnxt_en: Fix VF virtual link state.
2016-11-11 5:11 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
2016-11-11 5:11 ` [PATCH net 1/2] bnxt_en: Fix ring arithmetic in bnxt_setup_tc() Michael Chan
@ 2016-11-11 5:11 ` Michael Chan
2016-11-13 17:37 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2016-11-11 5:11 UTC (permalink / raw)
To: davem; +Cc: netdev
If the physical link is down and the VF virtual link is set to "enable",
the current code does not always work. If the link is down but the
cable is attached, the firmware returns LINK_SIGNAL instead of
NO_LINK. The current code is treating LINK_SIGNAL as link up.
The fix is to treat link as down when the link_status != LINK.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index ec6cd18..60e2af8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -774,8 +774,8 @@ static int bnxt_vf_set_link(struct bnxt *bp, struct bnxt_vf_info *vf)
if (vf->flags & BNXT_VF_LINK_UP) {
/* if physical link is down, force link up on VF */
- if (phy_qcfg_resp.link ==
- PORT_PHY_QCFG_RESP_LINK_NO_LINK) {
+ if (phy_qcfg_resp.link !=
+ PORT_PHY_QCFG_RESP_LINK_LINK) {
phy_qcfg_resp.link =
PORT_PHY_QCFG_RESP_LINK_LINK;
phy_qcfg_resp.link_speed = cpu_to_le16(
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
2016-11-11 5:11 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
2016-11-11 5:11 ` [PATCH net 1/2] bnxt_en: Fix ring arithmetic in bnxt_setup_tc() Michael Chan
2016-11-11 5:11 ` [PATCH net 2/2] bnxt_en: Fix VF virtual link state Michael Chan
@ 2016-11-13 17:37 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-11-13 17:37 UTC (permalink / raw)
To: michael.chan; +Cc: netdev
From: Michael Chan <michael.chan@broadcom.com>
Date: Fri, 11 Nov 2016 00:11:41 -0500
> Bug fixes in bnxt_setup_tc() and VF vitual link state.
Series applied, thanks Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-13 17:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 5:11 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
2016-11-11 5:11 ` [PATCH net 1/2] bnxt_en: Fix ring arithmetic in bnxt_setup_tc() Michael Chan
2016-11-11 5:11 ` [PATCH net 2/2] bnxt_en: Fix VF virtual link state Michael Chan
2016-11-13 17:37 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
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).