Skip to content

Commit 88a5af9

Browse files
committed
Merge tag 'net-5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Networking fixes for 5.12-rc8, including fixes from netfilter, and bpf. BPF verifier changes stand out, otherwise things have slowed down. Current release - regressions: - gro: ensure frag0 meets IP header alignment - Revert "net: stmmac: re-init rx buffers when mac resume back" - ethernet: macb: fix the restore of cmp registers Previous releases - regressions: - ixgbe: Fix NULL pointer dereference in ethtool loopback test - ixgbe: fix unbalanced device enable/disable in suspend/resume - phy: marvell: fix detection of PHY on Topaz switches - make tcp_allowed_congestion_control readonly in non-init netns - xen-netback: Check for hotplug-status existence before watching Previous releases - always broken: - bpf: mitigate a speculative oob read of up to map value size by tightening the masking window - sctp: fix race condition in sctp_destroy_sock - sit, ip6_tunnel: Unregister catch-all devices - netfilter: nftables: clone set element expression template - netfilter: flowtable: fix NAT IPv6 offload mangling - net: geneve: check skb is large enough for IPv4/IPv6 header - netlink: don't call ->netlink_bind with table lock held" * tag 'net-5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (52 commits) netlink: don't call ->netlink_bind with table lock held MAINTAINERS: update my email bpf: Update selftests to reflect new error states bpf: Tighten speculative pointer arithmetic mask bpf: Move sanitize_val_alu out of op switch bpf: Refactor and streamline bounds check into helper bpf: Improve verifier error messages for users bpf: Rework ptr_limit into alu_limit and add common error path bpf: Ensure off_reg has no mixed signed bounds for all types bpf: Move off_reg into sanitize_ptr_alu bpf: Use correct permission flag for mixed signed bounds arithmetic ch_ktls: do not send snd_una update to TCB in middle ch_ktls: tcb close causes tls connection failure ch_ktls: fix device connection close ch_ktls: Fix kernel panic i40e: fix the panic when running bpf in xdpdrv mode net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta net/mlx5e: Fix setting of RS FEC mode net/mlx5: Fix setting of devlink traps in switchdev mode Revert "net: stmmac: re-init rx buffers when mac resume back" ...
2 parents bdfd99e + f2764bd commit 88a5af9

File tree

53 files changed

+479
-439
lines changed

Some content is hidden

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

53 files changed

+479
-439
lines changed

Documentation/networking/ip-sysctl.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,21 +1849,6 @@ ip6frag_low_thresh - INTEGER
18491849
ip6frag_time - INTEGER
18501850
Time in seconds to keep an IPv6 fragment in memory.
18511851

