* [PATCH net 0/3] bnxt_en: bug fixes.
@ 2017-08-23 23:34 Michael Chan
2017-08-23 23:34 ` [PATCH net 1/3] bnxt_en: Fix .ndo_setup_tc() to include XDP rings Michael Chan
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Michael Chan @ 2017-08-23 23:34 UTC (permalink / raw)
To: davem; +Cc: netdev
3 bug fixes related to XDP ring accounting in bnxt_setup_tc(), freeing
MSIX vectors when bnxt_re unregisters, and preserving the user-administered
PF MAC address when disabling SRIOV.
Michael Chan (3):
bnxt_en: Fix .ndo_setup_tc() to include XDP rings.
bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re.
bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps().
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 41 +++++++++++++++++++--------
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 2 ++
2 files changed, 31 insertions(+), 12 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/3] bnxt_en: Fix .ndo_setup_tc() to include XDP rings.
2017-08-23 23:34 [PATCH net 0/3] bnxt_en: bug fixes Michael Chan
@ 2017-08-23 23:34 ` Michael Chan
2017-08-23 23:34 ` [PATCH net 2/3] bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re Michael Chan
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2017-08-23 23:34 UTC (permalink / raw)
To: davem; +Cc: netdev
When the number of TX rings is changed in bnxt_setup_tc(), we need to
include the XDP rings in the total TX ring count.
Fixes: 38413406277f ("bnxt_en: Add support for XDP_TX action.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e7c8539..f2f2bbf 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7152,6 +7152,7 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
bp->tx_nr_rings = bp->tx_nr_rings_per_tc;
netdev_reset_tc(dev);
}
+ bp->tx_nr_rings += bp->tx_nr_rings_xdp;
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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re.
2017-08-23 23:34 [PATCH net 0/3] bnxt_en: bug fixes Michael Chan
2017-08-23 23:34 ` [PATCH net 1/3] bnxt_en: Fix .ndo_setup_tc() to include XDP rings Michael Chan
@ 2017-08-23 23:34 ` Michael Chan
2017-08-23 23:34 ` [PATCH net 3/3] bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps() Michael Chan
2017-08-24 5:42 ` [PATCH net 0/3] bnxt_en: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2017-08-23 23:34 UTC (permalink / raw)
To: davem; +Cc: netdev
Take back ownership of the MSIX vectors when unregistering the device
from bnxt_re.
Fixes: a588e4580a7e ("bnxt_en: Add interface to support RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
index 77da75a..997e10e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
@@ -84,6 +84,8 @@ static int bnxt_unregister_dev(struct bnxt_en_dev *edev, int ulp_id)
max_stat_ctxs = bnxt_get_max_func_stat_ctxs(bp);
bnxt_set_max_func_stat_ctxs(bp, max_stat_ctxs + 1);
+ if (ulp->msix_requested)
+ edev->en_ops->bnxt_free_msix(edev, ulp_id);
}
if (ulp->max_async_event_id)
bnxt_hwrm_func_rgtr_async_events(bp, NULL, 0);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps().
2017-08-23 23:34 [PATCH net 0/3] bnxt_en: bug fixes Michael Chan
2017-08-23 23:34 ` [PATCH net 1/3] bnxt_en: Fix .ndo_setup_tc() to include XDP rings Michael Chan
2017-08-23 23:34 ` [PATCH net 2/3] bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re Michael Chan
@ 2017-08-23 23:34 ` Michael Chan
2017-08-24 5:42 ` [PATCH net 0/3] bnxt_en: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2017-08-23 23:34 UTC (permalink / raw)
To: davem; +Cc: netdev
bnxt_hwrm_func_qcaps() is called during probe to get all device
resources and it also sets up the factory MAC address. The same function
is called when SRIOV is disabled to reclaim all resources. If
the MAC address has been overridden by a user administered MAC
address, calling this function will overwrite it.
Separate the logic that sets up the default MAC address into a new
function bnxt_init_mac_addr() that is only called during probe time.
Fixes: 4a21b49b34c0 ("bnxt_en: Improve VF resource accounting.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 40 +++++++++++++++++++++----------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f2f2bbf..f20b3d2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4647,7 +4647,6 @@ static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
pf->port_id = le16_to_cpu(resp->port_id);
bp->dev->dev_port = pf->port_id;
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
- memcpy(bp->dev->dev_addr, pf->mac_addr, ETH_ALEN);
pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
pf->max_cp_rings = le16_to_cpu(resp->max_cmpl_rings);
pf->max_tx_rings = le16_to_cpu(resp->max_tx_rings);
@@ -4687,16 +4686,6 @@ static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
vf->max_stat_ctxs = le16_to_cpu(resp->max_stat_ctx);
memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN);
- mutex_unlock(&bp->hwrm_cmd_lock);
-
- if (is_valid_ether_addr(vf->mac_addr)) {
- /* overwrite netdev dev_adr with admin VF MAC */
- memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN);
- } else {
- eth_hw_addr_random(bp->dev);
- rc = bnxt_approve_mac(bp, bp->dev->dev_addr);
- }
- return rc;
#endif
}
@@ -7662,6 +7651,28 @@ void bnxt_restore_pf_fw_resources(struct bnxt *bp)
bnxt_subtract_ulp_resources(bp, BNXT_ROCE_ULP);
}
+static int bnxt_init_mac_addr(struct bnxt *bp)
+{
+ int rc = 0;
+
+ if (BNXT_PF(bp)) {
+ memcpy(bp->dev->dev_addr, bp->pf.mac_addr, ETH_ALEN);
+ } else {
+#ifdef CONFIG_BNXT_SRIOV
+ struct bnxt_vf_info *vf = &bp->vf;
+
+ if (is_valid_ether_addr(vf->mac_addr)) {
+ /* overwrite netdev dev_adr with admin VF MAC */
+ memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN);
+ } else {
+ eth_hw_addr_random(bp->dev);
+ rc = bnxt_approve_mac(bp, bp->dev->dev_addr);
+ }
+#endif
+ }
+ return rc;
+}
+
static void bnxt_parse_log_pcie_link(struct bnxt *bp)
{
enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
@@ -7790,7 +7801,12 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = -1;
goto init_err_pci_clean;
}
-
+ rc = bnxt_init_mac_addr(bp);
+ if (rc) {
+ dev_err(&pdev->dev, "Unable to initialize mac address.\n");
+ rc = -EADDRNOTAVAIL;
+ goto init_err_pci_clean;
+ }
rc = bnxt_hwrm_queue_qportcfg(bp);
if (rc) {
netdev_err(bp->dev, "hwrm query qportcfg failure rc: %x\n",
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3] bnxt_en: bug fixes.
2017-08-23 23:34 [PATCH net 0/3] bnxt_en: bug fixes Michael Chan
` (2 preceding siblings ...)
2017-08-23 23:34 ` [PATCH net 3/3] bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps() Michael Chan
@ 2017-08-24 5:42 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-08-24 5:42 UTC (permalink / raw)
To: michael.chan; +Cc: netdev
From: Michael Chan <michael.chan@broadcom.com>
Date: Wed, 23 Aug 2017 19:34:02 -0400
> 3 bug fixes related to XDP ring accounting in bnxt_setup_tc(), freeing
> MSIX vectors when bnxt_re unregisters, and preserving the user-administered
> PF MAC address when disabling SRIOV.
Series applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-24 5:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23 23:34 [PATCH net 0/3] bnxt_en: bug fixes Michael Chan
2017-08-23 23:34 ` [PATCH net 1/3] bnxt_en: Fix .ndo_setup_tc() to include XDP rings Michael Chan
2017-08-23 23:34 ` [PATCH net 2/3] bnxt_en: Free MSIX vectors when unregistering the device from bnxt_re Michael Chan
2017-08-23 23:34 ` [PATCH net 3/3] bnxt_en: Do not setup MAC address in bnxt_hwrm_func_qcaps() Michael Chan
2017-08-24 5:42 ` [PATCH net 0/3] bnxt_en: 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).