Skip to content

Commit 65ae975

Browse files
committed
Merge tag 'net-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bluetooth. Current release - regressions: - rtnetlink: fix rtnl_dump_ifinfo() error path - bluetooth: remove the redundant sco_conn_put Previous releases - regressions: - netlink: fix false positive warning in extack during dumps - sched: sch_fq: don't follow the fast path if Tx is behind now - ipv6: delete temporary address if mngtmpaddr is removed or unmanaged - tcp: fix use-after-free of nreq in reqsk_timer_handler(). - bluetooth: fix slab-use-after-free Read in set_powered_sync - l2tp: fix warning in l2tp_exit_net found - eth: - bnxt_en: fix receive ring space parameters when XDP is active - lan78xx: fix double free issue with interrupt buffer allocation - tg3: set coherent DMA mask bits to 31 for BCM57766 chipsets Previous releases - always broken: - ipmr: fix tables suspicious RCU usage - iucv: MSG_PEEK causes memory leak in iucv_sock_destruct() - eth: - octeontx2-af: fix low network performance - stmmac: dwmac-socfpga: set RX watchdog interrupt as broken - rtase: correct the speed for RTL907XD-V1 Misc: - some documentation fixup" * tag 'net-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (49 commits) ipmr: fix build with clang and DEBUG_NET disabled. Documentation: tls_offload: fix typos and grammar Fix spelling mistake ipmr: fix tables suspicious RCU usage ip6mr: fix tables suspicious RCU usage ipmr: add debug check for mr table cleanup selftests: rds: move test.py to TEST_FILES net_sched: sch_fq: don't follow the fast path if Tx is behind now tcp: Fix use-after-free of nreq in reqsk_timer_handler(). net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI net: Comment copy_from_sockptr() explaining its behaviour rxrpc: Improve setsockopt() handling of malformed user input llc: Improve setsockopt() handling of malformed user input Bluetooth: SCO: remove the redundant sco_conn_put Bluetooth: MGMT: Fix possible deadlocks Bluetooth: MGMT: Fix slab-use-after-free Read in set_powered_sync bnxt_en: Unregister PTP during PCI shutdown and suspend bnxt_en: Refactor bnxt_ptp_init() bnxt_en: Fix receive ring space parameters when XDP is active bnxt_en: Fix queue start to update vnic RSS table ...
2 parents 86f4197 + f6d7695 commit 65ae975

File tree

46 files changed

+811
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+811
-226
lines changed

Documentation/networking/cdc_mbim.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Such userspace applications includes, but are not limited to:
5151
- mbimcli (included with the libmbim [3] library), and
5252
- ModemManager [4]
5353

54-
Establishing a MBIM IP session reequires at least these actions by the
54+
Establishing a MBIM IP session requires at least these actions by the
5555
management application:
5656

5757
- open the control channel

Documentation/networking/tls-offload.rst

+15-14
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ and send them to the device for encryption and transmission.
5151
RX
5252
--
5353

54-
On the receive side if the device handled decryption and authentication
54+
On the receive side, if the device handled decryption and authentication
5555
successfully, the driver will set the decrypted bit in the associated
5656
:c:type:`struct sk_buff <sk_buff>`. The packets reach the TCP stack and
5757
are handled normally. ``ktls`` is informed when data is queued to the socket
@@ -120,8 +120,9 @@ before installing the connection state in the kernel.
120120
RX
121121
--
122122

123-
In RX direction local networking stack has little control over the segmentation,
124-
so the initial records' TCP sequence number may be anywhere inside the segment.
123+
In the RX direction, the local networking stack has little control over
124+
segmentation, so the initial records' TCP sequence number may be anywhere
125+
inside the segment.
125126

126127
Normal operation
127128
================
@@ -138,8 +139,8 @@ There are no guarantees on record length or record segmentation. In particular
138139
segments may start at any point of a record and contain any number of records.
139140
Assuming segments are received in order, the device should be able to perform
140141
crypto operations and authentication regardless of segmentation. For this
141-
to be possible device has to keep small amount of segment-to-segment state.
142-
This includes at least:
142+
to be possible, the device has to keep a small amount of segment-to-segment
143+
state. This includes at least:
143144

