Skip to content

Commit 6346713

Browse files
committed
Merge tag 'net-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from Netfilter and IPsec. Current release - regressions: - netfilter: nft_set_pipapo: - don't return bogus extension pointer - fix null deref for empty set Current release - new code bugs: - core: prevent deadlocks when enabling NAPIs with mixed kthread config - eth: netdevsim: Fix wild pointer access in nsim_queue_free(). Previous releases - regressions: - page_pool: allow enabling recycling late, fix false positive warning - sched: ets: use old 'nbands' while purging unused classes - xfrm: - restore GSO for SW crypto - bring back device check in validate_xmit_xfrm - tls: handle data disappearing from under the TLS ULP - ptp: prevent possible ABBA deadlock in ptp_clock_freerun() - eth: - bnxt: fill data page pool with frags if PAGE_SIZE > BNXT_RX_PAGE_SIZE - hv_netvsc: fix panic during namespace deletion with VF Previous releases - always broken: - netfilter: fix refcount leak on table dump - vsock: do not allow binding to VMADDR_PORT_ANY - sctp: linearize cloned gso packets in sctp_rcv - eth: - hibmcge: fix the division by zero issue - microchip: fix KSZ8863 reset problem" * tag 'net-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits) net: usb: asix_devices: add phy_mask for ax88772 mdio bus net: kcm: Fix race condition in kcm_unattach() selftests: net/forwarding: test purge of active DWRR classes net/sched: ets: use old 'nbands' while purging unused classes bnxt: fill data page pool with frags if PAGE_SIZE > BNXT_RX_PAGE_SIZE netdevsim: Fix wild pointer access in nsim_queue_free(). net: mctp: Fix bad kfree_skb in bind lookup test netfilter: nf_tables: reject duplicate device on updates ipvs: Fix estimator kthreads preferred affinity netfilter: nft_set_pipapo: fix null deref for empty set selftests: tls: test TCP stealing data from under the TLS socket tls: handle data disappearing from under the TLS ULP ptp: prevent possible ABBA deadlock in ptp_clock_freerun() ixgbe: prevent from unwanted interface name changes devlink: let driver opt out of automatic phys_port_name generation net: prevent deadlocks when enabling NAPIs with mixed kthread config net: update NAPI threaded config even for disabled NAPIs selftests: drv-net: don't assume device has only 2 queues docs: Fix name for net.ipv4.udp_child_hash_entries riscv: dts: thead: Add APB clocks for TH1520 GMACs ...
2 parents 0cc5352 + 4faff70 commit 6346713

File tree

65 files changed

+429
-157
lines changed

Some content is hidden

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

65 files changed

+429
-157
lines changed

Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ properties:
6262
items:
6363
- description: GMAC main clock
6464
- description: Peripheral registers interface clock
65+
- description: APB glue registers interface clock
6566

6667
clock-names:
6768
items:
6869
- const: stmmaceth
6970
- const: pclk
71+
- const: apb
7072

7173
interrupts:
7274
items:
@@ -88,8 +90,8 @@ examples:
8890
compatible = "thead,th1520-gmac", "snps,dwmac-3.70a";
8991
reg = <0xe7070000 0x2000>, <0xec003000 0x1000>;
9092
reg-names = "dwmac", "apb";
91-
clocks = <&clk 1>, <&clk 2>;
92-
clock-names = "stmmaceth", "pclk";
93+
clocks = <&clk 1>, <&clk 2>, <&clk 3>;
94+
clock-names = "stmmaceth", "pclk", "apb";
9395
interrupts = <66>;
9496
interrupt-names = "macirq";
9597
phy-mode = "rgmii-id";

Documentation/networking/ip-sysctl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ udp_hash_entries - INTEGER
14201420
A negative value means the networking namespace does not own its
14211421
hash buckets and shares the initial networking namespace's one.
14221422

1423-
udp_child_ehash_entries - INTEGER
1423+
udp_child_hash_entries - INTEGER
14241424
Control the number of hash buckets for UDP sockets in the child
14251425
networking namespace, which must be set before clone() or unshare().
14261426

MAINTAINERS

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12584,10 +12584,9 @@ S: Supported
1258412584
F: drivers/cpufreq/intel_pstate.c
1258512585

1258612586
INTEL PTP DFL ToD DRIVER
12587-
M: Tianfei Zhang <[email protected]>
1258812587
1258912588
12590-
S: Maintained
12589+
S: Orphan
1259112590
F: drivers/ptp/ptp_dfl_tod.c
1259212591

1259312592
INTEL QUADRATURE ENCODER PERIPHERAL DRIVER
@@ -12725,9 +12724,8 @@ S: Maintained
1272512724
F: drivers/platform/x86/intel/wmi/thunderbolt.c
1272612725