1852-
IPv6 Segment Routing:
1853-
1854-
seg6_flowlabel - INTEGER
1855-
Controls the behaviour of computing the flowlabel of outer
1856-
IPv6 header in case of SR T.encaps
1857-
1858-
== =======================================================
1859-
-1 set flowlabel to zero.
1860-
0 copy flowlabel from Inner packet in case of Inner IPv6
1861-
(Set flowlabel to 0 in case IPv4/L2)
1862-
1 Compute the flowlabel using seg6_make_flowlabel()
1863-
== =======================================================
1864-
1865-
Default is 0.
1866-
18671852
``conf/default/*``:
18681853
Change the interface-specific default settings.
18691854

Documentation/networking/seg6-sysctl.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@ seg6_require_hmac - INTEGER
2424
* 1 - Drop SR packets without HMAC, validate SR packets with HMAC
2525

2626
Default is 0.
27+
28+
seg6_flowlabel - INTEGER
29+
Controls the behaviour of computing the flowlabel of outer
30+
IPv6 header in case of SR T.encaps
31+
32+
== =======================================================
33+
-1 set flowlabel to zero.
34+
0 copy flowlabel from Inner packet in case of Inner IPv6
35+
(Set flowlabel to 0 in case IPv4/L2)
36+
1 Compute the flowlabel using seg6_make_flowlabel()
37+
== =======================================================
38+
39+
Default is 0.

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7096,7 +7096,7 @@ S: Maintained
70967096
F: drivers/i2c/busses/i2c-cpm.c
70977097

70987098
FREESCALE IMX / MXC FEC DRIVER
7099-
M: Fugang Duan <fugang.duan@nxp.com>
7099+
M: Joakim Zhang <qiangqing.zhang@nxp.com>
71007100
L: netdev@vger.kernel.org
71017101
S: Maintained
71027102
F: Documentation/devicetree/bindings/net/fsl-fec.txt
@@ -8524,9 +8524,9 @@ F: drivers/pci/hotplug/rpaphp*
85248524

85258525
IBM Power SRIOV Virtual NIC Device Driver
85268526
M: Dany Madden <drt@linux.ibm.com>
8527-
M: Lijun Pan <ljp@linux.ibm.com>
85288527
M: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
85298528
R: Thomas Falcon <tlfalcon@linux.ibm.com>
8529+
R: Lijun Pan <lijunp213@gmail.com>
85308530
L: netdev@vger.kernel.org
85318531
S: Supported
85328532
F: drivers/net/ethernet/ibm/ibmvnic.*

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,10 +3026,17 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
30263026
return err;
30273027
}
30283028

3029+
/* prod_id for switch families which do not have a PHY model number */
3030+
static const u16 family_prod_id_table[] = {
3031+
[MV88E6XXX_FAMILY_6341] = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
3032+
[MV88E6XXX_FAMILY_6390] = MV88E6XXX_PORT_SWITCH_ID_PROD_6390,
3033+
};
3034+
30293035
static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
30303036
{
30313037
struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv;
30323038
struct mv88e6xxx_chip *chip = mdio_bus->chip;
3039+
u16 prod_id;
30333040
u16 val;
30343041
int err;
30353042

@@ -3040,23 +3047,12 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
30403047
err = chip->info->ops->phy_read(chip, bus, phy, reg, &val);
30413048
mv88e6xxx_reg_unlock(chip);
30423049

3043-
if (reg == MII_PHYSID2) {
3044-
/* Some internal PHYs don't have a model number. */
3045-
if (chip->info->family != MV88E6XXX_FAMILY_6165)
3046-
/* Then there is the 6165 family. It gets is
3047-
* PHYs correct. But it can also have two
3048-
* SERDES interfaces in the PHY address
3049-
* space. And these don't have a model
3050-
* number. But they are not PHYs, so we don't
3051-
* want to give them something a PHY driver
3052-
* will recognise.
3053-
*
3054-
* Use the mv88e6390 family model number
3055-
* instead, for anything which really could be
3056-
* a PHY,
3057-
*/
3058-
if (!(val & 0x3f0))
3059-
val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
3050+
/* Some internal PHYs don't have a model number. */
3051+
if (reg == MII_PHYSID2 && !(val & 0x3f0) &&
3052+
chip->info->family < ARRAY_SIZE(family_prod_id_table)) {
3053+
prod_id = family_prod_id_table[chip->info->family];
3054+
if (prod_id)
3055+
val |= prod_id >> 4;
30603056
}
30613057

30623058
return err ? err : val;

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3918,6 +3918,7 @@ static int macb_init(struct platform_device *pdev)
39183918
reg = gem_readl(bp, DCFG8);
39193919
bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3),
39203920
GEM_BFEXT(T2SCR, reg));
3921+
INIT_LIST_HEAD(&bp->rx_fs_list.list);
39213922
if (bp->max_tuples > 0) {
39223923
/* also needs one ethtype match to check IPv4 */
39233924
if (GEM_BFEXT(SCR2ETH, reg) > 0) {
@@ -3928,7 +3929,6 @@ static int macb_init(struct platform_device *pdev)
39283929
/* Filtering is supported in hw but don't enable it in kernel now */
39293930
dev->hw_features |= NETIF_F_NTUPLE;
39303931
/* init Rx flow definitions */
3931-
INIT_LIST_HEAD(&bp->rx_fs_list.list);
39323932
bp->rx_fs_list.count = 0;
39333933
spin_lock_init(&bp->rx_fs_lock);
39343934
} else

drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
| CN6XXX_INTR_M0UNWI_ERR \
413413
| CN6XXX_INTR_M1UPB0_ERR \
414414
| CN6XXX_INTR_M1UPWI_ERR \
415-
| CN6XXX_INTR_M1UPB0_ERR \
415+
| CN6XXX_INTR_M1UNB0_ERR \
416416
| CN6XXX_INTR_M1UNWI_ERR \
417417
| CN6XXX_INTR_INSTR_DB_OF_ERR \
418418
| CN6XXX_INTR_SLIST_DB_OF_ERR \

drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c

Lines changed: 11 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,6 @@ static int chcr_set_tcb_field(struct chcr_ktls_info *tx_info, u16 word,
349349
return cxgb4_ofld_send(tx_info->netdev, skb);
350350
}
351351

352-
/*
353-
* chcr_ktls_mark_tcb_close: mark tcb state to CLOSE
354-
* @tx_info - driver specific tls info.
355-
* return: NET_TX_OK/NET_XMIT_DROP.
356-
*/
357-
static int chcr_ktls_mark_tcb_close(struct chcr_ktls_info *tx_info)
358-
{
359-
return chcr_set_tcb_field(tx_info, TCB_T_STATE_W,
360-
TCB_T_STATE_V(TCB_T_STATE_M),
361-
CHCR_TCB_STATE_CLOSED, 1);
362-
}
363-
364352
/*
365353
* chcr_ktls_dev_del: call back for tls_dev_del.
366354
* Remove the tid and l2t entry and close the connection.
@@ -395,8 +383,6 @@ static void chcr_ktls_dev_del(struct net_device *netdev,
395383

396384
/* clear tid */
397385
if (tx_info->tid != -1) {
398-
/* clear tcb state and then release tid */
399-
chcr_ktls_mark_tcb_close(tx_info);
400386
cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan,
401387
tx_info->tid, tx_info->ip_family);
402388
}
@@ -574,7 +560,6 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk,
574560
return 0;
575561