144145
* partial headers (if a segment carried only a part of the TLS header)
145146
* partial data block
@@ -175,12 +176,12 @@ and packet transformation functions) the device validates the Layer 4
175176
checksum and performs a 5-tuple lookup to find any TLS connection the packet
176177
may belong to (technically a 4-tuple
177178
lookup is sufficient - IP addresses and TCP port numbers, as the protocol
178-
is always TCP). If connection is matched device confirms if the TCP sequence
179-
number is the expected one and proceeds to TLS handling (record delineation,
180-
decryption, authentication for each record in the packet). The device leaves
181-
the record framing unmodified, the stack takes care of record decapsulation.
182-
Device indicates successful handling of TLS offload in the per-packet context
183-
(descriptor) passed to the host.
179+
is always TCP). If the packet is matched to a connection, the device confirms
180+
if the TCP sequence number is the expected one and proceeds to TLS handling
181+
(record delineation, decryption, authentication for each record in the packet).
182+
The device leaves the record framing unmodified, the stack takes care of record
183+
decapsulation. Device indicates successful handling of TLS offload in the
184+
per-packet context (descriptor) passed to the host.
184185

185186
Upon reception of a TLS offloaded packet, the driver sets
186187
the :c:member:`decrypted` mark in :c:type:`struct sk_buff <sk_buff>`
@@ -439,7 +440,7 @@ by the driver:
439440
* ``rx_tls_resync_req_end`` - number of times the TLS async resync request
440441
properly ended with providing the HW tracked tcp-seq.
441442
* ``rx_tls_resync_req_skip`` - number of times the TLS async resync request
442-
procedure was started by not properly ended.
443+
procedure was started but not properly ended.
443444
* ``rx_tls_resync_res_ok`` - number of times the TLS resync response call to
444445
the driver was successfully handled.
445446
* ``rx_tls_resync_res_skip`` - number of times the TLS resync response call to
@@ -507,8 +508,8 @@ in packets as seen on the wire.
507508
Transport layer transparency
508509
----------------------------
509510

510-
The device should not modify any packet headers for the purpose
511-
of the simplifying TLS offload.
511+
For the purpose of simplifying TLS offload, the device should not modify any
512+
packet headers.
512513

513514
The device should not depend on any packet headers beyond what is strictly
514515
necessary for TLS offload.

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

+31-6
Original file line numberDiff line numberDiff line change
@@ -4661,7 +4661,7 @@ int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
46614661
struct net_device *dev = bp->dev;
46624662

