Skip to content

Commit 407c114

Browse files
committed
Merge tag 'net-6.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from can and xfrm. The TI regression notified last week is actually on our net-next tree, it does not affect 6.16. We are investigating a virtio regression which is quite hard to reproduce - currently only our CI sporadically hits it. Hopefully it should not be critical, and I'm not sure that an additional week would be enough to solve it. Current release - fix to a fix: - sched: sch_qfq: avoid sleeping in atomic context in qfq_delete_class Previous releases - regressions: - xfrm: - set transport header to fix UDP GRO handling - delete x->tunnel as we delete x - eth: - mlx5: fix memory leak in cmd_exec() - i40e: when removing VF MAC filters, avoid losing PF-set MAC - gve: fix stuck TX queue for DQ queue format Previous releases - always broken: - can: fix NULL pointer deref of struct can_priv::do_set_mode - eth: - ice: fix a null pointer dereference in ice_copy_and_init_pkg() - ism: fix concurrency management in ism_cmd() - dpaa2: fix device reference count leak in MAC endpoint handling - icssg-prueth: fix buffer allocation for ICSSG Misc: - selftests: mptcp: increase code coverage" * tag 'net-6.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (34 commits) net: hns3: default enable tx bounce buffer when smmu enabled net: hns3: fixed vf get max channels bug net: hns3: disable interrupt when ptp init failed net: hns3: fix concurrent setting vlan filter issue s390/ism: fix concurrency management in ism_cmd() selftests: drv-net: wait for iperf client to stop sending MAINTAINERS: Add in6.h to MAINTAINERS selftests: netfilter: tone-down conntrack clash test can: netlink: can_changelink(): fix NULL pointer deref of struct can_priv::do_set_mode net/sched: sch_qfq: Avoid triggering might_sleep in atomic context in qfq_delete_class gve: Fix stuck TX queue for DQ queue format net: appletalk: Fix use-after-free in AARP proxy probe net: bcmasp: Restore programming of TX map vector register selftests: mptcp: connect: also cover checksum selftests: mptcp: connect: also cover alt modes e1000e: ignore uninitialized checksum word on tgp e1000e: disregard NVM checksum on tgp when valid checksum bit is not set ice: Fix a null pointer dereference in ice_copy_and_init_pkg() i40e: When removing VF MAC filters, only check PF-set MAC i40e: report VF tx_dropped with tx_errors instead of tx_discards ...
2 parents 25fae0b + 291d5dc commit 407c114

Some content is hidden

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

47 files changed

+549
-306
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17383,6 +17383,7 @@ F: include/linux/ethtool.h
1738317383
F: include/linux/framer/framer-provider.h
1738417384
F: include/linux/framer/framer.h
1738517385
F: include/linux/in.h
17386+
F: include/linux/in6.h
1738617387
F: include/linux/indirect_call_wrapper.h
1738717388
F: include/linux/inet.h
1738817389
F: include/linux/inet_diag.h

drivers/bus/fsl-mc/fsl-mc-bus.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
943943
struct fsl_mc_obj_desc endpoint_desc = {{ 0 }};
944944
struct dprc_endpoint endpoint1 = {{ 0 }};
945945
struct dprc_endpoint endpoint2 = {{ 0 }};
946+
struct fsl_mc_bus *mc_bus;
946947
int state, err;
947948

948949
mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
@@ -966,24 +967,22 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
966967
strcpy(endpoint_desc.type, endpoint2.type);
967968
endpoint_desc.id = endpoint2.id;
968969
endpoint = fsl_mc_device_lookup(&endpoint_desc, mc_bus_dev);
970+
if (endpoint)
971+
return endpoint;
969972

