Skip to content

Commit d0309c0

Browse files
committed
Merge tag 'net-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from Bluetooth and Wireless. No known outstanding regressions. Current release - regressions: - eth: - bonding: fix mii_status when slave is down - mlx5e: fix missing error assignment in mlx5e_xfrm_add_state() Previous releases - regressions: - sched: limit try_bulk_dequeue_skb() batches - ipv4: route: prevent rt_bind_exception() from rebinding stale fnhe - af_unix: initialise scc_index in unix_add_edge() - netpoll: fix incorrect refcount handling causing incorrect cleanup - bluetooth: don't hold spin lock over sleeping functions - hsr: Fix supervision frame sending on HSRv0 - sctp: prevent possible shift out-of-bounds - tipc: fix use-after-free in tipc_mon_reinit_self(). - dsa: tag_brcm: do not mark link local traffic as offloaded - eth: virtio-net: fix incorrect flags recording in big mode Previous releases - always broken: - sched: initialize struct tc_ife to fix kernel-infoleak - wifi: - mac80211: reject address change while connecting - iwlwifi: avoid toggling links due to wrong element use - bluetooth: cancel mesh send timer when hdev removed - strparser: fix signed/unsigned mismatch bug - handshake: fix memory leak in tls_handshake_accept() Misc: - selftests: mptcp: fix some flaky tests" * tag 'net-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (60 commits) hsr: Follow standard for HSRv0 supervision frames hsr: Fix supervision frame sending on HSRv0 virtio-net: fix incorrect flags recording in big mode ipv4: route: Prevent rt_bind_exception() from rebinding stale fnhe wifi: iwlwifi: mld: always take beacon ies in link grading wifi: iwlwifi: mvm: fix beacon template/fixed rate wifi: iwlwifi: fix aux ROC time event iterator usage net_sched: limit try_bulk_dequeue_skb() batches selftests: mptcp: join: properly kill background tasks selftests: mptcp: connect: trunc: read all recv data selftests: mptcp: join: userspace: longer transfer selftests: mptcp: join: endpoints: longer transfer selftests: mptcp: join: rm: set backup flag selftests: mptcp: connect: fix fallback note due to OoO ethtool: fix incorrect kernel-doc style comment in ethtool.h mlx5: Fix default values in create CQ Bluetooth: btrtl: Avoid loading the config file on security chips net/mlx5e: Fix potentially misleading debug message net/mlx5e: Fix wraparound in rate limiting for values above 255 Gbps net/mlx5e: Fix maxrate wraparound in threshold between units ...
2 parents 2ccec59 + 94909c5 commit d0309c0

65 files changed

Lines changed: 1202 additions & 312 deletions

File tree

Some content is hidden

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

Documentation/userspace-api/netlink/intro-specs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Simple CLI
1313
Kernel comes with a simple CLI tool which should be useful when
1414
developing Netlink related code. The tool is implemented in Python
1515
and can use a YAML specification to issue Netlink requests
16-
to the kernel. Only Generic Netlink is supported.
16+
to the kernel.
1717

1818
The tool is located at ``tools/net/ynl/pyynl/cli.py``. It accepts
19-
a handul of arguments, the most important ones are:
19+
a handful of arguments, the most important ones are:
2020

2121
- ``--spec`` - point to the spec file
2222
- ``--do $name`` / ``--dump $name`` - issue request ``$name``

drivers/bluetooth/btrtl.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
#define RTL_CHIP_SUBVER (&(struct rtl_vendor_cmd) {{0x10, 0x38, 0x04, 0x28, 0x80}})
5252
#define RTL_CHIP_REV (&(struct rtl_vendor_cmd) {{0x10, 0x3A, 0x04, 0x28, 0x80}})
53-
#define RTL_SEC_PROJ (&(struct rtl_vendor_cmd) {{0x10, 0xA4, 0x0D, 0x00, 0xb0}})
53+
#define RTL_SEC_PROJ (&(struct rtl_vendor_cmd) {{0x10, 0xA4, 0xAD, 0x00, 0xb0}})
5454