576562
free_tid:
577-
chcr_ktls_mark_tcb_close(tx_info);
578563
#if IS_ENABLED(CONFIG_IPV6)
579564
/* clear clip entry */
580565
if (tx_info->ip_family == AF_INET6)
@@ -672,10 +657,6 @@ static int chcr_ktls_cpl_act_open_rpl(struct adapter *adap,
672657
if (tx_info->pending_close) {
673658
spin_unlock(&tx_info->lock);
674659
if (!status) {
675-
/* it's a late success, tcb status is established,
676-
* mark it close.
677-
*/
678-
chcr_ktls_mark_tcb_close(tx_info);
679660
cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan,
680661
tid, tx_info->ip_family);
681662
}
@@ -1663,54 +1644,6 @@ static void chcr_ktls_copy_record_in_skb(struct sk_buff *nskb,
16631644
refcount_add(nskb->truesize, &nskb->sk->sk_wmem_alloc);
16641645
}
16651646

1666-
/*
1667-
* chcr_ktls_update_snd_una: Reset the SEND_UNA. It will be done to avoid
1668-
* sending the same segment again. It will discard the segment which is before
1669-
* the current tx max.
1670-
* @tx_info - driver specific tls info.
1671-
* @q - TX queue.
1672-
* return: NET_TX_OK/NET_XMIT_DROP.
1673-
*/
1674-
static int chcr_ktls_update_snd_una(struct chcr_ktls_info *tx_info,
1675-
struct sge_eth_txq *q)
1676-
{
1677-
struct fw_ulptx_wr *wr;
1678-
unsigned int ndesc;
1679-
int credits;
1680-
void *pos;
1681-
u32 len;
1682-
1683-
len = sizeof(*wr) + roundup(CHCR_SET_TCB_FIELD_LEN, 16);
1684-
ndesc = DIV_ROUND_UP(len, 64);
1685-
1686-
credits = chcr_txq_avail(&q->q) - ndesc;
1687-
if (unlikely(credits < 0)) {
1688-
chcr_eth_txq_stop(q);
1689-
return NETDEV_TX_BUSY;
1690-
}
1691-
1692-
pos = &q->q.desc[q->q.pidx];
1693-
1694-
wr = pos;
1695-
/* ULPTX wr */
1696-
wr->op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR));
1697-
wr->cookie = 0;
1698-
/* fill len in wr field */
1699-
wr->flowid_len16 = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(len, 16)));
1700-
1701-
pos += sizeof(*wr);
1702-
1703-
pos = chcr_write_cpl_set_tcb_ulp(tx_info, q, tx_info->tid, pos,
1704-
TCB_SND_UNA_RAW_W,
1705-
TCB_SND_UNA_RAW_V(TCB_SND_UNA_RAW_M),
1706-
TCB_SND_UNA_RAW_V(0), 0);
1707-
1708-
chcr_txq_advance(&q->q, ndesc);
1709-
cxgb4_ring_tx_db(tx_info->adap, &q->q, ndesc);
1710-
1711-
return 0;
1712-
}
1713-
17141647
/*
17151648
* chcr_end_part_handler: This handler will handle the record which
17161649
* is complete or if record's end part is received. T6 adapter has a issue that
@@ -1735,7 +1668,9 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17351668
struct sge_eth_txq *q, u32 skb_offset,
17361669
u32 tls_end_offset, bool last_wr)
17371670
{
1671+
bool free_skb_if_tx_fails = false;
17381672
struct sk_buff *nskb = NULL;
1673+
17391674
/* check if it is a complete record */
17401675
if (tls_end_offset == record->len) {
17411676
nskb = skb;
@@ -1758,6 +1693,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17581693

17591694
if (last_wr)
17601695
dev_kfree_skb_any(skb);
1696+
else
1697+
free_skb_if_tx_fails = true;
17611698

17621699
last_wr = true;
17631700

@@ -1769,6 +1706,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17691706
record->num_frags,
17701707
(last_wr && tcp_push_no_fin),
17711708
mss)) {
1709+
if (free_skb_if_tx_fails)
1710+
dev_kfree_skb_any(skb);
17721711
goto out;
17731712
}
17741713
tx_info->prev_seq = record->end_seq;
@@ -1905,11 +1844,6 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info,
19051844
/* reset tcp_seq as per the prior_data_required len */
19061845
tcp_seq -= prior_data_len;
19071846
}
1908-
/* reset snd una, so the middle record won't send the already
1909-
* sent part.
1910-
*/
1911-
if (chcr_ktls_update_snd_una(tx_info, q))
1912-
goto out;
19131847
atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts);
19141848
} else {
19151849
atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts);
@@ -2010,12 +1944,11 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
20101944
* we will send the complete record again.
20111945
*/
20121946

