Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull networking fixes from Paolo Abeni:
"Including fixes from WiFi and netfilter.

Most regressions addressed here come from quite old versions, with the
exceptions of the iavf one and the WiFi fixes. No known outstanding
reports or investigation.

Fixes to fixes:

- eth: iavf: in iavf_down, disable queues when removing the driver

Previous releases - regressions:

- sched: act_ct: additional checks for outdated flows

- tcp: do not leave an empty skb in write queue

- tcp: fix wrong RTO timeout when received SACK reneging

- wifi: cfg80211: pass correct pointer to rdev_inform_bss()

- eth: i40e: sync next_to_clean and next_to_process for programming
status desc

- eth: iavf: initialize waitqueues before starting watchdog_task

Previous releases - always broken:

- eth: r8169: fix data-races

- eth: igb: fix potential memory leak in igb_add_ethtool_nfc_entry

- eth: r8152: avoid writing garbage to the adapter's registers

- eth: gtp: fix fragmentation needed check with gso"

* tag 'net-6.6-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (43 commits)
iavf: in iavf_down, disable queues when removing the driver
vsock/virtio: initialize the_virtio_vsock before using VQs
net: ipv6: fix typo in comments
net: ipv4: fix typo in comments
net/sched: act_ct: additional checks for outdated flows
netfilter: flowtable: GC pushes back packets to classic path
i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR
gtp: fix fragmentation needed check with gso
gtp: uapi: fix GTPA_MAX
Fix NULL pointer dereference in cn_filter()
sfc: cleanup and reduce netlink error messages
net/handshake: fix file ref count in handshake_nl_accept_doit()
wifi: mac80211: don't drop all unprotected public action frames
wifi: cfg80211: fix assoc response warning on failed links
wifi: cfg80211: pass correct pointer to rdev_inform_bss()
isdn: mISDN: hfcsusb: Spelling fix in comment
tcp: fix wrong RTO timeout when received SACK reneging
r8152: Block future register access if register access fails
r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE
r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en()
...