1272712726
INTEL WWAN IOSM DRIVER
12728-
M: M Chetan Kumar <[email protected]>
1272912727
12730-
S: Maintained
12728+
S: Orphan
1273112729
F: drivers/net/wwan/iosm/
1273212730

1273312731
INTEL(R) FLEXIBLE RETURN AND EVENT DELIVERY
@@ -15674,7 +15672,6 @@ MEDIATEK T7XX 5G WWAN MODEM DRIVER
1567415672
M: Chandrashekar Devegowda <[email protected]>
1567515673
R: Chiranjeevi Rapolu <[email protected]>
1567615674
R: Liu Haijun <[email protected]>
15677-
R: M Chetan Kumar <[email protected]>
1567815675
R: Ricardo Martinez <[email protected]>
1567915676
1568015677
S: Supported
@@ -17451,6 +17448,7 @@ F: drivers/net/ethernet/neterion/
1745117448
NETFILTER
1745217449
M: Pablo Neira Ayuso <[email protected]>
1745317450
M: Jozsef Kadlecsik <[email protected]>
17451+
M: Florian Westphal <[email protected]>
1745417452
1745517453
1745617454
S: Maintained

arch/riscv/boot/dts/thead/th1520.dtsi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@
297297
reg-names = "dwmac", "apb";
298298
interrupts = <67 IRQ_TYPE_LEVEL_HIGH>;
299299
interrupt-names = "macirq";
300-
clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>;
301-
clock-names = "stmmaceth", "pclk";
300+
clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>,
301+
<&clk CLK_PERISYS_APB4_HCLK>;
302+
clock-names = "stmmaceth", "pclk", "apb";
302303
snps,pbl = <32>;
303304
snps,fixed-burst;
304305
snps,multicast-filter-bins = <64>;
@@ -319,8 +320,9 @@
319320
reg-names = "dwmac", "apb";
320321
interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
321322
interrupt-names = "macirq";
322-
clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>;
323-
clock-names = "stmmaceth", "pclk";
323+
clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>,
324+
<&clk CLK_PERISYS_APB4_HCLK>;
325+
clock-names = "stmmaceth", "pclk", "apb";
324326
snps,pbl = <32>;
325327
snps,fixed-burst;
326328
snps,multicast-filter-bins = <64>;

drivers/net/dsa/microchip/ksz8.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@
3636

3737
static void ksz_cfg(struct ksz_device *dev, u32 addr, u8 bits, bool set)
3838
{
39-
regmap_update_bits(ksz_regmap_8(dev), addr, bits, set ? bits : 0);
39+
ksz_rmw8(dev, addr, bits, set ? bits : 0);
4040
}
4141

4242
static void ksz_port_cfg(struct ksz_device *dev, int port, int offset, u8 bits,
4343
bool set)
4444
{
45-
regmap_update_bits(ksz_regmap_8(dev),
46-
dev->dev_ops->get_port_addr(port, offset),
47-
bits, set ? bits : 0);
45+
ksz_rmw8(dev, dev->dev_ops->get_port_addr(port, offset), bits,
46+
set ? bits : 0);
4847
}
4948

5049
/**
@@ -1955,16 +1954,19 @@ int ksz8_setup(struct dsa_switch *ds)
19551954
ksz_cfg(dev, S_LINK_AGING_CTRL, SW_LINK_AUTO_AGING, true);
19561955

19571956
/* Enable aggressive back off algorithm in half duplex mode. */
1958-
regmap_update_bits(ksz_regmap_8(dev), REG_SW_CTRL_1,
1959-
SW_AGGR_BACKOFF, SW_AGGR_BACKOFF);
1957+
ret = ksz_rmw8(dev, REG_SW_CTRL_1, SW_AGGR_BACKOFF, SW_AGGR_BACKOFF);
1958+
if (ret)
1959+
return ret;
19601960

19611961
/*
19621962
* Make sure unicast VLAN boundary is set as default and
19631963
* enable no excessive collision drop.
19641964
*/
1965-
regmap_update_bits(ksz_regmap_8(dev), REG_SW_CTRL_2,
1966-
UNICAST_VLAN_BOUNDARY | NO_EXC_COLLISION_DROP,
1967-
UNICAST_VLAN_BOUNDARY | NO_EXC_COLLISION_DROP);
1965+
ret = ksz_rmw8(dev, REG_SW_CTRL_2,
1966+
UNICAST_VLAN_BOUNDARY | NO_EXC_COLLISION_DROP,
1967+
UNICAST_VLAN_BOUNDARY | NO_EXC_COLLISION_DROP);
1968+
if (ret)
1969+
return ret;
19681970