1947+
spin_lock_irqsave(&tx_ctx->base.lock, flags);
1948+
20131949
do {
2014-
int i;
20151950

20161951
cxgb4_reclaim_completed_tx(adap, &q->q, true);
2017-
/* lock taken */
2018-
spin_lock_irqsave(&tx_ctx->base.lock, flags);
20191952
/* fetch the tls record */
20201953
record = tls_get_record(&tx_ctx->base, tcp_seq,
20211954
&tx_info->record_no);
@@ -2074,11 +2007,11 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
20742007
tls_end_offset, skb_offset,
20752008
0);
20762009

2077-
spin_unlock_irqrestore(&tx_ctx->base.lock, flags);
20782010
if (ret) {
20792011
/* free the refcount taken earlier */
20802012
if (tls_end_offset < data_len)
20812013
dev_kfree_skb_any(skb);
2014+
spin_unlock_irqrestore(&tx_ctx->base.lock, flags);
20822015
goto out;
20832016
}
20842017

@@ -2088,16 +2021,6 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
20882021
continue;
20892022
}
20902023

2091-
/* increase page reference count of the record, so that there
2092-
* won't be any chance of page free in middle if in case stack
2093-
* receives ACK and try to delete the record.
2094-
*/
2095-
for (i = 0; i < record->num_frags; i++)
2096-
__skb_frag_ref(&record->frags[i]);
2097-
/* lock cleared */
2098-
spin_unlock_irqrestore(&tx_ctx->base.lock, flags);
2099-
2100-
21012024
/* if a tls record is finishing in this SKB */
21022025
if (tls_end_offset <= data_len) {
21032026
ret = chcr_end_part_handler(tx_info, skb, record,
@@ -2122,13 +2045,9 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
21222045
data_len = 0;
21232046
}
21242047

2125-
/* clear the frag ref count which increased locally before */
2126-
for (i = 0; i < record->num_frags; i++) {
2127-
/* clear the frag ref count */
2128-
__skb_frag_unref(&record->frags[i]);
2129-
}
21302048
/* if any failure, come out from the loop. */
21312049
if (ret) {
2050+
spin_unlock_irqrestore(&tx_ctx->base.lock, flags);
21322051
if (th->fin)
21332052
dev_kfree_skb_any(skb);
21342053

@@ -2143,6 +2062,7 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev)
21432062

21442063
} while (data_len > 0);
21452064

2065+
spin_unlock_irqrestore(&tx_ctx->base.lock, flags);
21462066
atomic64_inc(&port_stats->ktls_tx_encrypted_packets);
21472067
atomic64_add(skb_data_len, &port_stats->ktls_tx_encrypted_bytes);
21482068

drivers/net/ethernet/davicom/dm9000.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,8 +1471,10 @@ dm9000_probe(struct platform_device *pdev)
14711471

14721472
/* Init network device */
14731473
ndev = alloc_etherdev(sizeof(struct board_info));
1474-
if (!ndev)
1475-
return -ENOMEM;
1474+
if (!ndev) {
1475+
ret = -ENOMEM;
1476+
goto out_regulator_disable;
1477+
}
14761478

14771479
SET_NETDEV_DEV(ndev, &pdev->dev);
14781480

0 commit comments

Comments
 (0)