mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Merge branch 'bnxt_en-updates-for-net-next'
Michael Chan says: ==================== bnxt_en: Updates for net-next (part) This series includes an enhnacement to the priority TX counters, an enhancement to a PHY module error extack message, cleanup of unneeded MSIX logic in bnxt_ulp.c, adding CQ dump during TX timeout, LRO/HW_GRO performance improvement by enabling Relaxed Ordering, and improved SRIOV admin link state support. ==================== Link: https://patch.msgid.link/20251126215648.1885936-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -4479,7 +4479,14 @@ static void bnxt_init_one_rx_agg_ring_rxbd(struct bnxt *bp,
|
||||
ring->fw_ring_id = INVALID_HW_RING_ID;
|
||||
if ((bp->flags & BNXT_FLAG_AGG_RINGS)) {
|
||||
type = ((u32)BNXT_RX_PAGE_SIZE << RX_BD_LEN_SHIFT) |
|
||||
RX_BD_TYPE_RX_AGG_BD | RX_BD_FLAGS_SOP;
|
||||
RX_BD_TYPE_RX_AGG_BD;
|
||||
|
||||
/* On P7, setting EOP will cause the chip to disable
|
||||
* Relaxed Ordering (RO) for TPA data. Disable EOP for
|
||||
* potentially higher performance with RO.
|
||||
*/
|
||||
if (BNXT_CHIP_P5_AND_MINUS(bp) || !(bp->flags & BNXT_FLAG_TPA))
|
||||
type |= RX_BD_FLAGS_AGG_EOP;
|
||||
|
||||
bnxt_init_rxbd_pages(ring, type);
|
||||
}
|
||||
@@ -5688,6 +5695,10 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size,
|
||||
u16 cmd = bnxt_vf_req_snif[i];
|
||||
unsigned int bit, idx;
|
||||
|
||||
if ((bp->fw_cap & BNXT_FW_CAP_LINK_ADMIN) &&
|
||||
cmd == HWRM_PORT_PHY_QCFG)
|
||||
continue;
|
||||
|
||||
idx = cmd / 32;
|
||||
bit = cmd % 32;
|
||||
data[idx] |= 1 << bit;
|
||||
@@ -8506,6 +8517,11 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
|
||||
|
||||
if (flags & FUNC_QCFG_RESP_FLAGS_ENABLE_RDMA_SRIOV)
|
||||
bp->fw_cap |= BNXT_FW_CAP_ENABLE_RDMA_SRIOV;
|
||||
if (resp->roce_bidi_opt_mode &
|
||||
FUNC_QCFG_RESP_ROCE_BIDI_OPT_MODE_DEDICATED)
|
||||
bp->cos0_cos1_shared = 1;
|
||||
else
|
||||
bp->cos0_cos1_shared = 0;
|
||||
|
||||
switch (resp->port_partition_type) {
|
||||
case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0:
|
||||
@@ -9653,6 +9669,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||
bp->flags |= BNXT_FLAG_ROCEV1_CAP;
|
||||
if (flags & FUNC_QCAPS_RESP_FLAGS_ROCE_V2_SUPPORTED)
|
||||
bp->flags |= BNXT_FLAG_ROCEV2_CAP;
|
||||
if (flags & FUNC_QCAPS_RESP_FLAGS_LINK_ADMIN_STATUS_SUPPORTED)
|
||||
bp->fw_cap |= BNXT_FW_CAP_LINK_ADMIN;
|
||||
if (flags & FUNC_QCAPS_RESP_FLAGS_PCIE_STATS_SUPPORTED)
|
||||
bp->fw_cap |= BNXT_FW_CAP_PCIE_STATS_SUPPORTED;
|
||||
if (flags & FUNC_QCAPS_RESP_FLAGS_HOT_RESET_CAPABLE)
|
||||
@@ -14020,11 +14038,19 @@ static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi)
|
||||
|
||||
static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi)
|
||||
{
|
||||
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
|
||||
int i = bnapi->index;
|
||||
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring, *cpr2;
|
||||
int i = bnapi->index, j;
|
||||
|
||||
netdev_info(bnapi->bp->dev, "[%d]: cp{fw_ring: %d raw_cons: %x}\n",
|
||||
i, cpr->cp_ring_struct.fw_ring_id, cpr->cp_raw_cons);
|
||||
for (j = 0; j < cpr->cp_ring_count; j++) {
|
||||
cpr2 = &cpr->cp_ring_arr[j];
|
||||
if (!cpr2->bnapi)
|
||||
continue;
|
||||
netdev_info(bnapi->bp->dev, "[%d.%d]: cp{fw_ring: %d raw_cons: %x}\n",
|
||||
i, j, cpr2->cp_ring_struct.fw_ring_id,
|
||||
cpr2->cp_raw_cons);
|
||||
}
|
||||
}
|
||||
|
||||
static void bnxt_dbg_dump_states(struct bnxt *bp)
|
||||
|
||||
@@ -131,6 +131,7 @@ struct rx_bd {
|
||||
#define RX_BD_TYPE_48B_BD_SIZE (2 << 4)
|
||||
#define RX_BD_TYPE_64B_BD_SIZE (3 << 4)
|
||||
#define RX_BD_FLAGS_SOP (1 << 6)
|
||||
#define RX_BD_FLAGS_AGG_EOP (1 << 6)
|
||||
#define RX_BD_FLAGS_EOP (1 << 7)
|
||||
#define RX_BD_FLAGS_BUFFERS (3 << 8)
|
||||
#define RX_BD_FLAGS_1_BUFFER_PACKET (0 << 8)
|
||||
@@ -2424,6 +2425,7 @@ struct bnxt {
|
||||
u8 tc_to_qidx[BNXT_MAX_QUEUE];
|
||||
u8 q_ids[BNXT_MAX_QUEUE];
|
||||
u8 max_q;
|
||||
u8 cos0_cos1_shared;
|
||||
u8 num_tc;
|
||||
|
||||
u16 max_pfcwd_tmo_ms;
|
||||
@@ -2482,6 +2484,7 @@ struct bnxt {
|
||||
#define BNXT_FW_CAP_ROCE_VF_RESC_MGMT_SUPPORTED BIT_ULL(6)
|
||||
#define BNXT_FW_CAP_KONG_MB_CHNL BIT_ULL(7)
|
||||
#define BNXT_FW_CAP_ROCE_VF_DYN_ALLOC_SUPPORT BIT_ULL(8)
|
||||
#define BNXT_FW_CAP_LINK_ADMIN BIT_ULL(9)
|
||||
#define BNXT_FW_CAP_OVS_64BIT_HANDLE BIT_ULL(10)
|
||||
#define BNXT_FW_CAP_TRUSTED_VF BIT_ULL(11)
|
||||
#define BNXT_FW_CAP_ERROR_RECOVERY BIT_ULL(13)
|
||||
|
||||
@@ -688,16 +688,22 @@ skip_ring_stats:
|
||||
buf[j] = *(rx_port_stats_ext + n);
|
||||
}
|
||||
for (i = 0; i < 8; i++, j++) {
|
||||
long n = bnxt_tx_bytes_pri_arr[i].base_off +
|
||||
bp->pri2cos_idx[i];
|
||||
u8 cos_idx = bp->pri2cos_idx[i];
|
||||
long n;
|
||||
|
||||
n = bnxt_tx_bytes_pri_arr[i].base_off + cos_idx;
|
||||
buf[j] = *(tx_port_stats_ext + n);
|
||||
if (bp->cos0_cos1_shared && !cos_idx)
|
||||
buf[j] += *(tx_port_stats_ext + n + 1);
|
||||
}
|
||||
for (i = 0; i < 8; i++, j++) {
|
||||
long n = bnxt_tx_pkts_pri_arr[i].base_off +
|
||||
bp->pri2cos_idx[i];
|
||||
u8 cos_idx = bp->pri2cos_idx[i];
|
||||
long n;
|
||||
|
||||
n = bnxt_tx_pkts_pri_arr[i].base_off + cos_idx;
|
||||
buf[j] = *(tx_port_stats_ext + n);
|
||||
if (bp->cos0_cos1_shared && !cos_idx)
|
||||
buf[j] += *(tx_port_stats_ext + n + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4617,6 +4623,11 @@ static int bnxt_get_module_status(struct bnxt *bp, struct netlink_ext_ack *extac
|
||||
PORT_PHY_QCFG_RESP_MODULE_STATUS_WARNINGMSG)
|
||||
return 0;
|
||||
|
||||
if (bp->link_info.phy_type == PORT_PHY_QCFG_RESP_PHY_TYPE_BASET ||
|
||||
bp->link_info.phy_type == PORT_PHY_QCFG_RESP_PHY_TYPE_BASETE){
|
||||
NL_SET_ERR_MSG_MOD(extack, "Operation not supported as PHY type is Base-T");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
switch (bp->link_info.module_status) {
|
||||
case PORT_PHY_QCFG_RESP_MODULE_STATUS_PWRDOWN:
|
||||
NL_SET_ERR_MSG_MOD(extack, "Transceiver module is powering down");
|
||||
|
||||
@@ -332,6 +332,38 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int bnxt_set_vf_link_admin_state(struct bnxt *bp, int vf_id)
|
||||
{
|
||||
struct hwrm_func_cfg_input *req;
|
||||
struct bnxt_vf_info *vf;
|
||||
int rc;
|
||||
|
||||
if (!(bp->fw_cap & BNXT_FW_CAP_LINK_ADMIN))
|
||||
return 0;
|
||||
|
||||
vf = &bp->pf.vf[vf_id];
|
||||
|
||||
rc = bnxt_hwrm_func_cfg_short_req_init(bp, &req);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
req->fid = cpu_to_le16(vf->fw_fid);
|
||||
switch (vf->flags & (BNXT_VF_LINK_FORCED | BNXT_VF_LINK_UP)) {
|
||||
case BNXT_VF_LINK_FORCED:
|
||||
req->options =
|
||||
FUNC_CFG_REQ_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN;
|
||||
break;
|
||||
case (BNXT_VF_LINK_FORCED | BNXT_VF_LINK_UP):
|
||||
req->options = FUNC_CFG_REQ_OPTIONS_LINK_ADMIN_STATE_FORCED_UP;
|
||||
break;
|
||||
default:
|
||||
req->options = FUNC_CFG_REQ_OPTIONS_LINK_ADMIN_STATE_AUTO;
|
||||
break;
|
||||
}
|
||||
req->enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_ADMIN_LINK_STATE);
|
||||
return hwrm_req_send(bp, req);
|
||||
}
|
||||
|
||||
int bnxt_set_vf_link_state(struct net_device *dev, int vf_id, int link)
|
||||
{
|
||||
struct bnxt *bp = netdev_priv(dev);
|
||||
@@ -357,10 +389,11 @@ int bnxt_set_vf_link_state(struct net_device *dev, int vf_id, int link)
|
||||
break;
|
||||
default:
|
||||
netdev_err(bp->dev, "Invalid link option\n");
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
return -EINVAL;
|
||||
}
|
||||
if (vf->flags & (BNXT_VF_LINK_UP | BNXT_VF_LINK_FORCED))
|
||||
if (bp->fw_cap & BNXT_FW_CAP_LINK_ADMIN)
|
||||
rc = bnxt_set_vf_link_admin_state(bp, vf_id);
|
||||
else if (vf->flags & (BNXT_VF_LINK_UP | BNXT_VF_LINK_FORCED))
|
||||
rc = bnxt_hwrm_fwd_async_event_cmpl(bp, vf,
|
||||
ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE);
|
||||
return rc;
|
||||
@@ -666,15 +699,21 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
|
||||
|
||||
hwrm_req_hold(bp, req);
|
||||
for (i = 0; i < num_vfs; i++) {
|
||||
struct bnxt_vf_info *vf = &pf->vf[i];
|
||||
|
||||
vf->fw_fid = pf->first_vf_id + i;
|
||||
rc = bnxt_set_vf_link_admin_state(bp, i);
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
if (reset)
|
||||
__bnxt_set_vf_params(bp, i);
|
||||
|
||||
req->vf_id = cpu_to_le16(pf->first_vf_id + i);
|
||||
req->vf_id = cpu_to_le16(vf->fw_fid);
|
||||
rc = hwrm_req_send(bp, req);
|
||||
if (rc)
|
||||
break;
|
||||
pf->active_vfs = i + 1;
|
||||
pf->vf[i].fw_fid = pf->first_vf_id + i;
|
||||
}
|
||||
|
||||
if (pf->active_vfs) {
|
||||
@@ -741,6 +780,12 @@ static int bnxt_hwrm_func_cfg(struct bnxt *bp, int num_vfs)
|
||||
FUNC_CFG_REQ_ENABLES_NUM_VNICS |
|
||||
FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS);
|
||||
|
||||
if (bp->fw_cap & BNXT_FW_CAP_LINK_ADMIN) {
|
||||
req->options = FUNC_CFG_REQ_OPTIONS_LINK_ADMIN_STATE_AUTO;
|
||||
req->enables |=
|
||||
cpu_to_le32(FUNC_CFG_REQ_ENABLES_ADMIN_LINK_STATE);
|
||||
}
|
||||
|
||||
mtu = bp->dev->mtu + VLAN_ETH_HLEN;
|
||||
req->mru = cpu_to_le16(mtu);
|
||||
req->admin_mtu = cpu_to_le16(mtu);
|
||||
|
||||
@@ -142,7 +142,6 @@ int bnxt_register_dev(struct bnxt_en_dev *edev,
|
||||
edev->ulp_tbl->msix_requested = bnxt_get_ulp_msix_num(bp);
|
||||
|
||||
bnxt_fill_msix_vecs(bp, bp->edev->msix_entries);
|
||||
edev->flags |= BNXT_EN_FLAG_MSIX_REQUESTED;
|
||||
exit:
|
||||
mutex_unlock(&edev->en_dev_lock);
|
||||
netdev_unlock(dev);
|
||||
@@ -159,8 +158,6 @@ void bnxt_unregister_dev(struct bnxt_en_dev *edev)
|
||||
ulp = edev->ulp_tbl;
|
||||
netdev_lock(dev);
|
||||
mutex_lock(&edev->en_dev_lock);
|
||||
if (ulp->msix_requested)
|
||||
edev->flags &= ~BNXT_EN_FLAG_MSIX_REQUESTED;
|
||||
edev->ulp_tbl->msix_requested = 0;
|
||||
|
||||
if (ulp->max_async_event_id)
|
||||
@@ -298,7 +295,7 @@ void bnxt_ulp_irq_stop(struct bnxt *bp)
|
||||
struct bnxt_ulp_ops *ops;
|
||||
bool reset = false;
|
||||
|
||||
if (!edev || !(edev->flags & BNXT_EN_FLAG_MSIX_REQUESTED))
|
||||
if (!edev)
|
||||
return;
|
||||
|
||||
if (bnxt_ulp_registered(bp->edev)) {
|
||||
@@ -321,7 +318,7 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err)
|
||||
struct bnxt_en_dev *edev = bp->edev;
|
||||
struct bnxt_ulp_ops *ops;
|
||||
|
||||
if (!edev || !(edev->flags & BNXT_EN_FLAG_MSIX_REQUESTED))
|
||||
if (!edev)
|
||||
return;
|
||||
|
||||
if (bnxt_ulp_registered(bp->edev)) {
|
||||
|
||||
@@ -58,7 +58,6 @@ struct bnxt_en_dev {
|
||||
#define BNXT_EN_FLAG_ROCEV2_CAP 0x2
|
||||
#define BNXT_EN_FLAG_ROCE_CAP (BNXT_EN_FLAG_ROCEV1_CAP | \
|
||||
BNXT_EN_FLAG_ROCEV2_CAP)
|
||||
#define BNXT_EN_FLAG_MSIX_REQUESTED 0x4
|
||||
#define BNXT_EN_FLAG_ULP_STOPPED 0x8
|
||||
#define BNXT_EN_FLAG_VF 0x10
|
||||
#define BNXT_EN_VF(edev) ((edev)->flags & BNXT_EN_FLAG_VF)
|
||||
|
||||
Reference in New Issue
Block a user