970973
/*
971974
* We know that the device has an endpoint because we verified by
972975
* interrogating the firmware. This is the case when the device was not
973976
* yet discovered by the fsl-mc bus, thus the lookup returned NULL.
974977
* Force a rescan of the devices in this container and retry the lookup.
975978
*/
976-
if (!endpoint) {
977-
struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
978-
979-
if (mutex_trylock(&mc_bus->scan_mutex)) {
980-
err = dprc_scan_objects(mc_bus_dev, true);
981-
mutex_unlock(&mc_bus->scan_mutex);
982-
}
983-
984-
if (err < 0)
985-
return ERR_PTR(err);
979+
mc_bus = to_fsl_mc_bus(mc_bus_dev);
980+
if (mutex_trylock(&mc_bus->scan_mutex)) {
981+
err = dprc_scan_objects(mc_bus_dev, true);
982+
mutex_unlock(&mc_bus->scan_mutex);
986983
}
984+
if (err < 0)
985+
return ERR_PTR(err);
987986

988987
endpoint = fsl_mc_device_lookup(&endpoint_desc, mc_bus_dev);
989988
/*

drivers/net/can/dev/dev.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,16 @@ void can_change_state(struct net_device *dev, struct can_frame *cf,
145145
EXPORT_SYMBOL_GPL(can_change_state);
146146

147147
/* CAN device restart for bus-off recovery */
148-
static void can_restart(struct net_device *dev)
148+
static int can_restart(struct net_device *dev)
149149
{
150150
struct can_priv *priv = netdev_priv(dev);
151151
struct sk_buff *skb;
152152
struct can_frame *cf;
153153
int err;
154154

155+
if (!priv->do_set_mode)
156+
return -EOPNOTSUPP;
157+
155158
if (netif_carrier_ok(dev))
156159
netdev_err(dev, "Attempt to restart for bus-off recovery, but carrier is OK?\n");
157160

@@ -173,10 +176,14 @@ static void can_restart(struct net_device *dev)
173176
if (err) {
174177
netdev_err(dev, "Restart failed, error %pe\n", ERR_PTR(err));
175178
netif_carrier_off(dev);
179+
180+
return err;
176181
} else {
177182
netdev_dbg(dev, "Restarted\n");
178183
priv->can_stats.restarts++;
179184
}
185+
186+
return 0;
180187
}
181188

182189
static void can_restart_work(struct work_struct *work)
@@ -201,9 +208,8 @@ int can_restart_now(struct net_device *dev)
201208
return -EBUSY;
202209

203210
cancel_delayed_work_sync(&priv->restart_work);
204-
can_restart(dev);
205211

206-
return 0;
212+
return can_restart(dev);
207213
}
208214

209215
/* CAN bus-off

drivers/net/can/dev/netlink.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,25 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
285285
}
286286

287287
if (data[IFLA_CAN_RESTART_MS]) {
288+
if (!priv->do_set_mode) {
289+
NL_SET_ERR_MSG(extack,
290+
"Device doesn't support restart from Bus Off");
291+
return -EOPNOTSUPP;
292+
}
293+
288294
/* Do not allow changing restart delay while running */
289295
if (dev->flags & IFF_UP)
290296
return -EBUSY;
291297
priv->restart_ms = nla_get_u32(data[IFLA_CAN_RESTART_MS]);
292298
}
293299

294300
if (data[IFLA_CAN_RESTART]) {
301+
if (!priv->do_set_mode) {
302+
NL_SET_ERR_MSG(extack,
303+
"Device doesn't support restart from Bus Off");
304+
return -EOPNOTSUPP;
305+
}
306+
295307
/* Do not allow a restart while not running */
296308
if (!(dev->flags & IFF_UP))
297309
return -EINVAL;

drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,9 @@ static void bcmasp_init_tx(struct bcmasp_intf *intf)
818818
/* Tx SPB */
819819
tx_spb_ctrl_wl(intf, ((intf->channel + 8) << TX_SPB_CTRL_XF_BID_SHIFT),
820820
TX_SPB_CTRL_XF_CTRL2);
821+
822+
if (intf->parent->tx_chan_offset)
823+
tx_pause_ctrl_wl(intf, (1 << (intf->channel + 8)), TX_PAUSE_MAP_VECTOR);
821824
tx_spb_top_wl(intf, 0x1e, TX_SPB_TOP_BLKOUT);
822825

823826
tx_spb_dma_wq(intf, intf->tx_spb_dma_addr, TX_SPB_DMA_READ);

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4666,12 +4666,19 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
46664666
return PTR_ERR(dpmac_dev);
46674667
}
46684668

4669-
if (IS_ERR(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
4669+
if (IS_ERR(dpmac_dev))
46704670
return 0;
46714671

4672+
if (dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type) {
4673+
err = 0;
4674+
goto out_put_device;
4675+
}
4676+
46724677
mac = kzalloc(sizeof(struct dpaa2_mac), GFP_KERNEL);
4673-
if (!mac)
4674-
return -ENOMEM;
4678+
if (!mac) {
4679+
err = -ENOMEM;
4680+
goto out_put_device;
4681+
}
46754682

46764683
mac->mc_dev = dpmac_dev;
46774684
mac->mc_io = priv->mc_io;
@@ -4705,6 +4712,8 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
47054712
dpaa2_mac_close(mac);
47064713
err_free_mac:
47074714
kfree(mac);
4715+
out_put_device:
4716+
put_device(&dpmac_dev->dev);
47084717
return err;
47094718
}
47104719

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,12 +1448,19 @@ static int dpaa2_switch_port_connect_mac(struct ethsw_port_priv *port_priv)
14481448
if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER)
14491449
return PTR_ERR(dpmac_dev);
14501450

