History

Merge tag 'net-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni: "Including fixes from WiFi and bpf. Current release - regressions: - bpf: syzkaller found null ptr deref in unix_bpf proto add - eth: i40e: fix ST code value for clause 45 Previous releases - regressions: - core: return error from sk_stream_wait_connect() if sk_wait_event() fails - ipv6: revert remove expired routes with a separated list of routes - wifi rfkill: - set GPIO direction - fix crash with WED rx support enabled - bluetooth: - fix deadlock in vhci_send_frame - fix use-after-free in bt_sock_recvmsg - eth: mlx5e: fix a race in command alloc flow - eth: ice: fix PF with enabled XDP going no-carrier after reset - eth: bnxt_en: do not map packet buffers twice Previous releases - always broken: - core: - check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() - check dev->gso_max_size in gso_features_check() - mptcp: fix inconsistent state on fastopen race - phy: skip LED triggers on PHYs on SFP modules - eth: mlx5e: - fix double free of encap_header - fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list()" * tag 'net-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (69 commits) net: check dev->gso_max_size in gso_features_check() kselftest: rtnetlink.sh: use grep_fail when expecting the cmd fail net/ipv6: Revert remove expired routes with a separated list of routes net: avoid build bug in skb extension length calculation net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_clean() net: stmmac: fix incorrect flag check in timestamp interrupt selftests: add vlan hw filter tests net: check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() net: hns3: add new maintainer for the HNS3 ethernet driver net: mana: select PAGE_POOL net: ks8851: Fix TX stall caused by TX buffer overrun ice: Fix PF with enabled XDP going no-carrier after reset ice: alter feature support check for SRIOV and LAG ice: stop trashing VF VSI aggregator node ID information mailmap: add entries for Geliang Tang mptcp: fill in missing MODULE_DESCRIPTION() mptcp: fix inconsistent state on fastopen race selftests: mptcp: join: fix subflow_send_ack lookup net: phy: skip LED triggers on PHYs on SFP modules bpf: Add missing BPF_LINK_TYPE invocations ...

Linus Torvalds committed 2 years ago

Commit 7c5e0462 parents a4aebe9 74769d874 files · +561 −369Browse files

Unified · Split

74 files
  1. .mailmap +4 −0
  2. MAINTAINERS +1 −0
  3. drivers/bluetooth/hci_vhci.c +6 −4
  4. drivers/net/ethernet/atheros/atl1e/atl1e_main.c +4 −1
  5. drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +2 −9
  6. drivers/net/ethernet/intel/i40e/i40e_register.h +1 −1
  7. drivers/net/ethernet/intel/i40e/i40e_type.h +2 −2
  8. drivers/net/ethernet/intel/ice/ice_ethtool.c +2 −2
  9. drivers/net/ethernet/intel/ice/ice_lag.c +2 −0
  10. drivers/net/ethernet/intel/ice/ice_lib.c +3 −4
  11. drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +14 −3
  12. drivers/net/ethernet/mediatek/mtk_wed_wo.c +3 −0
  13. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +7 −5
  14. drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +1 −1
  15. drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +1 −0
  16. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c +3 −2
  17. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +28 −22
  18. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +2 −1
  19. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +3 −1
  20. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +1 −1
  21. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +1 −1
  22. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 −1
  23. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +7 −3
  24. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 −1
  25. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +19 −12
  26. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +2 −2
  27. drivers/net/ethernet/mellanox/mlx5/core/vport.c +1 −1
  28. drivers/net/ethernet/micrel/ks8851.h +3 −0
  29. drivers/net/ethernet/micrel/ks8851_common.c +10 −10
  30. drivers/net/ethernet/micrel/ks8851_spi.c +27 −15
  31. drivers/net/ethernet/microsoft/Kconfig +1 −0
  32. drivers/net/ethernet/mscc/ocelot_stats.c +8 −8
  33. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +1 −1
  34. drivers/net/ethernet/wangxun/libwx/wx_lib.c +6 −76
  35. drivers/net/ethernet/wangxun/libwx/wx_type.h +0 −1
  36. drivers/net/phy/phy_device.c +4 −2
  37. drivers/net/wireless/intel/iwlwifi/pcie/rx.c +1 −1
  38. drivers/net/wireless/intel/iwlwifi/pcie/trans.c +2 −2
  39. drivers/net/wireless/mediatek/mt76/dma.c +6 −4
  40. include/linux/bpf_types.h +4 −0
  41. include/linux/ieee80211.h +2 −1
  42. include/net/bluetooth/hci_core.h +7 −2
  43. include/net/ip6_fib.h +13 −51
  44. include/net/sock.h +5 −0
  45. net/8021q/vlan_core.c +8 −1
  46. net/bluetooth/af_bluetooth.c +6 −1
  47. net/bluetooth/hci_event.c +21 −9
  48. net/bluetooth/l2cap_core.c +15 −6
  49. net/bluetooth/mgmt.c +18 −7
  50. net/bluetooth/smp.c +7 −0
  51. net/core/dev.c +3 −0
  52. net/core/skbuff.c +2 −0
  53. net/core/sock_map.c +2 −0
  54. net/core/stream.c +1 −1
  55. net/ife/ife.c +1 −0
  56. net/ipv6/ip6_fib.c +6 −49
  57. net/ipv6/route.c +3 −3
  58. net/mac80211/cfg.c +2 −2
  59. net/mac80211/driver-ops.c +5 −1
  60. net/mac80211/mesh_plink.c +9 −7
  61. net/mac80211/mlme.c +3 −1
  62. net/mptcp/crypto_test.c +1 −0
  63. net/mptcp/protocol.c +3 −3
  64. net/mptcp/protocol.h +6 −3
  65. net/mptcp/subflow.c +17 −11
  66. net/mptcp/token_test.c +1 −0
  67. net/rfkill/rfkill-gpio.c +8 −0
  68. net/rose/af_rose.c +34 −5
  69. net/wireless/certs/wens.hex +87 −0
  70. tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +34 −0
  71. tools/testing/selftests/net/Makefile +1 −0
  72. tools/testing/selftests/net/mptcp/mptcp_join.sh +4 −4
  73. tools/testing/selftests/net/rtnetlink.sh +1 −1
  74. tools/testing/selftests/net/vlan_hw_filter.sh +29 −0