46634663
if (page_mode) {
4664-
bp->flags &= ~BNXT_FLAG_AGG_RINGS;
4664+
bp->flags &= ~(BNXT_FLAG_AGG_RINGS | BNXT_FLAG_NO_AGG_RINGS);
46654665
bp->flags |= BNXT_FLAG_RX_PAGE_MODE;
46664666

46674667
if (bp->xdp_prog->aux->xdp_has_frags)
@@ -9299,7 +9299,6 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
92999299
struct hwrm_port_mac_ptp_qcfg_output *resp;
93009300
struct hwrm_port_mac_ptp_qcfg_input *req;
93019301
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
9302-
bool phc_cfg;
93039302
u8 flags;
93049303
int rc;
93059304

@@ -9346,8 +9345,9 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
93469345
rc = -ENODEV;
93479346
goto exit;
93489347
}
9349-
phc_cfg = (flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9350-
rc = bnxt_ptp_init(bp, phc_cfg);
9348+
ptp->rtc_configured =
9349+
(flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9350+
rc = bnxt_ptp_init(bp);
93519351
if (rc)
93529352
netdev_warn(bp->dev, "PTP initialization failed.\n");
93539353
exit:
@@ -14746,6 +14746,14 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
1474614746
bnxt_close_nic(bp, true, false);
1474714747

1474814748
WRITE_ONCE(dev->mtu, new_mtu);
14749+
14750+
/* MTU change may change the AGG ring settings if an XDP multi-buffer
14751+
* program is attached. We need to set the AGG rings settings and
14752+
* rx_skb_func accordingly.
14753+
*/
14754+
if (READ_ONCE(bp->xdp_prog))
14755+
bnxt_set_rx_skb_mode(bp, true);
14756+
1474914757
bnxt_set_ring_params(bp);
1475014758

1475114759
if (netif_running(dev))
@@ -15483,6 +15491,13 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1548315491

1548415492
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
1548515493
vnic = &bp->vnic_info[i];
15494+
15495+
rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
15496+
if (rc) {
15497+
netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
15498+
vnic->vnic_id, rc);
15499+
return rc;
15500+
}
1548615501
vnic->mru = bp->dev->mtu + ETH_HLEN + VLAN_HLEN;
1548715502
bnxt_hwrm_vnic_update(bp, vnic,
1548815503
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
@@ -16236,6 +16251,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1623616251
if (netif_running(dev))
1623716252
dev_close(dev);
1623816253

16254+
bnxt_ptp_clear(bp);
1623916255
bnxt_clear_int_mode(bp);
1624016256
pci_disable_device(pdev);
1624116257

@@ -16263,6 +16279,7 @@ static int bnxt_suspend(struct device *device)
1626316279
rc = bnxt_close(dev);
1626416280
}
1626516281
bnxt_hwrm_func_drv_unrgtr(bp);
16282+
bnxt_ptp_clear(bp);
1626616283
pci_disable_device(bp->pdev);
1626716284
bnxt_free_ctx_mem(bp, false);
1626816285
rtnl_unlock();
@@ -16306,6 +16323,10 @@ static int bnxt_resume(struct device *device)
1630616323
if (bp->fw_crash_mem)
1630716324
bnxt_hwrm_crash_dump_mem_cfg(bp);
1630816325

16326+
if (bnxt_ptp_init(bp)) {
16327+
kfree(bp->ptp_cfg);
16328+
bp->ptp_cfg = NULL;
16329+
}
1630916330
bnxt_get_wol_settings(bp);
1631016331
if (netif_running(dev)) {
1631116332
rc = bnxt_open(dev);
@@ -16484,8 +16505,12 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1648416505
rtnl_lock();
1648516506

1648616507
err = bnxt_hwrm_func_qcaps(bp);
16487-
if (!err && netif_running(netdev))
16488-
err = bnxt_open(netdev);
16508+
if (!err) {
16509+
if (netif_running(netdev))
16510+
err = bnxt_open(netdev);
16511+
else
16512+
err = bnxt_reserve_rings(bp, true);
16513+
}
1648916514

1649016515
if (!err)
1649116516
netif_device_attach(netdev);

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -2837,19 +2837,24 @@ static int bnxt_get_link_ksettings(struct net_device *dev,
28372837
}
28382838

28392839
base->port = PORT_NONE;
2840-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP) {
2840+
if (media == BNXT_MEDIA_TP) {
28412841
base->port = PORT_TP;
28422842
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28432843
lk_ksettings->link_modes.supported);
28442844
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28452845
lk_ksettings->link_modes.advertising);
2846+
} else if (media == BNXT_MEDIA_KR) {
2847+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2848+
lk_ksettings->link_modes.supported);
2849+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2850+
lk_ksettings->link_modes.advertising);
28462851
} else {
28472852
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28482853
lk_ksettings->link_modes.supported);
28492854
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28502855
lk_ksettings->link_modes.advertising);
28512856

2852-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_DAC)
2857+
if (media == BNXT_MEDIA_CR)
28532858
base->port = PORT_DA;
28542859
else
28552860
base->port = PORT_FIBRE;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static void bnxt_ptp_free(struct bnxt *bp)
10381038
}
10391039
}
10401040