5555
#define RTL_PATCH_SNIPPETS 0x01
5656
#define RTL_PATCH_DUMMY_HEADER 0x02
@@ -534,7 +534,6 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
534534
{
535535
struct rtl_epatch_header_v2 *hdr;
536536
int rc;
537-
u8 reg_val[2];
538537
u8 key_id;
539538
u32 num_sections;
540539
struct rtl_section *section;
@@ -549,14 +548,7 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
549548
.len = btrtl_dev->fw_len - 7, /* Cut the tail */
550549
};
551550

552-
rc = btrtl_vendor_read_reg16(hdev, RTL_SEC_PROJ, reg_val);
553-
if (rc < 0)
554-
return -EIO;
555-
key_id = reg_val[0];
556-
557-
rtl_dev_dbg(hdev, "%s: key id %u", __func__, key_id);
558-
559-
btrtl_dev->key_id = key_id;
551+
key_id = btrtl_dev->key_id;
560552

561553
hdr = rtl_iov_pull_data(&iov, sizeof(*hdr));
562554
if (!hdr)
@@ -1070,6 +1062,8 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
10701062
u16 hci_rev, lmp_subver;
10711063
u8 hci_ver, lmp_ver, chip_type = 0;
10721064
int ret;
1065+
int rc;
1066+
u8 key_id;
10731067
u8 reg_val[2];
10741068

10751069
btrtl_dev = kzalloc(sizeof(*btrtl_dev), GFP_KERNEL);
@@ -1180,6 +1174,14 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
11801174
goto err_free;
11811175
}
11821176