1451-
if (IS_ERR(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
1451+
if (IS_ERR(dpmac_dev))
14521452
return 0;
14531453

1454+
if (dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type) {
1455+
err = 0;
1456+
goto out_put_device;
1457+
}
1458+
14541459
mac = kzalloc(sizeof(*mac), GFP_KERNEL);
1455-
if (!mac)
1456-
return -ENOMEM;
1460+
if (!mac) {
1461+
err = -ENOMEM;
1462+
goto out_put_device;
1463+
}
14571464

14581465
mac->mc_dev = dpmac_dev;
14591466
mac->mc_io = port_priv->ethsw_data->mc_io;
@@ -1483,6 +1490,8 @@ static int dpaa2_switch_port_connect_mac(struct ethsw_port_priv *port_priv)
14831490
dpaa2_mac_close(mac);
14841491
err_free_mac:
14851492
kfree(mac);
1493+
out_put_device:
1494+
put_device(&dpmac_dev->dev);
14861495
return err;
14871496
}
14881497

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,49 +1917,56 @@ static void gve_turnup_and_check_status(struct gve_priv *priv)
19171917
gve_handle_link_status(priv, GVE_DEVICE_STATUS_LINK_STATUS_MASK & status);
19181918
}
19191919

1920-
static void gve_tx_timeout(struct net_device *dev, unsigned int txqueue)
1920+
static struct gve_notify_block *gve_get_tx_notify_block(struct gve_priv *priv,
1921+
unsigned int txqueue)
19211922
{
1922-
struct gve_notify_block *block;
1923-
struct gve_tx_ring *tx = NULL;
1924-
struct gve_priv *priv;
1925-
u32 last_nic_done;
1926-
u32 current_time;
19271923
u32 ntfy_idx;
19281924

1929-
netdev_info(dev, "Timeout on tx queue, %d", txqueue);
1930-
priv = netdev_priv(dev);
19311925
if (txqueue > priv->tx_cfg.num_queues)
1932-
goto reset;
1926+
return NULL;
19331927

19341928
ntfy_idx = gve_tx_idx_to_ntfy(priv, txqueue);
19351929
if (ntfy_idx >= priv->num_ntfy_blks)
1936-
goto reset;
1930+
return NULL;
1931+
1932+
return &priv->ntfy_blocks[ntfy_idx];
1933+
}
1934+
1935+
static bool gve_tx_timeout_try_q_kick(struct gve_priv *priv,
1936+
unsigned int txqueue)
1937+
{
1938+
struct gve_notify_block *block;
1939+
u32 current_time;
19371940

1938-
block = &priv->ntfy_blocks[ntfy_idx];
1939-
tx = block->tx;
1941+
block = gve_get_tx_notify_block(priv, txqueue);
1942+
1943+
if (!block)
1944+
return false;
19401945

19411946
current_time = jiffies_to_msecs(jiffies);
1942-
if (tx->last_kick_msec + MIN_TX_TIMEOUT_GAP > current_time)
1943-
goto reset;
1947+
if (block->tx->last_kick_msec + MIN_TX_TIMEOUT_GAP > current_time)
1948+
return false;
19441949

1945-
/* Check to see if there are missed completions, which will allow us to
1946-
* kick the queue.
1947-
*/
1948-
last_nic_done = gve_tx_load_event_counter(priv, tx);
1949-
if (last_nic_done - tx->done) {
1950-
netdev_info(dev, "Kicking queue %d", txqueue);
1951-
iowrite32be(GVE_IRQ_MASK, gve_irq_doorbell(priv, block));
1952-
napi_schedule(&block->napi);
1953-
tx->last_kick_msec = current_time;
1954-
goto out;
1955-
} // Else reset.
1950+
netdev_info(priv->dev, "Kicking queue %d", txqueue);
1951+
napi_schedule(&block->napi);
1952+
block->tx->last_kick_msec = current_time;
1953+
return true;
1954+
}
19561955