19691971
ksz_cfg(dev, S_REPLACE_VID_CTRL, SW_REPLACE_VID, false);
19701972

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ static const struct regmap_range ksz8873_valid_regs[] = {
14471447
regmap_reg_range(0x3f, 0x3f),
14481448

14491449
/* advanced control registers */
1450+
regmap_reg_range(0x43, 0x43),
14501451
regmap_reg_range(0x60, 0x6f),
14511452
regmap_reg_range(0x70, 0x75),
14521453
regmap_reg_range(0x76, 0x78),

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,15 +926,21 @@ static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping,
926926

927927
static netmem_ref __bnxt_alloc_rx_netmem(struct bnxt *bp, dma_addr_t *mapping,
928928
struct bnxt_rx_ring_info *rxr,
929+
unsigned int *offset,
929930
gfp_t gfp)
930931
{
931932
netmem_ref netmem;
932933

933-
netmem = page_pool_alloc_netmems(rxr->page_pool, gfp);
934+
if (PAGE_SIZE > BNXT_RX_PAGE_SIZE) {
935+
netmem = page_pool_alloc_frag_netmem(rxr->page_pool, offset, BNXT_RX_PAGE_SIZE, gfp);
936+
} else {
937+
netmem = page_pool_alloc_netmems(rxr->page_pool, gfp);
938+
*offset = 0;
939+
}
934940
if (!netmem)
935941
return 0;
936942

937-
*mapping = page_pool_get_dma_addr_netmem(netmem);
943+
*mapping = page_pool_get_dma_addr_netmem(netmem) + *offset;
938944
return netmem;
939945
}
940946

@@ -1029,7 +1035,7 @@ static int bnxt_alloc_rx_netmem(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
10291035
dma_addr_t mapping;
10301036
netmem_ref netmem;
10311037

1032-
netmem = __bnxt_alloc_rx_netmem(bp, &mapping, rxr, gfp);
1038+
netmem = __bnxt_alloc_rx_netmem(bp, &mapping, rxr, &offset, gfp);
10331039
if (!netmem)
10341040
return -ENOMEM;
10351041

@@ -3819,7 +3825,6 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
38193825
if (BNXT_RX_PAGE_MODE(bp))
38203826
pp.pool_size += bp->rx_ring_size / rx_size_fac;
38213827
pp.nid = numa_node;
3822-
pp.napi = &rxr->bnapi->napi;
38233828
pp.netdev = bp->dev;
38243829
pp.dev = &bp->pdev->dev;
38253830
pp.dma_dir = bp->rx_dir;
@@ -3851,6 +3856,12 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
38513856
return PTR_ERR(pool);
38523857
}
38533858

3859+
static void bnxt_enable_rx_page_pool(struct bnxt_rx_ring_info *rxr)
3860+
{
3861+
page_pool_enable_direct_recycling(rxr->head_pool, &rxr->bnapi->napi);
3862+
page_pool_enable_direct_recycling(rxr->page_pool, &rxr->bnapi->napi);
3863+
}
3864+
38543865
static int bnxt_alloc_rx_agg_bmap(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
38553866
{
38563867
u16 mem_size;
@@ -3889,6 +3900,7 @@ static int bnxt_alloc_rx_rings(struct bnxt *bp)
38893900
rc = bnxt_alloc_rx_page_pool(bp, rxr, cpu_node);
38903901
if (rc)
38913902
return rc;
3903+
bnxt_enable_rx_page_pool(rxr);
38923904

38933905
rc = xdp_rxq_info_reg(&rxr->xdp_rxq, bp->dev, i, 0);
38943906
if (rc < 0)
@@ -16031,6 +16043,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1603116043
goto err_reset;
1603216044
}
1603316045

16046+
bnxt_enable_rx_page_pool(rxr);
1603416047
napi_enable_locked(&bnapi->napi);
1603516048
bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons);
1603616049

drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ static int hbg_reset_prepare(struct hbg_priv *priv, enum hbg_reset_type type)
5353
{
5454
int ret;
5555

56-
ASSERT_RTNL();
56+
if (test_and_set_bit(HBG_NIC_STATE_RESETTING, &priv->state))
57+
return -EBUSY;
5758

5859
if (netif_running(priv->netdev)) {
60+
clear_bit(HBG_NIC_STATE_RESETTING, &priv->state);
5961
dev_warn(&priv->pdev->dev,
6062
"failed to reset because port is up\n");
6163
return -EBUSY;
@@ -64,7 +66,6 @@ static int hbg_reset_prepare(struct hbg_priv *priv, enum hbg_reset_type type)
6466
netif_device_detach(priv->netdev);
6567

6668
priv->reset_type = type;
67-
set_bit(HBG_NIC_STATE_RESETTING, &priv->state);
6869
clear_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state);
6970
ret = hbg_hw_event_notify(priv, HBG_HW_EVENT_RESET);
7071
if (ret) {
@@ -84,29 +85,26 @@ static int hbg_reset_done(struct hbg_priv *priv, enum hbg_reset_type type)
8485
type != priv->reset_type)
8586
return 0;
8687

87-
ASSERT_RTNL();
88-
89-
clear_bit(HBG_NIC_STATE_RESETTING, &priv->state);
9088
ret = hbg_rebuild(priv);
9189
if (ret) {
9290
priv->stats.reset_fail_cnt++;
9391
set_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state);
92+
clear_bit(HBG_NIC_STATE_RESETTING, &priv->state);
9493
dev_err(&priv->pdev->dev, "failed to rebuild after reset\n");
9594
return ret;
9695
}
9796

9897
netif_device_attach(priv->netdev);
98+
clear_bit(HBG_NIC_STATE_RESETTING, &priv->state);
9999

100100
dev_info(&priv->pdev->dev, "reset done\n");
101101
return ret;
102102
}
103103

