Skip to content

Commit 02f177c

Browse files
committed
Merge: bnxt_en: post-v6.12 fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/57 JIRA: https://issues.redhat.com/browse/RHEL-54644 JIRA: https://issues.redhat.com/browse/RHEL-69499 Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents d4b130c + d0d43c8 commit 02f177c

File tree

5 files changed

+71
-33
lines changed

5 files changed

+71
-33
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4558,7 +4558,7 @@ int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
45584558
struct net_device *dev = bp->dev;
45594559

45604560
if (page_mode) {
4561-
bp->flags &= ~BNXT_FLAG_AGG_RINGS;
4561+
bp->flags &= ~(BNXT_FLAG_AGG_RINGS | BNXT_FLAG_NO_AGG_RINGS);
45624562
bp->flags |= BNXT_FLAG_RX_PAGE_MODE;
45634563

45644564
if (bp->xdp_prog->aux->xdp_has_frags)
@@ -9053,7 +9053,6 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
90539053
struct hwrm_port_mac_ptp_qcfg_output *resp;
90549054
struct hwrm_port_mac_ptp_qcfg_input *req;
90559055
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
9056-
bool phc_cfg;
90579056
u8 flags;
90589057
int rc;
90599058

@@ -9100,8 +9099,9 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
91009099
rc = -ENODEV;
91019100
goto exit;
91029101
}
9103-
phc_cfg = (flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9104-
rc = bnxt_ptp_init(bp, phc_cfg);
9102+
ptp->rtc_configured =
9103+
(flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9104+
rc = bnxt_ptp_init(bp);
91059105
if (rc)
91069106
netdev_warn(bp->dev, "PTP initialization failed.\n");
91079107
exit:
@@ -10885,7 +10885,7 @@ static void bnxt_free_irq(struct bnxt *bp)
1088510885
irq = &bp->irq_tbl[map_idx];
1088610886
if (irq->requested) {
1088710887
if (irq->have_cpumask) {
10888-
irq_set_affinity_hint(irq->vector, NULL);
10888+
irq_update_affinity_hint(irq->vector, NULL);
1088910889
free_cpumask_var(irq->cpu_mask);
1089010890
irq->have_cpumask = 0;
1089110891
}
@@ -10940,10 +10940,10 @@ static int bnxt_request_irq(struct bnxt *bp)
1094010940
irq->have_cpumask = 1;
1094110941
cpumask_set_cpu(cpumask_local_spread(i, numa_node),
1094210942
irq->cpu_mask);
10943-
rc = irq_set_affinity_hint(irq->vector, irq->cpu_mask);
10943+
rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask);
1094410944
if (rc) {
1094510945
netdev_warn(bp->dev,
10946-
"Set affinity failed, IRQ = %d\n",
10946+
"Update affinity hint failed, IRQ = %d\n",
1094710947
irq->vector);
1094810948
break;
1094910949
}
@@ -14494,6 +14494,14 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
1449414494
bnxt_close_nic(bp, true, false);
1449514495

1449614496
WRITE_ONCE(dev->mtu, new_mtu);
14497+
14498+
/* MTU change may change the AGG ring settings if an XDP multi-buffer
14499+
* program is attached. We need to set the AGG rings settings and
14500+
* rx_skb_func accordingly.
14501+
*/
14502+
if (READ_ONCE(bp->xdp_prog))
14503+
bnxt_set_rx_skb_mode(bp, true);
14504+
1449714505
bnxt_set_ring_params(bp);
1449814506

1449914507
if (netif_running(dev))
@@ -15231,6 +15239,13 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1523115239

1523215240
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
1523315241
vnic = &bp->vnic_info[i];
15242+
15243+
rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
15244+
if (rc) {
15245+
netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
15246+
vnic->vnic_id, rc);
15247+
return rc;
15248+
}
1523415249
vnic->mru = bp->dev->mtu + ETH_HLEN + VLAN_HLEN;
1523515250
bnxt_hwrm_vnic_update(bp, vnic,
1523615251
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
@@ -15984,6 +15999,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1598415999
if (netif_running(dev))
1598516000
dev_close(dev);
1598616001

16002+
bnxt_ptp_clear(bp);
1598716003
bnxt_clear_int_mode(bp);
1598816004
pci_disable_device(pdev);
1598916005

@@ -16011,6 +16027,7 @@ static int bnxt_suspend(struct device *device)
1601116027
rc = bnxt_close(dev);
1601216028
}
1601316029
bnxt_hwrm_func_drv_unrgtr(bp);
16030+
bnxt_ptp_clear(bp);
1601416031
pci_disable_device(bp->pdev);
1601516032
bnxt_free_ctx_mem(bp);
1601616033
rtnl_unlock();
@@ -16054,6 +16071,10 @@ static int bnxt_resume(struct device *device)
1605416071
if (bp->fw_crash_mem)
1605516072
bnxt_hwrm_crash_dump_mem_cfg(bp);
1605616073

16074+
if (bnxt_ptp_init(bp)) {
16075+
kfree(bp->ptp_cfg);
16076+
bp->ptp_cfg = NULL;
16077+
}
1605716078
bnxt_get_wol_settings(bp);
1605816079
if (netif_running(dev)) {
1605916080
rc = bnxt_open(dev);
@@ -16232,8 +16253,12 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1623216253
rtnl_lock();
1623316254

1623416255
err = bnxt_hwrm_func_qcaps(bp);
16235-
if (!err && netif_running(netdev))
16236-
err = bnxt_open(netdev);
16256+
if (!err) {
16257+
if (netif_running(netdev))
16258+
err = bnxt_open(netdev);
16259+
else
16260+
err = bnxt_reserve_rings(bp, true);
16261+
}
1623716262

1623816263
if (!err)
1623916264
netif_device_attach(netdev);

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,15 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
11311131
fkeys = &fltr->fkeys;
11321132
fmasks = &fltr->fmasks;
11331133
if (fkeys->basic.n_proto == htons(ETH_P_IP)) {
1134-
if (fkeys->basic.ip_proto == IPPROTO_ICMP ||
1135-
fkeys->basic.ip_proto == IPPROTO_RAW) {
1134+
if (fkeys->basic.ip_proto == BNXT_IP_PROTO_WILDCARD) {
11361135
fs->flow_type = IP_USER_FLOW;
11371136
fs->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
1138-
if (fkeys->basic.ip_proto == IPPROTO_ICMP)
1139-
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
1140-
else
1141-
fs->h_u.usr_ip4_spec.proto = IPPROTO_RAW;
1137+
fs->h_u.usr_ip4_spec.proto = BNXT_IP_PROTO_WILDCARD;
1138+
fs->m_u.usr_ip4_spec.proto = 0;
1139+
} else if (fkeys->basic.ip_proto == IPPROTO_ICMP) {
1140+
fs->flow_type = IP_USER_FLOW;
1141+
fs->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
1142+
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
11421143
fs->m_u.usr_ip4_spec.proto = BNXT_IP_PROTO_FULL_MASK;
11431144
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
11441145
fs->flow_type = TCP_V4_FLOW;
@@ -1160,13 +1161,13 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
11601161
fs->m_u.tcp_ip4_spec.pdst = fmasks->ports.dst;
11611162
}
11621163
} else {
1163-
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6 ||
1164-
fkeys->basic.ip_proto == IPPROTO_RAW) {
1164+
if (fkeys->basic.ip_proto == BNXT_IP_PROTO_WILDCARD) {
11651165
fs->flow_type = IPV6_USER_FLOW;
1166-
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6)
1167-
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
1168-
else
1169-
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_RAW;
1166+
fs->h_u.usr_ip6_spec.l4_proto = BNXT_IP_PROTO_WILDCARD;
1167+
fs->m_u.usr_ip6_spec.l4_proto = 0;
1168+
} else if (fkeys->basic.ip_proto == IPPROTO_ICMPV6) {
1169+
fs->flow_type = IPV6_USER_FLOW;
1170+
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
11701171
fs->m_u.usr_ip6_spec.l4_proto = BNXT_IP_PROTO_FULL_MASK;
11711172
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
11721173
fs->flow_type = TCP_V6_FLOW;
@@ -1289,21 +1290,24 @@ static int bnxt_add_l2_cls_rule(struct bnxt *bp,
12891290
static bool bnxt_verify_ntuple_ip4_flow(struct ethtool_usrip4_spec *ip_spec,
12901291
struct ethtool_usrip4_spec *ip_mask)
12911292
{
1293+
u8 mproto = ip_mask->proto;
1294+
u8 sproto = ip_spec->proto;
1295+
12921296
if (ip_mask->l4_4_bytes || ip_mask->tos ||
12931297
ip_spec->ip_ver != ETH_RX_NFC_IP4 ||
1294-
ip_mask->proto != BNXT_IP_PROTO_FULL_MASK ||
1295-
(ip_spec->proto != IPPROTO_RAW && ip_spec->proto != IPPROTO_ICMP))
1298+
(mproto && (mproto != BNXT_IP_PROTO_FULL_MASK || sproto != IPPROTO_ICMP)))
12961299
return false;
12971300
return true;
12981301
}
12991302

13001303
static bool bnxt_verify_ntuple_ip6_flow(struct ethtool_usrip6_spec *ip_spec,
13011304
struct ethtool_usrip6_spec *ip_mask)
13021305
{
1306+
u8 mproto = ip_mask->l4_proto;
1307+
u8 sproto = ip_spec->l4_proto;
1308+
13031309
if (ip_mask->l4_4_bytes || ip_mask->tclass ||
1304-
ip_mask->l4_proto != BNXT_IP_PROTO_FULL_MASK ||
1305-
(ip_spec->l4_proto != IPPROTO_RAW &&
1306-
ip_spec->l4_proto != IPPROTO_ICMPV6))
1310+
(mproto && (mproto != BNXT_IP_PROTO_FULL_MASK || sproto != IPPROTO_ICMPV6)))
13071311
return false;
13081312
return true;
13091313
}
@@ -1357,7 +1361,8 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp,
13571361
struct ethtool_usrip4_spec *ip_spec = &fs->h_u.usr_ip4_spec;
13581362
struct ethtool_usrip4_spec *ip_mask = &fs->m_u.usr_ip4_spec;
13591363

1360-
fkeys->basic.ip_proto = ip_spec->proto;
1364+
fkeys->basic.ip_proto = ip_mask->proto ? ip_spec->proto
1365+
: BNXT_IP_PROTO_WILDCARD;
13611366
fkeys->basic.n_proto = htons(ETH_P_IP);
13621367
fkeys->addrs.v4addrs.src = ip_spec->ip4src;
13631368
fmasks->addrs.v4addrs.src = ip_mask->ip4src;
@@ -1388,7 +1393,8 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp,
13881393
struct ethtool_usrip6_spec *ip_spec = &fs->h_u.usr_ip6_spec;
13891394
struct ethtool_usrip6_spec *ip_mask = &fs->m_u.usr_ip6_spec;
13901395

1391-
fkeys->basic.ip_proto = ip_spec->l4_proto;
1396+
fkeys->basic.ip_proto = ip_mask->l4_proto ? ip_spec->l4_proto
1397+
: BNXT_IP_PROTO_WILDCARD;
13921398
fkeys->basic.n_proto = htons(ETH_P_IPV6);
13931399
fkeys->addrs.v6addrs.src = *(struct in6_addr *)&ip_spec->ip6src;
13941400
fmasks->addrs.v6addrs.src = *(struct in6_addr *)&ip_mask->ip6src;
@@ -2838,19 +2844,24 @@ static int bnxt_get_link_ksettings(struct net_device *dev,
28382844
}
28392845

28402846
base->port = PORT_NONE;
2841-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP) {
2847+
if (media == BNXT_MEDIA_TP) {
28422848
base->port = PORT_TP;
28432849
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28442850
lk_ksettings->link_modes.supported);
28452851
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28462852
lk_ksettings->link_modes.advertising);
2853+
} else if (media == BNXT_MEDIA_KR) {
2854+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2855+
lk_ksettings->link_modes.supported);
2856+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2857+
lk_ksettings->link_modes.advertising);
28472858
} else {
28482859
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28492860
lk_ksettings->link_modes.supported);
28502861
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28512862
lk_ksettings->link_modes.advertising);
28522863