+458 -214
+1 -1
drivers/connector/cn_proc.c
··· 54 54 enum proc_cn_mcast_op mc_op; 55 55 uintptr_t val; 56 56 57 - if (!dsk || !data) 57 + if (!dsk || !dsk->sk_user_data || !data) 58 58 return 0; 59 59 60 60 ptr = (__u32 *)data;
+1 -1
drivers/isdn/hardware/mISDN/hfcsusb.c
··· 678 678 } 679 679 680 680 /* 681 - * disable/enable BChannel for desired protocoll 681 + * disable/enable BChannel for desired protocol 682 682 */ 683 683 static int 684 684 hfcsusb_setup_bch(struct bchannel *bch, int protocol)
+1 -1
drivers/net/ethernet/adi/adin1110.c
··· 294 294 { 295 295 struct adin1110_priv *priv = port_priv->priv; 296 296 u32 header_len = ADIN1110_RD_HEADER_LEN; 297 - struct spi_transfer t; 297 + struct spi_transfer t = {0}; 298 298 u32 frame_size_no_fcs; 299 299 struct sk_buff *rxb; 300 300 u32 frame_size;
+1 -1
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
··· 2170 2170 static struct platform_driver xgene_enet_driver = { 2171 2171 .driver = { 2172 2172 .name = "xgene-enet", 2173 - .of_match_table = of_match_ptr(xgene_enet_of_match), 2173 + .of_match_table = xgene_enet_of_match, 2174 2174 .acpi_match_table = ACPI_PTR(xgene_enet_acpi_match), 2175 2175 }, 2176 2176 .probe = xgene_enet_probe,
+2
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
··· 3816 3816 FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD)); 3817 3817 ret = t4_set_params_timeout(adap, adap->mbox, adap->pf, 0, 1, 3818 3818 &param, &val, 30000); 3819 + if (ret) 3820 + return ret; 3819 3821 3820 3822 /* If we have version number support, then check to see that the new 3821 3823 * firmware got loaded properly.
+1 -1
drivers/net/ethernet/intel/i40e/i40e.h
··· 580 580 #define I40E_FLAG_DISABLE_FW_LLDP BIT(24) 581 581 #define I40E_FLAG_RS_FEC BIT(25) 582 582 #define I40E_FLAG_BASE_R_FEC BIT(26) 583 - #define I40E_FLAG_VF_VLAN_PRUNING BIT(27) 584 583 /* TOTAL_PORT_SHUTDOWN 585 584 * Allows to physically disable the link on the NIC's port. 586 585 * If enabled, (after link down request from the OS) ··· 602 603 * in abilities field of i40e_aq_set_phy_config structure 603 604 */ 604 605 #define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED BIT(27) 606 + #define I40E_FLAG_VF_VLAN_PRUNING BIT(28) 605 607 606 608 struct i40e_client_instance *cinst; 607 609 bool stat_offsets_loaded;
+9 -2
drivers/net/ethernet/intel/i40e/i40e_txrx.c
··· 2544 2544 rx_buffer = i40e_rx_bi(rx_ring, ntp); 2545 2545 i40e_inc_ntp(rx_ring); 2546 2546 i40e_reuse_rx_page(rx_ring, rx_buffer); 2547 - cleaned_count++; 2547 + /* Update ntc and bump cleaned count if not in the 2548 + * middle of mb packet. 2549 + */ 2550 + if (rx_ring->next_to_clean == ntp) { 2551 + rx_ring->next_to_clean = 2552 + rx_ring->next_to_process; 2553 + cleaned_count++; 2554 + } 2548 2555 continue; 2549 2556 } 2550 2557 ··· 2854 2847 return budget; 2855 2848 } 2856 2849 2857 - if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR) 2850 + if (q_vector->tx.ring[0].flags & I40E_TXR_FLAGS_WB_ON_ITR) 2858 2851 q_vector->arm_wb_state = false; 2859 2852 2860 2853 /* Exit the polling mode, but don't re-enable interrupts if stack might
+13 -9
drivers/net/ethernet/intel/i40e/i40e_xsk.c
··· 437 437 unsigned int total_rx_bytes = 0, total_rx_packets = 0; 438 438 u16 next_to_process = rx_ring->next_to_process; 439 439 u16 next_to_clean = rx_ring->next_to_clean; 440 - u16 count_mask = rx_ring->count - 1; 441 440 unsigned int xdp_res, xdp_xmit = 0; 442 441 struct xdp_buff *first = NULL; 442 + u32 count = rx_ring->count; 443 443 struct bpf_prog *xdp_prog; 444 + u32 entries_to_alloc; 444 445 bool failure = false; 445 - u16 cleaned_count; 446 446 447 447 if (next_to_process != next_to_clean) 448 448 first = *i40e_rx_bi(rx_ring, next_to_clean); ··· 475 475 qword); 476 476 bi = *i40e_rx_bi(rx_ring, next_to_process); 477 477 xsk_buff_free(bi); 478 - next_to_process = (next_to_process + 1) & count_mask; 478 + if (++next_to_process == count) 479 + next_to_process = 0; 479 480 continue; 480 481 } 481 482 ··· 494 493 else if (i40e_add_xsk_frag(rx_ring, first, bi, size)) 495 494 break; 496 495 497 - next_to_process = (next_to_process + 1) & count_mask; 496 + if (++next_to_process == count) 497 + next_to_process = 0; 498 498 499 499 if (i40e_is_non_eop(rx_ring, rx_desc)) 500 500 continue; ··· 515 513 516 514 rx_ring->next_to_clean = next_to_clean; 517 515 rx_ring->next_to_process = next_to_process; 518 - cleaned_count = (next_to_clean - rx_ring->next_to_use - 1) & count_mask; 519 516 520 - if (cleaned_count >= I40E_RX_BUFFER_WRITE) 521 - failure |= !i40e_alloc_rx_buffers_zc(rx_ring, cleaned_count); 517 + entries_to_alloc = I40E_DESC_UNUSED(rx_ring); 518 + if (entries_to_alloc >= I40E_RX_BUFFER_WRITE) 519 + failure |= !i40e_alloc_rx_buffers_zc(rx_ring, entries_to_alloc); 522 520 523 521 i40e_finalize_xdp_rx(rx_ring, xdp_xmit); 524 522 i40e_update_rx_stats(rx_ring, total_rx_bytes, total_rx_packets); ··· 754 752 755 753 void i40e_xsk_clean_rx_ring(struct i40e_ring *rx_ring) 756 754 { 757 - u16 count_mask = rx_ring->count - 1; 758 755 u16 ntc = rx_ring->next_to_clean; 759 756 u16 ntu = rx_ring->next_to_use; 760 757 761 - for ( ; ntc != ntu; ntc = (ntc + 1) & count_mask) { 758 + while (ntc != ntu) { 762 759 struct xdp_buff *rx_bi = *i40e_rx_bi(rx_ring, ntc); 763 760 764 761 xsk_buff_free(rx_bi); 762 + ntc++; 763 + if (ntc >= rx_ring->count) 764 + ntc = 0; 765 765 } 766 766 } 767 767
+4 -3
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 1437 1437 adapter->aq_required |= IAVF_FLAG_AQ_DEL_FDIR_FILTER; 1438 1438 if (!list_empty(&adapter->adv_rss_list_head)) 1439 1439 adapter->aq_required |= IAVF_FLAG_AQ_DEL_ADV_RSS_CFG; 1440 - adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; 1441 1440 } 1442 1441 1442 + adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; 1443 1443 mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1444 1444 } 1445 1445 ··· 4982 4982 INIT_WORK(&adapter->finish_config, iavf_finish_config); 4983 4983 INIT_DELAYED_WORK(&adapter->watchdog_task, iavf_watchdog_task); 4984 4984 INIT_DELAYED_WORK(&adapter->client_task, iavf_client_task); 4985 - queue_delayed_work(adapter->wq, &adapter->watchdog_task, 4986 - msecs_to_jiffies(5 * (pdev->devfn & 0x07))); 4987 4985 4988 4986 /* Setup the wait queue for indicating transition to down status */ 4989 4987 init_waitqueue_head(&adapter->down_waitqueue); ··· 4992 4994 /* Setup the wait queue for indicating virtchannel events */ 4993 4995 init_waitqueue_head(&adapter->vc_waitqueue); 4994 4996 4997 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 4998 + msecs_to_jiffies(5 * (pdev->devfn & 0x07))); 4999 + /* Initialization goes on in the work. Do not add more of it below. */ 4995 5000 return 0; 4996 5001 4997 5002 err_ioremap:
+5 -1
drivers/net/ethernet/intel/igb/igb_ethtool.c
··· 2978 2978 if (err) 2979 2979 goto err_out_w_lock; 2980 2980 2981 - igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx); 2981 + err = igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx); 2982 + if (err) 2983 + goto err_out_input_filter; 2982 2984 2983 2985 spin_unlock(&adapter->nfc_lock); 2984 2986 return 0; 2985 2987 2988 + err_out_input_filter: 2989 + igb_erase_filter(adapter, input); 2986 2990 err_out_w_lock: 2987 2991 spin_unlock(&adapter->nfc_lock); 2988 2992 err_out:
+25 -10
drivers/net/ethernet/intel/igc/igc_ethtool.c
··· 1817 1817 struct igc_adapter *adapter = netdev_priv(netdev); 1818 1818 struct net_device *dev = adapter->netdev; 1819 1819 struct igc_hw *hw = &adapter->hw; 1820 - u32 advertising; 1820 + u16 advertised = 0; 1821 1821 1822 1822 /* When adapter in resetting mode, autoneg/speed/duplex 1823 1823 * cannot be changed ··· 1842 1842 while (test_and_set_bit(__IGC_RESETTING, &adapter->state)) 1843 1843 usleep_range(1000, 2000); 1844 1844 1845 - ethtool_convert_link_mode_to_legacy_u32(&advertising, 1846 - cmd->link_modes.advertising); 1847 - /* Converting to legacy u32 drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT. 1848 - * We have to check this and convert it to ADVERTISE_2500_FULL 1849 - * (aka ETHTOOL_LINK_MODE_2500baseX_Full_BIT) explicitly. 1850 - */ 1851 - if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full)) 1852 - advertising |= ADVERTISE_2500_FULL; 1845 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1846 + 2500baseT_Full)) 1847 + advertised |= ADVERTISE_2500_FULL; 1848 + 1849 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1850 + 1000baseT_Full)) 1851 + advertised |= ADVERTISE_1000_FULL; 1852 + 1853 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1854 + 100baseT_Full)) 1855 + advertised |= ADVERTISE_100_FULL; 1856 + 1857 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1858 + 100baseT_Half)) 1859 + advertised |= ADVERTISE_100_HALF; 1860 + 1861 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1862 + 10baseT_Full)) 1863 + advertised |= ADVERTISE_10_FULL; 1864 + 1865 + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 1866 + 10baseT_Half)) 1867 + advertised |= ADVERTISE_10_HALF; 1853 1868 1854 1869 if (cmd->base.autoneg == AUTONEG_ENABLE) { 1855 1870 hw->mac.autoneg = 1; 1856 - hw->phy.autoneg_advertised = advertising; 1871 + hw->phy.autoneg_advertised = advertised; 1857 1872 if (adapter->fc_autoneg) 1858 1873 hw->fc.requested_mode = igc_fc_default; 1859 1874 } else {
+3 -3
drivers/net/ethernet/realtek/r8169_main.c
··· 4364 4364 unsigned int entry = dirty_tx % NUM_TX_DESC; 4365 4365 u32 status; 4366 4366 4367 - status = le32_to_cpu(tp->TxDescArray[entry].opts1); 4367 + status = le32_to_cpu(READ_ONCE(tp->TxDescArray[entry].opts1)); 4368 4368 if (status & DescOwn) 4369 4369 break; 4370 4370 ··· 4394 4394 * If skb is NULL then we come here again once a tx irq is 4395 4395 * triggered after the last fragment is marked transmitted. 4396 4396 */ 4397 - if (tp->cur_tx != dirty_tx && skb) 4397 + if (READ_ONCE(tp->cur_tx) != dirty_tx && skb) 4398 4398 rtl8169_doorbell(tp); 4399 4399 } 4400 4400 } ··· 4427 4427 dma_addr_t addr; 4428 4428 u32 status; 4429 4429 4430 - status = le32_to_cpu(desc->opts1); 4430 + status = le32_to_cpu(READ_ONCE(desc->opts1)); 4431 4431 if (status & DescOwn) 4432 4432 break; 4433 4433
+19 -19
drivers/net/ethernet/sfc/tc.c
··· 629 629 } 630 630 if (child_ip_tos_mask != old->child_ip_tos_mask) { 631 631 NL_SET_ERR_MSG_FMT_MOD(extack, 632 - "Pseudo encap match for TOS mask %#04x conflicts with existing pseudo(MASK) entry for TOS mask %#04x", 632 + "Pseudo encap match for TOS mask %#04x conflicts with existing mask %#04x", 633 633 child_ip_tos_mask, 634 634 old->child_ip_tos_mask); 635 635 return -EEXIST; 636 636 } 637 637 if (child_udp_sport_mask != old->child_udp_sport_mask) { 638 638 NL_SET_ERR_MSG_FMT_MOD(extack, 639 - "Pseudo encap match for UDP src port mask %#x conflicts with existing pseudo(MASK) entry for mask %#x", 639 + "Pseudo encap match for UDP src port mask %#x conflicts with existing mask %#x", 640 640 child_udp_sport_mask, 641 641 old->child_udp_sport_mask); 642 642 return -EEXIST; ··· 1081 1081 /* check that we do not decrement ttl twice */ 1082 1082 if (!efx_tc_flower_action_order_ok(act, 1083 1083 EFX_TC_AO_DEC_TTL)) { 1084 - NL_SET_ERR_MSG_MOD(extack, "Unsupported: multiple dec ttl"); 1084 + NL_SET_ERR_MSG_MOD(extack, "multiple dec ttl are not supported"); 1085 1085 return -EOPNOTSUPP; 1086 1086 } 1087 1087 act->do_ttl_dec = 1; ··· 1106 1106 /* check that we do not decrement hoplimit twice */ 1107 1107 if (!efx_tc_flower_action_order_ok(act, 1108 1108 EFX_TC_AO_DEC_TTL)) { 1109 - NL_SET_ERR_MSG_MOD(extack, "Unsupported: multiple dec ttl"); 1109 + NL_SET_ERR_MSG_MOD(extack, "multiple dec ttl are not supported"); 1110 1110 return -EOPNOTSUPP; 1111 1111 } 1112 1112 act->do_ttl_dec = 1; ··· 1120 1120 } 1121 1121 1122 1122 NL_SET_ERR_MSG_FMT_MOD(extack, 1123 - "Unsupported: ttl add action type %x %x %x/%x", 1123 + "ttl add action type %x %x %x/%x is not supported", 1124 1124 fa->mangle.htype, fa->mangle.offset, 1125 1125 fa->mangle.val, fa->mangle.mask); 1126 1126 return -EOPNOTSUPP; ··· 1164 1164 case 0: 1165 1165 if (fa->mangle.mask) { 1166 1166 NL_SET_ERR_MSG_FMT_MOD(extack, 1167 - "Unsupported: mask (%#x) of eth.dst32 mangle", 1167 + "mask (%#x) of eth.dst32 mangle is not supported", 1168 1168 fa->mangle.mask); 1169 1169 return -EOPNOTSUPP; 1170 1170 } ··· 1184 1184 mung->dst_mac_16 = 1; 1185 1185 } else { 1186 1186 NL_SET_ERR_MSG_FMT_MOD(extack, 1187 - "Unsupported: mask (%#x) of eth+4 mangle is not high or low 16b", 1187 + "mask (%#x) of eth+4 mangle is not high or low 16b", 1188 1188 fa->mangle.mask); 1189 1189 return -EOPNOTSUPP; 1190 1190 } ··· 1192 1192 case 8: 1193 1193 if (fa->mangle.mask) { 1194 1194 NL_SET_ERR_MSG_FMT_MOD(extack, 1195 - "Unsupported: mask (%#x) of eth.src32 mangle", 1195 + "mask (%#x) of eth.src32 mangle is not supported", 1196 1196 fa->mangle.mask); 1197 1197 return -EOPNOTSUPP; 1198 1198 } ··· 1201 1201 mung->src_mac_32 = 1; 1202 1202 return efx_tc_complete_mac_mangle(efx, act, mung, extack); 1203 1203 default: 1204 - NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported: mangle eth+%u %x/%x", 1204 + NL_SET_ERR_MSG_FMT_MOD(extack, "mangle eth+%u %x/%x is not supported", 1205 1205 fa->mangle.offset, fa->mangle.val, fa->mangle.mask); 1206 1206 return -EOPNOTSUPP; 1207 1207 } ··· 1217 1217 /* check that pedit applies to ttl only */ 1218 1218 if (fa->mangle.mask != ~EFX_TC_HDR_TYPE_TTL_MASK) { 1219 1219 NL_SET_ERR_MSG_FMT_MOD(extack, 1220 - "Unsupported: mask (%#x) out of range, only support mangle action on ipv4.ttl", 1220 + "mask (%#x) out of range, only support mangle action on ipv4.ttl", 1221 1221 fa->mangle.mask); 1222 1222 return -EOPNOTSUPP; 1223 1223 } ··· 1227 1227 */ 1228 1228 if (match->mask.ip_ttl != U8_MAX) { 1229 1229 NL_SET_ERR_MSG_FMT_MOD(extack, 1230 - "Unsupported: only support mangle ipv4.ttl when we have an exact match on ttl, mask used for match (%#x)", 1230 + "only support mangle ttl when we have an exact match, current mask (%#x)", 1231 1231 match->mask.ip_ttl); 1232 1232 return -EOPNOTSUPP; 1233 1233 } ··· 1237 1237 */ 1238 1238 if (match->value.ip_ttl == 0) { 1239 1239 NL_SET_ERR_MSG_MOD(extack, 1240 - "Unsupported: we cannot decrement ttl past 0"); 1240 + "decrement ttl past 0 is not supported"); 1241 1241 return -EOPNOTSUPP; 1242 1242 } 1243 1243 ··· 1245 1245 if (!efx_tc_flower_action_order_ok(act, 1246 1246 EFX_TC_AO_DEC_TTL)) { 1247 1247 NL_SET_ERR_MSG_MOD(extack, 1248 - "Unsupported: multiple dec ttl"); 1248 + "multiple dec ttl is not supported"); 1249 1249 return -EOPNOTSUPP; 1250 1250 } 1251 1251 ··· 1259 1259 fallthrough; 1260 1260 default: 1261 1261 NL_SET_ERR_MSG_FMT_MOD(extack, 1262 - "Unsupported: only support mangle on the ttl field (offset is %u)", 1262 + "only support mangle on the ttl field (offset is %u)", 1263 1263 fa->mangle.offset); 1264 1264 return -EOPNOTSUPP; 1265 1265 } ··· 1275 1275 /* check that pedit applies to ttl only */ 1276 1276 if (fa->mangle.mask != EFX_TC_HDR_TYPE_HLIMIT_MASK) { 1277 1277 NL_SET_ERR_MSG_FMT_MOD(extack, 1278 - "Unsupported: mask (%#x) out of range, only support mangle action on ipv6.hop_limit", 1278 + "mask (%#x) out of range, only support mangle action on ipv6.hop_limit", 1279 1279 fa->mangle.mask); 1280 1280 1281 1281 return -EOPNOTSUPP; ··· 1286 1286 */ 1287 1287 if (match->mask.ip_ttl != U8_MAX) { 1288 1288 NL_SET_ERR_MSG_FMT_MOD(extack, 1289 - "Unsupported: only support mangle ipv6.hop_limit when we have an exact match on ttl, mask used for match (%#x)", 1289 + "only support hop_limit when we have an exact match, current mask (%#x)", 1290 1290 match->mask.ip_ttl); 1291 1291 return -EOPNOTSUPP; 1292 1292 } ··· 1296 1296 */ 1297 1297 if (match->value.ip_ttl == 0) { 1298 1298 NL_SET_ERR_MSG_MOD(extack, 1299 - "Unsupported: we cannot decrement hop_limit past 0"); 1299 + "decrementing hop_limit past 0 is not supported"); 1300 1300 return -EOPNOTSUPP; 1301 1301 } 1302 1302 ··· 1304 1304 if (!efx_tc_flower_action_order_ok(act, 1305 1305 EFX_TC_AO_DEC_TTL)) { 1306 1306 NL_SET_ERR_MSG_MOD(extack, 1307 - "Unsupported: multiple dec ttl"); 1307 + "multiple dec ttl is not supported"); 1308 1308 return -EOPNOTSUPP; 1309 1309 } 1310 1310 ··· 1318 1318 fallthrough; 1319 1319 default: 1320 1320 NL_SET_ERR_MSG_FMT_MOD(extack, 1321 - "Unsupported: only support mangle on the hop_limit field"); 1321 + "only support mangle on the hop_limit field"); 1322 1322 return -EOPNOTSUPP; 1323 1323 } 1324 1324 default:
+13 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1197 1197 return ret; 1198 1198 } 1199 1199 1200 + static void stmmac_set_half_duplex(struct stmmac_priv *priv) 1201 + { 1202 + /* Half-Duplex can only work with single tx queue */ 1203 + if (priv->plat->tx_queues_to_use > 1) 1204 + priv->phylink_config.mac_capabilities &= 1205 + ~(MAC_10HD | MAC_100HD | MAC_1000HD); 1206 + else 1207 + priv->phylink_config.mac_capabilities |= 1208 + (MAC_10HD | MAC_100HD | MAC_1000HD); 1209 + } 1210 + 1200 1211 static int stmmac_phy_setup(struct stmmac_priv *priv) 1201 1212 { 1202 1213 struct stmmac_mdio_bus_data *mdio_bus_data; ··· 1239 1228 MAC_10FD | MAC_100FD | 1240 1229 MAC_1000FD; 1241 1230 1242 - /* Half-Duplex can only work with single queue */ 1243 - if (priv->plat->tx_queues_to_use <= 1) 1244 - priv->phylink_config.mac_capabilities |= MAC_10HD | MAC_100HD | 1245 - MAC_1000HD; 1231 + stmmac_set_half_duplex(priv); 1246 1232 1247 1233 /* Get the MAC specific capabilities */ 1248 1234 stmmac_mac_phylink_get_caps(priv); ··· 7180 7172 priv->rss.table[i] = ethtool_rxfh_indir_default(i, 7181 7173 rx_cnt); 7182 7174 7175 + stmmac_set_half_duplex(priv); 7183 7176 stmmac_napi_add(dev); 7184 7177 7185 7178 if (netif_running(dev))
+1 -1
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
··· 1217 1217 key_index = wl->current_key; 1218 1218 1219 1219 if (!enc->length && (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)) { 1220 - /* reques to change default key index */ 1220 + /* request to change default key index */ 1221 1221 pr_debug("%s: request to change default key to %d\n", 1222 1222 __func__, key_index); 1223 1223 wl->current_key = key_index;
+3 -2
drivers/net/gtp.c
··· 872 872 873 873 skb_dst_update_pmtu_no_confirm(skb, mtu); 874 874 875 - if (!skb_is_gso(skb) && (iph->frag_off & htons(IP_DF)) && 876 - mtu < ntohs(iph->tot_len)) { 875 + if (iph->frag_off & htons(IP_DF) && 876 + ((!skb_is_gso(skb) && skb->len > mtu) || 877 + (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)))) { 877 878 netdev_dbg(dev, "packet too big, fragmentation needed\n"); 878 879 icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 879 880 htonl(mtu));
+3 -2
drivers/net/ieee802154/adf7242.c
··· 1162 1162 1163 1163 static void adf7242_debugfs_init(struct adf7242_local *lp) 1164 1164 { 1165 - char debugfs_dir_name[DNAME_INLINE_LEN + 1] = "adf7242-"; 1165 + char debugfs_dir_name[DNAME_INLINE_LEN + 1]; 1166 1166 1167 - strncat(debugfs_dir_name, dev_name(&lp->spi->dev), DNAME_INLINE_LEN); 1167 + snprintf(debugfs_dir_name, sizeof(debugfs_dir_name), 1168 + "adf7242-%s", dev_name(&lp->spi->dev)); 1168 1169 1169 1170 lp->debugfs_root = debugfs_create_dir(debugfs_dir_name, NULL); 1170 1171
+230 -73
drivers/net/usb/r8152.c
··· 764 764 765 765 /* rtl8152 flags */ 766 766 enum rtl8152_flags { 767 - RTL8152_UNPLUG = 0, 767 + RTL8152_INACCESSIBLE = 0, 768 768 RTL8152_SET_RX_MODE, 769 769 WORK_ENABLE, 770 770 RTL8152_LINK_CHG, ··· 773 773 SCHEDULE_TASKLET, 774 774 GREEN_ETHERNET, 775 775 RX_EPROTO, 776 + IN_PRE_RESET, 777 + PROBED_WITH_NO_ERRORS, 778 + PROBE_SHOULD_RETRY, 776 779 }; 777 780 778 781 #define DEVICE_ID_LENOVO_USB_C_TRAVEL_HUB 0x721e ··· 956 953 u8 version; 957 954 u8 duplex; 958 955 u8 autoneg; 956 + 957 + unsigned int reg_access_reset_count; 959 958 }; 960 959 961 960 /** ··· 1205 1200 1206 1201 #define RTL_LIMITED_TSO_SIZE (size_to_mtu(agg_buf_sz) - sizeof(struct tx_desc)) 1207 1202 1203 + /* If register access fails then we block access and issue a reset. If this 1204 + * happens too many times in a row without a successful access then we stop 1205 + * trying to reset and just leave access blocked. 1206 + */ 1207 + #define REGISTER_ACCESS_MAX_RESETS 3 1208 + 1209 + static void rtl_set_inaccessible(struct r8152 *tp) 1210 + { 1211 + set_bit(RTL8152_INACCESSIBLE, &tp->flags); 1212 + smp_mb__after_atomic(); 1213 + } 1214 + 1215 + static void rtl_set_accessible(struct r8152 *tp) 1216 + { 1217 + clear_bit(RTL8152_INACCESSIBLE, &tp->flags); 1218 + smp_mb__after_atomic(); 1219 + } 1220 + 1221 + static 1222 + int r8152_control_msg(struct r8152 *tp, unsigned int pipe, __u8 request, 1223 + __u8 requesttype, __u16 value, __u16 index, void *data, 1224 + __u16 size, const char *msg_tag) 1225 + { 1226 + struct usb_device *udev = tp->udev; 1227 + int ret; 1228 + 1229 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1230 + return -ENODEV; 1231 + 1232 + ret = usb_control_msg(udev, pipe, request, requesttype, 1233 + value, index, data, size, 1234 + USB_CTRL_GET_TIMEOUT); 1235 + 1236 + /* No need to issue a reset to report an error if the USB device got 1237 + * unplugged; just return immediately. 1238 + */ 1239 + if (ret == -ENODEV) 1240 + return ret; 1241 + 1242 + /* If the write was successful then we're done */ 1243 + if (ret >= 0) { 1244 + tp->reg_access_reset_count = 0; 1245 + return ret; 1246 + } 1247 + 1248 + dev_err(&udev->dev, 1249 + "Failed to %s %d bytes at %#06x/%#06x (%d)\n", 1250 + msg_tag, size, value, index, ret); 1251 + 1252 + /* Block all future register access until we reset. Much of the code 1253 + * in the driver doesn't check for errors. Notably, many parts of the 1254 + * driver do a read/modify/write of a register value without 1255 + * confirming that the read succeeded. Writing back modified garbage 1256 + * like this can fully wedge the adapter, requiring a power cycle. 1257 + */ 1258 + rtl_set_inaccessible(tp); 1259 + 1260 + /* If probe hasn't yet finished, then we'll request a retry of the 1261 + * whole probe routine if we get any control transfer errors. We 1262 + * never have to clear this bit since we free/reallocate the whole "tp" 1263 + * structure if we retry probe. 1264 + */ 1265 + if (!test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) { 1266 + set_bit(PROBE_SHOULD_RETRY, &tp->flags); 1267 + return ret; 1268 + } 1269 + 1270 + /* Failing to access registers in pre-reset is not surprising since we 1271 + * wouldn't be resetting if things were behaving normally. The register 1272 + * access we do in pre-reset isn't truly mandatory--we're just reusing 1273 + * the disable() function and trying to be nice by powering the 1274 + * adapter down before resetting it. Thus, if we're in pre-reset, 1275 + * we'll return right away and not try to queue up yet another reset. 1276 + * We know the post-reset is already coming. 1277 + */ 1278 + if (test_bit(IN_PRE_RESET, &tp->flags)) 1279 + return ret; 1280 + 1281 + if (tp->reg_access_reset_count < REGISTER_ACCESS_MAX_RESETS) { 1282 + usb_queue_reset_device(tp->intf); 1283 + tp->reg_access_reset_count++; 1284 + } else if (tp->reg_access_reset_count == REGISTER_ACCESS_MAX_RESETS) { 1285 + dev_err(&udev->dev, 1286 + "Tried to reset %d times; giving up.\n", 1287 + REGISTER_ACCESS_MAX_RESETS); 1288 + } 1289 + 1290 + return ret; 1291 + } 1292 + 1208 1293 static 1209 1294 int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) 1210 1295 { ··· 1305 1210 if (!tmp) 1306 1211 return -ENOMEM; 1307 1212 1308 - ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, 1309 - RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, 1310 - value, index, tmp, size, 500); 1213 + ret = r8152_control_msg(tp, tp->pipe_ctrl_in, 1214 + RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, 1215 + value, index, tmp, size, "read"); 1216 + 1311 1217 if (ret < 0) 1312 1218 memset(data, 0xff, size); 1313 1219 else ··· 1329 1233 if (!tmp) 1330 1234 return -ENOMEM; 1331 1235 1332 - ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, 1333 - RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, 1334 - value, index, tmp, size, 500); 1236 + ret = r8152_control_msg(tp, tp->pipe_ctrl_out, 1237 + RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, 1238 + value, index, tmp, size, "write"); 1335 1239 1336 1240 kfree(tmp); 1337 1241 ··· 1340 1244 1341 1245 static void rtl_set_unplug(struct r8152 *tp) 1342 1246 { 1343 - if (tp->udev->state == USB_STATE_NOTATTACHED) { 1344 - set_bit(RTL8152_UNPLUG, &tp->flags); 1345 - smp_mb__after_atomic(); 1346 - } 1247 + if (tp->udev->state == USB_STATE_NOTATTACHED) 1248 + rtl_set_inaccessible(tp); 1347 1249 } 1348 1250 1349 1251 static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, ··· 1350 1256 u16 limit = 64; 1351 1257 int ret = 0; 1352 1258 1353 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1259 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1354 1260 return -ENODEV; 1355 1261 1356 1262 /* both size and indix must be 4 bytes align */ ··· 1394 1300 u16 byteen_start, byteen_end, byen; 1395 1301 u16 limit = 512; 1396 1302 1397 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1303 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1398 1304 return -ENODEV; 1399 1305 1400 1306 /* both size and indix must be 4 bytes align */ ··· 1631 1537 struct r8152 *tp = netdev_priv(netdev); 1632 1538 int ret; 1633 1539 1634 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1540 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1635 1541 return -ENODEV; 1636 1542 1637 1543 if (phy_id != R8152_PHY_ID) ··· 1647 1553 { 1648 1554 struct r8152 *tp = netdev_priv(netdev); 1649 1555 1650 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1556 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1651 1557 return; 1652 1558 1653 1559 if (phy_id != R8152_PHY_ID) ··· 1852 1758 if (!tp) 1853 1759 return; 1854 1760 1855 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1761 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1856 1762 return; 1857 1763 1858 1764 if (!test_bit(WORK_ENABLE, &tp->flags)) ··· 1944 1850 if (!test_bit(WORK_ENABLE, &tp->flags)) 1945 1851 return; 1946 1852 1947 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1853 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1948 1854 return; 1949 1855 1950 1856 if (!skb_queue_empty(&tp->tx_queue)) ··· 1965 1871 if (!test_bit(WORK_ENABLE, &tp->flags)) 1966 1872 return; 1967 1873 1968 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 1874 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 1969 1875 return; 1970 1876 1971 1877 switch (status) { ··· 2709 2615 { 2710 2616 struct r8152 *tp = from_tasklet(tp, t, tx_tl); 2711 2617 2712 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 2618 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 2713 2619 return; 2714 2620 2715 2621 if (!test_bit(WORK_ENABLE, &tp->flags)) ··· 2752 2658 int ret; 2753 2659 2754 2660 /* The rx would be stopped, so skip submitting */ 2755 - if (test_bit(RTL8152_UNPLUG, &tp->flags) || 2661 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || 2756 2662 !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) 2757 2663 return 0; 2758 2664 ··· 3152 3058 3153 3059 static int rtl8152_enable(struct r8152 *tp) 3154 3060 { 3155 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 3061 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 3156 3062 return -ENODEV; 3157 3063 3158 3064 set_tx_qlen(tp); ··· 3239 3145 { 3240 3146 u32 ocp_data; 3241 3147 3242 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 3148 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 3243 3149 return -ENODEV; 3244 3150 3245 3151 set_tx_qlen(tp); ··· 3271 3177 u32 ocp_data; 3272 3178 int i; 3273 3179 3274 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { 3180 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 3275 3181 rtl_drop_queued_tx(tp); 3276 3182 return; 3277 3183 } ··· 3725 3631 } 3726 3632 3727 3633 msleep(20); 3728 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 3634 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 3729 3635 break; 3730 3636 } 3731 3637 ··· 3757 3663 int i; 3758 3664 3759 3665 for (i = 0; i < 500; i++) { 3666 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 3667 + return; 3760 3668 if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & 3761 3669 AUTOLOAD_DONE) 3762 3670 break; ··· 3799 3703 int i; 3800 3704 3801 3705 for (i = 0; i < 500; i++) { 3706 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 3707 + return; 3802 3708 if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & 3803 3709 AUTOLOAD_DONE) 3804 3710 break; ··· 4143 4045 4144 4046 for (i = 0; wait && i < 5000; i++) { 4145 4047 u32 ocp_data; 4048 + 4049 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 4050 + return -ENODEV; 4146 4051 4147 4052 usleep_range(1000, 2000); 4148 4053 ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); ··· 6103 6002 u32 ocp_data; 6104 6003 u16 speed; 6105 6004 6106 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6005 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6107 6006 return -ENODEV; 6108 6007 6109 6008 r8156_fc_parameter(tp); ··· 6161 6060 u32 ocp_data; 6162 6061 u16 speed; 6163 6062 6164 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6063 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6165 6064 return -ENODEV; 6166 6065 6167 6066 set_tx_qlen(tp); ··· 6347 6246 6348 6247 static void rtl8152_up(struct r8152 *tp) 6349 6248 { 6350 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6249 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6351 6250 return; 6352 6251 6353 6252 r8152_aldps_en(tp, false); ··· 6357 6256 6358 6257 static void rtl8152_down(struct r8152 *tp) 6359 6258 { 6360 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { 6259 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 6361 6260 rtl_drop_queued_tx(tp); 6362 6261 return; 6363 6262 } ··· 6372 6271 { 6373 6272 u32 ocp_data; 6374 6273 6375 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6274 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6376 6275 return; 6377 6276 6378 6277 r8153_u1u2en(tp, false); ··· 6412 6311 { 6413 6312 u32 ocp_data; 6414 6313 6415 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { 6314 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 6416 6315 rtl_drop_queued_tx(tp); 6417 6316 return; 6418 6317 } ··· 6433 6332 { 6434 6333 u32 ocp_data; 6435 6334 6436 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6335 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6437 6336 return; 6438 6337 6439 6338 r8153b_u1u2en(tp, false); ··· 6457 6356 { 6458 6357 u32 ocp_data; 6459 6358 6460 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { 6359 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 6461 6360 rtl_drop_queued_tx(tp); 6462 6361 return; 6463 6362 } ··· 6494 6393 { 6495 6394 u32 ocp_data; 6496 6395 6497 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6396 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6498 6397 return; 6499 6398 6500 6399 r8153b_u1u2en(tp, false); ··· 6575 6474 { 6576 6475 u32 ocp_data; 6577 6476 6578 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6477 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6579 6478 return; 6580 6479 6581 6480 r8153b_u1u2en(tp, false); ··· 6648 6547 { 6649 6548 u32 ocp_data; 6650 6549 6651 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { 6550 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 6652 6551 rtl_drop_queued_tx(tp); 6653 6552 return; 6654 6553 } ··· 6786 6685 /* If the device is unplugged or !netif_running(), the workqueue 6787 6686 * doesn't need to wake the device, and could return directly. 6788 6687 */ 6789 - if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) 6688 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) 6790 6689 return; 6791 6690 6792 6691 if (usb_autopm_get_interface(tp->intf) < 0) ··· 6825 6724 { 6826 6725 struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); 6827 6726 6828 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6727 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6829 6728 return; 6830 6729 6831 6730 if (usb_autopm_get_interface(tp->intf) < 0) ··· 6952 6851 netif_stop_queue(netdev); 6953 6852 6954 6853 res = usb_autopm_get_interface(tp->intf); 6955 - if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { 6854 + if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { 6956 6855 rtl_drop_queued_tx(tp); 6957 6856 rtl_stop_rx(tp); 6958 6857 } else { ··· 6985 6884 u32 ocp_data; 6986 6885 u16 data; 6987 6886 6988 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6887 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 6989 6888 return; 6990 6889 6991 6890 data = r8152_mdio_read(tp, MII_BMCR); ··· 7029 6928 u16 data; 7030 6929 int i; 7031 6930 7032 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6931 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7033 6932 return; 7034 6933 7035 6934 r8153_u1u2en(tp, false); ··· 7040 6939 break; 7041 6940 7042 6941 msleep(20); 7043 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 6942 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7044 6943 break; 7045 6944 } 7046 6945 ··· 7169 7068 u16 data; 7170 7069 int i; 7171 7070 7172 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 7071 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7173 7072 return; 7174 7073 7175 7074 r8153b_u1u2en(tp, false); ··· 7180 7079 break; 7181 7080 7182 7081 msleep(20); 7183 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 7082 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7184 7083 break; 7185 7084 } 7186 7085 ··· 7251 7150 u16 data; 7252 7151 int i; 7253 7152 7254 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 7153 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7255 7154 return; 7256 7155 7257 7156 r8153b_u1u2en(tp, false); ··· 7271 7170 break; 7272 7171 7273 7172 msleep(20); 7274 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 7173 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 7275 7174 return; 7276 7175 } 7277 7176 ··· 8100 7999 u16 data; 8101 8000 int i; 8102 8001 8103 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 8002 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 8104 8003 return; 8105 8004 8106 8005 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); ··· 8121 8020 break; 8122 8021 8123 8022 msleep(20); 8124 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 8023 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 8125 8024 return; 8126 8025 } 8127 8026 ··· 8196 8095 u16 data; 8197 8096 int i; 8198 8097 8199 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 8098 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 8200 8099 return; 8201 8100 8202 8101 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); ··· 8230 8129 break; 8231 8130 8232 8131 msleep(20); 8233 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 8132 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 8234 8133 return; 8235 8134 } 8236 8135 ··· 8356 8255 struct r8152 *tp = usb_get_intfdata(intf); 8357 8256 struct net_device *netdev; 8358 8257 8359 - if (!tp) 8258 + if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) 8360 8259 return 0; 8361 8260 8362 8261 netdev = tp->netdev; ··· 8371 8270 napi_disable(&tp->napi); 8372 8271 if (netif_carrier_ok(netdev)) { 8373 8272 mutex_lock(&tp->control); 8273 + set_bit(IN_PRE_RESET, &tp->flags); 8374 8274 tp->rtl_ops.disable(tp); 8275 + clear_bit(IN_PRE_RESET, &tp->flags); 8375 8276 mutex_unlock(&tp->control); 8376 8277 } 8377 8278 ··· 8386 8283 struct net_device *netdev; 8387 8284 struct sockaddr sa; 8388 8285 8389 - if (!tp) 8286 + if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) 8390 8287 return 0; 8288 + 8289 + rtl_set_accessible(tp); 8391 8290 8392 8291 /* reset the MAC address in case of policy change */ 8393 8292 if (determine_ethernet_addr(tp, &sa) >= 0) { ··· 9263 9158 struct mii_ioctl_data *data = if_mii(rq); 9264 9159 int res; 9265 9160 9266 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 9161 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 9267 9162 return -ENODEV; 9268 9163 9269 9164 res = usb_autopm_get_interface(tp->intf); ··· 9365 9260 9366 9261 static void rtl8152_unload(struct r8152 *tp) 9367 9262 { 9368 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 9263 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 9369 9264 return; 9370 9265 9371 9266 if (tp->version != RTL_VER_01) ··· 9374 9269 9375 9270 static void rtl8153_unload(struct r8152 *tp) 9376 9271 { 9377 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 9272 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 9378 9273 return; 9379 9274 9380 9275 r8153_power_cut_en(tp, false); ··· 9382 9277 9383 9278 static void rtl8153b_unload(struct r8152 *tp) 9384 9279 { 9385 - if (test_bit(RTL8152_UNPLUG, &tp->flags)) 9280 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 9386 9281 return; 9387 9282 9388 9283 r8153b_power_cut_en(tp, false); ··· 9592 9487 __le32 *tmp; 9593 9488 u8 version; 9594 9489 int ret; 9490 + int i; 9595 9491 9596 9492 tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); 9597 9493 if (!tmp) 9598 9494 return 0; 9599 9495 9600 - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 9601 - RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, 9602 - PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500); 9603 - if (ret > 0) 9604 - ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; 9496 + /* Retry up to 3 times in case there is a transitory error. We do this 9497 + * since retrying a read of the version is always safe and this 9498 + * function doesn't take advantage of r8152_control_msg(). 9499 + */ 9500 + for (i = 0; i < 3; i++) { 9501 + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 9502 + RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, 9503 + PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), 9504 + USB_CTRL_GET_TIMEOUT); 9505 + if (ret > 0) { 9506 + ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; 9507 + break; 9508 + } 9509 + } 9510 + 9511 + if (i != 0 && ret > 0) 9512 + dev_warn(&udev->dev, "Needed %d retries to read version\n", i); 9605 9513 9606 9514 kfree(tmp); 9607 9515 ··· 9713 9595 return 0; 9714 9596 } 9715 9597 9716 - static int rtl8152_probe(struct usb_interface *intf, 9717 - const struct usb_device_id *id) 9598 + static int rtl8152_probe_once(struct usb_interface *intf, 9599 + const struct usb_device_id *id, u8 version) 9718 9600 { 9719 9601 struct usb_device *udev = interface_to_usbdev(intf); 9720 9602 struct r8152 *tp; 9721 9603 struct net_device *netdev; 9722 - u8 version; 9723 9604 int ret; 9724 - 9725 - if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) 9726 - return -ENODEV; 9727 - 9728 - if (!rtl_check_vendor_ok(intf)) 9729 - return -ENODEV; 9730 - 9731 - version = rtl8152_get_version(intf); 9732 - if (version == RTL_VER_UNKNOWN) 9733 - return -ENODEV; 9734 9605 9735 9606 usb_reset_device(udev); 9736 9607 netdev = alloc_etherdev(sizeof(struct r8152)); ··· 9883 9776 else 9884 9777 device_set_wakeup_enable(&udev->dev, false); 9885 9778 9779 + /* If we saw a control transfer error while probing then we may 9780 + * want to try probe() again. Consider this an error. 9781 + */ 9782 + if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) 9783 + goto out2; 9784 + 9785 + set_bit(PROBED_WITH_NO_ERRORS, &tp->flags); 9886 9786 netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); 9887 9787 9888 9788 return 0; 9889 9789 9790 + out2: 9791 + unregister_netdev(netdev); 9792 + 9890 9793 out1: 9891 9794 tasklet_kill(&tp->tx_tl); 9795 + cancel_delayed_work_sync(&tp->hw_phy_work); 9796 + if (tp->rtl_ops.unload) 9797 + tp->rtl_ops.unload(tp); 9798 + rtl8152_release_firmware(tp); 9892 9799 usb_set_intfdata(intf, NULL); 9893 9800 out: 9801 + if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) 9802 + ret = -EAGAIN; 9803 + 9894 9804 free_netdev(netdev); 9805 + return ret; 9806 + } 9807 + 9808 + #define RTL8152_PROBE_TRIES 3 9809 + 9810 + static int rtl8152_probe(struct usb_interface *intf, 9811 + const struct usb_device_id *id) 9812 + { 9813 + u8 version; 9814 + int ret; 9815 + int i; 9816 + 9817 + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) 9818 + return -ENODEV; 9819 + 9820 + if (!rtl_check_vendor_ok(intf)) 9821 + return -ENODEV; 9822 + 9823 + version = rtl8152_get_version(intf); 9824 + if (version == RTL_VER_UNKNOWN) 9825 + return -ENODEV; 9826 + 9827 + for (i = 0; i < RTL8152_PROBE_TRIES; i++) { 9828 + ret = rtl8152_probe_once(intf, id, version); 9829 + if (ret != -EAGAIN) 9830 + break; 9831 + } 9832 + if (ret == -EAGAIN) { 9833 + dev_err(&intf->dev, 9834 + "r8152 failed probe after %d tries; giving up\n", i); 9835 + return -ENODEV; 9836 + } 9837 + 9895 9838 return ret; 9896 9839 } 9897 9840
+3 -1
drivers/net/usb/smsc95xx.c
··· 95 95 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN 96 96 | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 97 97 0, index, &buf, 4); 98 - if (ret < 0) { 98 + if (ret < 4) { 99 + ret = ret < 0 ? ret : -ENODATA; 100 + 99 101 if (ret != -ENODEV) 100 102 netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n", 101 103 index, ret);
+29
include/linux/ieee80211.h
··· 4356 4356 } 4357 4357 4358 4358 /** 4359 + * ieee80211_is_protected_dual_of_public_action - check if skb contains a 4360 + * protected dual of public action management frame 4361 + * @skb: the skb containing the frame, length will be checked 4362 + * 4363 + * Return: true if the skb contains a protected dual of public action 4364 + * management frame, false otherwise. 4365 + */ 4366 + static inline bool 4367 + ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb) 4368 + { 4369 + u8 action; 4370 + 4371 + if (!ieee80211_is_public_action((void *)skb->data, skb->len) || 4372 + skb->len < IEEE80211_MIN_ACTION_SIZE + 1) 4373 + return false; 4374 + 4375 + action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE); 4376 + 4377 + return action != WLAN_PUB_ACTION_20_40_BSS_COEX && 4378 + action != WLAN_PUB_ACTION_DSE_REG_LOC_ANN && 4379 + action != WLAN_PUB_ACTION_MSMT_PILOT && 4380 + action != WLAN_PUB_ACTION_TDLS_DISCOVER_RES && 4381 + action != WLAN_PUB_ACTION_LOC_TRACK_NOTI && 4382 + action != WLAN_PUB_ACTION_FTM_REQUEST && 4383 + action != WLAN_PUB_ACTION_FTM_RESPONSE && 4384 + action != WLAN_PUB_ACTION_FILS_DISCOVERY; 4385 + } 4386 + 4387 + /** 4359 4388 * _ieee80211_is_group_privacy_action - check if frame is a group addressed 4360 4389 * privacy action frame 4361 4390 * @hdr: the frame
+1
include/net/netfilter/nf_flow_table.h
··· 53 53 struct list_head list; 54 54 int family; 55 55 int (*init)(struct nf_flowtable *ft); 56 + bool (*gc)(const struct flow_offload *flow); 56 57 int (*setup)(struct nf_flowtable *ft, 57 58 struct net_device *dev, 58 59 enum flow_block_command cmd);
+1 -1
include/uapi/linux/gtp.h
··· 33 33 GTPA_PAD, 34 34 __GTPA_MAX, 35 35 }; 36 - #define GTPA_MAX (__GTPA_MAX + 1) 36 + #define GTPA_MAX (__GTPA_MAX - 1) 37 37 38 38 #endif /* _UAPI_LINUX_GTP_H_ */
+35 -32
net/core/neighbour.c
··· 251 251 252 252 static int neigh_forced_gc(struct neigh_table *tbl) 253 253 { 254 - int max_clean = atomic_read(&tbl->gc_entries) - tbl->gc_thresh2; 254 + int max_clean = atomic_read(&tbl->gc_entries) - 255 + READ_ONCE(tbl->gc_thresh2); 255 256 unsigned long tref = jiffies - 5 * HZ; 256 257 struct neighbour *n, *tmp; 257 258 int shrunk = 0; ··· 281 280 } 282 281 } 283 282 284 - tbl->last_flush = jiffies; 283 + WRITE_ONCE(tbl->last_flush, jiffies); 285 284 286 285 write_unlock_bh(&tbl->lock); 287 286 ··· 465 464 { 466 465 struct neighbour *n = NULL; 467 466 unsigned long now = jiffies; 468 - int entries; 467 + int entries, gc_thresh3; 469 468 470 469 if (exempt_from_gc) 471 470 goto do_alloc; 472 471 473 472 entries = atomic_inc_return(&tbl->gc_entries) - 1; 474 - if (entries >= tbl->gc_thresh3 || 475 - (entries >= tbl->gc_thresh2 && 476 - time_after(now, tbl->last_flush + 5 * HZ))) { 477 - if (!neigh_forced_gc(tbl) && 478 - entries >= tbl->gc_thresh3) { 473 + gc_thresh3 = READ_ONCE(tbl->gc_thresh3); 474 + if (entries >= gc_thresh3 || 475 + (entries >= READ_ONCE(tbl->gc_thresh2) && 476 + time_after(now, READ_ONCE(tbl->last_flush) + 5 * HZ))) { 477 + if (!neigh_forced_gc(tbl) && entries >= gc_thresh3) { 479 478 net_info_ratelimited("%s: neighbor table overflow!\n", 480 479 tbl->id); 481 480 NEIGH_CACHE_STAT_INC(tbl, table_fulls); ··· 956 955 957 956 if (time_after(jiffies, tbl->last_rand + 300 * HZ)) { 958 957 struct neigh_parms *p; 959 - tbl->last_rand = jiffies; 958 + 959 + WRITE_ONCE(tbl->last_rand, jiffies); 960 960 list_for_each_entry(p, &tbl->parms_list, list) 961 961 p->reachable_time = 962 962 neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); 963 963 } 964 964 965 - if (atomic_read(&tbl->entries) < tbl->gc_thresh1) 965 + if (atomic_read(&tbl->entries) < READ_ONCE(tbl->gc_thresh1)) 966 966 goto out; 967 967 968 968 for (i = 0 ; i < (1 << nht->hash_shift); i++) { ··· 2169 2167 ndtmsg->ndtm_pad2 = 0; 2170 2168 2171 2169 if (nla_put_string(skb, NDTA_NAME, tbl->id) || 2172 - nla_put_msecs(skb, NDTA_GC_INTERVAL, tbl->gc_interval, NDTA_PAD) || 2173 - nla_put_u32(skb, NDTA_THRESH1, tbl->gc_thresh1) || 2174 - nla_put_u32(skb, NDTA_THRESH2, tbl->gc_thresh2) || 2175 - nla_put_u32(skb, NDTA_THRESH3, tbl->gc_thresh3)) 2170 + nla_put_msecs(skb, NDTA_GC_INTERVAL, READ_ONCE(tbl->gc_interval), 2171 + NDTA_PAD) || 2172 + nla_put_u32(skb, NDTA_THRESH1, READ_ONCE(tbl->gc_thresh1)) || 2173 + nla_put_u32(skb, NDTA_THRESH2, READ_ONCE(tbl->gc_thresh2)) || 2174 + nla_put_u32(skb, NDTA_THRESH3, READ_ONCE(tbl->gc_thresh3))) 2176 2175 goto nla_put_failure; 2177 2176 { 2178 2177 unsigned long now = jiffies; 2179 - long flush_delta = now - tbl->last_flush; 2180 - long rand_delta = now - tbl->last_rand; 2178 + long flush_delta = now - READ_ONCE(tbl->last_flush); 2179 + long rand_delta = now - READ_ONCE(tbl->last_rand); 2181 2180 struct neigh_hash_table *nht; 2182 2181 struct ndt_config ndc = { 2183 2182 .ndtc_key_len = tbl->key_len, ··· 2186 2183 .ndtc_entries = atomic_read(&tbl->entries), 2187 2184 .ndtc_last_flush = jiffies_to_msecs(flush_delta), 2188 2185 .ndtc_last_rand = jiffies_to_msecs(rand_delta), 2189 - .ndtc_proxy_qlen = tbl->proxy_queue.qlen, 2186 + .ndtc_proxy_qlen = READ_ONCE(tbl->proxy_queue.qlen), 2190 2187 }; 2191 2188 2192 2189 rcu_read_lock(); ··· 2209 2206 struct neigh_statistics *st; 2210 2207 2211 2208 st = per_cpu_ptr(tbl->stats, cpu); 2212 - ndst.ndts_allocs += st->allocs; 2213 - ndst.ndts_destroys += st->destroys; 2214 - ndst.ndts_hash_grows += st->hash_grows; 2215 - ndst.ndts_res_failed += st->res_failed; 2216 - ndst.ndts_lookups += st->lookups; 2217 - ndst.ndts_hits += st->hits; 2218 - ndst.ndts_rcv_probes_mcast += st->rcv_probes_mcast; 2219 - ndst.ndts_rcv_probes_ucast += st->rcv_probes_ucast; 2220 - ndst.ndts_periodic_gc_runs += st->periodic_gc_runs; 2221 - ndst.ndts_forced_gc_runs += st->forced_gc_runs; 2222 - ndst.ndts_table_fulls += st->table_fulls; 2209 + ndst.ndts_allocs += READ_ONCE(st->allocs); 2210 + ndst.ndts_destroys += READ_ONCE(st->destroys); 2211 + ndst.ndts_hash_grows += READ_ONCE(st->hash_grows); 2212 + ndst.ndts_res_failed += READ_ONCE(st->res_failed); 2213 + ndst.ndts_lookups += READ_ONCE(st->lookups); 2214 + ndst.ndts_hits += READ_ONCE(st->hits); 2215 + ndst.ndts_rcv_probes_mcast += READ_ONCE(st->rcv_probes_mcast); 2216 + ndst.ndts_rcv_probes_ucast += READ_ONCE(st->rcv_probes_ucast); 2217 + ndst.ndts_periodic_gc_runs += READ_ONCE(st->periodic_gc_runs); 2218 + ndst.ndts_forced_gc_runs += READ_ONCE(st->forced_gc_runs); 2219 + ndst.ndts_table_fulls += READ_ONCE(st->table_fulls); 2223 2220 } 2224 2221 2225 2222 if (nla_put_64bit(skb, NDTA_STATS, sizeof(ndst), &ndst, ··· 2448 2445 goto errout_tbl_lock; 2449 2446 2450 2447 if (tb[NDTA_THRESH1]) 2451 - tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]); 2448 + WRITE_ONCE(tbl->gc_thresh1, nla_get_u32(tb[NDTA_THRESH1])); 2452 2449 2453 2450 if (tb[NDTA_THRESH2]) 2454 - tbl->gc_thresh2 = nla_get_u32(tb[NDTA_THRESH2]); 2451 + WRITE_ONCE(tbl->gc_thresh2, nla_get_u32(tb[NDTA_THRESH2])); 2455 2452 2456 2453 if (tb[NDTA_THRESH3]) 2457 - tbl->gc_thresh3 = nla_get_u32(tb[NDTA_THRESH3]); 2454 + WRITE_ONCE(tbl->gc_thresh3, nla_get_u32(tb[NDTA_THRESH3])); 2458 2455 2459 2456 if (tb[NDTA_GC_INTERVAL]) 2460 - tbl->gc_interval = nla_get_msecs(tb[NDTA_GC_INTERVAL]); 2457 + WRITE_ONCE(tbl->gc_interval, nla_get_msecs(tb[NDTA_GC_INTERVAL])); 2461 2458 2462 2459 err = 0; 2463 2460
+5 -25
net/handshake/netlink.c
··· 87 87 } 88 88 EXPORT_SYMBOL(handshake_genl_put); 89 89 90 - /* 91 - * dup() a kernel socket for use as a user space file descriptor 92 - * in the current process. The kernel socket must have an 93 - * instatiated struct file. 94 - * 95 - * Implicit argument: "current()" 96 - */ 97 - static int handshake_dup(struct socket *sock) 98 - { 99 - struct file *file; 100 - int newfd; 101 - 102 - file = get_file(sock->file); 103 - newfd = get_unused_fd_flags(O_CLOEXEC); 104 - if (newfd < 0) { 105 - fput(file); 106 - return newfd; 107 - } 108 - 109 - fd_install(newfd, file); 110 - return newfd; 111 - } 112 - 113 90 int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info) 114 91 { 115 92 struct net *net = sock_net(skb->sk); ··· 110 133 goto out_status; 111 134 112 135 sock = req->hr_sk->sk_socket; 113 - fd = handshake_dup(sock); 136 + fd = get_unused_fd_flags(O_CLOEXEC); 114 137 if (fd < 0) { 115 138 err = fd; 116 139 goto out_complete; 117 140 } 141 + 118 142 err = req->hr_proto->hp_accept(req, info, fd); 119 143 if (err) { 120 - fput(sock->file); 144 + put_unused_fd(fd); 121 145 goto out_complete; 122 146 } 147 + 148 + fd_install(fd, get_file(sock->file)); 123 149 124 150 trace_handshake_cmd_accept(net, req, req->hr_sk, fd); 125 151 return 0;
+1 -1
net/ipv4/esp4.c
··· 786 786 787 787 /* 788 788 * 1) if the NAT-T peer's IP or port changed then 789 - * advertize the change to the keying daemon. 789 + * advertise the change to the keying daemon. 790 790 * This is an inbound SA, so just compare 791 791 * SRC ports. 792 792 */
+5 -3
net/ipv4/tcp.c
··· 927 927 return mss_now; 928 928 } 929 929 930 - /* In some cases, both sendmsg() could have added an skb to the write queue, 931 - * but failed adding payload on it. We need to remove it to consume less 930 + /* In some cases, sendmsg() could have added an skb to the write queue, 931 + * but failed adding payload on it. We need to remove it to consume less 932 932 * memory, but more importantly be able to generate EPOLLOUT for Edge Trigger 933 - * epoll() users. 933 + * epoll() users. Another reason is that tcp_write_xmit() does not like 934 + * finding an empty skb in the write queue. 934 935 */ 935 936 void tcp_remove_empty_skb(struct sock *sk) 936 937 { ··· 1290 1289 1291 1290 wait_for_space: 1292 1291 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); 1292 + tcp_remove_empty_skb(sk); 1293 1293 if (copied) 1294 1294 tcp_push(sk, flags & ~MSG_MORE, mss_now, 1295 1295 TCP_NAGLE_PUSH, size_goal);
+5 -4
net/ipv4/tcp_input.c
··· 2207 2207 * restore sanity to the SACK scoreboard. If the apparent reneging 2208 2208 * persists until this RTO then we'll clear the SACK scoreboard. 2209 2209 */ 2210 - static bool tcp_check_sack_reneging(struct sock *sk, int flag) 2210 + static bool tcp_check_sack_reneging(struct sock *sk, int *ack_flag) 2211 2211 { 2212 - if (flag & FLAG_SACK_RENEGING && 2213 - flag & FLAG_SND_UNA_ADVANCED) { 2212 + if (*ack_flag & FLAG_SACK_RENEGING && 2213 + *ack_flag & FLAG_SND_UNA_ADVANCED) { 2214 2214 struct tcp_sock *tp = tcp_sk(sk); 2215 2215 unsigned long delay = max(usecs_to_jiffies(tp->srtt_us >> 4), 2216 2216 msecs_to_jiffies(10)); 2217 2217 2218 2218 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, 2219 2219 delay, TCP_RTO_MAX); 2220 + *ack_flag &= ~FLAG_SET_XMIT_TIMER; 2220 2221 return true; 2221 2222 } 2222 2223 return false; ··· 2987 2986 tp->prior_ssthresh = 0; 2988 2987 2989 2988 /* B. In all the states check for reneging SACKs. */ 2990 - if (tcp_check_sack_reneging(sk, flag)) 2989 + if (tcp_check_sack_reneging(sk, ack_flag)) 2991 2990 return; 2992 2991 2993 2992 /* C. Check consistency of the current state. */
+1 -1
net/ipv6/esp6.c
··· 833 833 834 834 /* 835 835 * 1) if the NAT-T peer's IP or port changed then 836 - * advertize the change to the keying daemon. 836 + * advertise the change to the keying daemon. 837 837 * This is an inbound SA, so just compare 838 838 * SRC ports. 839 839 */
+1 -2
net/mac80211/rx.c
··· 2468 2468 2469 2469 /* drop unicast public action frames when using MPF */ 2470 2470 if (is_unicast_ether_addr(mgmt->da) && 2471 - ieee80211_is_public_action((void *)rx->skb->data, 2472 - rx->skb->len)) 2471 + ieee80211_is_protected_dual_of_public_action(rx->skb)) 2473 2472 return -EACCES; 2474 2473 } 2475 2474
+7 -7
net/netfilter/nf_flow_table_core.c
··· 316 316 } 317 317 EXPORT_SYMBOL_GPL(flow_offload_refresh); 318 318 319 - static bool nf_flow_is_outdated(const struct flow_offload *flow) 320 - { 321 - return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) && 322 - !test_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags); 323 - } 324 - 325 319 static inline bool nf_flow_has_expired(const struct flow_offload *flow) 326 320 { 327 321 return nf_flow_timeout_delta(flow->timeout) <= 0; ··· 401 407 return err; 402 408 } 403 409 410 + static bool nf_flow_custom_gc(struct nf_flowtable *flow_table, 411 + const struct flow_offload *flow) 412 + { 413 + return flow_table->type->gc && flow_table->type->gc(flow); 414 + } 415 + 404 416 static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table, 405 417 struct flow_offload *flow, void *data) 406 418 { 407 419 if (nf_flow_has_expired(flow) || 408 420 nf_ct_is_dying(flow->ct) || 409 - nf_flow_is_outdated(flow)) 421 + nf_flow_custom_gc(flow_table, flow)) 410 422 flow_offload_teardown(flow); 411 423 412 424 if (test_bit(NF_FLOW_TEARDOWN, &flow->flags)) {
+9
net/sched/act_ct.c
··· 278 278 return err; 279 279 } 280 280 281 + static bool tcf_ct_flow_is_outdated(const struct flow_offload *flow) 282 + { 283 + return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) && 284 + test_bit(IPS_HW_OFFLOAD_BIT, &flow->ct->status) && 285 + !test_bit(NF_FLOW_HW_PENDING, &flow->flags) && 286 + !test_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags); 287 + } 288 + 281 289 static struct nf_flowtable_type flowtable_ct = { 290 + .gc = tcf_ct_flow_is_outdated, 282 291 .action = tcf_ct_flow_table_fill_actions, 283 292 .owner = THIS_MODULE, 284 293 };
+17 -1
net/vmw_vsock/virtio_transport.c
··· 555 555 556 556 virtio_device_ready(vdev); 557 557 558 + return 0; 559 + } 560 + 561 + static void virtio_vsock_vqs_start(struct virtio_vsock *vsock) 562 + { 558 563 mutex_lock(&vsock->tx_lock); 559 564 vsock->tx_run = true; 560 565 mutex_unlock(&vsock->tx_lock); ··· 574 569 vsock->event_run = true; 575 570 mutex_unlock(&vsock->event_lock); 576 571 577 - return 0; 572 + /* virtio_transport_send_pkt() can queue packets once 573 + * the_virtio_vsock is set, but they won't be processed until 574 + * vsock->tx_run is set to true. We queue vsock->send_pkt_work 575 + * when initialization finishes to send those packets queued 576 + * earlier. 577 + * We don't need to queue the other workers (rx, event) because 578 + * as long as we don't fill the queues with empty buffers, the 579 + * host can't send us any notification. 580 + */ 581 + queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work); 578 582 } 579 583 580 584 static void virtio_vsock_vqs_del(struct virtio_vsock *vsock) ··· 678 664 goto out; 679 665 680 666 rcu_assign_pointer(the_virtio_vsock, vsock); 667 + virtio_vsock_vqs_start(vsock); 681 668 682 669 mutex_unlock(&the_virtio_vsock_mutex); 683 670 ··· 751 736 goto out; 752 737 753 738 rcu_assign_pointer(the_virtio_vsock, vsock); 739 + virtio_vsock_vqs_start(vsock); 754 740 755 741 out: 756 742 mutex_unlock(&the_virtio_vsock_mutex);
+2 -1
net/wireless/mlme.c
··· 43 43 44 44 for (link_id = 0; link_id < ARRAY_SIZE(data->links); link_id++) { 45 45 cr.links[link_id].status = data->links[link_id].status; 46 + cr.links[link_id].bss = data->links[link_id].bss; 47 + 46 48 WARN_ON_ONCE(cr.links[link_id].status != WLAN_STATUS_SUCCESS && 47 49 (!cr.ap_mld_addr || !cr.links[link_id].bss)); 48 50 49 - cr.links[link_id].bss = data->links[link_id].bss; 50 51 if (!cr.links[link_id].bss) 51 52 continue; 52 53 cr.links[link_id].bssid = data->links[link_id].bss->bssid;
+1 -1
net/wireless/scan.c
··· 2125 2125 if (!res) 2126 2126 goto drop; 2127 2127 2128 - rdev_inform_bss(rdev, &res->pub, ies, data->drv_data); 2128 + rdev_inform_bss(rdev, &res->pub, ies, drv_data->drv_data); 2129 2129 2130 2130 if (data->bss_source == BSS_SOURCE_MBSSID) { 2131 2131 /* this is a nontransmitting bss, we need to add it to