.mailmap+4−0
@@ -191,6 +191,10 @@ Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com> · 190 unmodified lines
191191 Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
192192 Gao Xiang <xiang@kernel.org> <hsiangkao@linux.alibaba.com>
193193 Gao Xiang <xiang@kernel.org> <hsiangkao@redhat.com>
194+Geliang Tang <geliang.tang@linux.dev> <geliang.tang@suse.com>
195+Geliang Tang <geliang.tang@linux.dev> <geliangtang@xiaomi.com>
196+Geliang Tang <geliang.tang@linux.dev> <geliangtang@gmail.com>
197+Geliang Tang <geliang.tang@linux.dev> <geliangtang@163.com>
194198 Georgi Djakov <djakov@kernel.org> <georgi.djakov@linaro.org>
195199 Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@de.ibm.com>
196200 Gerald Schaefer <gerald.schaefer@linux.ibm.com> <gerald.schaefer@de.ibm.com>
MAINTAINERS+1−0
@@ -9524,6 +9524,7 @@ F: drivers/bus/hisi_lpc.c · 9523 unmodified lines
95249524 HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
95259525 M: Yisen Zhuang <yisen.zhuang@huawei.com>
95269526 M: Salil Mehta <salil.mehta@huawei.com>
9527+M: Jijie Shao <shaojijie@huawei.com>
95279528 L: netdev@vger.kernel.org
95289529 S: Maintained
95299530 W: http://www.hisilicon.com
drivers/bluetooth/hci_vhci.c+6−4
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/module.h>
1212 #include <asm/unaligned.h>
1313
14+#include <linux/atomic.h>
1415 #include <linux/kernel.h>
1516 #include <linux/init.h>
1617 #include <linux/slab.h>
@@ -44,6 +45,7 @@ struct vhci_data { · 27 unmodified lines
4445 bool wakeup;
4546 __u16 msft_opcode;
4647 bool aosp_capable;
48+ atomic_t initialized;
4749 };
4850
4951 static int vhci_open_dev(struct hci_dev *hdev)
@@ -75,11 +77,10 @@ static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · 25 unmodified lines
7577
7678 memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
7779
78− mutex_lock(&data->open_mutex);
7980 skb_queue_tail(&data->readq, skb);
80− mutex_unlock(&data->open_mutex);
8181
82− wake_up_interruptible(&data->read_wait);
82+ if (atomic_read(&data->initialized))
83+ wake_up_interruptible(&data->read_wait);
8384 return 0;
8485 }
8586
@@ -464,7 +465,8 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode) · 378 unmodified lines
464465 skb_put_u8(skb, 0xff);
465466 skb_put_u8(skb, opcode);
466467 put_unaligned_le16(hdev->id, skb_put(skb, 2));
467− skb_queue_tail(&data->readq, skb);
468+ skb_queue_head(&data->readq, skb);
469+ atomic_inc(&data->initialized);
468470
469471 wake_up_interruptible(&data->read_wait);
470472 return 0;
drivers/net/ethernet/atheros/atl1e/atl1e_main.c+4−1
@@ -866,10 +866,13 @@ static int atl1e_setup_ring_resources(struct atl1e_adapter *adapter) · 865 unmodified lines
866866 netdev_err(adapter->netdev, "offset(%d) > ring size(%d) !!\n",
867867 offset, adapter->ring_size);
868868 err = -1;
869− goto failed;
869+ goto free_buffer;
870870 }
871871
872872 return 0;
873+free_buffer:
874+ kfree(tx_ring->tx_buffer);
875+ tx_ring->tx_buffer = NULL;
873876 failed:
874877 if (adapter->ring_vir_addr != NULL) {
875878 dma_free_coherent(&pdev->dev, adapter->ring_size,
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c+2−9
@@ -59,7 +59,6 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, · 58 unmodified lines
5959 for (i = 0; i < num_frags ; i++) {
6060 skb_frag_t *frag = &sinfo->frags[i];
6161 struct bnxt_sw_tx_bd *frag_tx_buf;
62− struct pci_dev *pdev = bp->pdev;
6362 dma_addr_t frag_mapping;
6463 int frag_len;
6564
@@ -73,16 +72,10 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp, · 7 unmodified lines
7372 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
7473
7574 frag_len = skb_frag_size(frag);
76− frag_mapping = skb_frag_dma_map(&pdev->dev, frag, 0,
77− frag_len, DMA_TO_DEVICE);
78−
79− if (unlikely(dma_mapping_error(&pdev->dev, frag_mapping)))
80− return NULL;
81−
82− dma_unmap_addr_set(frag_tx_buf, mapping, frag_mapping);
83−
8475 flags = frag_len << TX_BD_LEN_SHIFT;
8576 txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
77+ frag_mapping = page_pool_get_dma_addr(skb_frag_page(frag)) +
78+ skb_frag_off(frag);
8679 txbd->tx_bd_haddr = cpu_to_le64(frag_mapping);
8780
8881 len = frag_len;
drivers/net/ethernet/intel/i40e/i40e_register.h+1−1
@@ -207,7 +207,7 @@ · 206 unmodified lines
207207 #define I40E_GLGEN_MSCA_OPCODE_SHIFT 26
208208 #define I40E_GLGEN_MSCA_OPCODE_MASK(_i) I40E_MASK(_i, I40E_GLGEN_MSCA_OPCODE_SHIFT)
209209 #define I40E_GLGEN_MSCA_STCODE_SHIFT 28
210−#define I40E_GLGEN_MSCA_STCODE_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_STCODE_SHIFT)
210+#define I40E_GLGEN_MSCA_STCODE_MASK(_i) I40E_MASK(_i, I40E_GLGEN_MSCA_STCODE_SHIFT)
211211 #define I40E_GLGEN_MSCA_MDICMD_SHIFT 30
212212 #define I40E_GLGEN_MSCA_MDICMD_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDICMD_SHIFT)
213213 #define I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT 31
drivers/net/ethernet/intel/i40e/i40e_type.h+2−2
@@ -37,11 +37,11 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); · 36 unmodified lines
3737 #define I40E_QTX_CTL_VM_QUEUE 0x1
3838 #define I40E_QTX_CTL_PF_QUEUE 0x2
3939
40−#define I40E_MDIO_CLAUSE22_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK
40+#define I40E_MDIO_CLAUSE22_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK(1)
4141 #define I40E_MDIO_CLAUSE22_OPCODE_WRITE_MASK I40E_GLGEN_MSCA_OPCODE_MASK(1)
4242 #define I40E_MDIO_CLAUSE22_OPCODE_READ_MASK I40E_GLGEN_MSCA_OPCODE_MASK(2)
4343
44−#define I40E_MDIO_CLAUSE45_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK
44+#define I40E_MDIO_CLAUSE45_STCODE_MASK I40E_GLGEN_MSCA_STCODE_MASK(0)
4545 #define I40E_MDIO_CLAUSE45_OPCODE_ADDRESS_MASK I40E_GLGEN_MSCA_OPCODE_MASK(0)
4646 #define I40E_MDIO_CLAUSE45_OPCODE_WRITE_MASK I40E_GLGEN_MSCA_OPCODE_MASK(1)
4747 #define I40E_MDIO_CLAUSE45_OPCODE_READ_MASK I40E_GLGEN_MSCA_OPCODE_MASK(3)
drivers/net/ethernet/intel/ice/ice_ethtool.c+2−2
@@ -1850,14 +1850,14 @@ ice_phy_type_to_ethtool(struct net_device *netdev, · 1849 unmodified lines
18501850 linkmode_zero(ks->link_modes.supported);
18511851 linkmode_zero(ks->link_modes.advertising);
18521852
1853− for (i = 0; i < BITS_PER_TYPE(u64); i++) {
1853+ for (i = 0; i < ARRAY_SIZE(phy_type_low_lkup); i++) {
18541854 if (phy_types_low & BIT_ULL(i))
18551855 ice_linkmode_set_bit(&phy_type_low_lkup[i], ks,
18561856 req_speeds, advert_phy_type_lo,
18571857 i);
18581858 }
18591859
1860− for (i = 0; i < BITS_PER_TYPE(u64); i++) {
1860+ for (i = 0; i < ARRAY_SIZE(phy_type_high_lkup); i++) {
18611861 if (phy_types_high & BIT_ULL(i))
18621862 ice_linkmode_set_bit(&phy_type_high_lkup[i], ks,
18631863 req_speeds, advert_phy_type_hi,
drivers/net/ethernet/intel/ice/ice_lag.c+2−0
@@ -1981,6 +1981,8 @@ int ice_init_lag(struct ice_pf *pf) · 1980 unmodified lines
19811981 int n, err;
19821982
19831983 ice_lag_init_feature_support_flag(pf);
1984+ if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG))
1985+ return 0;
19841986
19851987 pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL);
19861988 if (!pf->lag)
drivers/net/ethernet/intel/ice/ice_lib.c+3−4
@@ -2371,6 +2371,9 @@ static int ice_vsi_cfg_tc_lan(struct ice_pf *pf, struct ice_vsi *vsi) · 2370 unmodified lines
23712371 } else {
23722372 max_txqs[i] = vsi->alloc_txq;
23732373 }
2374+
2375+ if (vsi->type == ICE_VSI_PF)
2376+ max_txqs[i] += vsi->num_xdp_txq;
23742377 }
23752378
23762379 dev_dbg(dev, "vsi->tc_cfg.ena_tc = %d\n", vsi->tc_cfg.ena_tc);
@@ -2620,10 +2623,6 @@ void ice_vsi_decfg(struct ice_vsi *vsi) · 243 unmodified lines
26202623 if (vsi->type == ICE_VSI_VF &&
26212624 vsi->agg_node && vsi->agg_node->valid)
26222625 vsi->agg_node->num_vsis--;
2623− if (vsi->agg_node) {
2624− vsi->agg_node->valid = false;
2625− vsi->agg_node->agg_id = 0;
2626− }
26272626 }
26282627
26292628 /**
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c+14−3
@@ -399,9 +399,10 @@ static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) · 398 unmodified lines
399399 static int otx2_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc)
400400 {
401401 struct otx2_nic *pfvf = netdev_priv(dev);
402+ u8 old_pfc_en;
402403 int err;
403404
404− /* Save PFC configuration to interface */
405+ old_pfc_en = pfvf->pfc_en;
405406 pfvf->pfc_en = pfc->pfc_en;
406407
407408 if (pfvf->hw.tx_queues >= NIX_PF_PFC_PRIO_MAX)
@@ -411,13 +412,17 @@ static int otx2_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc) · 3 unmodified lines
411412 * supported by the tx queue configuration
412413 */
413414 err = otx2_check_pfc_config(pfvf);
414− if (err)
415+ if (err) {
416+ pfvf->pfc_en = old_pfc_en;
415417 return err;
418+ }
416419
417420 process_pfc:
418421 err = otx2_config_priority_flow_ctrl(pfvf);
419− if (err)
422+ if (err) {
423+ pfvf->pfc_en = old_pfc_en;
420424 return err;
425+ }
421426
422427 /* Request Per channel Bpids */
423428 if (pfc->pfc_en)
@@ -425,6 +430,12 @@ process_pfc: · 1 unmodified line
425430
426431 err = otx2_pfc_txschq_update(pfvf);
427432 if (err) {
433+ if (pfc->pfc_en)
434+ otx2_nix_config_bp(pfvf, false);
435+
436+ otx2_pfc_txschq_stop(pfvf);
437+ pfvf->pfc_en = old_pfc_en;
438+ otx2_config_priority_flow_ctrl(pfvf);
428439 dev_err(pfvf->dev, "%s failed to update TX schedulers\n", __func__);
429440 return err;
430441 }
drivers/net/ethernet/mediatek/mtk_wed_wo.c+3−0
@@ -291,6 +291,9 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q) · 290 unmodified lines
291291 for (i = 0; i < q->n_desc; i++) {
292292 struct mtk_wed_wo_queue_entry *entry = &q->entry[i];
293293
294+ if (!entry->buf)
295+ continue;
296+
294297 dma_unmap_single(wo->hw->dev, entry->addr, entry->len,
295298 DMA_TO_DEVICE);
296299 skb_free_frag(entry->buf);
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+7−5
@@ -156,15 +156,18 @@ static u8 alloc_token(struct mlx5_cmd *cmd) · 155 unmodified lines
156156 return token;
157157 }
158158
159−static int cmd_alloc_index(struct mlx5_cmd *cmd)
159+static int cmd_alloc_index(struct mlx5_cmd *cmd, struct mlx5_cmd_work_ent *ent)
160160 {
161161 unsigned long flags;
162162 int ret;
163163
164164 spin_lock_irqsave(&cmd->alloc_lock, flags);
165165 ret = find_first_bit(&cmd->vars.bitmask, cmd->vars.max_reg_cmds);
166− if (ret < cmd->vars.max_reg_cmds)
166+ if (ret < cmd->vars.max_reg_cmds) {
167167 clear_bit(ret, &cmd->vars.bitmask);
168+ ent->idx = ret;
169+ cmd->ent_arr[ent->idx] = ent;
170+ }
168171 spin_unlock_irqrestore(&cmd->alloc_lock, flags);
169172
170173 return ret < cmd->vars.max_reg_cmds ? ret : -ENOMEM;
@@ -979,7 +982,7 @@ static void cmd_work_handler(struct work_struct *work) · 808 unmodified lines
979982 sem = ent->page_queue ? &cmd->vars.pages_sem : &cmd->vars.sem;
980983 down(sem);
981984 if (!ent->page_queue) {
982− alloc_ret = cmd_alloc_index(cmd);
985+ alloc_ret = cmd_alloc_index(cmd, ent);
983986 if (alloc_ret < 0) {
984987 mlx5_core_err_rl(dev, "failed to allocate command entry\n");
985988 if (ent->callback) {
@@ -994,15 +997,14 @@ static void cmd_work_handler(struct work_struct *work) · 8 unmodified lines
994997 up(sem);
995998 return;
996999 }
997− ent->idx = alloc_ret;
9981000 } else {
9991001 ent->idx = cmd->vars.max_reg_cmds;
10001002 spin_lock_irqsave(&cmd->alloc_lock, flags);
10011003 clear_bit(ent->idx, &cmd->vars.bitmask);
1004+ cmd->ent_arr[ent->idx] = ent;
10021005 spin_unlock_irqrestore(&cmd->alloc_lock, flags);
10031006 }
10041007
1005− cmd->ent_arr[ent->idx] = ent;
10061008 lay = get_inst(cmd, ent->idx);
10071009 ent->lay = lay;
10081010 memset(lay, 0, sizeof(*lay));
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c+1−1
@@ -718,7 +718,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work) · 717 unmodified lines
718718
719719 while (block_timestamp > tracer->last_timestamp) {
720720 /* Check block override if it's not the first block */
721− if (!tracer->last_timestamp) {
721+ if (tracer->last_timestamp) {
722722 u64 *ts_event;
723723 /* To avoid block override be the HW in case of buffer
724724 * wraparound, the time stamp of the previous block
drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c+1−0
@@ -154,6 +154,7 @@ static int fs_udp_create_groups(struct mlx5e_flow_table *ft, enum fs_udp_type ty · 153 unmodified lines
154154 in = kvzalloc(inlen, GFP_KERNEL);
155155 if (!in || !ft->g) {
156156 kfree(ft->g);
157+ ft->g = NULL;
157158 kvfree(in);
158159 return -ENOMEM;
159160 }
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c+3−2
@@ -197,7 +197,7 @@ parse_mirred_encap(struct mlx5e_tc_act_parse_state *parse_state, · 196 unmodified lines
197197 }
198198 esw_attr->dests[esw_attr->out_count].flags |= MLX5_ESW_DEST_ENCAP;
199199 esw_attr->out_count++;
200− /* attr->dests[].rep is resolved when we handle encap */
200+ /* attr->dests[].vport is resolved when we handle encap */
201201
202202 return 0;
203203 }
@@ -270,7 +270,8 @@ parse_mirred(struct mlx5e_tc_act_parse_state *parse_state, · 66 unmodified lines
270270
271271 out_priv = netdev_priv(out_dev);
272272 rpriv = out_priv->ppriv;
273− esw_attr->dests[esw_attr->out_count].rep = rpriv->rep;
273+ esw_attr->dests[esw_attr->out_count].vport_valid = true;
274+ esw_attr->dests[esw_attr->out_count].vport = rpriv->rep->vport;
274275 esw_attr->dests[esw_attr->out_count].mdev = out_priv->mdev;
275276
276277 esw_attr->out_count++;
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c+28−22
@@ -300,6 +300,10 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv, · 299 unmodified lines
300300 if (err)
301301 goto destroy_neigh_entry;
302302
303+ e->encap_size = ipv4_encap_size;
304+ e->encap_header = encap_header;
305+ encap_header = NULL;
306+
303307 if (!(nud_state & NUD_VALID)) {
304308 neigh_event_send(attr.n, NULL);
305309 /* the encap entry will be made valid on neigh update event
@@ -310,8 +314,8 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv, · 4 unmodified lines
310314
311315 memset(&reformat_params, 0, sizeof(reformat_params));
312316 reformat_params.type = e->reformat_type;
313− reformat_params.size = ipv4_encap_size;
314− reformat_params.data = encap_header;
317+ reformat_params.size = e->encap_size;
318+ reformat_params.data = e->encap_header;
315319 e->pkt_reformat = mlx5_packet_reformat_alloc(priv->mdev, &reformat_params,
316320 MLX5_FLOW_NAMESPACE_FDB);
317321 if (IS_ERR(e->pkt_reformat)) {
@@ -319,8 +323,6 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv, · 1 unmodified line
319323 goto destroy_neigh_entry;
320324 }
321325
322− e->encap_size = ipv4_encap_size;
323− e->encap_header = encap_header;
324326 e->flags |= MLX5_ENCAP_ENTRY_VALID;
325327 mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev));
326328 mlx5e_route_lookup_ipv4_put(&attr);
@@ -403,18 +405,23 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv, · 76 unmodified lines
403405 if (err)
404406 goto free_encap;
405407
408+ e->encap_size = ipv4_encap_size;
409+ kfree(e->encap_header);
410+ e->encap_header = encap_header;
411+ encap_header = NULL;
412+
406413 if (!(nud_state & NUD_VALID)) {
407414 neigh_event_send(attr.n, NULL);
408415 /* the encap entry will be made valid on neigh update event
409416 * and not used before that.
410417 */
411− goto free_encap;
418+ goto release_neigh;
412419 }
413420
414421 memset(&reformat_params, 0, sizeof(reformat_params));
415422 reformat_params.type = e->reformat_type;
416− reformat_params.size = ipv4_encap_size;
417− reformat_params.data = encap_header;
423+ reformat_params.size = e->encap_size;
424+ reformat_params.data = e->encap_header;
418425 e->pkt_reformat = mlx5_packet_reformat_alloc(priv->mdev, &reformat_params,
419426 MLX5_FLOW_NAMESPACE_FDB);
420427 if (IS_ERR(e->pkt_reformat)) {
@@ -422,10 +429,6 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv, · 1 unmodified line
422429 goto free_encap;
423430 }
424431
425− e->encap_size = ipv4_encap_size;
426− kfree(e->encap_header);
427− e->encap_header = encap_header;
428−
429432 e->flags |= MLX5_ENCAP_ENTRY_VALID;
430433 mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev));
431434 mlx5e_route_lookup_ipv4_put(&attr);
@@ -567,6 +570,10 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv, · 135 unmodified lines
567570 if (err)
568571 goto destroy_neigh_entry;
569572
573+ e->encap_size = ipv6_encap_size;
574+ e->encap_header = encap_header;
575+ encap_header = NULL;
576+
570577 if (!(nud_state & NUD_VALID)) {
571578 neigh_event_send(attr.n, NULL);
572579 /* the encap entry will be made valid on neigh update event
@@ -577,8 +584,8 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv, · 4 unmodified lines
577584
578585 memset(&reformat_params, 0, sizeof(reformat_params));
579586 reformat_params.type = e->reformat_type;
580− reformat_params.size = ipv6_encap_size;
581− reformat_params.data = encap_header;
587+ reformat_params.size = e->encap_size;
588+ reformat_params.data = e->encap_header;
582589 e->pkt_reformat = mlx5_packet_reformat_alloc(priv->mdev, &reformat_params,
583590 MLX5_FLOW_NAMESPACE_FDB);
584591 if (IS_ERR(e->pkt_reformat)) {
@@ -586,8 +593,6 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv, · 1 unmodified line
586593 goto destroy_neigh_entry;
587594 }
588595
589− e->encap_size = ipv6_encap_size;
590− e->encap_header = encap_header;
591596 e->flags |= MLX5_ENCAP_ENTRY_VALID;
592597 mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev));
593598 mlx5e_route_lookup_ipv6_put(&attr);
@@ -669,18 +674,23 @@ int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv, · 75 unmodified lines
669674 if (err)
670675 goto free_encap;
671676
677+ e->encap_size = ipv6_encap_size;
678+ kfree(e->encap_header);
679+ e->encap_header = encap_header;
680+ encap_header = NULL;
681+
672682 if (!(nud_state & NUD_VALID)) {
673683 neigh_event_send(attr.n, NULL);
674684 /* the encap entry will be made valid on neigh update event
675685 * and not used before that.
676686 */
677− goto free_encap;
687+ goto release_neigh;
678688 }
679689
680690 memset(&reformat_params, 0, sizeof(reformat_params));
681691 reformat_params.type = e->reformat_type;
682− reformat_params.size = ipv6_encap_size;
683− reformat_params.data = encap_header;
692+ reformat_params.size = e->encap_size;
693+ reformat_params.data = e->encap_header;
684694 e->pkt_reformat = mlx5_packet_reformat_alloc(priv->mdev, &reformat_params,
685695 MLX5_FLOW_NAMESPACE_FDB);
686696 if (IS_ERR(e->pkt_reformat)) {
@@ -688,10 +698,6 @@ int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv, · 1 unmodified line
688698 goto free_encap;
689699 }
690700
691− e->encap_size = ipv6_encap_size;
692− kfree(e->encap_header);
693− e->encap_header = encap_header;
694−
695701 e->flags |= MLX5_ENCAP_ENTRY_VALID;
696702 mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev));
697703 mlx5e_route_lookup_ipv6_put(&attr);
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c+2−1
@@ -1064,7 +1064,8 @@ int mlx5e_tc_tun_encap_dests_set(struct mlx5e_priv *priv, · 1063 unmodified lines
10641064
10651065 out_priv = netdev_priv(encap_dev);
10661066 rpriv = out_priv->ppriv;
1067− esw_attr->dests[out_index].rep = rpriv->rep;
1067+ esw_attr->dests[out_index].vport_valid = true;
1068+ esw_attr->dests[out_index].vport = rpriv->rep->vport;
10681069 esw_attr->dests[out_index].mdev = out_priv->mdev;
10691070 }
10701071
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c+3−1
@@ -493,6 +493,7 @@ mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xmit_data *xdptxd, · 492 unmodified lines
493493 dma_addr_t dma_addr = xdptxd->dma_addr;
494494 u32 dma_len = xdptxd->len;
495495 u16 ds_cnt, inline_hdr_sz;
496+ unsigned int frags_size;
496497 u8 num_wqebbs = 1;
497498 int num_frags = 0;
498499 bool inline_ok;
@@ -503,8 +504,9 @@ mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xmit_data *xdptxd, · 4 unmodified lines
503504
504505 inline_ok = sq->min_inline_mode == MLX5_INLINE_MODE_NONE ||
505506 dma_len >= MLX5E_XDP_MIN_INLINE;
507+ frags_size = xdptxd->has_frags ? xdptxdf->sinfo->xdp_frags_size : 0;
506508
507− if (unlikely(!inline_ok || sq->hw_mtu < dma_len)) {
509+ if (unlikely(!inline_ok || sq->hw_mtu < dma_len + frags_size)) {
508510 stats->err++;
509511 return false;
510512 }
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+1−1
@@ -2142,7 +2142,7 @@ static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev) · 2141 unmodified lines
21422142
21432143 static void mlx5e_ipsec_unblock_tc_offload(struct mlx5_core_dev *mdev)
21442144 {
2145− mdev->num_block_tc++;
2145+ mdev->num_block_tc--;
21462146 }
21472147
21482148 int mlx5e_accel_ipsec_fs_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+1−1
@@ -49,7 +49,7 @@ void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv, · 48 unmodified lines
4949 count = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
5050 "%d.%d.%04d (%.16s)", fw_rev_maj(mdev),
5151 fw_rev_min(mdev), fw_rev_sub(mdev), mdev->board_id);
52− if (count == sizeof(drvinfo->fw_version))
52+ if (count >= sizeof(drvinfo->fw_version))
5353 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
5454 "%d.%d.%04d", fw_rev_maj(mdev),
5555 fw_rev_min(mdev), fw_rev_sub(mdev));
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+1−1
@@ -78,7 +78,7 @@ static void mlx5e_rep_get_drvinfo(struct net_device *dev, · 77 unmodified lines
7878 count = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
7979 "%d.%d.%04d (%.16s)", fw_rev_maj(mdev),
8080 fw_rev_min(mdev), fw_rev_sub(mdev), mdev->board_id);
81− if (count == sizeof(drvinfo->fw_version))
81+ if (count >= sizeof(drvinfo->fw_version))
8282 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
8383 "%d.%d.%04d", fw_rev_maj(mdev),
8484 fw_rev_min(mdev), fw_rev_sub(mdev));
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+7−3
@@ -3778,7 +3778,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow, · 3777 unmodified lines
37783778 break;
37793779 case FLOW_ACTION_ACCEPT:
37803780 case FLOW_ACTION_PIPE:
3781− if (set_branch_dest_ft(flow->priv, attr))
3781+ err = set_branch_dest_ft(flow->priv, attr);
3782+ if (err)
37823783 goto out_err;
37833784 break;
37843785 case FLOW_ACTION_JUMP:
@@ -3788,7 +3789,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow, · 3 unmodified lines
37883789 goto out_err;
37893790 }
37903791 *jump_count = cond->extval;
3791− if (set_branch_dest_ft(flow->priv, attr))
3792+ err = set_branch_dest_ft(flow->priv, attr);
3793+ if (err)
37923794 goto out_err;
37933795 break;
37943796 default:
@@ -5736,8 +5738,10 @@ int mlx5e_tc_action_miss_mapping_get(struct mlx5e_priv *priv, struct mlx5_flow_a · 1941 unmodified lines
57365738
57375739 esw = priv->mdev->priv.eswitch;
57385740 attr->act_id_restore_rule = esw_add_restore_rule(esw, *act_miss_mapping);
5739− if (IS_ERR(attr->act_id_restore_rule))
5741+ if (IS_ERR(attr->act_id_restore_rule)) {
5742+ err = PTR_ERR(attr->act_id_restore_rule);
57405743 goto err_rule;
5744+ }
57415745
57425746 return 0;
57435747
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+2−1
@@ -526,7 +526,8 @@ struct mlx5_esw_flow_attr { · 525 unmodified lines
526526 u8 total_vlan;
527527 struct {
528528 u32 flags;
529− struct mlx5_eswitch_rep *rep;
529+ bool vport_valid;
530+ u16 vport;
530531 struct mlx5_pkt_reformat *pkt_reformat;
531532 struct mlx5_core_dev *mdev;
532533 struct mlx5_termtbl_handle *termtbl;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+19−12
@@ -287,10 +287,9 @@ static void esw_put_dest_tables_loop(struct mlx5_eswitch *esw, struct mlx5_flow_ · 286 unmodified lines
287287 for (i = from; i < to; i++)
288288 if (esw_attr->dests[i].flags & MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE)
289289 mlx5_chains_put_table(chains, 0, 1, 0);
290− else if (mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].rep->vport,
290+ else if (mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].vport,
291291 esw_attr->dests[i].mdev))
292− mlx5_esw_indir_table_put(esw, esw_attr->dests[i].rep->vport,
293− false);
292+ mlx5_esw_indir_table_put(esw, esw_attr->dests[i].vport, false);
294293 }
295294
296295 static bool
@@ -358,8 +357,8 @@ esw_is_indir_table(struct mlx5_eswitch *esw, struct mlx5_flow_attr *attr) · 61 unmodified lines
358357 * this criteria.
359358 */
360359 for (i = esw_attr->split_count; i < esw_attr->out_count; i++) {
361− if (esw_attr->dests[i].rep &&
362− mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].rep->vport,
360+ if (esw_attr->dests[i].vport_valid &&
361+ mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].vport,
363362 esw_attr->dests[i].mdev)) {
364363 result = true;
365364 } else {
@@ -388,7 +387,7 @@ esw_setup_indir_table(struct mlx5_flow_destination *dest, · 22 unmodified lines
388387 dest[*i].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
389388
390389 dest[*i].ft = mlx5_esw_indir_table_get(esw, attr,
391− esw_attr->dests[j].rep->vport, false);
390+ esw_attr->dests[j].vport, false);
392391 if (IS_ERR(dest[*i].ft)) {
393392 err = PTR_ERR(dest[*i].ft);
394393 goto err_indir_tbl_get;
@@ -432,11 +431,11 @@ static bool esw_setup_uplink_fwd_ipsec_needed(struct mlx5_eswitch *esw, · 37 unmodified lines
432431 int attr_idx)
433432 {
434433 if (esw->offloads.ft_ipsec_tx_pol &&
435− esw_attr->dests[attr_idx].rep &&
436− esw_attr->dests[attr_idx].rep->vport == MLX5_VPORT_UPLINK &&
434+ esw_attr->dests[attr_idx].vport_valid &&
435+ esw_attr->dests[attr_idx].vport == MLX5_VPORT_UPLINK &&
437436 /* To be aligned with software, encryption is needed only for tunnel device */
438437 (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP_VALID) &&
439− esw_attr->dests[attr_idx].rep != esw_attr->in_rep &&
438+ esw_attr->dests[attr_idx].vport != esw_attr->in_rep->vport &&
440439 esw_same_vhca_id(esw_attr->dests[attr_idx].mdev, esw->dev))
441440 return true;
442441
@@ -469,7 +468,7 @@ esw_setup_dest_fwd_vport(struct mlx5_flow_destination *dest, struct mlx5_flow_ac · 26 unmodified lines
469468 int attr_idx, int dest_idx, bool pkt_reformat)
470469 {
471470 dest[dest_idx].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
472− dest[dest_idx].vport.num = esw_attr->dests[attr_idx].rep->vport;
471+ dest[dest_idx].vport.num = esw_attr->dests[attr_idx].vport;
473472 if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
474473 dest[dest_idx].vport.vhca_id =
475474 MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
@@ -1177,9 +1176,9 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw, · 701 unmodified lines
11771176 struct mlx5_flow_handle *flow;
11781177 struct mlx5_flow_spec *spec;
11791178 struct mlx5_vport *vport;
1179+ int err, pfindex;
11801180 unsigned long i;
11811181 void *misc;
1182− int err;
11831182
11841183 if (!MLX5_VPORT_MANAGER(esw->dev) && !mlx5_core_is_ecpf_esw_manager(esw->dev))
11851184 return 0;
@@ -1255,7 +1254,15 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw, · 69 unmodified lines
12551254 flows[vport->index] = flow;
12561255 }
12571256 }
1258− esw->fdb_table.offloads.peer_miss_rules[mlx5_get_dev_index(peer_dev)] = flows;
1257+
1258+ pfindex = mlx5_get_dev_index(peer_dev);
1259+ if (pfindex >= MLX5_MAX_PORTS) {
1260+ esw_warn(esw->dev, "Peer dev index(%d) is over the max num defined(%d)\n",
1261+ pfindex, MLX5_MAX_PORTS);
1262+ err = -EINVAL;
1263+ goto add_ec_vf_flow_err;
1264+ }
1265+ esw->fdb_table.offloads.peer_miss_rules[pfindex] = flows;
12591266
12601267 kvfree(spec);
12611268 return 0;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c+2−2
@@ -233,8 +233,8 @@ mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw, · 232 unmodified lines
233233
234234 /* hairpin */
235235 for (i = esw_attr->split_count; i < esw_attr->out_count; i++)
236− if (!esw_attr->dest_int_port && esw_attr->dests[i].rep &&
237− esw_attr->dests[i].rep->vport == MLX5_VPORT_UPLINK)
236+ if (!esw_attr->dest_int_port && esw_attr->dests[i].vport_valid &&
237+ esw_attr->dests[i].vport == MLX5_VPORT_UPLINK)
238238 return true;
239239
240240 return false;
drivers/net/ethernet/mellanox/mlx5/core/vport.c+1−1
@@ -277,7 +277,7 @@ int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev, · 276 unmodified lines
277277 req_list_size = max_list_size;
278278 }
279279
280− out_sz = MLX5_ST_SZ_BYTES(query_nic_vport_context_in) +
280+ out_sz = MLX5_ST_SZ_BYTES(query_nic_vport_context_out) +
281281 req_list_size * MLX5_ST_SZ_BYTES(mac_address_layout);
282282
283283 out = kvzalloc(out_sz, GFP_KERNEL);
drivers/net/ethernet/micrel/ks8851.h+3−0
@@ -350,6 +350,8 @@ union ks8851_tx_hdr { · 349 unmodified lines
350350 * @rxd: Space for receiving SPI data, in DMA-able space.
351351 * @txd: Space for transmitting SPI data, in DMA-able space.
352352 * @msg_enable: The message flags controlling driver output (see ethtool).
353+ * @tx_space: Free space in the hardware TX buffer (cached copy of KS_TXMIR).
354+ * @queued_len: Space required in hardware TX buffer for queued packets in txq.
353355 * @fid: Incrementing frame id tag.
354356 * @rc_ier: Cached copy of KS_IER.
355357 * @rc_ccr: Cached copy of KS_CCR.
@@ -399,6 +401,7 @@ struct ks8851_net { · 43 unmodified lines
399401 struct work_struct rxctrl_work;
400402
401403 struct sk_buff_head txq;
404+ unsigned int queued_len;
402405
403406 struct eeprom_93cx6 eeprom;
404407 struct regulator *vdd_reg;
drivers/net/ethernet/micrel/ks8851_common.c+10−10
@@ -362,16 +362,18 @@ static irqreturn_t ks8851_irq(int irq, void *_ks) · 361 unmodified lines
362362 handled |= IRQ_RXPSI;
363363
364364 if (status & IRQ_TXI) {
365− handled |= IRQ_TXI;
365+ unsigned short tx_space = ks8851_rdreg16(ks, KS_TXMIR);
366366
367− /* no lock here, tx queue should have been stopped */
367+ netif_dbg(ks, intr, ks->netdev,
368+ "%s: txspace %d\n", __func__, tx_space);
368369
369− /* update our idea of how much tx space is available to the
370− * system */
371− ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
370+ spin_lock(&ks->statelock);
371+ ks->tx_space = tx_space;
372+ if (netif_queue_stopped(ks->netdev))
373+ netif_wake_queue(ks->netdev);
374+ spin_unlock(&ks->statelock);
372375
373− netif_dbg(ks, intr, ks->netdev,
374− "%s: txspace %d\n", __func__, ks->tx_space);
376+ handled |= IRQ_TXI;
375377 }
376378
377379 if (status & IRQ_RXI)
@@ -414,9 +416,6 @@ static irqreturn_t ks8851_irq(int irq, void *_ks) · 36 unmodified lines
414416 if (status & IRQ_LCI)
415417 mii_check_link(&ks->mii);
416418
417− if (status & IRQ_TXI)
418− netif_wake_queue(ks->netdev);
419−
420419 return IRQ_HANDLED;
421420 }
422421
@@ -500,6 +499,7 @@ static int ks8851_net_open(struct net_device *dev) · 77 unmodified lines
500499 ks8851_wrreg16(ks, KS_ISR, ks->rc_ier);
501500 ks8851_wrreg16(ks, KS_IER, ks->rc_ier);
502501
502+ ks->queued_len = 0;
503503 netif_start_queue(ks->netdev);
504504
505505 netif_dbg(ks, ifup, ks->netdev, "network device up\n");
drivers/net/ethernet/micrel/ks8851_spi.c+27−15
@@ -286,6 +286,18 @@ static void ks8851_wrfifo_spi(struct ks8851_net *ks, struct sk_buff *txp, · 285 unmodified lines
286286 netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__);
287287 }
288288
289+/**
290+ * calc_txlen - calculate size of message to send packet
291+ * @len: Length of data
292+ *
293+ * Returns the size of the TXFIFO message needed to send
294+ * this packet.
295+ */
296+static unsigned int calc_txlen(unsigned int len)
297+{
298+ return ALIGN(len + 4, 4);
299+}
300+
289301 /**
290302 * ks8851_rx_skb_spi - receive skbuff
291303 * @ks: The device state
@@ -305,7 +317,9 @@ static void ks8851_rx_skb_spi(struct ks8851_net *ks, struct sk_buff *skb) · 13 unmodified lines
305317 */
306318 static void ks8851_tx_work(struct work_struct *work)
307319 {
320+ unsigned int dequeued_len = 0;
308321 struct ks8851_net_spi *kss;
322+ unsigned short tx_space;
309323 struct ks8851_net *ks;
310324 unsigned long flags;
311325 struct sk_buff *txb;
@@ -322,6 +336,8 @@ static void ks8851_tx_work(struct work_struct *work) · 10 unmodified lines
322336 last = skb_queue_empty(&ks->txq);
323337
324338 if (txb) {
339+ dequeued_len += calc_txlen(txb->len);
340+
325341 ks8851_wrreg16_spi(ks, KS_RXQCR,
326342 ks->rc_rxqcr | RXQCR_SDA);
327343 ks8851_wrfifo_spi(ks, txb, last);
@@ -332,6 +348,13 @@ static void ks8851_tx_work(struct work_struct *work) · 4 unmodified lines
332348 }
333349 }
334350
351+ tx_space = ks8851_rdreg16_spi(ks, KS_TXMIR);
352+
353+ spin_lock(&ks->statelock);
354+ ks->queued_len -= dequeued_len;
355+ ks->tx_space = tx_space;
356+ spin_unlock(&ks->statelock);
357+
335358 ks8851_unlock_spi(ks, &flags);
336359 }
337360
@@ -346,18 +369,6 @@ static void ks8851_flush_tx_work_spi(struct ks8851_net *ks) · 8 unmodified lines
346369 flush_work(&kss->tx_work);
347370 }
348371
349−/**
350− * calc_txlen - calculate size of message to send packet
351− * @len: Length of data
352− *
353− * Returns the size of the TXFIFO message needed to send
354− * this packet.
355− */
356−static unsigned int calc_txlen(unsigned int len)
357−{
358− return ALIGN(len + 4, 4);
359−}
360−
361372 /**
362373 * ks8851_start_xmit_spi - transmit packet using SPI
363374 * @skb: The buffer to transmit
@@ -386,16 +397,17 @@ static netdev_tx_t ks8851_start_xmit_spi(struct sk_buff *skb, · 22 unmodified lines
386397
387398 spin_lock(&ks->statelock);
388399
389− if (needed > ks->tx_space) {
400+ if (ks->queued_len + needed > ks->tx_space) {
390401 netif_stop_queue(dev);
391402 ret = NETDEV_TX_BUSY;
392403 } else {
393− ks->tx_space -= needed;
404+ ks->queued_len += needed;
394405 skb_queue_tail(&ks->txq, skb);
395406 }
396407
397408 spin_unlock(&ks->statelock);
398− schedule_work(&kss->tx_work);
409+ if (ret == NETDEV_TX_OK)
410+ schedule_work(&kss->tx_work);
399411
400412 return ret;
401413 }
drivers/net/ethernet/microsoft/Kconfig+1−0
@@ -20,6 +20,7 @@ config MICROSOFT_MANA · 19 unmodified lines
2020 depends on PCI_MSI && X86_64
2121 depends on PCI_HYPERV
2222 select AUXILIARY_BUS
23+ select PAGE_POOL
2324 help
2425 This driver supports Microsoft Azure Network Adapter (MANA).
2526 So far, the driver is only supported on X86_64.
drivers/net/ethernet/mscc/ocelot_stats.c+8−8
@@ -582,10 +582,10 @@ static void ocelot_port_rmon_stats_cb(struct ocelot *ocelot, int port, void *pri · 581 unmodified lines
582582 rmon_stats->hist_tx[0] = s[OCELOT_STAT_TX_64];
583583 rmon_stats->hist_tx[1] = s[OCELOT_STAT_TX_65_127];
584584 rmon_stats->hist_tx[2] = s[OCELOT_STAT_TX_128_255];
585− rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_128_255];
586− rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_256_511];
587− rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_512_1023];
588− rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_1024_1526];
585+ rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_256_511];
586+ rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_512_1023];
587+ rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_1024_1526];
588+ rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_1527_MAX];
589589 }
590590
591591 static void ocelot_port_pmac_rmon_stats_cb(struct ocelot *ocelot, int port,
@@ -610,10 +610,10 @@ static void ocelot_port_pmac_rmon_stats_cb(struct ocelot *ocelot, int port, · 18 unmodified lines
610610 rmon_stats->hist_tx[0] = s[OCELOT_STAT_TX_PMAC_64];
611611 rmon_stats->hist_tx[1] = s[OCELOT_STAT_TX_PMAC_65_127];
612612 rmon_stats->hist_tx[2] = s[OCELOT_STAT_TX_PMAC_128_255];
613− rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_PMAC_128_255];
614− rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_PMAC_256_511];
615− rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_PMAC_512_1023];
616− rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_PMAC_1024_1526];
613+ rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_PMAC_256_511];
614+ rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_PMAC_512_1023];
615+ rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_PMAC_1024_1526];
616+ rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_PMAC_1527_MAX];
617617 }
618618
619619 void ocelot_port_get_rmon_stats(struct ocelot *ocelot, int port,
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+1−1
@@ -237,7 +237,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv) · 236 unmodified lines
237237 */
238238 ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS);
239239
240− if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
240+ if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN))
241241 return;
242242
243243 num_snapshot = (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >>
drivers/net/ethernet/wangxun/libwx/wx_lib.c+6−76
@@ -160,60 +160,6 @@ static __le32 wx_test_staterr(union wx_rx_desc *rx_desc, · 159 unmodified lines
160160 return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits);
161161 }
162162
163−static bool wx_can_reuse_rx_page(struct wx_rx_buffer *rx_buffer,
164− int rx_buffer_pgcnt)
165−{
166− unsigned int pagecnt_bias = rx_buffer->pagecnt_bias;
167− struct page *page = rx_buffer->page;
168−
169− /* avoid re-using remote and pfmemalloc pages */
170− if (!dev_page_is_reusable(page))
171− return false;
172−
173−#if (PAGE_SIZE < 8192)
174− /* if we are only owner of page we can reuse it */
175− if (unlikely((rx_buffer_pgcnt - pagecnt_bias) > 1))
176− return false;
177−#endif
178−
179− /* If we have drained the page fragment pool we need to update
180− * the pagecnt_bias and page count so that we fully restock the
181− * number of references the driver holds.
182− */
183− if (unlikely(pagecnt_bias == 1)) {
184− page_ref_add(page, USHRT_MAX - 1);
185− rx_buffer->pagecnt_bias = USHRT_MAX;
186− }
187−
188− return true;
189−}
190−
191−/**
192− * wx_reuse_rx_page - page flip buffer and store it back on the ring
193− * @rx_ring: rx descriptor ring to store buffers on
194− * @old_buff: donor buffer to have page reused
195− *
196− * Synchronizes page for reuse by the adapter
197− **/
198−static void wx_reuse_rx_page(struct wx_ring *rx_ring,
199− struct wx_rx_buffer *old_buff)
200−{
201− u16 nta = rx_ring->next_to_alloc;
202− struct wx_rx_buffer *new_buff;
203−
204− new_buff = &rx_ring->rx_buffer_info[nta];
205−
206− /* update, and store next to alloc */
207− nta++;
208− rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
209−
210− /* transfer page from old buffer to new buffer */
211− new_buff->page = old_buff->page;
212− new_buff->page_dma = old_buff->page_dma;
213− new_buff->page_offset = old_buff->page_offset;
214− new_buff->pagecnt_bias = old_buff->pagecnt_bias;
215−}
216−
217163 static void wx_dma_sync_frag(struct wx_ring *rx_ring,
218164 struct wx_rx_buffer *rx_buffer)
219165 {
@@ -270,8 +216,6 @@ static struct wx_rx_buffer *wx_get_rx_buffer(struct wx_ring *rx_ring, · 50 unmodified lines
270216 size,
271217 DMA_FROM_DEVICE);
272218 skip_sync:
273− rx_buffer->pagecnt_bias--;
274−
275219 return rx_buffer;
276220 }
277221
@@ -280,19 +224,9 @@ static void wx_put_rx_buffer(struct wx_ring *rx_ring, · 2 unmodified lines
280224 struct sk_buff *skb,
281225 int rx_buffer_pgcnt)
282226 {
283− if (wx_can_reuse_rx_page(rx_buffer, rx_buffer_pgcnt)) {
284− /* hand second half of page back to the ring */
285− wx_reuse_rx_page(rx_ring, rx_buffer);
286− } else {
287− if (!IS_ERR(skb) && WX_CB(skb)->dma == rx_buffer->dma)
288− /* the page has been released from the ring */
289− WX_CB(skb)->page_released = true;
290− else
291− page_pool_put_full_page(rx_ring->page_pool, rx_buffer->page, false);
292−
293− __page_frag_cache_drain(rx_buffer->page,
294− rx_buffer->pagecnt_bias);
295− }
227+ if (!IS_ERR(skb) && WX_CB(skb)->dma == rx_buffer->dma)
228+ /* the page has been released from the ring */
229+ WX_CB(skb)->page_released = true;
296230
297231 /* clear contents of rx_buffer */
298232 rx_buffer->page = NULL;
@@ -335,11 +269,12 @@ static struct sk_buff *wx_build_skb(struct wx_ring *rx_ring, · 36 unmodified lines
335269 if (size <= WX_RXBUFFER_256) {
336270 memcpy(__skb_put(skb, size), page_addr,
337271 ALIGN(size, sizeof(long)));
338− rx_buffer->pagecnt_bias++;
339−
272+ page_pool_put_full_page(rx_ring->page_pool, rx_buffer->page, true);
340273 return skb;
341274 }
342275
276+ skb_mark_for_recycle(skb);
277+
343278 if (!wx_test_staterr(rx_desc, WX_RXD_STAT_EOP))
344279 WX_CB(skb)->dma = rx_buffer->dma;
345280
@@ -382,8 +317,6 @@ static bool wx_alloc_mapped_page(struct wx_ring *rx_ring, · 36 unmodified lines
382317 bi->page_dma = dma;
383318 bi->page = page;
384319 bi->page_offset = 0;
385− page_ref_add(page, USHRT_MAX - 1);
386− bi->pagecnt_bias = USHRT_MAX;
387320
388321 return true;
389322 }
@@ -723,7 +656,6 @@ static int wx_clean_rx_irq(struct wx_q_vector *q_vector, · 333 unmodified lines
723656 /* exit if we failed to retrieve a buffer */
724657 if (!skb) {
725658 rx_ring->rx_stats.alloc_rx_buff_failed++;
726− rx_buffer->pagecnt_bias++;
727659 break;
728660 }
729661
@@ -2248,8 +2180,6 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring) · 1518 unmodified lines
22482180
22492181 /* free resources associated with mapping */
22502182 page_pool_put_full_page(rx_ring->page_pool, rx_buffer->page, false);
2251− __page_frag_cache_drain(rx_buffer->page,
2252− rx_buffer->pagecnt_bias);
22532183
22542184 i++;
22552185 rx_buffer++;
drivers/net/ethernet/wangxun/libwx/wx_type.h+0−1
@@ -787,7 +787,6 @@ struct wx_rx_buffer { · 786 unmodified lines
787787 dma_addr_t page_dma;
788788 struct page *page;
789789 unsigned int page_offset;
790− u16 pagecnt_bias;
791790 };
792791
793792 struct wx_queue_stats {
drivers/net/phy/phy_device.c+4−2
@@ -1548,7 +1548,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, · 1547 unmodified lines
15481548 goto error;
15491549
15501550 phy_resume(phydev);
1551− phy_led_triggers_register(phydev);
1551+ if (!phydev->is_on_sfp_module)
1552+ phy_led_triggers_register(phydev);
15521553
15531554 /**
15541555 * If the external phy used by current mac interface is managed by
@@ -1817,7 +1818,8 @@ void phy_detach(struct phy_device *phydev) · 262 unmodified lines
18171818 }
18181819 phydev->phylink = NULL;
18191820
1820− phy_led_triggers_unregister(phydev);
1821+ if (!phydev->is_on_sfp_module)
1822+ phy_led_triggers_unregister(phydev);
18211823
18221824 if (phydev->mdio.dev.driver)
18231825 module_put(phydev->mdio.dev.driver->owner);
drivers/net/wireless/intel/iwlwifi/pcie/rx.c+1−1
@@ -1385,7 +1385,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, · 1384 unmodified lines
13851385 * if it is true then one of the handlers took the page.
13861386 */
13871387
1388− if (reclaim) {
1388+ if (reclaim && txq) {
13891389 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
13901390 int index = SEQ_TO_INDEX(sequence);
13911391 int cmd_index = iwl_txq_get_cmd_index(txq, index);
drivers/net/wireless/intel/iwlwifi/pcie/trans.c+2−2
@@ -3106,7 +3106,7 @@ static u32 iwl_trans_pcie_dump_rbs(struct iwl_trans *trans, · 3105 unmodified lines
31063106 struct iwl_rxq *rxq = &trans_pcie->rxq[0];
31073107 u32 i, r, j, rb_len = 0;
31083108
3109− spin_lock(&rxq->lock);
3109+ spin_lock_bh(&rxq->lock);
31103110
31113111 r = iwl_get_closed_rb_stts(trans, rxq);
31123112
@@ -3130,7 +3130,7 @@ static u32 iwl_trans_pcie_dump_rbs(struct iwl_trans *trans, · 17 unmodified lines
31303130 *data = iwl_fw_error_next_data(*data);
31313131 }
31323132
3133− spin_unlock(&rxq->lock);
3133+ spin_unlock_bh(&rxq->lock);
31343134
31353135 return rb_len;
31363136 }
drivers/net/wireless/mediatek/mt76/dma.c+6−4
@@ -783,7 +783,7 @@ mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid) · 782 unmodified lines
783783
784784 static void
785785 mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data,
786− int len, bool more, u32 info)
786+ int len, bool more, u32 info, bool allow_direct)
787787 {
788788 struct sk_buff *skb = q->rx_head;
789789 struct skb_shared_info *shinfo = skb_shinfo(skb);
@@ -795,7 +795,7 @@ mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data, · 5 unmodified lines
795795
796796 skb_add_rx_frag(skb, nr_frags, page, offset, len, q->buf_size);
797797 } else {
798− mt76_put_page_pool_buf(data, true);
798+ mt76_put_page_pool_buf(data, allow_direct);
799799 }
800800
801801 if (more)
@@ -815,6 +815,7 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) · 13 unmodified lines
815815 struct sk_buff *skb;
816816 unsigned char *data;
817817 bool check_ddone = false;
818+ bool allow_direct = !mt76_queue_is_wed_rx(q);
818819 bool more;
819820
820821 if (IS_ENABLED(CONFIG_NET_MEDIATEK_SOC_WED) &&
@@ -855,7 +856,8 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) · 34 unmodified lines
855856 }
856857
857858 if (q->rx_head) {
858− mt76_add_fragment(dev, q, data, len, more, info);
859+ mt76_add_fragment(dev, q, data, len, more, info,
860+ allow_direct);
859861 continue;
860862 }
861863
@@ -884,7 +886,7 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) · 22 unmodified lines
884886 continue;
885887
886888 free_frag:
887− mt76_put_page_pool_buf(data, true);
889+ mt76_put_page_pool_buf(data, allow_direct);
888890 }
889891
890892 mt76_dma_rx_fill(dev, q, true);
include/linux/bpf_types.h+4−0
@@ -142,9 +142,13 @@ BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter) · 141 unmodified lines
142142 #ifdef CONFIG_NET
143143 BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns)
144144 BPF_LINK_TYPE(BPF_LINK_TYPE_XDP, xdp)
145+BPF_LINK_TYPE(BPF_LINK_TYPE_NETFILTER, netfilter)
146+BPF_LINK_TYPE(BPF_LINK_TYPE_TCX, tcx)
147+BPF_LINK_TYPE(BPF_LINK_TYPE_NETKIT, netkit)
145148 #endif
146149 #ifdef CONFIG_PERF_EVENTS
147150 BPF_LINK_TYPE(BPF_LINK_TYPE_PERF_EVENT, perf)
148151 #endif
149152 BPF_LINK_TYPE(BPF_LINK_TYPE_KPROBE_MULTI, kprobe_multi)
150153 BPF_LINK_TYPE(BPF_LINK_TYPE_STRUCT_OPS, struct_ops)
154+BPF_LINK_TYPE(BPF_LINK_TYPE_UPROBE_MULTI, uprobe_multi)
include/linux/ieee80211.h+2−1
@@ -4447,7 +4447,8 @@ ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb) · 4446 unmodified lines
44474447 action != WLAN_PUB_ACTION_LOC_TRACK_NOTI &&
44484448 action != WLAN_PUB_ACTION_FTM_REQUEST &&
44494449 action != WLAN_PUB_ACTION_FTM_RESPONSE &&
4450− action != WLAN_PUB_ACTION_FILS_DISCOVERY;
4450+ action != WLAN_PUB_ACTION_FILS_DISCOVERY &&
4451+ action != WLAN_PUB_ACTION_VENDOR_SPECIFIC;
44514452 }
44524453
44534454 /**
include/net/bluetooth/hci_core.h+7−2
@@ -189,6 +189,7 @@ struct blocked_key { · 188 unmodified lines
189189 struct smp_csrk {
190190 bdaddr_t bdaddr;
191191 u8 bdaddr_type;
192+ u8 link_type;
192193 u8 type;
193194 u8 val[16];
194195 };
@@ -198,6 +199,7 @@ struct smp_ltk { · 3 unmodified lines
198199 struct rcu_head rcu;
199200 bdaddr_t bdaddr;
200201 u8 bdaddr_type;
202+ u8 link_type;
201203 u8 authenticated;
202204 u8 type;
203205 u8 enc_size;
@@ -212,6 +214,7 @@ struct smp_irk { · 8 unmodified lines
212214 bdaddr_t rpa;
213215 bdaddr_t bdaddr;
214216 u8 addr_type;
217+ u8 link_type;
215218 u8 val[16];
216219 };
217220
@@ -219,6 +222,8 @@ struct link_key { · 1 unmodified line
219222 struct list_head list;
220223 struct rcu_head rcu;
221224 bdaddr_t bdaddr;
225+ u8 bdaddr_type;
226+ u8 link_type;
222227 u8 type;
223228 u8 val[HCI_LINK_KEY_SIZE];
224229 u8 pin_len;
@@ -1227,11 +1232,11 @@ static inline struct hci_conn *hci_conn_hash_lookup_cis(struct hci_dev *hdev, · 1002 unmodified lines
12271232 continue;
12281233
12291234 /* Match CIG ID if set */
1230− if (cig != BT_ISO_QOS_CIG_UNSET && cig != c->iso_qos.ucast.cig)
1235+ if (cig != c->iso_qos.ucast.cig)
12311236 continue;
12321237
12331238 /* Match CIS ID if set */
1234− if (id != BT_ISO_QOS_CIS_UNSET && id != c->iso_qos.ucast.cis)
1239+ if (id != c->iso_qos.ucast.cis)
12351240 continue;
12361241
12371242 /* Match destination address if set */
include/net/ip6_fib.h+13−51
@@ -179,9 +179,6 @@ struct fib6_info { · 178 unmodified lines
179179
180180 refcount_t fib6_ref;
181181 unsigned long expires;
182−
183− struct hlist_node gc_link;
184−
185182 struct dst_metrics *fib6_metrics;
186183 #define fib6_pmtu fib6_metrics->metrics[RTAX_MTU-1]
187184
@@ -250,6 +247,19 @@ static inline bool fib6_requires_src(const struct fib6_info *rt) · 62 unmodified lines
250247 return rt->fib6_src.plen > 0;
251248 }
252249
250+static inline void fib6_clean_expires(struct fib6_info *f6i)
251+{
252+ f6i->fib6_flags &= ~RTF_EXPIRES;
253+ f6i->expires = 0;
254+}
255+
256+static inline void fib6_set_expires(struct fib6_info *f6i,
257+ unsigned long expires)
258+{
259+ f6i->expires = expires;
260+ f6i->fib6_flags |= RTF_EXPIRES;
261+}
262+
253263 static inline bool fib6_check_expired(const struct fib6_info *f6i)
254264 {
255265 if (f6i->fib6_flags & RTF_EXPIRES)
@@ -257,11 +267,6 @@ static inline bool fib6_check_expired(const struct fib6_info *f6i) · 1 unmodified line
257267 return false;
258268 }
259269
260−static inline bool fib6_has_expires(const struct fib6_info *f6i)
261−{
262− return f6i->fib6_flags & RTF_EXPIRES;
263−}
264−
265270 /* Function to safely get fn->fn_sernum for passed in rt
266271 * and store result in passed in cookie.
267272 * Return true if we can get cookie safely
@@ -383,7 +388,6 @@ struct fib6_table { · 115 unmodified lines
383388 struct inet_peer_base tb6_peers;
384389 unsigned int flags;
385390 unsigned int fib_seq;
386− struct hlist_head tb6_gc_hlist; /* GC candidates */
387391 #define RT6_TABLE_HAS_DFLT_ROUTER BIT(0)
388392 };
389393
@@ -500,48 +504,6 @@ void fib6_gc_cleanup(void); · 110 unmodified lines
500504
501505 int fib6_init(void);
502506
503−/* fib6_info must be locked by the caller, and fib6_info->fib6_table can be
504− * NULL.
505− */
506−static inline void fib6_set_expires_locked(struct fib6_info *f6i,
507− unsigned long expires)
508−{
509− struct fib6_table *tb6;
510−
511− tb6 = f6i->fib6_table;
512− f6i->expires = expires;
513− if (tb6 && !fib6_has_expires(f6i))
514− hlist_add_head(&f6i->gc_link, &tb6->tb6_gc_hlist);
515− f6i->fib6_flags |= RTF_EXPIRES;
516−}
517−
518−/* fib6_info must be locked by the caller, and fib6_info->fib6_table can be
519− * NULL. If fib6_table is NULL, the fib6_info will no be inserted into the
520− * list of GC candidates until it is inserted into a table.
521− */
522−static inline void fib6_set_expires(struct fib6_info *f6i,
523− unsigned long expires)
524−{
525− spin_lock_bh(&f6i->fib6_table->tb6_lock);
526− fib6_set_expires_locked(f6i, expires);
527− spin_unlock_bh(&f6i->fib6_table->tb6_lock);
528−}
529−
530−static inline void fib6_clean_expires_locked(struct fib6_info *f6i)
531−{
532− if (fib6_has_expires(f6i))
533− hlist_del_init(&f6i->gc_link);
534− f6i->fib6_flags &= ~RTF_EXPIRES;
535− f6i->expires = 0;
536−}
537−
538−static inline void fib6_clean_expires(struct fib6_info *f6i)
539−{
540− spin_lock_bh(&f6i->fib6_table->tb6_lock);
541− fib6_clean_expires_locked(f6i);
542− spin_unlock_bh(&f6i->fib6_table->tb6_lock);
543−}
544−
545507 struct ipv6_route_iter {
546508 struct seq_net_private p;
547509 struct fib6_walker w;
include/net/sock.h+5−0
@@ -2799,6 +2799,11 @@ static inline bool sk_is_tcp(const struct sock *sk) · 2798 unmodified lines
27992799 return sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP;
28002800 }
28012801
2802+static inline bool sk_is_stream_unix(const struct sock *sk)
2803+{
2804+ return sk->sk_family == AF_UNIX && sk->sk_type == SOCK_STREAM;
2805+}
2806+
28022807 /**
28032808 * sk_eat_skb - Release a skb if it is no longer needed
28042809 * @sk: socket to eat this skb from
net/8021q/vlan_core.c+8−1
@@ -407,6 +407,8 @@ int vlan_vids_add_by_dev(struct net_device *dev, · 406 unmodified lines
407407 return 0;
408408
409409 list_for_each_entry(vid_info, &vlan_info->vid_list, list) {
410+ if (!vlan_hw_filter_capable(by_dev, vid_info->proto))
411+ continue;
410412 err = vlan_vid_add(dev, vid_info->proto, vid_info->vid);
411413 if (err)
412414 goto unwind;
@@ -417,6 +419,8 @@ unwind: · 4 unmodified lines
417419 list_for_each_entry_continue_reverse(vid_info,
418420 &vlan_info->vid_list,
419421 list) {
422+ if (!vlan_hw_filter_capable(by_dev, vid_info->proto))
423+ continue;
420424 vlan_vid_del(dev, vid_info->proto, vid_info->vid);
421425 }
422426
@@ -436,8 +440,11 @@ void vlan_vids_del_by_dev(struct net_device *dev, · 13 unmodified lines
436440 if (!vlan_info)
437441 return;
438442
439− list_for_each_entry(vid_info, &vlan_info->vid_list, list)
443+ list_for_each_entry(vid_info, &vlan_info->vid_list, list) {
444+ if (!vlan_hw_filter_capable(by_dev, vid_info->proto))
445+ continue;
440446 vlan_vid_del(dev, vid_info->proto, vid_info->vid);
447+ }
441448 }
442449 EXPORT_SYMBOL(vlan_vids_del_by_dev);
443450
net/bluetooth/af_bluetooth.c+6−1
@@ -309,11 +309,14 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, · 308 unmodified lines
309309 if (flags & MSG_OOB)
310310 return -EOPNOTSUPP;
311311
312+ lock_sock(sk);
313+
312314 skb = skb_recv_datagram(sk, flags, &err);
313315 if (!skb) {
314316 if (sk->sk_shutdown & RCV_SHUTDOWN)
315− return 0;
317+ err = 0;
316318
319+ release_sock(sk);
317320 return err;
318321 }
319322
@@ -343,6 +346,8 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, · 23 unmodified lines
343346
344347 skb_free_datagram(sk, skb);
345348
349+ release_sock(sk);
350+
346351 if (flags & MSG_TRUNC)
347352 copied = skblen;
348353
net/bluetooth/hci_event.c+21−9
@@ -516,6 +516,9 @@ static u8 hci_cc_read_class_of_dev(struct hci_dev *hdev, void *data, · 515 unmodified lines
516516 {
517517 struct hci_rp_read_class_of_dev *rp = data;
518518
519+ if (WARN_ON(!hdev))
520+ return HCI_ERROR_UNSPECIFIED;
521+
519522 bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
520523
521524 if (rp->status)
@@ -747,9 +750,23 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data, · 225 unmodified lines
747750 } else {
748751 conn->enc_key_size = rp->key_size;
749752 status = 0;
753+
754+ if (conn->enc_key_size < hdev->min_enc_key_size) {
755+ /* As slave role, the conn->state has been set to
756+ * BT_CONNECTED and l2cap conn req might not be received
757+ * yet, at this moment the l2cap layer almost does
758+ * nothing with the non-zero status.
759+ * So we also clear encrypt related bits, and then the
760+ * handler of l2cap conn req will get the right secure
761+ * state at a later time.
762+ */
763+ status = HCI_ERROR_AUTH_FAILURE;
764+ clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
765+ clear_bit(HCI_CONN_AES_CCM, &conn->flags);
766+ }
750767 }
751768
752− hci_encrypt_cfm(conn, 0);
769+ hci_encrypt_cfm(conn, status);
753770
754771 done:
755772 hci_dev_unlock(hdev);
@@ -820,8 +837,6 @@ static u8 hci_cc_write_auth_payload_timeout(struct hci_dev *hdev, void *data, · 64 unmodified lines
820837 if (!rp->status)
821838 conn->auth_payload_timeout = get_unaligned_le16(sent + 2);
822839
823− hci_encrypt_cfm(conn, 0);
824−
825840 unlock:
826841 hci_dev_unlock(hdev);
827842
@@ -2304,7 +2319,8 @@ static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) · 1476 unmodified lines
23042319 return;
23052320 }
23062321
2307− set_bit(HCI_INQUIRY, &hdev->flags);
2322+ if (hci_sent_cmd_data(hdev, HCI_OP_INQUIRY))
2323+ set_bit(HCI_INQUIRY, &hdev->flags);
23082324 }
23092325
23102326 static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
@@ -3683,12 +3699,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data, · 1372 unmodified lines
36833699 cp.handle = cpu_to_le16(conn->handle);
36843700 cp.timeout = cpu_to_le16(hdev->auth_payload_timeout);
36853701 if (hci_send_cmd(conn->hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO,
3686− sizeof(cp), &cp)) {
3702+ sizeof(cp), &cp))
36873703 bt_dev_err(hdev, "write auth payload timeout failed");
3688− goto notify;
3689− }
3690−
3691− goto unlock;
36923704 }
36933705
36943706 notify:
net/bluetooth/l2cap_core.c+15−6
@@ -6492,6 +6492,14 @@ drop: · 6491 unmodified lines
64926492 kfree_skb(skb);
64936493 }
64946494
6495+static inline void l2cap_sig_send_rej(struct l2cap_conn *conn, u16 ident)
6496+{
6497+ struct l2cap_cmd_rej_unk rej;
6498+
6499+ rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD);
6500+ l2cap_send_cmd(conn, ident, L2CAP_COMMAND_REJ, sizeof(rej), &rej);
6501+}
6502+
64956503 static inline void l2cap_sig_channel(struct l2cap_conn *conn,
64966504 struct sk_buff *skb)
64976505 {
@@ -6517,23 +6525,24 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn, · 19 unmodified lines
65176525
65186526 if (len > skb->len || !cmd->ident) {
65196527 BT_DBG("corrupted command");
6528+ l2cap_sig_send_rej(conn, cmd->ident);
65206529 break;
65216530 }
65226531
65236532 err = l2cap_bredr_sig_cmd(conn, cmd, len, skb->data);
65246533 if (err) {
6525− struct l2cap_cmd_rej_unk rej;
6526−
65276534 BT_ERR("Wrong link type (%d)", err);
6528−
6529− rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD);
6530− l2cap_send_cmd(conn, cmd->ident, L2CAP_COMMAND_REJ,
6531− sizeof(rej), &rej);
6535+ l2cap_sig_send_rej(conn, cmd->ident);
65326536 }
65336537
65346538 skb_pull(skb, len);
65356539 }
65366540
6541+ if (skb->len > 0) {
6542+ BT_DBG("corrupted command");
6543+ l2cap_sig_send_rej(conn, 0);
6544+ }
6545+
65376546 drop:
65386547 kfree_skb(skb);
65396548 }
net/bluetooth/mgmt.c+18−7
@@ -2897,7 +2897,8 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, · 2896 unmodified lines
28972897 for (i = 0; i < key_count; i++) {
28982898 struct mgmt_link_key_info *key = &cp->keys[i];
28992899
2900− if (key->addr.type != BDADDR_BREDR || key->type > 0x08)
2900+ /* Considering SMP over BREDR/LE, there is no need to check addr_type */
2901+ if (key->type > 0x08)
29012902 return mgmt_cmd_status(sk, hdev->id,
29022903 MGMT_OP_LOAD_LINK_KEYS,
29032904 MGMT_STATUS_INVALID_PARAMS);
@@ -7130,6 +7131,7 @@ static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data, · 4226 unmodified lines
71307131
71317132 for (i = 0; i < irk_count; i++) {
71327133 struct mgmt_irk_info *irk = &cp->irks[i];
7134+ u8 addr_type = le_addr_type(irk->addr.type);
71337135
71347136 if (hci_is_blocked_key(hdev,
71357137 HCI_BLOCKED_KEY_TYPE_IRK,
@@ -7139,8 +7141,12 @@ static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data, · 3 unmodified lines
71397141 continue;
71407142 }
71417143
7144+ /* When using SMP over BR/EDR, the addr type should be set to BREDR */
7145+ if (irk->addr.type == BDADDR_BREDR)
7146+ addr_type = BDADDR_BREDR;
7147+
71427148 hci_add_irk(hdev, &irk->addr.bdaddr,
7143− le_addr_type(irk->addr.type), irk->val,
7149+ addr_type, irk->val,
71447150 BDADDR_ANY);
71457151 }
71467152
@@ -7221,6 +7227,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, · 74 unmodified lines
72217227 for (i = 0; i < key_count; i++) {
72227228 struct mgmt_ltk_info *key = &cp->keys[i];
72237229 u8 type, authenticated;
7230+ u8 addr_type = le_addr_type(key->addr.type);
72247231
72257232 if (hci_is_blocked_key(hdev,
72267233 HCI_BLOCKED_KEY_TYPE_LTK,
@@ -7255,8 +7262,12 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, · 28 unmodified lines
72557262 continue;
72567263 }
72577264
7265+ /* When using SMP over BR/EDR, the addr type should be set to BREDR */
7266+ if (key->addr.type == BDADDR_BREDR)
7267+ addr_type = BDADDR_BREDR;
7268+
72587269 hci_add_ltk(hdev, &key->addr.bdaddr,
7259− le_addr_type(key->addr.type), type, authenticated,
7270+ addr_type, type, authenticated,
72607271 key->val, key->enc_size, key->ediv, key->rand);
72617272 }
72627273
@@ -9523,7 +9534,7 @@ void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, · 2260 unmodified lines
95239534
95249535 ev.store_hint = persistent;
95259536 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
9526− ev.key.addr.type = BDADDR_BREDR;
9537+ ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
95279538 ev.key.type = key->type;
95289539 memcpy(ev.key.val, key->val, HCI_LINK_KEY_SIZE);
95299540 ev.key.pin_len = key->pin_len;
@@ -9574,7 +9585,7 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent) · 44 unmodified lines
95749585 ev.store_hint = persistent;
95759586
95769587 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
9577− ev.key.addr.type = link_to_bdaddr(LE_LINK, key->bdaddr_type);
9588+ ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
95789589 ev.key.type = mgmt_ltk_type(key);
95799590 ev.key.enc_size = key->enc_size;
95809591 ev.key.ediv = key->ediv;
@@ -9603,7 +9614,7 @@ void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent) · 22 unmodified lines
96039614
96049615 bacpy(&ev.rpa, &irk->rpa);
96059616 bacpy(&ev.irk.addr.bdaddr, &irk->bdaddr);
9606− ev.irk.addr.type = link_to_bdaddr(LE_LINK, irk->addr_type);
9617+ ev.irk.addr.type = link_to_bdaddr(irk->link_type, irk->addr_type);
96079618 memcpy(ev.irk.val, irk->val, sizeof(irk->val));
96089619
96099620 mgmt_event(MGMT_EV_NEW_IRK, hdev, &ev, sizeof(ev), NULL);
@@ -9632,7 +9643,7 @@ void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, · 22 unmodified lines
96329643 ev.store_hint = persistent;
96339644
96349645 bacpy(&ev.key.addr.bdaddr, &csrk->bdaddr);
9635− ev.key.addr.type = link_to_bdaddr(LE_LINK, csrk->bdaddr_type);
9646+ ev.key.addr.type = link_to_bdaddr(csrk->link_type, csrk->bdaddr_type);
96369647 ev.key.type = csrk->type;
96379648 memcpy(ev.key.val, csrk->val, sizeof(csrk->val));
96389649
net/bluetooth/smp.c+7−0
@@ -1059,6 +1059,7 @@ static void smp_notify_keys(struct l2cap_conn *conn) · 1058 unmodified lines
10591059 }
10601060
10611061 if (smp->remote_irk) {
1062+ smp->remote_irk->link_type = hcon->type;
10621063 mgmt_new_irk(hdev, smp->remote_irk, persistent);
10631064
10641065 /* Now that user space can be considered to know the
@@ -1078,24 +1079,28 @@ static void smp_notify_keys(struct l2cap_conn *conn) · 13 unmodified lines
10781079 }
10791080
10801081 if (smp->csrk) {
1082+ smp->csrk->link_type = hcon->type;
10811083 smp->csrk->bdaddr_type = hcon->dst_type;
10821084 bacpy(&smp->csrk->bdaddr, &hcon->dst);
10831085 mgmt_new_csrk(hdev, smp->csrk, persistent);
10841086 }
10851087
10861088 if (smp->responder_csrk) {
1089+ smp->responder_csrk->link_type = hcon->type;
10871090 smp->responder_csrk->bdaddr_type = hcon->dst_type;
10881091 bacpy(&smp->responder_csrk->bdaddr, &hcon->dst);
10891092 mgmt_new_csrk(hdev, smp->responder_csrk, persistent);
10901093 }
10911094
10921095 if (smp->ltk) {
1096+ smp->ltk->link_type = hcon->type;
10931097 smp->ltk->bdaddr_type = hcon->dst_type;
10941098 bacpy(&smp->ltk->bdaddr, &hcon->dst);
10951099 mgmt_new_ltk(hdev, smp->ltk, persistent);
10961100 }
10971101
10981102 if (smp->responder_ltk) {
1103+ smp->responder_ltk->link_type = hcon->type;
10991104 smp->responder_ltk->bdaddr_type = hcon->dst_type;
11001105 bacpy(&smp->responder_ltk->bdaddr, &hcon->dst);
11011106 mgmt_new_ltk(hdev, smp->responder_ltk, persistent);
@@ -1115,6 +1120,8 @@ static void smp_notify_keys(struct l2cap_conn *conn) · 13 unmodified lines
11151120 key = hci_add_link_key(hdev, smp->conn->hcon, &hcon->dst,
11161121 smp->link_key, type, 0, &persistent);
11171122 if (key) {
1123+ key->link_type = hcon->type;
1124+ key->bdaddr_type = hcon->dst_type;
11181125 mgmt_new_link_key(hdev, key, persistent);
11191126
11201127 /* Don't keep debug keys around if the relevant
net/core/dev.c+3−0
@@ -3472,6 +3472,9 @@ static netdev_features_t gso_features_check(const struct sk_buff *skb, · 3471 unmodified lines
34723472 if (gso_segs > READ_ONCE(dev->gso_max_segs))
34733473 return features & ~NETIF_F_GSO_MASK;
34743474
3475+ if (unlikely(skb->len >= READ_ONCE(dev->gso_max_size)))
3476+ return features & ~NETIF_F_GSO_MASK;
3477+
34753478 if (!skb_shinfo(skb)->gso_type) {
34763479 skb_warn_bad_offload(skb);
34773480 return features & ~NETIF_F_GSO_MASK;
net/core/skbuff.c+2−0
@@ -4825,7 +4825,9 @@ static __always_inline unsigned int skb_ext_total_length(void) · 4824 unmodified lines
48254825 static void skb_extensions_init(void)
48264826 {
48274827 BUILD_BUG_ON(SKB_EXT_NUM >= 8);
4828+#if !IS_ENABLED(CONFIG_KCOV_INSTRUMENT_ALL)
48284829 BUILD_BUG_ON(skb_ext_total_length() > 255);
4830+#endif
48294831
48304832 skbuff_ext_cache = kmem_cache_create("skbuff_ext_cache",
48314833 SKB_EXT_ALIGN_VALUE * skb_ext_total_length(),
net/core/sock_map.c+2−0
@@ -536,6 +536,8 @@ static bool sock_map_sk_state_allowed(const struct sock *sk) · 535 unmodified lines
536536 {
537537 if (sk_is_tcp(sk))
538538 return (1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_LISTEN);
539+ if (sk_is_stream_unix(sk))
540+ return (1 << sk->sk_state) & TCPF_ESTABLISHED;
539541 return true;
540542 }
541543
net/core/stream.c+1−1
@@ -79,7 +79,7 @@ int sk_stream_wait_connect(struct sock *sk, long *timeo_p) · 78 unmodified lines
7979 remove_wait_queue(sk_sleep(sk), &wait);
8080 sk->sk_write_pending--;
8181 } while (!done);
82− return 0;
82+ return done < 0 ? done : 0;
8383 }
8484 EXPORT_SYMBOL(sk_stream_wait_connect);
8585
net/ife/ife.c+1−0
@@ -82,6 +82,7 @@ void *ife_decode(struct sk_buff *skb, u16 *metalen) · 81 unmodified lines
8282 if (unlikely(!pskb_may_pull(skb, total_pull)))
8383 return NULL;
8484
85+ ifehdr = (struct ifeheadr *)(skb->data + skb->dev->hard_header_len);
8586 skb_set_mac_header(skb, total_pull);
8687 __skb_pull(skb, total_pull);
8788 *metalen = ifehdrln - IFE_METAHDRLEN;
net/ipv6/ip6_fib.c+6−49
@@ -160,8 +160,6 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh) · 159 unmodified lines
160160 INIT_LIST_HEAD(&f6i->fib6_siblings);
161161 refcount_set(&f6i->fib6_ref, 1);
162162
163− INIT_HLIST_NODE(&f6i->gc_link);
164−
165163 return f6i;
166164 }
167165
@@ -248,7 +246,6 @@ static struct fib6_table *fib6_alloc_table(struct net *net, u32 id) · 80 unmodified lines
248246 net->ipv6.fib6_null_entry);
249247 table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
250248 inet_peer_base_init(&table->tb6_peers);
251− INIT_HLIST_HEAD(&table->tb6_gc_hlist);
252249 }
253250
254251 return table;
@@ -1060,8 +1057,6 @@ static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn, · 805 unmodified lines
10601057 lockdep_is_held(&table->tb6_lock));
10611058 }
10621059 }
1063−
1064− fib6_clean_expires_locked(rt);
10651060 }
10661061
10671062 /*
@@ -1123,10 +1118,9 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt, · 55 unmodified lines
11231118 if (!(iter->fib6_flags & RTF_EXPIRES))
11241119 return -EEXIST;
11251120 if (!(rt->fib6_flags & RTF_EXPIRES))
1126− fib6_clean_expires_locked(iter);
1121+ fib6_clean_expires(iter);
11271122 else
1128− fib6_set_expires_locked(iter,
1129− rt->expires);
1123+ fib6_set_expires(iter, rt->expires);
11301124
11311125 if (rt->fib6_pmtu)
11321126 fib6_metric_set(iter, RTAX_MTU,
@@ -1485,10 +1479,6 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt, · 352 unmodified lines
14851479 if (rt->nh)
14861480 list_add(&rt->nh_list, &rt->nh->f6i_list);
14871481 __fib6_update_sernum_upto_root(rt, fib6_new_sernum(info->nl_net));
1488−
1489− if (fib6_has_expires(rt))
1490− hlist_add_head(&rt->gc_link, &table->tb6_gc_hlist);
1491−
14921482 fib6_start_gc(info->nl_net, rt);
14931483 }
14941484
@@ -2291,8 +2281,9 @@ static void fib6_flush_trees(struct net *net) · 796 unmodified lines
22912281 * Garbage collection
22922282 */
22932283
2294−static int fib6_age(struct fib6_info *rt, struct fib6_gc_args *gc_args)
2284+static int fib6_age(struct fib6_info *rt, void *arg)
22952285 {
2286+ struct fib6_gc_args *gc_args = arg;
22962287 unsigned long now = jiffies;
22972288
22982289 /*
@@ -2300,7 +2291,7 @@ static int fib6_age(struct fib6_info *rt, struct fib6_gc_args *gc_args) · 1 unmodified line
23002291 * Routes are expired even if they are in use.
23012292 */
23022293
2303− if (fib6_has_expires(rt) && rt->expires) {
2294+ if (rt->fib6_flags & RTF_EXPIRES && rt->expires) {
23042295 if (time_after(now, rt->expires)) {
23052296 RT6_TRACE("expiring %p\n", rt);
23062297 return -1;
@@ -2317,40 +2308,6 @@ static int fib6_age(struct fib6_info *rt, struct fib6_gc_args *gc_args) · 10 unmodified lines
23172308 return 0;
23182309 }
23192310
2320−static void fib6_gc_table(struct net *net,
2321− struct fib6_table *tb6,
2322− struct fib6_gc_args *gc_args)
2323−{
2324− struct fib6_info *rt;
2325− struct hlist_node *n;
2326− struct nl_info info = {
2327− .nl_net = net,
2328− .skip_notify = false,
2329− };
2330−
2331− hlist_for_each_entry_safe(rt, n, &tb6->tb6_gc_hlist, gc_link)
2332− if (fib6_age(rt, gc_args) == -1)
2333− fib6_del(rt, &info);
2334−}
2335−
2336−static void fib6_gc_all(struct net *net, struct fib6_gc_args *gc_args)
2337−{
2338− struct fib6_table *table;
2339− struct hlist_head *head;
2340− unsigned int h;
2341−
2342− rcu_read_lock();
2343− for (h = 0; h < FIB6_TABLE_HASHSZ; h++) {
2344− head = &net->ipv6.fib_table_hash[h];
2345− hlist_for_each_entry_rcu(table, head, tb6_hlist) {
2346− spin_lock_bh(&table->tb6_lock);
2347− fib6_gc_table(net, table, gc_args);
2348− spin_unlock_bh(&table->tb6_lock);
2349− }
2350− }
2351− rcu_read_unlock();
2352−}
2353−
23542311 void fib6_run_gc(unsigned long expires, struct net *net, bool force)
23552312 {
23562313 struct fib6_gc_args gc_args;
@@ -2366,7 +2323,7 @@ void fib6_run_gc(unsigned long expires, struct net *net, bool force) · 9 unmodified lines
23662323 net->ipv6.sysctl.ip6_rt_gc_interval;
23672324 gc_args.more = 0;
23682325
2369− fib6_gc_all(net, &gc_args);
2326+ fib6_clean_all(net, fib6_age, &gc_args);
23702327 now = jiffies;
23712328 net->ipv6.ip6_rt_last_gc = now;
23722329
net/ipv6/route.c+3−3
@@ -3763,10 +3763,10 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, · 3762 unmodified lines
37633763 rt->dst_nocount = true;
37643764
37653765 if (cfg->fc_flags & RTF_EXPIRES)
3766− fib6_set_expires_locked(rt, jiffies +
3767− clock_t_to_jiffies(cfg->fc_expires));
3766+ fib6_set_expires(rt, jiffies +
3767+ clock_t_to_jiffies(cfg->fc_expires));
37683768 else
3769− fib6_clean_expires_locked(rt);
3769+ fib6_clean_expires(rt);
37703770
37713771 if (cfg->fc_protocol == RTPROT_UNSPEC)
37723772 cfg->fc_protocol = RTPROT_BOOT;
net/mac80211/cfg.c+2−2
@@ -1788,10 +1788,10 @@ static int sta_link_apply_parameters(struct ieee80211_local *local, · 1787 unmodified lines
17881788 lockdep_is_held(&local->hw.wiphy->mtx));
17891789
17901790 /*
1791− * If there are no changes, then accept a link that doesn't exist,
1791+ * If there are no changes, then accept a link that exist,
17921792 * unless it's a new link.
17931793 */
1794− if (params->link_id < 0 && !new_link &&
1794+ if (params->link_id >= 0 && !new_link &&
17951795 !params->link_mac && !params->txpwr_set &&
17961796 !params->supported_rates_len &&
17971797 !params->ht_capa && !params->vht_capa &&
net/mac80211/driver-ops.c+5−1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * Copyright 2015 Intel Deutschland GmbH
4− * Copyright (C) 2022 Intel Corporation
4+ * Copyright (C) 2022-2023 Intel Corporation
55 */
66 #include <net/mac80211.h>
77 #include "ieee80211_i.h"
@@ -589,6 +589,10 @@ int drv_change_sta_links(struct ieee80211_local *local, · 581 unmodified lines
589589 if (ret)
590590 return ret;
591591
592+ /* during reconfig don't add it to debugfs again */
593+ if (local->in_reconfig)
594+ return 0;
595+
592596 for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) {
593597 link_sta = rcu_dereference_protected(info->link[link_id],
594598 lockdep_is_held(&local->hw.wiphy->mtx));
net/mac80211/mesh_plink.c+9−7
@@ -1068,8 +1068,8 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata, · 1067 unmodified lines
10681068 case WLAN_SP_MESH_PEERING_OPEN:
10691069 if (!matches_local)
10701070 event = OPN_RJCT;
1071− if (!mesh_plink_free_count(sdata) ||
1072− (sta->mesh->plid && sta->mesh->plid != plid))
1071+ else if (!mesh_plink_free_count(sdata) ||
1072+ (sta->mesh->plid && sta->mesh->plid != plid))
10731073 event = OPN_IGNR;
10741074 else
10751075 event = OPN_ACPT;
@@ -1077,9 +1077,9 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
10771077 case WLAN_SP_MESH_PEERING_CONFIRM:
10781078 if (!matches_local)
10791079 event = CNF_RJCT;
1080− if (!mesh_plink_free_count(sdata) ||
1081− sta->mesh->llid != llid ||
1082− (sta->mesh->plid && sta->mesh->plid != plid))
1080+ else if (!mesh_plink_free_count(sdata) ||
1081+ sta->mesh->llid != llid ||
1082+ (sta->mesh->plid && sta->mesh->plid != plid))
10831083 event = CNF_IGNR;
10841084 else
10851085 event = CNF_ACPT;
@@ -1247,6 +1247,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 161 unmodified lines
12471247 return;
12481248 }
12491249 elems = ieee802_11_parse_elems(baseaddr, len - baselen, true, NULL);
1250− mesh_process_plink_frame(sdata, mgmt, elems, rx_status);
1251− kfree(elems);
1250+ if (elems) {
1251+ mesh_process_plink_frame(sdata, mgmt, elems, rx_status);
1252+ kfree(elems);
1253+ }
12521254 }
net/mac80211/mlme.c+3−1
@@ -5782,7 +5782,7 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata, · 5781 unmodified lines
57825782 {
57835783 const struct ieee80211_multi_link_elem *ml;
57845784 const struct element *sub;
5785− size_t ml_len;
5785+ ssize_t ml_len;
57865786 unsigned long removed_links = 0;
57875787 u16 link_removal_timeout[IEEE80211_MLD_MAX_NUM_LINKS] = {};
57885788 u8 link_id;
@@ -5798,6 +5798,8 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata, · 9 unmodified lines
57985798 elems->scratch + elems->scratch_len -
57995799 elems->scratch_pos,
58005800 WLAN_EID_FRAGMENT);
5801+ if (ml_len < 0)
5802+ return;
58015803
58025804 elems->ml_reconf = (const void *)elems->scratch_pos;
58035805 elems->ml_reconf_len = ml_len;
net/mptcp/crypto_test.c+1−0
@@ -70,3 +70,4 @@ static struct kunit_suite mptcp_crypto_suite = { · 69 unmodified lines
7070 kunit_test_suite(mptcp_crypto_suite);
7171
7272 MODULE_LICENSE("GPL");
73+MODULE_DESCRIPTION("KUnit tests for MPTCP Crypto");
net/mptcp/protocol.c+3−3
@@ -3402,12 +3402,12 @@ static void mptcp_release_cb(struct sock *sk) · 3401 unmodified lines
34023402 if (__test_and_clear_bit(MPTCP_CLEAN_UNA, &msk->cb_flags))
34033403 __mptcp_clean_una_wakeup(sk);
34043404 if (unlikely(msk->cb_flags)) {
3405− /* be sure to set the current sk state before taking actions
3405+ /* be sure to sync the msk state before taking actions
34063406 * depending on sk_state (MPTCP_ERROR_REPORT)
34073407 * On sk release avoid actions depending on the first subflow
34083408 */
3409− if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags) && msk->first)
3410− __mptcp_set_connected(sk);
3409+ if (__test_and_clear_bit(MPTCP_SYNC_STATE, &msk->cb_flags) && msk->first)
3410+ __mptcp_sync_state(sk, msk->pending_state);
34113411 if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags))
34123412 __mptcp_error_report(sk);
34133413 if (__test_and_clear_bit(MPTCP_SYNC_SNDBUF, &msk->cb_flags))
net/mptcp/protocol.h+6−3
@@ -124,7 +124,7 @@ · 123 unmodified lines
124124 #define MPTCP_ERROR_REPORT 3
125125 #define MPTCP_RETRANSMIT 4
126126 #define MPTCP_FLUSH_JOIN_LIST 5
127−#define MPTCP_CONNECTED 6
127+#define MPTCP_SYNC_STATE 6
128128 #define MPTCP_SYNC_SNDBUF 7
129129
130130 struct mptcp_skb_cb {
@@ -296,6 +296,9 @@ struct mptcp_sock { · 165 unmodified lines
296296 bool use_64bit_ack; /* Set when we received a 64-bit DSN */
297297 bool csum_enabled;
298298 bool allow_infinite_fallback;
299+ u8 pending_state; /* A subflow asked to set this sk_state,
300+ * protected by the msk data lock
301+ */
299302 u8 mpc_endpoint_id;
300303 u8 recvmsg_inq:1,
301304 cork:1,
@@ -728,7 +731,7 @@ void mptcp_get_options(const struct sk_buff *skb, · 426 unmodified lines
728731 struct mptcp_options_received *mp_opt);
729732
730733 void mptcp_finish_connect(struct sock *sk);
731−void __mptcp_set_connected(struct sock *sk);
734+void __mptcp_sync_state(struct sock *sk, int state);
732735 void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout);
733736
734737 static inline void mptcp_stop_tout_timer(struct sock *sk)
@@ -1115,7 +1118,7 @@ static inline bool subflow_simultaneous_connect(struct sock *sk) · 380 unmodified lines
11151118 {
11161119 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
11171120
1118− return sk->sk_state == TCP_ESTABLISHED &&
1121+ return (1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_FIN_WAIT1) &&
11191122 is_active_ssk(subflow) &&
11201123 !subflow->conn_finished;
11211124 }
net/mptcp/subflow.c+17−11
@@ -419,22 +419,28 @@ static bool subflow_use_different_dport(struct mptcp_sock *msk, const struct soc · 418 unmodified lines
419419 return inet_sk(sk)->inet_dport != inet_sk((struct sock *)msk)->inet_dport;
420420 }
421421
422−void __mptcp_set_connected(struct sock *sk)
422+void __mptcp_sync_state(struct sock *sk, int state)
423423 {
424− __mptcp_propagate_sndbuf(sk, mptcp_sk(sk)->first);
424+ struct mptcp_sock *msk = mptcp_sk(sk);
425+
426+ __mptcp_propagate_sndbuf(sk, msk->first);
425427 if (sk->sk_state == TCP_SYN_SENT) {
426− inet_sk_state_store(sk, TCP_ESTABLISHED);
428+ inet_sk_state_store(sk, state);
427429 sk->sk_state_change(sk);
428430 }
429431 }
430432
431−static void mptcp_set_connected(struct sock *sk)
433+static void mptcp_propagate_state(struct sock *sk, struct sock *ssk)
432434 {
435+ struct mptcp_sock *msk = mptcp_sk(sk);
436+
433437 mptcp_data_lock(sk);
434− if (!sock_owned_by_user(sk))
435− __mptcp_set_connected(sk);
436− else
437− __set_bit(MPTCP_CONNECTED, &mptcp_sk(sk)->cb_flags);
438+ if (!sock_owned_by_user(sk)) {
439+ __mptcp_sync_state(sk, ssk->sk_state);
440+ } else {
441+ msk->pending_state = ssk->sk_state;
442+ __set_bit(MPTCP_SYNC_STATE, &msk->cb_flags);
443+ }
438444 mptcp_data_unlock(sk);
439445 }
440446
@@ -496,7 +502,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) · 55 unmodified lines
496502 subflow_set_remote_key(msk, subflow, &mp_opt);
497503 MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPCAPABLEACTIVEACK);
498504 mptcp_finish_connect(sk);
499− mptcp_set_connected(parent);
505+ mptcp_propagate_state(parent, sk);
500506 } else if (subflow->request_join) {
501507 u8 hmac[SHA256_DIGEST_SIZE];
502508
@@ -540,7 +546,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) · 37 unmodified lines
540546 } else if (mptcp_check_fallback(sk)) {
541547 fallback:
542548 mptcp_rcv_space_init(msk, sk);
543− mptcp_set_connected(parent);
549+ mptcp_propagate_state(parent, sk);
544550 }
545551 return;
546552
@@ -1740,7 +1746,7 @@ static void subflow_state_change(struct sock *sk) · 1193 unmodified lines
17401746 mptcp_rcv_space_init(msk, sk);
17411747 pr_fallback(msk);
17421748 subflow->conn_finished = 1;
1743− mptcp_set_connected(parent);
1749+ mptcp_propagate_state(parent, sk);
17441750 }
17451751
17461752 /* as recvmsg() does not acquire the subflow socket for ssk selection
net/mptcp/token_test.c+1−0
@@ -143,3 +143,4 @@ static struct kunit_suite mptcp_token_suite = { · 142 unmodified lines
143143 kunit_test_suite(mptcp_token_suite);
144144
145145 MODULE_LICENSE("GPL");
146+MODULE_DESCRIPTION("KUnit tests for MPTCP Token");
net/rfkill/rfkill-gpio.c+8−0
@@ -126,6 +126,14 @@ static int rfkill_gpio_probe(struct platform_device *pdev) · 125 unmodified lines
126126 return -EINVAL;
127127 }
128128
129+ ret = gpiod_direction_output(rfkill->reset_gpio, true);
130+ if (ret)
131+ return ret;
132+
133+ ret = gpiod_direction_output(rfkill->shutdown_gpio, true);
134+ if (ret)
135+ return ret;
136+
129137 rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev,
130138 rfkill->type, &rfkill_gpio_ops,
131139 rfkill);
net/rose/af_rose.c+34−5
@@ -182,21 +182,47 @@ void rose_kill_by_neigh(struct rose_neigh *neigh) · 181 unmodified lines
182182 */
183183 static void rose_kill_by_device(struct net_device *dev)
184184 {
185− struct sock *s;
185+ struct sock *sk, *array[16];
186+ struct rose_sock *rose;
187+ bool rescan;
188+ int i, cnt;
186189
190+start:
191+ rescan = false;
192+ cnt = 0;
187193 spin_lock_bh(&rose_list_lock);
188− sk_for_each(s, &rose_list) {
189− struct rose_sock *rose = rose_sk(s);
194+ sk_for_each(sk, &rose_list) {
195+ rose = rose_sk(sk);
196+ if (rose->device == dev) {
197+ if (cnt == ARRAY_SIZE(array)) {
198+ rescan = true;
199+ break;
200+ }
201+ sock_hold(sk);
202+ array[cnt++] = sk;
203+ }
204+ }
205+ spin_unlock_bh(&rose_list_lock);
190206
207+ for (i = 0; i < cnt; i++) {
208+ sk = array[cnt];
209+ rose = rose_sk(sk);
210+ lock_sock(sk);
211+ spin_lock_bh(&rose_list_lock);
191212 if (rose->device == dev) {
192− rose_disconnect(s, ENETUNREACH, ROSE_OUT_OF_ORDER, 0);
213+ rose_disconnect(sk, ENETUNREACH, ROSE_OUT_OF_ORDER, 0);
193214 if (rose->neighbour)
194215 rose->neighbour->use--;
195216 netdev_put(rose->device, &rose->dev_tracker);
196217 rose->device = NULL;
197218 }
219+ spin_unlock_bh(&rose_list_lock);
220+ release_sock(sk);
221+ sock_put(sk);
222+ cond_resched();
198223 }
199− spin_unlock_bh(&rose_list_lock);
224+ if (rescan)
225+ goto start;
200226 }
201227
202228 /*
@@ -656,7 +682,10 @@ static int rose_release(struct socket *sock) · 453 unmodified lines
656682 break;
657683 }
658684
685+ spin_lock_bh(&rose_list_lock);
659686 netdev_put(rose->device, &rose->dev_tracker);
687+ rose->device = NULL;
688+ spin_unlock_bh(&rose_list_lock);
660689 sock->sk = NULL;
661690 release_sock(sk);
662691 sock_put(sk);
net/wireless/certs/wens.hex+87−0
@@ -0,0 +1,87 @@
1+/* Chen-Yu Tsai's regdb certificate */
2+0x30, 0x82, 0x02, 0xa7, 0x30, 0x82, 0x01, 0x8f,
3+0x02, 0x14, 0x61, 0xc0, 0x38, 0x65, 0x1a, 0xab,
4+0xdc, 0xf9, 0x4b, 0xd0, 0xac, 0x7f, 0xf0, 0x6c,
5+0x72, 0x48, 0xdb, 0x18, 0xc6, 0x00, 0x30, 0x0d,
6+0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
7+0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x0f, 0x31,
8+0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03,
9+0x0c, 0x04, 0x77, 0x65, 0x6e, 0x73, 0x30, 0x20,
10+0x17, 0x0d, 0x32, 0x33, 0x31, 0x32, 0x30, 0x31,
11+0x30, 0x37, 0x34, 0x31, 0x31, 0x34, 0x5a, 0x18,
12+0x0f, 0x32, 0x31, 0x32, 0x33, 0x31, 0x31, 0x30,
13+0x37, 0x30, 0x37, 0x34, 0x31, 0x31, 0x34, 0x5a,
14+0x30, 0x0f, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03,
15+0x55, 0x04, 0x03, 0x0c, 0x04, 0x77, 0x65, 0x6e,
16+0x73, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06,
17+0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
18+0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
19+0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
20+0x01, 0x00, 0xa9, 0x7a, 0x2c, 0x78, 0x4d, 0xa7,
21+0x19, 0x2d, 0x32, 0x52, 0xa0, 0x2e, 0x6c, 0xef,
22+0x88, 0x7f, 0x15, 0xc5, 0xb6, 0x69, 0x54, 0x16,
23+0x43, 0x14, 0x79, 0x53, 0xb7, 0xae, 0x88, 0xfe,
24+0xc0, 0xb7, 0x5d, 0x47, 0x8e, 0x1a, 0xe1, 0xef,
25+0xb3, 0x90, 0x86, 0xda, 0xd3, 0x64, 0x81, 0x1f,
26+0xce, 0x5d, 0x9e, 0x4b, 0x6e, 0x58, 0x02, 0x3e,
27+0xb2, 0x6f, 0x5e, 0x42, 0x47, 0x41, 0xf4, 0x2c,
28+0xb8, 0xa8, 0xd4, 0xaa, 0xc0, 0x0e, 0xe6, 0x48,
29+0xf0, 0xa8, 0xce, 0xcb, 0x08, 0xae, 0x37, 0xaf,
30+0xf6, 0x40, 0x39, 0xcb, 0x55, 0x6f, 0x5b, 0x4f,
31+0x85, 0x34, 0xe6, 0x69, 0x10, 0x50, 0x72, 0x5e,
32+0x4e, 0x9d, 0x4c, 0xba, 0x38, 0x36, 0x0d, 0xce,
33+0x73, 0x38, 0xd7, 0x27, 0x02, 0x2a, 0x79, 0x03,
34+0xe1, 0xac, 0xcf, 0xb0, 0x27, 0x85, 0x86, 0x93,
35+0x17, 0xab, 0xec, 0x42, 0x77, 0x37, 0x65, 0x8a,
36+0x44, 0xcb, 0xd6, 0x42, 0x93, 0x92, 0x13, 0xe3,
37+0x39, 0x45, 0xc5, 0x6e, 0x00, 0x4a, 0x7f, 0xcb,
38+0x42, 0x17, 0x2b, 0x25, 0x8c, 0xb8, 0x17, 0x3b,
39+0x15, 0x36, 0x59, 0xde, 0x42, 0xce, 0x21, 0xe6,
40+0xb6, 0xc7, 0x6e, 0x5e, 0x26, 0x1f, 0xf7, 0x8a,
41+0x57, 0x9e, 0xa5, 0x96, 0x72, 0xb7, 0x02, 0x32,
42+0xeb, 0x07, 0x2b, 0x73, 0xe2, 0x4f, 0x66, 0x58,
43+0x9a, 0xeb, 0x0f, 0x07, 0xb6, 0xab, 0x50, 0x8b,
44+0xc3, 0x8f, 0x17, 0xfa, 0x0a, 0x99, 0xc2, 0x16,
45+0x25, 0xbf, 0x2d, 0x6b, 0x1a, 0xaa, 0xe6, 0x3e,
46+0x5f, 0xeb, 0x6d, 0x9b, 0x5d, 0x4d, 0x42, 0x83,
47+0x2d, 0x39, 0xb8, 0xc9, 0xac, 0xdb, 0x3a, 0x91,
48+0x50, 0xdf, 0xbb, 0xb1, 0x76, 0x6d, 0x15, 0x73,
49+0xfd, 0xc6, 0xe6, 0x6b, 0x71, 0x9e, 0x67, 0x36,
50+0x22, 0x83, 0x79, 0xb1, 0xd6, 0xb8, 0x84, 0x52,
51+0xaf, 0x96, 0x5b, 0xc3, 0x63, 0x02, 0x4e, 0x78,
52+0x70, 0x57, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30,
53+0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
54+0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82,
55+0x01, 0x01, 0x00, 0x24, 0x28, 0xee, 0x22, 0x74,
56+0x7f, 0x7c, 0xfa, 0x6c, 0x1f, 0xb3, 0x18, 0xd1,
57+0xc2, 0x3d, 0x7d, 0x29, 0x42, 0x88, 0xad, 0x82,
58+0xa5, 0xb1, 0x8a, 0x05, 0xd0, 0xec, 0x5c, 0x91,
59+0x20, 0xf6, 0x82, 0xfd, 0xd5, 0x67, 0x60, 0x5f,
60+0x31, 0xf5, 0xbd, 0x88, 0x91, 0x70, 0xbd, 0xb8,
61+0xb9, 0x8c, 0x88, 0xfe, 0x53, 0xc9, 0x54, 0x9b,
62+0x43, 0xc4, 0x7a, 0x43, 0x74, 0x6b, 0xdd, 0xb0,
63+0xb1, 0x3b, 0x33, 0x45, 0x46, 0x78, 0xa3, 0x1c,
64+0xef, 0x54, 0x68, 0xf7, 0x85, 0x9c, 0xe4, 0x51,
65+0x6f, 0x06, 0xaf, 0x81, 0xdb, 0x2a, 0x7b, 0x7b,
66+0x6f, 0xa8, 0x9c, 0x67, 0xd8, 0xcb, 0xc9, 0x91,
67+0x40, 0x00, 0xae, 0xd9, 0xa1, 0x9f, 0xdd, 0xa6,
68+0x43, 0x0e, 0x28, 0x7b, 0xaa, 0x1b, 0xe9, 0x84,
69+0xdb, 0x76, 0x64, 0x42, 0x70, 0xc9, 0xc0, 0xeb,
70+0xae, 0x84, 0x11, 0x16, 0x68, 0x4e, 0x84, 0x9e,
71+0x7e, 0x92, 0x36, 0xee, 0x1c, 0x3b, 0x08, 0x63,
72+0xeb, 0x79, 0x84, 0x15, 0x08, 0x9d, 0xaf, 0xc8,
73+0x9a, 0xc7, 0x34, 0xd3, 0x94, 0x4b, 0xd1, 0x28,
74+0x97, 0xbe, 0xd1, 0x45, 0x75, 0xdc, 0x35, 0x62,
75+0xac, 0x1d, 0x1f, 0xb7, 0xb7, 0x15, 0x87, 0xc8,
76+0x98, 0xc0, 0x24, 0x31, 0x56, 0x8d, 0xed, 0xdb,
77+0x06, 0xc6, 0x46, 0xbf, 0x4b, 0x6d, 0xa6, 0xd5,
78+0xab, 0xcc, 0x60, 0xfc, 0xe5, 0x37, 0xb6, 0x53,
79+0x7d, 0x58, 0x95, 0xa9, 0x56, 0xc7, 0xf7, 0xee,
80+0xc3, 0xa0, 0x76, 0xf7, 0x65, 0x4d, 0x53, 0xfa,
81+0xff, 0x5f, 0x76, 0x33, 0x5a, 0x08, 0xfa, 0x86,
82+0x92, 0x5a, 0x13, 0xfa, 0x1a, 0xfc, 0xf2, 0x1b,
83+0x8c, 0x7f, 0x42, 0x6d, 0xb7, 0x7e, 0xb7, 0xb4,
84+0xf0, 0xc7, 0x83, 0xbb, 0xa2, 0x81, 0x03, 0x2d,
85+0xd4, 0x2a, 0x63, 0x3f, 0xf7, 0x31, 0x2e, 0x40,
86+0x33, 0x5c, 0x46, 0xbc, 0x9b, 0xc1, 0x05, 0xa5,
87+0x45, 0x4e, 0xc3,
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c+34−0
@@ -524,6 +524,37 @@ out: · 523 unmodified lines
524524 test_sockmap_pass_prog__destroy(pass);
525525 }
526526
527+static void test_sockmap_unconnected_unix(void)
528+{
529+ int err, map, stream = 0, dgram = 0, zero = 0;
530+ struct test_sockmap_pass_prog *skel;
531+
532+ skel = test_sockmap_pass_prog__open_and_load();
533+ if (!ASSERT_OK_PTR(skel, "open_and_load"))
534+ return;
535+
536+ map = bpf_map__fd(skel->maps.sock_map_rx);
537+
538+ stream = xsocket(AF_UNIX, SOCK_STREAM, 0);
539+ if (stream < 0)
540+ return;
541+
542+ dgram = xsocket(AF_UNIX, SOCK_DGRAM, 0);
543+ if (dgram < 0) {
544+ close(stream);
545+ return;
546+ }
547+
548+ err = bpf_map_update_elem(map, &zero, &stream, BPF_ANY);
549+ ASSERT_ERR(err, "bpf_map_update_elem(stream)");
550+
551+ err = bpf_map_update_elem(map, &zero, &dgram, BPF_ANY);
552+ ASSERT_OK(err, "bpf_map_update_elem(dgram)");
553+
554+ close(stream);
555+ close(dgram);
556+}
557+
527558 void test_sockmap_basic(void)
528559 {
529560 if (test__start_subtest("sockmap create_update_free"))
@@ -566,4 +597,7 @@ void test_sockmap_basic(void) · 36 unmodified lines
566597 test_sockmap_skb_verdict_fionread(false);
567598 if (test__start_subtest("sockmap skb_verdict msg_f_peek"))
568599 test_sockmap_skb_verdict_peek();
600+
601+ if (test__start_subtest("sockmap unconnected af_unix"))
602+ test_sockmap_unconnected_unix();
569603 }
tools/testing/selftests/net/Makefile+1−0
@@ -91,6 +91,7 @@ TEST_PROGS += test_bridge_neigh_suppress.sh · 90 unmodified lines
9191 TEST_PROGS += test_vxlan_nolocalbypass.sh
9292 TEST_PROGS += test_bridge_backup_port.sh
9393 TEST_PROGS += fdb_flush.sh
94+TEST_PROGS += vlan_hw_filter.sh
9495
9596 TEST_FILES := settings
9697
tools/testing/selftests/net/mptcp/mptcp_join.sh+4−4
@@ -2776,7 +2776,7 @@ backup_tests() · 2775 unmodified lines
27762776 fi
27772777
27782778 if reset "mpc backup" &&
2779− continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
2779+ continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
27802780 pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,backup
27812781 speed=slow \
27822782 run_tests $ns1 $ns2 10.0.1.1
@@ -2785,7 +2785,7 @@ backup_tests() · 2 unmodified lines
27852785 fi
27862786
27872787 if reset "mpc backup both sides" &&
2788− continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
2788+ continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
27892789 pm_nl_add_endpoint $ns1 10.0.1.1 flags subflow,backup
27902790 pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,backup
27912791 speed=slow \
@@ -2795,7 +2795,7 @@ backup_tests() · 3 unmodified lines
27952795 fi
27962796
27972797 if reset "mpc switch to backup" &&
2798− continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
2798+ continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
27992799 pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow
28002800 sflags=backup speed=slow \
28012801 run_tests $ns1 $ns2 10.0.1.1
@@ -2804,7 +2804,7 @@ backup_tests() · 2 unmodified lines
28042804 fi
28052805
28062806 if reset "mpc switch to backup both sides" &&
2807− continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
2807+ continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
28082808 pm_nl_add_endpoint $ns1 10.0.1.1 flags subflow
28092809 pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow
28102810 sflags=backup speed=slow \
tools/testing/selftests/net/rtnetlink.sh+1−1
@@ -297,7 +297,7 @@ kci_test_addrlft() · 296 unmodified lines
297297 done
298298
299299 sleep 5
300− run_cmd_grep "10.23.11." ip addr show dev "$devdummy"
300+ run_cmd_grep_fail "10.23.11." ip addr show dev "$devdummy"
301301 if [ $? -eq 0 ]; then
302302 check_err 1
303303 end_test "FAIL: preferred_lft addresses remaining"
tools/testing/selftests/net/vlan_hw_filter.sh+29−0
@@ -0,0 +1,29 @@
1+#!/bin/sh
2+# SPDX-License-Identifier: GPL-2.0
3+
4+readonly NETNS="ns-$(mktemp -u XXXXXX)"
5+
6+ret=0
7+
8+cleanup() {
9+ ip netns del $NETNS
10+}
11+
12+trap cleanup EXIT
13+
14+fail() {
15+ echo "ERROR: ${1:-unexpected return code} (ret: $_)" >&2
16+ ret=1
17+}
18+
19+ip netns add ${NETNS}
20+ip netns exec ${NETNS} ip link add bond0 type bond mode 0
21+ip netns exec ${NETNS} ip link add bond_slave_1 type veth peer veth2
22+ip netns exec ${NETNS} ip link set bond_slave_1 master bond0
23+ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter off
24+ip netns exec ${NETNS} ip link add link bond_slave_1 name bond_slave_1.0 type vlan id 0
25+ip netns exec ${NETNS} ip link add link bond0 name bond0.0 type vlan id 0
26+ip netns exec ${NETNS} ip link set bond_slave_1 nomaster
27+ip netns exec ${NETNS} ip link del veth2 || fail "Please check vlan HW filter function"
28+
29+exit $ret

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t