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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Smooth Cong Wang's bug fix into 'net-next'. Basically put
the bulk of the tcf_block_put() logic from 'net' into
tcf_block_put_ext(), but after the offload unbind.

Signed-off-by: David S. Miller <davem@davemloft.net>

+285 -170
+1 -3
Documentation/ABI/testing/sysfs-devices-power
··· 211 211 device, after it has been suspended at run time, from a resume 212 212 request to the moment the device will be ready to process I/O, 213 213 in microseconds. If it is equal to 0, however, this means that 214 - the PM QoS resume latency may be arbitrary and the special value 215 - "n/a" means that user space cannot accept any resume latency at 216 - all for the given device. 214 + the PM QoS resume latency may be arbitrary. 217 215 218 216 Not all drivers support this attribute. If it isn't supported, 219 217 it is not present.
+3 -3
MAINTAINERS
··· 6678 6678 F: Documentation/networking/ieee802154.txt 6679 6679 6680 6680 IFE PROTOCOL 6681 - M: Yotam Gigi <yotamg@mellanox.com> 6681 + M: Yotam Gigi <yotam.gi@gmail.com> 6682 6682 M: Jamal Hadi Salim <jhs@mojatatu.com> 6683 6683 F: net/ife 6684 6684 F: include/net/ife.h ··· 8751 8751 F: drivers/net/ethernet/mellanox/mlxsw/ 8752 8752 8753 8753 MELLANOX FIRMWARE FLASH LIBRARY (mlxfw) 8754 - M: Yotam Gigi <yotamg@mellanox.com> 8754 + M: mlxsw@mellanox.com 8755 8755 L: netdev@vger.kernel.org 8756 8756 S: Supported 8757 8757 W: http://www.mellanox.com ··· 10899 10899 F: drivers/block/ps3vram.c 10900 10900 10901 10901 PSAMPLE PACKET SAMPLING SUPPORT: 10902 - M: Yotam Gigi <yotamg@mellanox.com> 10902 + M: Yotam Gigi <yotam.gi@gmail.com> 10903 10903 S: Maintained 10904 10904 F: net/psample 10905 10905 F: include/net/psample.h
+2 -2
arch/x86/crypto/chacha20-avx2-x86_64.S
··· 45 45 46 46 vzeroupper 47 47 # 4 * 32 byte stack, 32-byte aligned 48 - mov %rsp, %r8 48 + lea 8(%rsp),%r10 49 49 and $~31, %rsp 50 50 sub $0x80, %rsp 51 51 ··· 443 443 vmovdqu %ymm15,0x01e0(%rsi) 444 444 445 445 vzeroupper 446 - mov %r8,%rsp 446 + lea -8(%r10),%rsp 447 447 ret 448 448 ENDPROC(chacha20_8block_xor_avx2)
+2 -2
arch/x86/crypto/chacha20-ssse3-x86_64.S
··· 160 160 # done with the slightly better performing SSSE3 byte shuffling, 161 161 # 7/12-bit word rotation uses traditional shift+OR. 162 162 163 - mov %rsp,%r11 163 + lea 8(%rsp),%r10 164 164 sub $0x80,%rsp 165 165 and $~63,%rsp 166 166 ··· 625 625 pxor %xmm1,%xmm15 626 626 movdqu %xmm15,0xf0(%rsi) 627 627 628 - mov %r11,%rsp 628 + lea -8(%r10),%rsp 629 629 ret 630 630 ENDPROC(chacha20_4block_xor_ssse3)
+10 -1
arch/x86/mm/fault.c
··· 1440 1440 * make sure we exit gracefully rather than endlessly redo 1441 1441 * the fault. Since we never set FAULT_FLAG_RETRY_NOWAIT, if 1442 1442 * we get VM_FAULT_RETRY back, the mmap_sem has been unlocked. 1443 + * 1444 + * Note that handle_userfault() may also release and reacquire mmap_sem 1445 + * (and not return with VM_FAULT_RETRY), when returning to userland to 1446 + * repeat the page fault later with a VM_FAULT_NOPAGE retval 1447 + * (potentially after handling any pending signal during the return to 1448 + * userland). The return to userland is identified whenever 1449 + * FAULT_FLAG_USER|FAULT_FLAG_KILLABLE are both set in flags. 1450 + * Thus we have to be careful about not touching vma after handling the 1451 + * fault, so we read the pkey beforehand. 1443 1452 */ 1453 + pkey = vma_pkey(vma); 1444 1454 fault = handle_mm_fault(vma, address, flags); 1445 1455 major |= fault & VM_FAULT_MAJOR; 1446 1456 ··· 1477 1467 return; 1478 1468 } 1479 1469 1480 - pkey = vma_pkey(vma); 1481 1470 up_read(&mm->mmap_sem); 1482 1471 if (unlikely(fault & VM_FAULT_ERROR)) { 1483 1472 mm_fault_error(regs, error_code, address, &pkey, fault);
+1 -2
drivers/base/cpu.c
··· 377 377 378 378 per_cpu(cpu_sys_devices, num) = &cpu->dev; 379 379 register_cpu_under_node(num, cpu_to_node(num)); 380 - dev_pm_qos_expose_latency_limit(&cpu->dev, 381 - PM_QOS_RESUME_LATENCY_NO_CONSTRAINT); 380 + dev_pm_qos_expose_latency_limit(&cpu->dev, 0); 382 381 383 382 return 0; 384 383 }
+23 -30
drivers/base/power/domain_governor.c
··· 14 14 static int dev_update_qos_constraint(struct device *dev, void *data) 15 15 { 16 16 s64 *constraint_ns_p = data; 17 - s64 constraint_ns = -1; 17 + s32 constraint_ns = -1; 18 18 19 19 if (dev->power.subsys_data && dev->power.subsys_data->domain_data) 20 20 constraint_ns = dev_gpd_data(dev)->td.effective_constraint_ns; 21 21 22 - if (constraint_ns < 0) 22 + if (constraint_ns < 0) { 23 23 constraint_ns = dev_pm_qos_read_value(dev); 24 - 25 - if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 24 + constraint_ns *= NSEC_PER_USEC; 25 + } 26 + if (constraint_ns == 0) 26 27 return 0; 27 28 28 - constraint_ns *= NSEC_PER_USEC; 29 - 30 - if (constraint_ns < *constraint_ns_p || *constraint_ns_p < 0) 29 + /* 30 + * constraint_ns cannot be negative here, because the device has been 31 + * suspended. 32 + */ 33 + if (constraint_ns < *constraint_ns_p || *constraint_ns_p == 0) 31 34 *constraint_ns_p = constraint_ns; 32 35 33 36 return 0; ··· 63 60 64 61 spin_unlock_irqrestore(&dev->power.lock, flags); 65 62 66 - if (constraint_ns == 0) 63 + if (constraint_ns < 0) 67 64 return false; 68 65 69 - if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 70 - constraint_ns = -1; 71 - else 72 - constraint_ns *= NSEC_PER_USEC; 73 - 66 + constraint_ns *= NSEC_PER_USEC; 74 67 /* 75 68 * We can walk the children without any additional locking, because 76 69 * they all have been suspended at this point and their ··· 76 77 device_for_each_child(dev, &constraint_ns, 77 78 dev_update_qos_constraint); 78 79 79 - if (constraint_ns < 0) { 80 - /* The children have no constraints. */ 81 - td->effective_constraint_ns = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; 82 - td->cached_suspend_ok = true; 83 - } else { 84 - constraint_ns -= td->suspend_latency_ns + td->resume_latency_ns; 85 - if (constraint_ns > 0) { 86 - td->effective_constraint_ns = constraint_ns; 87 - td->cached_suspend_ok = true; 88 - } else { 89 - td->effective_constraint_ns = 0; 90 - } 80 + if (constraint_ns > 0) { 81 + constraint_ns -= td->suspend_latency_ns + 82 + td->resume_latency_ns; 83 + if (constraint_ns == 0) 84 + return false; 91 85 } 86 + td->effective_constraint_ns = constraint_ns; 87 + td->cached_suspend_ok = constraint_ns >= 0; 92 88 93 89 /* 94 90 * The children have been suspended already, so we don't need to take ··· 145 151 td = &to_gpd_data(pdd)->td; 146 152 constraint_ns = td->effective_constraint_ns; 147 153 /* default_suspend_ok() need not be called before us. */ 148 - if (constraint_ns < 0) 154 + if (constraint_ns < 0) { 149 155 constraint_ns = dev_pm_qos_read_value(pdd->dev); 150 - 151 - if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 156 + constraint_ns *= NSEC_PER_USEC; 157 + } 158 + if (constraint_ns == 0) 152 159 continue; 153 - 154 - constraint_ns *= NSEC_PER_USEC; 155 160 156 161 /* 157 162 * constraint_ns cannot be negative here, because the device has
+1 -1
drivers/base/power/qos.c
··· 189 189 plist_head_init(&c->list); 190 190 c->target_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE; 191 191 c->default_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE; 192 - c->no_constraint_value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; 192 + c->no_constraint_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE; 193 193 c->type = PM_QOS_MIN; 194 194 c->notifiers = n; 195 195
+1 -1
drivers/base/power/runtime.c
··· 253 253 || (dev->power.request_pending 254 254 && dev->power.request == RPM_REQ_RESUME)) 255 255 retval = -EAGAIN; 256 - else if (__dev_pm_qos_read_value(dev) == 0) 256 + else if (__dev_pm_qos_read_value(dev) < 0) 257 257 retval = -EPERM; 258 258 else if (dev->power.runtime_status == RPM_SUSPENDED) 259 259 retval = 1;
+5 -22
drivers/base/power/sysfs.c
··· 218 218 struct device_attribute *attr, 219 219 char *buf) 220 220 { 221 - s32 value = dev_pm_qos_requested_resume_latency(dev); 222 - 223 - if (value == 0) 224 - return sprintf(buf, "n/a\n"); 225 - else if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 226 - value = 0; 227 - 228 - return sprintf(buf, "%d\n", value); 221 + return sprintf(buf, "%d\n", dev_pm_qos_requested_resume_latency(dev)); 229 222 } 230 223 231 224 static ssize_t pm_qos_resume_latency_store(struct device *dev, ··· 228 235 s32 value; 229 236 int ret; 230 237 231 - if (!kstrtos32(buf, 0, &value)) { 232 - /* 233 - * Prevent users from writing negative or "no constraint" values 234 - * directly. 235 - */ 236 - if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 237 - return -EINVAL; 238 - 239 - if (value == 0) 240 - value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; 241 - } else if (!strcmp(buf, "n/a") || !strcmp(buf, "n/a\n")) { 242 - value = 0; 243 - } else { 238 + if (kstrtos32(buf, 0, &value)) 244 239 return -EINVAL; 245 - } 240 + 241 + if (value < 0) 242 + return -EINVAL; 246 243 247 244 ret = dev_pm_qos_update_request(dev->power.qos->resume_latency_req, 248 245 value);
+12
drivers/block/virtio_blk.c
··· 593 593 return blk_mq_virtio_map_queues(set, vblk->vdev, 0); 594 594 } 595 595 596 + #ifdef CONFIG_VIRTIO_BLK_SCSI 597 + static void virtblk_initialize_rq(struct request *req) 598 + { 599 + struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); 600 + 601 + scsi_req_init(&vbr->sreq); 602 + } 603 + #endif 604 + 596 605 static const struct blk_mq_ops virtio_mq_ops = { 597 606 .queue_rq = virtio_queue_rq, 598 607 .complete = virtblk_request_done, 599 608 .init_request = virtblk_init_request, 609 + #ifdef CONFIG_VIRTIO_BLK_SCSI 610 + .initialize_rq_fn = virtblk_initialize_rq, 611 + #endif 600 612 .map_queues = virtblk_map_queues, 601 613 }; 602 614
+2 -2
drivers/cpuidle/governors/menu.c
··· 298 298 data->needs_update = 0; 299 299 } 300 300 301 - if (resume_latency < latency_req && 302 - resume_latency != PM_QOS_RESUME_LATENCY_NO_CONSTRAINT) 301 + /* resume_latency is 0 means no restriction */ 302 + if (resume_latency && resume_latency < latency_req) 303 303 latency_req = resume_latency; 304 304 305 305 /* Special case when user has set very strict latency requirement */
+1
drivers/ide/ide-cd.c
··· 1328 1328 unsigned long blocks = blk_rq_sectors(rq) / (hard_sect >> 9); 1329 1329 struct scsi_request *req = scsi_req(rq); 1330 1330 1331 + scsi_req_init(req); 1331 1332 memset(req->cmd, 0, BLK_MAX_CDB); 1332 1333 1333 1334 if (rq_data_dir(rq) == READ)
+3 -1
drivers/infiniband/core/nldev.c
··· 214 214 215 215 err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, 216 216 nldev_policy, extack); 217 - if (err || !tb[RDMA_NLDEV_ATTR_PORT_INDEX]) 217 + if (err || 218 + !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || 219 + !tb[RDMA_NLDEV_ATTR_PORT_INDEX]) 218 220 return -EINVAL; 219 221 220 222 index = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
+10 -7
drivers/mmc/host/renesas_sdhi_internal_dmac.c
··· 146 146 WARN_ON(host->sg_len > 1); 147 147 148 148 /* This DMAC cannot handle if buffer is not 8-bytes alignment */ 149 - if (!IS_ALIGNED(sg->offset, 8)) { 150 - host->force_pio = true; 151 - renesas_sdhi_internal_dmac_enable_dma(host, false); 152 - return; 153 - } 149 + if (!IS_ALIGNED(sg->offset, 8)) 150 + goto force_pio; 154 151 155 152 if (data->flags & MMC_DATA_READ) { 156 153 dtran_mode |= DTRAN_MODE_CH_NUM_CH1; ··· 160 163 } 161 164 162 165 ret = dma_map_sg(&host->pdev->dev, sg, host->sg_len, dir); 163 - if (ret < 0) 164 - return; 166 + if (ret == 0) 167 + goto force_pio; 165 168 166 169 renesas_sdhi_internal_dmac_enable_dma(host, true); 167 170 ··· 173 176 dtran_mode); 174 177 renesas_sdhi_internal_dmac_dm_write(host, DM_DTRAN_ADDR, 175 178 sg->dma_address); 179 + 180 + return; 181 + 182 + force_pio: 183 + host->force_pio = true; 184 + renesas_sdhi_internal_dmac_enable_dma(host, false); 176 185 } 177 186 178 187 static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
+13
drivers/mmc/host/tmio_mmc_core.c
··· 47 47 #include <linux/mmc/sdio.h> 48 48 #include <linux/scatterlist.h> 49 49 #include <linux/spinlock.h> 50 + #include <linux/swiotlb.h> 50 51 #include <linux/workqueue.h> 51 52 52 53 #include "tmio_mmc.h" ··· 1216 1215 mmc->max_blk_count = pdata->max_blk_count ? : 1217 1216 (PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs; 1218 1217 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; 1218 + /* 1219 + * Since swiotlb has memory size limitation, this will calculate 1220 + * the maximum size locally (because we don't have any APIs for it now) 1221 + * and check the current max_req_size. And then, this will update 1222 + * the max_req_size if needed as a workaround. 1223 + */ 1224 + if (swiotlb_max_segment()) { 1225 + unsigned int max_size = (1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE; 1226 + 1227 + if (mmc->max_req_size > max_size) 1228 + mmc->max_req_size = max_size; 1229 + } 1219 1230 mmc->max_seg_size = mmc->max_req_size; 1220 1231 1221 1232 _host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
+2 -2
drivers/net/ethernet/hisilicon/hns/hns_enet.c
··· 2369 2369 priv->enet_ver = AE_VERSION_2; 2370 2370 2371 2371 ae_node = of_parse_phandle(dev->of_node, "ae-handle", 0); 2372 - if (IS_ERR_OR_NULL(ae_node)) { 2373 - ret = PTR_ERR(ae_node); 2372 + if (!ae_node) { 2373 + ret = -ENODEV; 2374 2374 dev_err(dev, "not find ae-handle\n"); 2375 2375 goto out_read_prop_fail; 2376 2376 }
+1 -1
drivers/net/ethernet/mellanox/mlxsw/i2c.c
··· 294 294 write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size; 295 295 mlxsw_i2c_set_slave_addr(tran_buf, off); 296 296 memcpy(&tran_buf[MLXSW_I2C_ADDR_BUF_SIZE], in_mbox + 297 - chunk_size * i, chunk_size); 297 + MLXSW_I2C_BLK_MAX * i, chunk_size); 298 298 299 299 j = 0; 300 300 end = jiffies + timeout;
+25
drivers/net/ethernet/mellanox/mlxsw/reg.h
··· 6216 6216 */ 6217 6217 MLXSW_ITEM32(reg, mtmp, max_temperature, 0x08, 0, 16); 6218 6218 6219 + /* reg_mtmp_tee 6220 + * Temperature Event Enable. 6221 + * 0 - Do not generate event 6222 + * 1 - Generate event 6223 + * 2 - Generate single event 6224 + * Access: RW 6225 + */ 6226 + MLXSW_ITEM32(reg, mtmp, tee, 0x0C, 30, 2); 6227 + 6228 + #define MLXSW_REG_MTMP_THRESH_HI 0x348 /* 105 Celsius */ 6229 + 6230 + /* reg_mtmp_temperature_threshold_hi 6231 + * High threshold for Temperature Warning Event. In 0.125 Celsius. 6232 + * Access: RW 6233 + */ 6234 + MLXSW_ITEM32(reg, mtmp, temperature_threshold_hi, 0x0C, 0, 16); 6235 + 6236 + /* reg_mtmp_temperature_threshold_lo 6237 + * Low threshold for Temperature Warning Event. In 0.125 Celsius. 6238 + * Access: RW 6239 + */ 6240 + MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16); 6241 + 6219 6242 #define MLXSW_REG_MTMP_SENSOR_NAME_SIZE 8 6220 6243 6221 6244 /* reg_mtmp_sensor_name ··· 6255 6232 mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index); 6256 6233 mlxsw_reg_mtmp_mte_set(payload, max_temp_enable); 6257 6234 mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset); 6235 + mlxsw_reg_mtmp_temperature_threshold_hi_set(payload, 6236 + MLXSW_REG_MTMP_THRESH_HI); 6258 6237 } 6259 6238 6260 6239 static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp,
+5 -3
drivers/net/phy/marvell.c
··· 681 681 if (err < 0) 682 682 return err; 683 683 684 - err = m88e1121_config_aneg_rgmii_delays(phydev); 685 - if (err < 0) 686 - return err; 684 + if (phy_interface_is_rgmii(phydev)) { 685 + err = m88e1121_config_aneg_rgmii_delays(phydev); 686 + if (err < 0) 687 + return err; 688 + } 687 689 688 690 err = genphy_soft_reset(phydev); 689 691 if (err < 0)
+2
drivers/net/tap.c
··· 1032 1032 case TUNSETSNDBUF: 1033 1033 if (get_user(s, sp)) 1034 1034 return -EFAULT; 1035 + if (s <= 0) 1036 + return -EINVAL; 1035 1037 1036 1038 q->sk.sk_sndbuf = s; 1037 1039 return 0;
+4
drivers/net/tun.c
··· 2654 2654 ret = -EFAULT; 2655 2655 break; 2656 2656 } 2657 + if (sndbuf <= 0) { 2658 + ret = -EINVAL; 2659 + break; 2660 + } 2657 2661 2658 2662 tun->sndbuf = sndbuf; 2659 2663 tun_set_sndbuf(tun);
-1
drivers/net/wan/lapbether.c
··· 346 346 fail: 347 347 dev_put(dev); 348 348 free_netdev(ndev); 349 - kfree(lapbeth); 350 349 goto out; 351 350 } 352 351
+95 -27
drivers/net/wireless/ath/ath10k/htt_rx.c
··· 550 550 return IEEE80211_TKIP_IV_LEN; 551 551 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2: 552 552 return IEEE80211_CCMP_HDR_LEN; 553 + case HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2: 554 + return IEEE80211_CCMP_256_HDR_LEN; 555 + case HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2: 556 + case HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2: 557 + return IEEE80211_GCMP_HDR_LEN; 553 558 case HTT_RX_MPDU_ENCRYPT_WEP128: 554 559 case HTT_RX_MPDU_ENCRYPT_WAPI: 555 560 break; ··· 580 575 return IEEE80211_TKIP_ICV_LEN; 581 576 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2: 582 577 return IEEE80211_CCMP_MIC_LEN; 578 + case HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2: 579 + return IEEE80211_CCMP_256_MIC_LEN; 580 + case HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2: 581 + case HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2: 582 + return IEEE80211_GCMP_MIC_LEN; 583 583 case HTT_RX_MPDU_ENCRYPT_WEP128: 584 584 case HTT_RX_MPDU_ENCRYPT_WAPI: 585 585 break; ··· 1061 1051 hdr = (void *)msdu->data; 1062 1052 1063 1053 /* Tail */ 1064 - if (status->flag & RX_FLAG_IV_STRIPPED) 1054 + if (status->flag & RX_FLAG_IV_STRIPPED) { 1065 1055 skb_trim(msdu, msdu->len - 1066 1056 ath10k_htt_rx_crypto_tail_len(ar, enctype)); 1057 + } else { 1058 + /* MIC */ 1059 + if ((status->flag & RX_FLAG_MIC_STRIPPED) && 1060 + enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) 1061 + skb_trim(msdu, msdu->len - 8); 1062 + 1063 + /* ICV */ 1064 + if (status->flag & RX_FLAG_ICV_STRIPPED && 1065 + enctype != HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) 1066 + skb_trim(msdu, msdu->len - 1067 + ath10k_htt_rx_crypto_tail_len(ar, enctype)); 1068 + } 1067 1069 1068 1070 /* MMIC */ 1069 1071 if ((status->flag & RX_FLAG_MMIC_STRIPPED) && ··· 1097 1075 static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar, 1098 1076 struct sk_buff *msdu, 1099 1077 struct ieee80211_rx_status *status, 1100 - const u8 first_hdr[64]) 1078 + const u8 first_hdr[64], 1079 + enum htt_rx_mpdu_encrypt_type enctype) 1101 1080 { 1102 1081 struct ieee80211_hdr *hdr; 1103 1082 struct htt_rx_desc *rxd; ··· 1106 1083 u8 da[ETH_ALEN]; 1107 1084 u8 sa[ETH_ALEN]; 1108 1085 int l3_pad_bytes; 1086 + int bytes_aligned = ar->hw_params.decap_align_bytes; 1109 1087 1110 1088 /* Delivered decapped frame: 1111 1089 * [nwifi 802.11 header] <-- replaced with 802.11 hdr ··· 1135 1111 /* push original 802.11 header */ 1136 1112 hdr = (struct ieee80211_hdr *)first_hdr; 1137 1113 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1114 + 1115 + if (!(status->flag & RX_FLAG_IV_STRIPPED)) { 1116 + memcpy(skb_push(msdu, 1117 + ath10k_htt_rx_crypto_param_len(ar, enctype)), 1118 + (void *)hdr + round_up(hdr_len, bytes_aligned), 1119 + ath10k_htt_rx_crypto_param_len(ar, enctype)); 1120 + } 1121 + 1138 1122 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1139 1123 1140 1124 /* original 802.11 header has a different DA and in ··· 1203 1171 u8 sa[ETH_ALEN]; 1204 1172 int l3_pad_bytes; 1205 1173 struct htt_rx_desc *rxd; 1174 + int bytes_aligned = ar->hw_params.decap_align_bytes; 1206 1175 1207 1176 /* Delivered decapped frame: 1208 1177 * [eth header] <-- replaced with 802.11 hdr & rfc1042/llc ··· 1232 1199 /* push original 802.11 header */ 1233 1200 hdr = (struct ieee80211_hdr *)first_hdr; 1234 1201 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1202 + 1203 + if (!(status->flag & RX_FLAG_IV_STRIPPED)) { 1204 + memcpy(skb_push(msdu, 1205 + ath10k_htt_rx_crypto_param_len(ar, enctype)), 1206 + (void *)hdr + round_up(hdr_len, bytes_aligned), 1207 + ath10k_htt_rx_crypto_param_len(ar, enctype)); 1208 + } 1209 + 1235 1210 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1236 1211 1237 1212 /* original 802.11 header has a different DA and in ··· 1253 1212 static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar, 1254 1213 struct sk_buff *msdu, 1255 1214 struct ieee80211_rx_status *status, 1256 - const u8 first_hdr[64]) 1215 + const u8 first_hdr[64], 1216 + enum htt_rx_mpdu_encrypt_type enctype) 1257 1217 { 1258 1218 struct ieee80211_hdr *hdr; 1259 1219 size_t hdr_len; 1260 1220 int l3_pad_bytes; 1261 1221 struct htt_rx_desc *rxd; 1222 + int bytes_aligned = ar->hw_params.decap_align_bytes; 1262 1223 1263 1224 /* Delivered decapped frame: 1264 1225 * [amsdu header] <-- replaced with 802.11 hdr ··· 1276 1233 1277 1234 hdr = (struct ieee80211_hdr *)first_hdr; 1278 1235 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1236 + 1237 + if (!(status->flag & RX_FLAG_IV_STRIPPED)) { 1238 + memcpy(skb_push(msdu, 1239 + ath10k_htt_rx_crypto_param_len(ar, enctype)), 1240 + (void *)hdr + round_up(hdr_len, bytes_aligned), 1241 + ath10k_htt_rx_crypto_param_len(ar, enctype)); 1242 + } 1243 + 1279 1244 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1280 1245 } 1281 1246 ··· 1318 1267 is_decrypted); 1319 1268 break; 1320 1269 case RX_MSDU_DECAP_NATIVE_WIFI: 1321 - ath10k_htt_rx_h_undecap_nwifi(ar, msdu, status, first_hdr); 1270 + ath10k_htt_rx_h_undecap_nwifi(ar, msdu, status, first_hdr, 1271 + enctype); 1322 1272 break; 1323 1273 case RX_MSDU_DECAP_ETHERNET2_DIX: 1324 1274 ath10k_htt_rx_h_undecap_eth(ar, msdu, status, first_hdr, enctype); 1325 1275 break; 1326 1276 case RX_MSDU_DECAP_8023_SNAP_LLC: 1327 - ath10k_htt_rx_h_undecap_snap(ar, msdu, status, first_hdr); 1277 + ath10k_htt_rx_h_undecap_snap(ar, msdu, status, first_hdr, 1278 + enctype); 1328 1279 break; 1329 1280 } 1330 1281 } ··· 1369 1316 1370 1317 static void ath10k_htt_rx_h_mpdu(struct ath10k *ar, 1371 1318 struct sk_buff_head *amsdu, 1372 - struct ieee80211_rx_status *status) 1319 + struct ieee80211_rx_status *status, 1320 + bool fill_crypt_header) 1373 1321 { 1374 1322 struct sk_buff *first; 1375 1323 struct sk_buff *last; ··· 1380 1326 enum htt_rx_mpdu_encrypt_type enctype; 1381 1327 u8 first_hdr[64]; 1382 1328 u8 *qos; 1383 - size_t hdr_len; 1384 1329 bool has_fcs_err; 1385 1330 bool has_crypto_err; 1386 1331 bool has_tkip_err; ··· 1404 1351 * decapped header. It'll be used for undecapping of each MSDU. 1405 1352 */ 1406 1353 hdr = (void *)rxd->rx_hdr_status; 1407 - hdr_len = ieee80211_hdrlen(hdr->frame_control); 1408 - memcpy(first_hdr, hdr, hdr_len); 1354 + memcpy(first_hdr, hdr, RX_HTT_HDR_STATUS_LEN); 1409 1355 1410 1356 /* Each A-MSDU subframe will use the original header as the base and be 1411 1357 * reported as a separate MSDU so strip the A-MSDU bit from QoS Ctl. 1412 1358 */ 1413 1359 hdr = (void *)first_hdr; 1414 - qos = ieee80211_get_qos_ctl(hdr); 1415 - qos[0] &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; 1360 + 1361 + if (ieee80211_is_data_qos(hdr->frame_control)) { 1362 + qos = ieee80211_get_qos_ctl(hdr); 1363 + qos[0] &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; 1364 + } 1416 1365 1417 1366 /* Some attention flags are valid only in the last MSDU. */ 1418 1367 last = skb_peek_tail(amsdu); ··· 1461 1406 status->flag |= RX_FLAG_DECRYPTED; 1462 1407 1463 1408 if (likely(!is_mgmt)) 1464 - status->flag |= RX_FLAG_IV_STRIPPED | 1465 - RX_FLAG_MMIC_STRIPPED; 1466 - } 1409 + status->flag |= RX_FLAG_MMIC_STRIPPED; 1410 + 1411 + if (fill_crypt_header) 1412 + status->flag |= RX_FLAG_MIC_STRIPPED | 1413 + RX_FLAG_ICV_STRIPPED; 1414 + else 1415 + status->flag |= RX_FLAG_IV_STRIPPED; 1416 + } 1467 1417 1468 1418 skb_queue_walk(amsdu, msdu) { 1469 1419 ath10k_htt_rx_h_csum_offload(msdu); ··· 1484 1424 if (is_mgmt) 1485 1425 continue; 1486 1426 1427 + if (fill_crypt_header) 1428 + continue; 1429 + 1487 1430 hdr = (void *)msdu->data; 1488 1431 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); 1489 1432 } ··· 1497 1434 struct ieee80211_rx_status *status) 1498 1435 { 1499 1436 struct sk_buff *msdu; 1437 + struct sk_buff *first_subframe; 1438 + 1439 + first_subframe = skb_peek(amsdu); 1500 1440 1501 1441 while ((msdu = __skb_dequeue(amsdu))) { 1502 1442 /* Setup per-MSDU flags */ ··· 1507 1441 status->flag &= ~RX_FLAG_AMSDU_MORE; 1508 1442 else 1509 1443 status->flag |= RX_FLAG_AMSDU_MORE; 1444 + 1445 + if (msdu == first_subframe) { 1446 + first_subframe = NULL; 1447 + status->flag &= ~RX_FLAG_ALLOW_SAME_PN; 1448 + } else { 1449 + status->flag |= RX_FLAG_ALLOW_SAME_PN; 1450 + } 1510 1451 1511 1452 ath10k_process_rx(ar, status, msdu); 1512 1453 } ··· 1657 1584 ath10k_htt_rx_h_unchain(ar, &amsdu); 1658 1585 1659 1586 ath10k_htt_rx_h_filter(ar, &amsdu, rx_status); 1660 - ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status); 1587 + ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true); 1661 1588 ath10k_htt_rx_h_deliver(ar, &amsdu, rx_status); 1662 1589 1663 1590 return num_msdus; ··· 1818 1745 } 1819 1746 1820 1747 static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list, 1821 - struct sk_buff_head *amsdu, 1822 - int budget_left) 1748 + struct sk_buff_head *amsdu) 1823 1749 { 1824 1750 struct sk_buff *msdu; 1825 1751 struct htt_rx_desc *rxd; ··· 1829 1757 if (WARN_ON(!skb_queue_empty(amsdu))) 1830 1758 return -EINVAL; 1831 1759 1832 - while ((msdu = __skb_dequeue(list)) && budget_left) { 1760 + while ((msdu = __skb_dequeue(list))) { 1833 1761 __skb_queue_tail(amsdu, msdu); 1834 - budget_left--; 1835 1762 1836 1763 rxd = (void *)msdu->data - sizeof(*rxd); 1837 1764 if (rxd->msdu_end.common.info0 & ··· 1921 1850 return num_msdu; 1922 1851 } 1923 1852 1924 - static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb, 1925 - int budget_left) 1853 + static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb) 1926 1854 { 1927 1855 struct ath10k_htt *htt = &ar->htt; 1928 1856 struct htt_resp *resp = (void *)skb->data; ··· 1978 1908 if (offload) 1979 1909 num_msdus = ath10k_htt_rx_h_rx_offload(ar, &list); 1980 1910 1981 - while (!skb_queue_empty(&list) && budget_left) { 1911 + while (!skb_queue_empty(&list)) { 1982 1912 __skb_queue_head_init(&amsdu); 1983 - ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu, budget_left); 1913 + ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu); 1984 1914 switch (ret) { 1985 1915 case 0: 1986 1916 /* Note: The in-order indication may report interleaved ··· 1990 1920 * should still give an idea about rx rate to the user. 1991 1921 */ 1992 1922 num_msdus += skb_queue_len(&amsdu); 1993 - budget_left -= skb_queue_len(&amsdu); 1994 1923 ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id); 1995 1924 ath10k_htt_rx_h_filter(ar, &amsdu, status); 1996 - ath10k_htt_rx_h_mpdu(ar, &amsdu, status); 1925 + ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false); 1997 1926 ath10k_htt_rx_h_deliver(ar, &amsdu, status); 1998 1927 break; 1999 1928 case -EAGAIN: ··· 2632 2563 } 2633 2564 2634 2565 spin_lock_bh(&htt->rx_ring.lock); 2635 - num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb, 2636 - (budget - quota)); 2566 + num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb); 2637 2567 spin_unlock_bh(&htt->rx_ring.lock); 2638 2568 if (num_rx_msdus < 0) { 2639 2569 resched_napi = true;
+3
drivers/net/wireless/ath/ath10k/rx_desc.h
··· 239 239 HTT_RX_MPDU_ENCRYPT_WAPI = 5, 240 240 HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2 = 6, 241 241 HTT_RX_MPDU_ENCRYPT_NONE = 7, 242 + HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2 = 8, 243 + HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2 = 9, 244 + HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2 = 10, 242 245 }; 243 246 244 247 #define RX_MPDU_START_INFO0_PEER_IDX_MASK 0x000007ff
-1
drivers/net/wireless/ath/wcn36xx/main.c
··· 812 812 if (!sta) { 813 813 wcn36xx_err("sta %pM is not found\n", 814 814 bss_conf->bssid); 815 - rcu_read_unlock(); 816 815 goto out; 817 816 } 818 817 sta_priv = wcn36xx_sta_to_priv(sta);
+1
drivers/nvme/host/core.c
··· 1249 1249 goto out; 1250 1250 } 1251 1251 1252 + __nvme_revalidate_disk(disk, id); 1252 1253 nvme_report_ns_ids(ctrl, ns->ns_id, id, eui64, nguid, &uuid); 1253 1254 if (!uuid_equal(&ns->uuid, &uuid) || 1254 1255 memcmp(&ns->nguid, &nguid, sizeof(ns->nguid)) ||
+7 -4
drivers/nvme/host/rdma.c
··· 1614 1614 /* 1615 1615 * reconnecting state means transport disruption, which 1616 1616 * can take a long time and even might fail permanently, 1617 - * so we can't let incoming I/O be requeued forever. 1618 - * fail it fast to allow upper layers a chance to 1619 - * failover. 1617 + * fail fast to give upper layers a chance to failover. 1618 + * deleting state means that the ctrl will never accept 1619 + * commands again, fail it permanently. 1620 1620 */ 1621 - if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING) 1621 + if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING || 1622 + queue->ctrl->ctrl.state == NVME_CTRL_DELETING) { 1623 + nvme_req(rq)->status = NVME_SC_ABORT_REQ; 1622 1624 return BLK_STS_IOERR; 1625 + } 1623 1626 return BLK_STS_RESOURCE; /* try again later */ 1624 1627 } 1625 1628 }
+3 -2
fs/cifs/dir.c
··· 204 204 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb); 205 205 int i; 206 206 207 - if (unlikely(direntry->d_name.len > 207 + if (unlikely(tcon->fsAttrInfo.MaxPathNameComponentLength && 208 + direntry->d_name.len > 208 209 le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength))) 209 210 return -ENAMETOOLONG; 210 211 ··· 521 520 522 521 rc = check_name(direntry, tcon); 523 522 if (rc) 524 - goto out_free_xid; 523 + goto out; 525 524 526 525 server = tcon->ses->server; 527 526
+2 -3
include/linux/pm_qos.h
··· 27 27 PM_QOS_FLAGS_ALL, 28 28 }; 29 29 30 - #define PM_QOS_DEFAULT_VALUE (-1) 31 - #define PM_QOS_LATENCY_ANY S32_MAX 30 + #define PM_QOS_DEFAULT_VALUE -1 32 31 33 32 #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 34 33 #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 35 34 #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 36 35 #define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE 0 37 36 #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE 0 38 - #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY 39 37 #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0 40 38 #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1) 39 + #define PM_QOS_LATENCY_ANY ((s32)(~(__u32)0 >> 1)) 41 40 42 41 #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) 43 42 #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1)
+3 -3
include/net/tcp.h
··· 1738 1738 tcp_sk(sk)->highest_sack = skb ?: tcp_send_head(sk); 1739 1739 } 1740 1740 1741 - /* Called when old skb is about to be deleted (to be combined with new skb) */ 1742 - static inline void tcp_highest_sack_combine(struct sock *sk, 1741 + /* Called when old skb is about to be deleted and replaced by new skb */ 1742 + static inline void tcp_highest_sack_replace(struct sock *sk, 1743 1743 struct sk_buff *old, 1744 1744 struct sk_buff *new) 1745 1745 { 1746 - if (tcp_sk(sk)->sacked_out && (old == tcp_sk(sk)->highest_sack)) 1746 + if (old == tcp_highest_sack(sk)) 1747 1747 tcp_sk(sk)->highest_sack = new; 1748 1748 } 1749 1749
-1
include/uapi/linux/bpf.h
··· 889 889 enum sk_action { 890 890 SK_DROP = 0, 891 891 SK_PASS, 892 - SK_REDIRECT, 893 892 }; 894 893 895 894 #define BPF_TAG_SIZE 8
+12 -4
kernel/bpf/sockmap.c
··· 104 104 TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb); 105 105 } 106 106 107 + enum __sk_action { 108 + __SK_DROP = 0, 109 + __SK_PASS, 110 + __SK_REDIRECT, 111 + }; 112 + 107 113 static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb) 108 114 { 109 115 struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict); 110 116 int rc; 111 117 112 118 if (unlikely(!prog)) 113 - return SK_DROP; 119 + return __SK_DROP; 114 120 115 121 skb_orphan(skb); 116 122 /* We need to ensure that BPF metadata for maps is also cleared ··· 131 125 preempt_enable(); 132 126 skb->sk = NULL; 133 127 128 + /* Moving return codes from UAPI namespace into internal namespace */ 134 129 return rc == SK_PASS ? 135 - (TCP_SKB_CB(skb)->bpf.map ? SK_REDIRECT : SK_PASS) : SK_DROP; 130 + (TCP_SKB_CB(skb)->bpf.map ? __SK_REDIRECT : __SK_PASS) : 131 + __SK_DROP; 136 132 } 137 133 138 134 static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) ··· 144 136 145 137 rc = smap_verdict_func(psock, skb); 146 138 switch (rc) { 147 - case SK_REDIRECT: 139 + case __SK_REDIRECT: 148 140 sk = do_sk_redirect_map(skb); 149 141 if (likely(sk)) { 150 142 struct smap_psock *peer = smap_psock_sk(sk); ··· 160 152 } 161 153 } 162 154 /* Fall through and free skb otherwise */ 163 - case SK_DROP: 155 + case __SK_DROP: 164 156 default: 165 157 kfree_skb(skb); 166 158 }
+1 -1
kernel/signal.c
··· 2698 2698 [SIGSEGV] = { NSIGSEGV, SIL_FAULT }, 2699 2699 [SIGBUS] = { NSIGBUS, SIL_FAULT }, 2700 2700 [SIGTRAP] = { NSIGTRAP, SIL_FAULT }, 2701 - #if defined(SIGMET) && defined(NSIGEMT) 2701 + #if defined(SIGEMT) && defined(NSIGEMT) 2702 2702 [SIGEMT] = { NSIGEMT, SIL_FAULT }, 2703 2703 #endif 2704 2704 [SIGCHLD] = { NSIGCHLD, SIL_CHLD },
+1
lib/ioremap.c
··· 161 161 unsigned long next; 162 162 int err; 163 163 164 + might_sleep(); 164 165 BUG_ON(addr >= end); 165 166 166 167 start = addr;
+1 -1
net/ife/ife.c
··· 137 137 EXPORT_SYMBOL_GPL(ife_tlv_meta_encode); 138 138 139 139 MODULE_AUTHOR("Jamal Hadi Salim <jhs@mojatatu.com>"); 140 - MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 140 + MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>"); 141 141 MODULE_DESCRIPTION("Inter-FE LFB action"); 142 142 MODULE_LICENSE("GPL");
+2 -1
net/ipv4/tcp_output.c
··· 2132 2132 nskb->ip_summed = skb->ip_summed; 2133 2133 2134 2134 tcp_insert_write_queue_before(nskb, skb, sk); 2135 + tcp_highest_sack_replace(sk, skb, nskb); 2135 2136 2136 2137 len = 0; 2137 2138 tcp_for_write_queue_from_safe(skb, next, sk) { ··· 2736 2735 else if (!skb_shift(skb, next_skb, next_skb_size)) 2737 2736 return false; 2738 2737 } 2739 - tcp_highest_sack_combine(sk, next_skb, skb); 2738 + tcp_highest_sack_replace(sk, next_skb, skb); 2740 2739 2741 2740 if (next_skb->ip_summed == CHECKSUM_PARTIAL) 2742 2741 skb->ip_summed = CHECKSUM_PARTIAL;
+1
net/ipv6/addrconf.c
··· 3349 3349 if ((ifp->flags & IFA_F_PERMANENT) && 3350 3350 fixup_permanent_addr(idev, ifp) < 0) { 3351 3351 write_unlock_bh(&idev->lock); 3352 + in6_ifa_hold(ifp); 3352 3353 ipv6_del_addr(ifp); 3353 3354 write_lock_bh(&idev->lock); 3354 3355
+6 -1
net/l2tp/l2tp_ppp.c
··· 641 641 u32 tunnel_id, peer_tunnel_id; 642 642 u32 session_id, peer_session_id; 643 643 bool drop_refcnt = false; 644 + bool drop_tunnel = false; 644 645 int ver = 2; 645 646 int fd; 646 647 ··· 710 709 if (tunnel_id == 0) 711 710 goto end; 712 711 713 - tunnel = l2tp_tunnel_find(sock_net(sk), tunnel_id); 712 + tunnel = l2tp_tunnel_get(sock_net(sk), tunnel_id); 713 + if (tunnel) 714 + drop_tunnel = true; 714 715 715 716 /* Special case: create tunnel context if session_id and 716 717 * peer_session_id is 0. Otherwise look up tunnel using supplied ··· 840 837 end: 841 838 if (drop_refcnt) 842 839 l2tp_session_dec_refcount(session); 840 + if (drop_tunnel) 841 + l2tp_tunnel_dec_refcount(tunnel); 843 842 release_sock(sk); 844 843 845 844 return error;
+1 -1
net/psample/psample.c
··· 296 296 module_init(psample_module_init); 297 297 module_exit(psample_module_exit); 298 298 299 - MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 299 + MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>"); 300 300 MODULE_DESCRIPTION("netlink channel for packet sampling"); 301 301 MODULE_LICENSE("GPL v2");
+1 -1
net/sched/act_sample.c
··· 271 271 module_init(sample_init_module); 272 272 module_exit(sample_cleanup_module); 273 273 274 - MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 274 + MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>"); 275 275 MODULE_DESCRIPTION("Packet sampling action"); 276 276 MODULE_LICENSE("GPL v2");
+9 -29
net/sched/cls_api.c
··· 322 322 struct tcf_block *block = container_of(work, struct tcf_block, work); 323 323 struct tcf_chain *chain, *tmp; 324 324 325 - /* At this point, all the chains should have refcnt == 1. */ 326 325 rtnl_lock(); 326 + /* Only chain 0 should be still here. */ 327 327 list_for_each_entry_safe(chain, tmp, &block->chain_list, list) 328 328 tcf_chain_put(chain); 329 329 rtnl_unlock(); ··· 331 331 } 332 332 333 333 /* XXX: Standalone actions are not allowed to jump to any chain, and bound 334 - * actions should be all removed after flushing. However, filters are destroyed 335 - * in RCU callbacks, we have to hold the chains first, otherwise we would 336 - * always race with RCU callbacks on this list without proper locking. 334 + * actions should be all removed after flushing. However, filters are now 335 + * destroyed in tc filter workqueue with RTNL lock, they can not race here. 337 336 */ 338 - static void tcf_block_put_deferred(struct work_struct *work) 339 - { 340 - struct tcf_block *block = container_of(work, struct tcf_block, work); 341 - struct tcf_chain *chain; 342 - 343 - rtnl_lock(); 344 - /* Hold a refcnt for all chains, except 0, in case they are gone. */ 345 - list_for_each_entry(chain, &block->chain_list, list) 346 - if (chain->index) 347 - tcf_chain_hold(chain); 348 - 349 - /* No race on the list, because no chain could be destroyed. */ 350 - list_for_each_entry(chain, &block->chain_list, list) 351 - tcf_chain_flush(chain); 352 - 353 - INIT_WORK(&block->work, tcf_block_put_final); 354 - /* Wait for RCU callbacks to release the reference count and make 355 - * sure their works have been queued before this. 356 - */ 357 - rcu_barrier(); 358 - tcf_queue_work(&block->work); 359 - rtnl_unlock(); 360 - } 361 - 362 337 void tcf_block_put_ext(struct tcf_block *block, 363 338 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q, 364 339 struct tcf_block_ext_info *ei) 365 340 { 341 + struct tcf_chain *chain, *tmp; 342 + 366 343 if (!block) 367 344 return; 368 345 369 346 tcf_block_offload_unbind(block, q, ei); 370 347 371 - INIT_WORK(&block->work, tcf_block_put_deferred); 348 + list_for_each_entry_safe(chain, tmp, &block->chain_list, list) 349 + tcf_chain_flush(chain); 350 + 351 + INIT_WORK(&block->work, tcf_block_put_final); 372 352 /* Wait for existing RCU callbacks to cool down, make sure their works 373 353 * have been queued before this. We can not flush pending works here 374 354 * because we are holding the RTNL lock.
+3 -1
net/xfrm/xfrm_output.c
··· 105 105 if (xfrm_offload(skb)) { 106 106 x->type_offload->encap(x, skb); 107 107 } else { 108 + /* Inner headers are invalid now. */ 109 + skb->encapsulation = 0; 110 + 108 111 err = x->type->output(x, skb); 109 112 if (err == -EINPROGRESS) 110 113 goto out; ··· 211 208 int err; 212 209 213 210 secpath_reset(skb); 214 - skb->encapsulation = 0; 215 211 216 212 if (xfrm_dev_offload_ok(skb, x)) { 217 213 struct sec_path *sp;
-1
net/xfrm/xfrm_policy.c
··· 2075 2075 xdst->num_xfrms = num_xfrms; 2076 2076 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); 2077 2077 2078 - dst_hold(&xdst->u.dst); 2079 2078 return xdst; 2080 2079 2081 2080 inc_error:
+1
net/xfrm/xfrm_state.c
··· 2069 2069 if (err >= 0) { 2070 2070 xfrm_sk_policy_insert(sk, err, pol); 2071 2071 xfrm_pol_put(pol); 2072 + __sk_dst_reset(sk); 2072 2073 err = 0; 2073 2074 } 2074 2075
+1 -2
tools/include/uapi/linux/bpf.h
··· 645 645 * @map: pointer to sockmap 646 646 * @key: key to lookup sock in map 647 647 * @flags: reserved for future use 648 - * Return: SK_REDIRECT 648 + * Return: SK_PASS 649 649 * 650 650 * int bpf_sock_map_update(skops, map, key, flags) 651 651 * @skops: pointer to bpf_sock_ops ··· 889 889 enum sk_action { 890 890 SK_DROP = 0, 891 891 SK_PASS, 892 - SK_REDIRECT, 893 892 }; 894 893 895 894 #define BPF_TAG_SIZE 8
+2 -2
tools/testing/selftests/tc-testing/tdc.py
··· 152 152 exec_cmd(cmd, False) 153 153 cmd = 'ip link set $DEV0 up' 154 154 exec_cmd(cmd, False) 155 - cmd = 'ip -s $NS link set $DEV1 up' 155 + cmd = 'ip -n $NS link set $DEV1 up' 156 156 exec_cmd(cmd, False) 157 157 cmd = 'ip link set $DEV2 netns $NS' 158 158 exec_cmd(cmd, False) 159 - cmd = 'ip -s $NS link set $DEV2 up' 159 + cmd = 'ip -n $NS link set $DEV2 up' 160 160 exec_cmd(cmd, False) 161 161 162 162