1177+
rc = btrtl_vendor_read_reg16(hdev, RTL_SEC_PROJ, reg_val);
1178+
if (rc < 0)
1179+
goto err_free;
1180+
1181+
key_id = reg_val[0];
1182+
btrtl_dev->key_id = key_id;
1183+
rtl_dev_info(hdev, "%s: key id %u", __func__, key_id);
1184+
11831185
btrtl_dev->fw_len = -EIO;
11841186
if (lmp_subver == RTL_ROM_LMP_8852A && hci_rev == 0x000c) {
11851187
snprintf(fw_name, sizeof(fw_name), "%s_v2.bin",
@@ -1202,7 +1204,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
12021204
goto err_free;
12031205
}
12041206

1205-
if (btrtl_dev->ic_info->cfg_name) {
1207+
if (btrtl_dev->ic_info->cfg_name && !btrtl_dev->key_id) {
12061208
if (postfix) {
12071209
snprintf(cfg_name, sizeof(cfg_name), "%s-%s.bin",
12081210
btrtl_dev->ic_info->cfg_name, postfix);

drivers/bluetooth/btusb.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4361,6 +4361,11 @@ static void btusb_disconnect(struct usb_interface *intf)
43614361

43624362
hci_unregister_dev(hdev);
43634363

4364+
if (data->oob_wake_irq)
4365+
device_init_wakeup(&data->udev->dev, false);
4366+
if (data->reset_gpio)
4367+
gpiod_put(data->reset_gpio);
4368+
43644369
if (intf == data->intf) {
43654370
if (data->isoc)
43664371
usb_driver_release_interface(&btusb_driver, data->isoc);
@@ -4371,17 +4376,11 @@ static void btusb_disconnect(struct usb_interface *intf)
43714376
usb_driver_release_interface(&btusb_driver, data->diag);
43724377
usb_driver_release_interface(&btusb_driver, data->intf);
43734378
} else if (intf == data->diag) {
4374-
usb_driver_release_interface(&btusb_driver, data->intf);
43754379
if (data->isoc)
43764380
usb_driver_release_interface(&btusb_driver, data->isoc);
4381+
usb_driver_release_interface(&btusb_driver, data->intf);
43774382
}
43784383

4379-
if (data->oob_wake_irq)
4380-
device_init_wakeup(&data->udev->dev, false);
4381-
4382-
if (data->reset_gpio)
4383-
gpiod_put(data->reset_gpio);
4384-
43854384
hci_free_dev(hdev);
43864385
}
43874386

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,15 +1020,18 @@ int mlx5_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
10201020
if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
10211021
MLX5_SET(cqc, cqc, oi, 1);
10221022

1023+
if (udata) {
1024+
cq->mcq.comp = mlx5_add_cq_to_tasklet;
1025+
cq->mcq.tasklet_ctx.comp = mlx5_ib_cq_comp;
1026+
} else {
1027+
cq->mcq.comp = mlx5_ib_cq_comp;
1028+
}
1029+
10231030
err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen, out, sizeof(out));
10241031
if (err)
10251032
goto err_cqb;
10261033

10271034
mlx5_ib_dbg(dev, "cqn 0x%x\n", cq->mcq.cqn);
1028-
if (udata)
1029-
cq->mcq.tasklet_ctx.comp = mlx5_ib_cq_comp;
1030-
else
1031-
cq->mcq.comp = mlx5_ib_cq_comp;
10321035
cq->mcq.event = mlx5_ib_cq_event;
10331036

10341037
INIT_LIST_HEAD(&cq->wc_list);

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
21202120
/* check for initial state */
21212121
new_slave->link = BOND_LINK_NOCHANGE;
21222122
if (bond->params.miimon) {
2123-
if (netif_carrier_ok(slave_dev)) {
2123+
if (netif_running(slave_dev) && netif_carrier_ok(slave_dev)) {
21242124
if (bond->params.updelay) {
21252125
bond_set_slave_link_state(new_slave,
21262126
BOND_LINK_BACK,
@@ -2665,7 +2665,8 @@ static int bond_miimon_inspect(struct bonding *bond)
26652665
bond_for_each_slave_rcu(bond, slave, iter) {
26662666
bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
26672667

2668-
link_state = netif_carrier_ok(slave->dev);
2668+
link_state = netif_running(slave->dev) &&
2669+
netif_carrier_ok(slave->dev);
26692670

26702671
switch (slave->link) {
26712672
case BOND_LINK_UP:

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,8 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
18351835
ndev->stats.rx_packets++;
18361836
pkt_len = fec16_to_cpu(bdp->cbd_datlen);
18371837
ndev->stats.rx_bytes += pkt_len;
1838+
if (fep->quirks & FEC_QUIRK_HAS_RACC)
1839+
ndev->stats.rx_bytes -= 2;
18381840

18391841
index = fec_enet_get_bd_index(bdp, &rxq->bd);
18401842
page = rxq->rx_skb_info[index].page;

drivers/net/ethernet/mellanox/mlx5/core/cq.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void mlx5_cq_tasklet_cb(struct tasklet_struct *t)
6666
tasklet_schedule(&ctx->task);
6767
}
6868

69-
static void mlx5_add_cq_to_tasklet(struct mlx5_core_cq *cq,
70-
struct mlx5_eqe *eqe)
69+
void mlx5_add_cq_to_tasklet(struct mlx5_core_cq *cq,
70+
struct mlx5_eqe *eqe)
7171
{
7272
unsigned long flags;
7373
struct mlx5_eq_tasklet *tasklet_ctx = cq->tasklet_ctx.priv;
@@ -95,7 +95,15 @@ static void mlx5_add_cq_to_tasklet(struct mlx5_core_cq *cq,
9595
if (schedule_tasklet)
9696
tasklet_schedule(&tasklet_ctx->task);
9797
}
98+
EXPORT_SYMBOL(mlx5_add_cq_to_tasklet);
9899

100+
static void mlx5_core_cq_dummy_cb(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe)
101+
{
102+
mlx5_core_err(cq->eq->core.dev,
103+
"CQ default completion callback, CQ #%u\n", cq->cqn);
104+
}
105+
106+
#define MLX5_CQ_INIT_CMD_SN cpu_to_be32(2 << 28)
99107
/* Callers must verify outbox status in case of err */
100108
int mlx5_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
101109
u32 *in, int inlen, u32 *out, int outlen)
@@ -121,10 +129,19 @@ int mlx5_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
121129
cq->arm_sn = 0;
122130
cq->eq = eq;
123131
cq->uid = MLX5_GET(create_cq_in, in, uid);
132+
133+
/* Kernel CQs must set the arm_db address prior to calling
134+
* this function, allowing for the proper value to be
135+
* initialized. User CQs are responsible for their own
136+
* initialization since they do not use the arm_db field.
137+
*/
138+
if (cq->arm_db)
139+
*cq->arm_db = MLX5_CQ_INIT_CMD_SN;
140+
124141
refcount_set(&cq->refcount, 1);
125142
init_completion(&cq->free);
126143
if (!cq->comp)
127-
cq->comp = mlx5_add_cq_to_tasklet;
144+
cq->comp = mlx5_core_cq_dummy_cb;
128145
/* assuming CQ will be deleted before the EQ */
129146
cq->tasklet_ctx.priv = &eq->tasklet_ctx;
130147
INIT_LIST_HEAD(&cq->tasklet_ctx.list);

drivers/net/ethernet/mellanox/mlx5/core/devlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ static int mlx5_devlink_num_doorbells_validate(struct devlink *devlink, u32 id,
541541
max_num_channels = mlx5e_get_max_num_channels(mdev);
542542
if (val32 > max_num_channels) {
543543
NL_SET_ERR_MSG_FMT_MOD(extack,
544-
"Requested num_doorbells (%u) exceeds maximum number of channels (%u)",
544+
"Requested num_doorbells (%u) exceeds max number of channels (%u)",
545545
val32, max_num_channels);
546546
return -EINVAL;
547547
}

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,8 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
804804
goto err_xfrm;
805805
}
806806

807-
if (mlx5_eswitch_block_mode(priv->mdev))
807+
err = mlx5_eswitch_block_mode(priv->mdev);
808+
if (err)
808809
goto unblock_ipsec;
809810

810811
if (x->props.mode == XFRM_MODE_TUNNEL &&

drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,32 +595,55 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,
595595
struct mlx5_core_dev *mdev = priv->mdev;
596596
u8 max_bw_value[IEEE_8021QAZ_MAX_TCS];
597597
u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS];
598-
__u64 upper_limit_mbps = roundup(255 * MLX5E_100MB, MLX5E_1GB);
598+
__u64 upper_limit_mbps;
599+
__u64 upper_limit_gbps;
599600
int i;
601+
struct {
602+
int scale;
603+
const char *units_str;
604+
} units[] = {
605+
[MLX5_100_MBPS_UNIT] = {
606+
.scale = 100,
607+
.units_str = "Mbps",
608+
},
609+
[MLX5_GBPS_UNIT] = {
610+
.scale = 1,
611+
.units_str = "Gbps",
612+
},
613+
};
600614

601615
memset(max_bw_value, 0, sizeof(max_bw_value));
602616
memset(max_bw_unit, 0, sizeof(max_bw_unit));
617+
upper_limit_mbps = 255 * MLX5E_100MB;
618+
upper_limit_gbps = 255 * MLX5E_1GB;
603619

604620
for (i = 0; i <= mlx5_max_tc(mdev); i++) {
605621
if (!maxrate->tc_maxrate[i]) {
606622
max_bw_unit[i] = MLX5_BW_NO_LIMIT;
607623
continue;
608624
}
609-
if (maxrate->tc_maxrate[i] < upper_limit_mbps) {
625+
if (maxrate->tc_maxrate[i] <= upper_limit_mbps) {
610626
max_bw_value[i] = div_u64(maxrate->tc_maxrate[i],
611627
MLX5E_100MB);
612628
max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] : 1;
613629
max_bw_unit[i] = MLX5_100_MBPS_UNIT;
614-
} else {
630+
} else if (max_bw_value[i] <= upper_limit_gbps) {
615631
max_bw_value[i] = div_u64(maxrate->tc_maxrate[i],
616632
MLX5E_1GB);
617633
max_bw_unit[i] = MLX5_GBPS_UNIT;
634+
} else {
635+
netdev_err(netdev,
636+
"tc_%d maxrate %llu Kbps exceeds limit %llu\n",
637+
i, maxrate->tc_maxrate[i],
638+
upper_limit_gbps);
639+
return -EINVAL;
618640
}
619641
}
620642

621643
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
622-
netdev_dbg(netdev, "%s: tc_%d <=> max_bw %d Gbps\n",
623-
__func__, i, max_bw_value[i]);
644+
netdev_dbg(netdev, "%s: tc_%d <=> max_bw %u %s\n", __func__, i,
645+
max_bw_value[i] * units[max_bw_unit[i]].scale,
646+
units[max_bw_unit[i]].units_str);
624647
}
625648

626649
return mlx5_modify_port_ets_rate_limit(mdev, max_bw_value, max_bw_unit);

0 commit comments

Comments
 (0)