1041-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
1041+
int bnxt_ptp_init(struct bnxt *bp)
10421042
{
10431043
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
10441044
int rc;
@@ -1061,7 +1061,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
10611061

10621062
if (BNXT_PTP_USE_RTC(bp)) {
10631063
bnxt_ptp_timecounter_init(bp, false);
1064-
rc = bnxt_ptp_init_rtc(bp, phc_cfg);
1064+
rc = bnxt_ptp_init_rtc(bp, ptp->rtc_configured);
10651065
if (rc)
10661066
goto out;
10671067
} else {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct bnxt_ptp_cfg {
135135
BNXT_PTP_MSG_PDELAY_REQ | \
136136
BNXT_PTP_MSG_PDELAY_RESP)
137137
u8 tx_tstamp_en:1;
138+
u8 rtc_configured:1;
138139
int rx_filter;
139140
u32 tstamp_filters;
140141

@@ -168,7 +169,7 @@ void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
168169
struct tx_ts_cmp *tscmp);
169170
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns);
170171
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg);
171-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg);
172+
int bnxt_ptp_init(struct bnxt *bp);
172173
void bnxt_ptp_clear(struct bnxt *bp);
173174
static inline u64 bnxt_timecounter_cyc2time(struct bnxt_ptp_cfg *ptp, u64 ts)
174175
{

drivers/net/ethernet/broadcom/tg3.c

+3
Original file line numberDiff line numberDiff line change
@@ -17839,6 +17839,9 @@ static int tg3_init_one(struct pci_dev *pdev,
1783917839
} else
1784017840
persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
1784117841

17842+
if (tg3_asic_rev(tp) == ASIC_REV_57766)
17843+
persist_dma_mask = DMA_BIT_MASK(31);
17844+
1784217845
/* Configure DMA attributes. */
1784317846
if (dma_mask > DMA_BIT_MASK(32)) {
1784417847
err = dma_set_mask(&pdev->dev, dma_mask);

drivers/net/ethernet/marvell/octeontx2/af/cgx.c

+68-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ struct mac_ops *get_mac_ops(void *cgxd)
112112
return ((struct cgx *)cgxd)->mac_ops;
113113
}
114114

115+
u32 cgx_get_fifo_len(void *cgxd)
116+
{
117+
return ((struct cgx *)cgxd)->fifo_len;
118+
}
119+
115120
void cgx_write(struct cgx *cgx, u64 lmac, u64 offset, u64 val)
116121
{
117122
writeq(val, cgx->reg_base + (lmac << cgx->mac_ops->lmac_offset) +
@@ -209,6 +214,24 @@ u8 cgx_lmac_get_p2x(int cgx_id, int lmac_id)
209214
return (cfg & CMR_P2X_SEL_MASK) >> CMR_P2X_SEL_SHIFT;
210215
}
211216

217+
static u8 cgx_get_nix_resetbit(struct cgx *cgx)
218+
{
219+
int first_lmac;
220+
u8 p2x;
221+
222+
/* non 98XX silicons supports only NIX0 block */
223+
if (cgx->pdev->subsystem_device != PCI_SUBSYS_DEVID_98XX)
224+
return CGX_NIX0_RESET;
225+
226+
first_lmac = find_first_bit(&cgx->lmac_bmap, cgx->max_lmac_per_mac);
227+
p2x = cgx_lmac_get_p2x(cgx->cgx_id, first_lmac);
228+
229+
if (p2x == CMR_P2X_SEL_NIX1)
230+
return CGX_NIX1_RESET;
231+
else
232+
return CGX_NIX0_RESET;
233+
}
234+
212235
/* Ensure the required lock for event queue(where asynchronous events are
213236
* posted) is acquired before calling this API. Else an asynchronous event(with
214237
* latest link status) can reach the destination before this function returns
@@ -501,7 +524,7 @@ static u32 cgx_get_lmac_fifo_len(void *cgxd, int lmac_id)
501524
u8 num_lmacs;
502525
u32 fifo_len;
503526

504-
fifo_len = cgx->mac_ops->fifo_len;
527+
fifo_len = cgx->fifo_len;
505528
num_lmacs = cgx->mac_ops->get_nr_lmacs(cgx);
506529

507530
switch (num_lmacs) {
@@ -1719,6 +1742,8 @@ static int cgx_lmac_init(struct cgx *cgx)
17191742
lmac->lmac_type = cgx->mac_ops->get_lmac_type(cgx, lmac->lmac_id);
17201743
}
17211744

1745+
/* Start X2P reset on given MAC block */
1746+
cgx->mac_ops->mac_x2p_reset(cgx, true);
17221747
return cgx_lmac_verify_fwi_version(cgx);
17231748

17241749
err_bitmap_free:
@@ -1764,7 +1789,7 @@ static void cgx_populate_features(struct cgx *cgx)
17641789
u64 cfg;
17651790

17661791
cfg = cgx_read(cgx, 0, CGX_CONST);
1767-
cgx->mac_ops->fifo_len = FIELD_GET(CGX_CONST_RXFIFO_SIZE, cfg);
1792+
cgx->fifo_len = FIELD_GET(CGX_CONST_RXFIFO_SIZE, cfg);
17681793
cgx->max_lmac_per_mac = FIELD_GET(CGX_CONST_MAX_LMACS, cfg);
17691794

17701795
if (is_dev_rpm(cgx))
@@ -1784,6 +1809,45 @@ static u8 cgx_get_rxid_mapoffset(struct cgx *cgx)
17841809
return 0x60;
17851810
}
17861811

1812+
static void cgx_x2p_reset(void *cgxd, bool enable)
1813+
{
1814+
struct cgx *cgx = cgxd;
1815+
int lmac_id;
1816+
u64 cfg;
1817+
1818+
if (enable) {
1819+
for_each_set_bit(lmac_id, &cgx->lmac_bmap, cgx->max_lmac_per_mac)
1820+
cgx->mac_ops->mac_enadis_rx(cgx, lmac_id, false);
1821+
1822+
usleep_range(1000, 2000);
1823+
1824+
cfg = cgx_read(cgx, 0, CGXX_CMR_GLOBAL_CONFIG);
1825+
cfg |= cgx_get_nix_resetbit(cgx) | CGX_NSCI_DROP;
1826+
cgx_write(cgx, 0, CGXX_CMR_GLOBAL_CONFIG, cfg);
1827+
} else {
1828+
cfg = cgx_read(cgx, 0, CGXX_CMR_GLOBAL_CONFIG);
1829+
cfg &= ~(cgx_get_nix_resetbit(cgx) | CGX_NSCI_DROP);
1830+
cgx_write(cgx, 0, CGXX_CMR_GLOBAL_CONFIG, cfg);
1831+
}
1832+
}
1833+
1834+
static int cgx_enadis_rx(void *cgxd, int lmac_id, bool enable)
1835+
{
1836+
struct cgx *cgx = cgxd;
1837+
u64 cfg;
1838+
1839+
if (!is_lmac_valid(cgx, lmac_id))
1840+
return -ENODEV;
1841+
1842+
cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG);
1843+
if (enable)
1844+
cfg |= DATA_PKT_RX_EN;
1845+
else
1846+
cfg &= ~DATA_PKT_RX_EN;
1847+
cgx_write(cgx, lmac_id, CGXX_CMRX_CFG, cfg);
1848+
return 0;
1849+
}
1850+
17871851
static struct mac_ops cgx_mac_ops = {
17881852
.name = "cgx",
17891853
.csr_offset = 0,
@@ -1815,6 +1879,8 @@ static struct mac_ops cgx_mac_ops = {
18151879
.mac_get_pfc_frm_cfg = cgx_lmac_get_pfc_frm_cfg,
18161880
.mac_reset = cgx_lmac_reset,
18171881
.mac_stats_reset = cgx_stats_reset,
1882+
.mac_x2p_reset = cgx_x2p_reset,
1883+
.mac_enadis_rx = cgx_enadis_rx,
18181884
};
18191885

18201886
static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)