104-
/* must be protected by rtnl lock */
105104
int hbg_reset(struct hbg_priv *priv)
106105
{
107106
int ret;
108107

109-
ASSERT_RTNL();
110108
ret = hbg_reset_prepare(priv, HBG_RESET_TYPE_FUNCTION);
111109
if (ret)
112110
return ret;
@@ -171,7 +169,6 @@ static void hbg_pci_err_reset_prepare(struct pci_dev *pdev)
171169
struct net_device *netdev = pci_get_drvdata(pdev);
172170
struct hbg_priv *priv = netdev_priv(netdev);
173171

174-
rtnl_lock();
175172
hbg_reset_prepare(priv, HBG_RESET_TYPE_FLR);
176173
}
177174

@@ -181,7 +178,6 @@ static void hbg_pci_err_reset_done(struct pci_dev *pdev)
181178
struct hbg_priv *priv = netdev_priv(netdev);
182179

183180
hbg_reset_done(priv, HBG_RESET_TYPE_FLR);
184-
rtnl_unlock();
185181
}
186182

187183
static const struct pci_error_handlers hbg_pci_err_handler = {

drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#define HBG_HW_EVENT_WAIT_TIMEOUT_US (2 * 1000 * 1000)
1414
#define HBG_HW_EVENT_WAIT_INTERVAL_US (10 * 1000)
15+
#define HBG_MAC_LINK_WAIT_TIMEOUT_US (500 * 1000)
16+
#define HBG_MAC_LINK_WAIT_INTERVAL_US (5 * 1000)
1517
/* little endian or big endian.
1618
* ctrl means packet description, data means skb packet data
1719
*/
@@ -228,6 +230,9 @@ void hbg_hw_fill_buffer(struct hbg_priv *priv, u32 buffer_dma_addr)
228230

229231
void hbg_hw_adjust_link(struct hbg_priv *priv, u32 speed, u32 duplex)
230232
{
233+
u32 link_status;
234+
int ret;
235+
231236
hbg_hw_mac_enable(priv, HBG_STATUS_DISABLE);
232237

233238
hbg_reg_write_field(priv, HBG_REG_PORT_MODE_ADDR,
@@ -239,8 +244,14 @@ void hbg_hw_adjust_link(struct hbg_priv *priv, u32 speed, u32 duplex)
239244

240245
hbg_hw_mac_enable(priv, HBG_STATUS_ENABLE);
241246

242-
if (!hbg_reg_read_field(priv, HBG_REG_AN_NEG_STATE_ADDR,
243-
HBG_REG_AN_NEG_STATE_NP_LINK_OK_B))
247+
/* wait MAC link up */
248+
ret = readl_poll_timeout(priv->io_base + HBG_REG_AN_NEG_STATE_ADDR,
249+
link_status,
250+
FIELD_GET(HBG_REG_AN_NEG_STATE_NP_LINK_OK_B,
251+
link_status),
252+
HBG_MAC_LINK_WAIT_INTERVAL_US,
253+
HBG_MAC_LINK_WAIT_TIMEOUT_US);
254+
if (ret)
244255
hbg_np_link_fail_task_schedule(priv);
245256
}
246257

drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ static inline bool hbg_fifo_is_full(struct hbg_priv *priv, enum hbg_dir dir)
2929

3030
static inline u32 hbg_get_queue_used_num(struct hbg_ring *ring)
3131
{
32-
return (ring->ntu + ring->len - ring->ntc) % ring->len;
32+
u32 len = READ_ONCE(ring->len);
33+
34+
if (!len)
35+
return 0;
36+
37+
return (READ_ONCE(ring->ntu) + len - READ_ONCE(ring->ntc)) % len;
3338
}
3439

3540
netdev_tx_t hbg_net_start_xmit(struct sk_buff *skb, struct net_device *netdev);

0 commit comments

Comments
 (0)