2853-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_DAC)
2864+
if (media == BNXT_MEDIA_CR)
28542865
base->port = PORT_DA;
28552866
else
28562867
base->port = PORT_FIBRE;

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct bnxt_led_cfg {
4444
#define BNXT_PXP_REG_LEN 0x3110
4545

4646
#define BNXT_IP_PROTO_FULL_MASK 0xFF
47+
#define BNXT_IP_PROTO_WILDCARD 0x0
4748

4849
extern const struct ethtool_ops bnxt_ethtool_ops;
4950

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ static void bnxt_ptp_free(struct bnxt *bp)
10241024
}
10251025
}
10261026

1027-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
1027+
int bnxt_ptp_init(struct bnxt *bp)
10281028
{
10291029
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
10301030
int rc;
@@ -1047,7 +1047,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
10471047

10481048
if (BNXT_PTP_USE_RTC(bp)) {
10491049
bnxt_ptp_timecounter_init(bp, false);
1050-
rc = bnxt_ptp_init_rtc(bp, phc_cfg);
1050+
rc = bnxt_ptp_init_rtc(bp, ptp->rtc_configured);
10511051
if (rc)
10521052
goto out;
10531053
} else {

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ struct bnxt_ptp_cfg {
133133
BNXT_PTP_MSG_PDELAY_REQ | \
134134
BNXT_PTP_MSG_PDELAY_RESP)
135135
u8 tx_tstamp_en:1;
136+
u8 rtc_configured:1;
136137
int rx_filter;
137138
u32 tstamp_filters;
138139

@@ -180,6 +181,6 @@ void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
180181
struct tx_ts_cmp *tscmp);
181182
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns);
182183
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg);
183-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg);
184+
int bnxt_ptp_init(struct bnxt *bp);
184185
void bnxt_ptp_clear(struct bnxt *bp);
185186
#endif

0 commit comments

Comments
 (0)