drivers/net/ethernet/marvell/octeontx2/af/cgx.h

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#define CGX_LMAC_TYPE_MASK 0xF
3333
#define CGXX_CMRX_INT 0x040
3434
#define FW_CGX_INT BIT_ULL(1)
35+
#define CGXX_CMR_GLOBAL_CONFIG 0x08
36+
#define CGX_NIX0_RESET BIT_ULL(2)
37+
#define CGX_NIX1_RESET BIT_ULL(3)
38+
#define CGX_NSCI_DROP BIT_ULL(9)
3539
#define CGXX_CMRX_INT_ENA_W1S 0x058
3640
#define CGXX_CMRX_RX_ID_MAP 0x060
3741
#define CGXX_CMRX_RX_STAT0 0x070
@@ -185,4 +189,5 @@ int cgx_lmac_get_pfc_frm_cfg(void *cgxd, int lmac_id, u8 *tx_pause,
185189
int verify_lmac_fc_cfg(void *cgxd, int lmac_id, u8 tx_pause, u8 rx_pause,
186190
int pfvf_idx);
187191
int cgx_lmac_reset(void *cgxd, int lmac_id, u8 pf_req_flr);
192+
u32 cgx_get_fifo_len(void *cgxd);
188193
#endif /* CGX_H */

0 commit comments

Comments
 (0)