1957-
reset:
1958-
gve_schedule_reset(priv);
1956+
static void gve_tx_timeout(struct net_device *dev, unsigned int txqueue)
1957+
{
1958+
struct gve_notify_block *block;
1959+
struct gve_priv *priv;
19591960

1960-
out:
1961-
if (tx)
1962-
tx->queue_timeout++;
1961+
netdev_info(dev, "Timeout on tx queue, %d", txqueue);
1962+
priv = netdev_priv(dev);
1963+
1964+
if (!gve_tx_timeout_try_q_kick(priv, txqueue))
1965+
gve_schedule_reset(priv);
1966+
1967+
block = gve_get_tx_notify_block(priv, txqueue);
1968+
if (block)
1969+
block->tx->queue_timeout++;
19631970
priv->tx_timeo_cnt++;
19641971
}
19651972

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/irq.h>
1212
#include <linux/ip.h>
1313
#include <linux/ipv6.h>
14+
#include <linux/iommu.h>
1415
#include <linux/module.h>
1516
#include <linux/pci.h>
1617
#include <linux/skbuff.h>
@@ -1039,6 +1040,8 @@ static bool hns3_can_use_tx_sgl(struct hns3_enet_ring *ring,
10391040
static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
10401041
{
10411042
u32 alloc_size = ring->tqp->handle->kinfo.tx_spare_buf_size;
1043+
struct net_device *netdev = ring_to_netdev(ring);
1044+
struct hns3_nic_priv *priv = netdev_priv(netdev);
10421045
struct hns3_tx_spare *tx_spare;
10431046
struct page *page;
10441047
dma_addr_t dma;
@@ -1080,6 +1083,7 @@ static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
10801083
tx_spare->buf = page_address(page);
10811084
tx_spare->len = PAGE_SIZE << order;
10821085
ring->tx_spare = tx_spare;
1086+
ring->tx_copybreak = priv->tx_copybreak;
10831087
return;
10841088

10851089
dma_mapping_error:
@@ -4874,6 +4878,30 @@ static void hns3_nic_dealloc_vector_data(struct hns3_nic_priv *priv)
48744878
devm_kfree(&pdev->dev, priv->tqp_vector);
48754879
}
48764880

4881+
static void hns3_update_tx_spare_buf_config(struct hns3_nic_priv *priv)
4882+
{
4883+
#define HNS3_MIN_SPARE_BUF_SIZE (2 * 1024 * 1024)
4884+
#define HNS3_MAX_PACKET_SIZE (64 * 1024)
4885+
4886+
struct iommu_domain *domain = iommu_get_domain_for_dev(priv->dev);
4887+
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
4888+
struct hnae3_handle *handle = priv->ae_handle;
4889+
4890+
if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V3)
4891+
return;
4892+
4893+
if (!(domain && iommu_is_dma_domain(domain)))
4894+
return;
4895+
4896+
priv->min_tx_copybreak = HNS3_MAX_PACKET_SIZE;
4897+
priv->min_tx_spare_buf_size = HNS3_MIN_SPARE_BUF_SIZE;
4898+
4899+
if (priv->tx_copybreak < priv->min_tx_copybreak)
4900+
priv->tx_copybreak = priv->min_tx_copybreak;
4901+
if (handle->kinfo.tx_spare_buf_size < priv->min_tx_spare_buf_size)
4902+
handle->kinfo.tx_spare_buf_size = priv->min_tx_spare_buf_size;
4903+
}
4904+
48774905
static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv,
48784906
unsigned int ring_type)
48794907
{
@@ -5107,6 +5135,7 @@ int hns3_init_all_ring(struct hns3_nic_priv *priv)
51075135
int i, j;
51085136
int ret;
51095137

5138+
hns3_update_tx_spare_buf_config(priv);
51105139
for (i = 0; i < ring_num; i++) {
51115140
ret = hns3_alloc_ring_memory(&priv->ring[i]);
51125141
if (ret) {
@@ -5311,6 +5340,8 @@ static int hns3_client_init(struct hnae3_handle *handle)
53115340
priv->ae_handle = handle;
53125341
priv->tx_timeout_count = 0;
53135342
priv->max_non_tso_bd_num = ae_dev->dev_specs.max_non_tso_bd_num;
5343+
priv->min_tx_copybreak = 0;
5344+
priv->min_tx_spare_buf_size = 0;
53145345
set_bit(HNS3_NIC_STATE_DOWN, &priv->state);
53155346

53165347
handle->msg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);

drivers/net/ethernet/hisilicon/hns3/hns3_enet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,8 @@ struct hns3_nic_priv {
596596
struct hns3_enet_coalesce rx_coal;
597597
u32 tx_copybreak;
598598
u32 rx_copybreak;
599+
u32 min_tx_copybreak;
600+
u32 min_tx_spare_buf_size;
599601
};
600602

601603
union l3_hdr_info {

0 commit comments

Comments
 (0)