aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/i2c.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/reg.h25
-rw-r--r--drivers/net/phy/marvell.c8
-rw-r--r--drivers/net/tap.c2
-rw-r--r--drivers/net/tun.c4
-rw-r--r--drivers/net/wan/lapbether.c1
-rw-r--r--drivers/net/wireless/ath/ath10k/htt_rx.c122
-rw-r--r--drivers/net/wireless/ath/ath10k/rx_desc.h3
-rw-r--r--drivers/net/wireless/ath/wcn36xx/main.c1
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/uapi/linux/bpf.h1
-rw-r--r--kernel/bpf/sockmap.c16
-rw-r--r--net/ife/ife.c2
-rw-r--r--net/ipv4/tcp_output.c3
-rw-r--r--net/ipv6/addrconf.c1
-rw-r--r--net/l2tp/l2tp_ppp.c7
-rw-r--r--net/psample/psample.c2
-rw-r--r--net/sched/act_sample.c2
-rw-r--r--net/sched/cls_api.c37
-rw-r--r--net/xfrm/xfrm_output.c4
-rw-r--r--net/xfrm/xfrm_policy.c1
-rw-r--r--net/xfrm/xfrm_state.c1
-rw-r--r--tools/include/uapi/linux/bpf.h3
-rwxr-xr-xtools/testing/selftests/tc-testing/tdc.py4
26 files changed, 182 insertions, 86 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index af0cb69f6a3e..bf1d20695cbf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6671,7 +6671,7 @@ F: include/net/ieee802154_netdev.h
6671F: Documentation/networking/ieee802154.txt 6671F: Documentation/networking/ieee802154.txt
6672 6672
6673IFE PROTOCOL 6673IFE PROTOCOL
6674M: Yotam Gigi <yotamg@mellanox.com> 6674M: Yotam Gigi <yotam.gi@gmail.com>
6675M: Jamal Hadi Salim <jhs@mojatatu.com> 6675M: Jamal Hadi Salim <jhs@mojatatu.com>
6676F: net/ife 6676F: net/ife
6677F: include/net/ife.h 6677F: include/net/ife.h
@@ -8743,7 +8743,7 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/
8743F: drivers/net/ethernet/mellanox/mlxsw/ 8743F: drivers/net/ethernet/mellanox/mlxsw/
8744 8744
8745MELLANOX FIRMWARE FLASH LIBRARY (mlxfw) 8745MELLANOX FIRMWARE FLASH LIBRARY (mlxfw)
8746M: Yotam Gigi <yotamg@mellanox.com> 8746M: mlxsw@mellanox.com
8747L: netdev@vger.kernel.org 8747L: netdev@vger.kernel.org
8748S: Supported 8748S: Supported
8749W: http://www.mellanox.com 8749W: http://www.mellanox.com
@@ -10890,7 +10890,7 @@ S: Maintained
10890F: drivers/block/ps3vram.c 10890F: drivers/block/ps3vram.c
10891 10891
10892PSAMPLE PACKET SAMPLING SUPPORT: 10892PSAMPLE PACKET SAMPLING SUPPORT:
10893M: Yotam Gigi <yotamg@mellanox.com> 10893M: Yotam Gigi <yotam.gi@gmail.com>
10894S: Maintained 10894S: Maintained
10895F: net/psample 10895F: net/psample
10896F: include/net/psample.h 10896F: include/net/psample.h
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 36520634c96a..e77192683dba 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -2369,8 +2369,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
2369 priv->enet_ver = AE_VERSION_2; 2369 priv->enet_ver = AE_VERSION_2;
2370 2370
2371 ae_node = of_parse_phandle(dev->of_node, "ae-handle", 0); 2371 ae_node = of_parse_phandle(dev->of_node, "ae-handle", 0);
2372 if (IS_ERR_OR_NULL(ae_node)) { 2372 if (!ae_node) {
2373 ret = PTR_ERR(ae_node); 2373 ret = -ENODEV;
2374 dev_err(dev, "not find ae-handle\n"); 2374 dev_err(dev, "not find ae-handle\n");
2375 goto out_read_prop_fail; 2375 goto out_read_prop_fail;
2376 } 2376 }
diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
index 12c3a4449120..c0dcfa05b077 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
@@ -294,7 +294,7 @@ mlxsw_i2c_write(struct device *dev, size_t in_mbox_size, u8 *in_mbox, int num,
294 write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size; 294 write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size;
295 mlxsw_i2c_set_slave_addr(tran_buf, off); 295 mlxsw_i2c_set_slave_addr(tran_buf, off);
296 memcpy(&tran_buf[MLXSW_I2C_ADDR_BUF_SIZE], in_mbox + 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 j = 0; 299 j = 0;
300 end = jiffies + timeout; 300 end = jiffies + timeout;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 4afc8486eb9a..5acfbe5b8b9d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -5827,6 +5827,29 @@ MLXSW_ITEM32(reg, mtmp, mtr, 0x08, 30, 1);
5827 */ 5827 */
5828MLXSW_ITEM32(reg, mtmp, max_temperature, 0x08, 0, 16); 5828MLXSW_ITEM32(reg, mtmp, max_temperature, 0x08, 0, 16);
5829 5829
5830/* reg_mtmp_tee
5831 * Temperature Event Enable.
5832 * 0 - Do not generate event
5833 * 1 - Generate event
5834 * 2 - Generate single event
5835 * Access: RW
5836 */
5837MLXSW_ITEM32(reg, mtmp, tee, 0x0C, 30, 2);
5838
5839#define MLXSW_REG_MTMP_THRESH_HI 0x348 /* 105 Celsius */
5840
5841/* reg_mtmp_temperature_threshold_hi
5842 * High threshold for Temperature Warning Event. In 0.125 Celsius.
5843 * Access: RW
5844 */
5845MLXSW_ITEM32(reg, mtmp, temperature_threshold_hi, 0x0C, 0, 16);
5846
5847/* reg_mtmp_temperature_threshold_lo
5848 * Low threshold for Temperature Warning Event. In 0.125 Celsius.
5849 * Access: RW
5850 */
5851MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16);
5852
5830#define MLXSW_REG_MTMP_SENSOR_NAME_SIZE 8 5853#define MLXSW_REG_MTMP_SENSOR_NAME_SIZE 8
5831 5854
5832/* reg_mtmp_sensor_name 5855/* reg_mtmp_sensor_name
@@ -5843,6 +5866,8 @@ static inline void mlxsw_reg_mtmp_pack(char *payload, u8 sensor_index,
5843 mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index); 5866 mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index);
5844 mlxsw_reg_mtmp_mte_set(payload, max_temp_enable); 5867 mlxsw_reg_mtmp_mte_set(payload, max_temp_enable);
5845 mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset); 5868 mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset);
5869 mlxsw_reg_mtmp_temperature_threshold_hi_set(payload,
5870 MLXSW_REG_MTMP_THRESH_HI);
5846} 5871}
5847 5872
5848static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp, 5873static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp,
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 15cbcdba618a..4d02b27df044 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -681,9 +681,11 @@ static int m88e1116r_config_init(struct phy_device *phydev)
681 if (err < 0) 681 if (err < 0)
682 return err; 682 return err;
683 683
684 err = m88e1121_config_aneg_rgmii_delays(phydev); 684 if (phy_interface_is_rgmii(phydev)) {
685 if (err < 0) 685 err = m88e1121_config_aneg_rgmii_delays(phydev);
686 return err; 686 if (err < 0)
687 return err;
688 }
687 689
688 err = genphy_soft_reset(phydev); 690 err = genphy_soft_reset(phydev);
689 if (err < 0) 691 if (err < 0)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 1b10fcc6a58d..6c0c84c33e1f 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -1032,6 +1032,8 @@ static long tap_ioctl(struct file *file, unsigned int cmd,
1032 case TUNSETSNDBUF: 1032 case TUNSETSNDBUF:
1033 if (get_user(s, sp)) 1033 if (get_user(s, sp))
1034 return -EFAULT; 1034 return -EFAULT;
1035 if (s <= 0)
1036 return -EINVAL;
1035 1037
1036 q->sk.sk_sndbuf = s; 1038 q->sk.sk_sndbuf = s;
1037 return 0; 1039 return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 5550f56cb895..42bb820a56c9 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2429,6 +2429,10 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
2429 ret = -EFAULT; 2429 ret = -EFAULT;
2430 break; 2430 break;
2431 } 2431 }
2432 if (sndbuf <= 0) {
2433 ret = -EINVAL;
2434 break;
2435 }
2432 2436
2433 tun->sndbuf = sndbuf; 2437 tun->sndbuf = sndbuf;
2434 tun_set_sndbuf(tun); 2438 tun_set_sndbuf(tun);
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 63f749078a1f..0e3f8ed84660 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -346,7 +346,6 @@ out:
346fail: 346fail:
347 dev_put(dev); 347 dev_put(dev);
348 free_netdev(ndev); 348 free_netdev(ndev);
349 kfree(lapbeth);
350 goto out; 349 goto out;
351} 350}
352 351
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index a3f5dc78353f..0aeeb233af78 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -550,6 +550,11 @@ static int ath10k_htt_rx_crypto_param_len(struct ath10k *ar,
550 return IEEE80211_TKIP_IV_LEN; 550 return IEEE80211_TKIP_IV_LEN;
551 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2: 551 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2:
552 return IEEE80211_CCMP_HDR_LEN; 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 case HTT_RX_MPDU_ENCRYPT_WEP128: 558 case HTT_RX_MPDU_ENCRYPT_WEP128:
554 case HTT_RX_MPDU_ENCRYPT_WAPI: 559 case HTT_RX_MPDU_ENCRYPT_WAPI:
555 break; 560 break;
@@ -575,6 +580,11 @@ static int ath10k_htt_rx_crypto_tail_len(struct ath10k *ar,
575 return IEEE80211_TKIP_ICV_LEN; 580 return IEEE80211_TKIP_ICV_LEN;
576 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2: 581 case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2:
577 return IEEE80211_CCMP_MIC_LEN; 582 return IEEE80211_CCMP_MIC_LEN;
583 case HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2:
584 return IEEE80211_CCMP_256_MIC_LEN;
585 case HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2:
586 case HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2:
587 return IEEE80211_GCMP_MIC_LEN;
578 case HTT_RX_MPDU_ENCRYPT_WEP128: 588 case HTT_RX_MPDU_ENCRYPT_WEP128:
579 case HTT_RX_MPDU_ENCRYPT_WAPI: 589 case HTT_RX_MPDU_ENCRYPT_WAPI:
580 break; 590 break;
@@ -1051,9 +1061,21 @@ static void ath10k_htt_rx_h_undecap_raw(struct ath10k *ar,
1051 hdr = (void *)msdu->data; 1061 hdr = (void *)msdu->data;
1052 1062
1053 /* Tail */ 1063 /* Tail */
1054 if (status->flag & RX_FLAG_IV_STRIPPED) 1064 if (status->flag & RX_FLAG_IV_STRIPPED) {
1055 skb_trim(msdu, msdu->len - 1065 skb_trim(msdu, msdu->len -
1056 ath10k_htt_rx_crypto_tail_len(ar, enctype)); 1066 ath10k_htt_rx_crypto_tail_len(ar, enctype));
1067 } else {
1068 /* MIC */
1069 if ((status->flag & RX_FLAG_MIC_STRIPPED) &&
1070 enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
1071 skb_trim(msdu, msdu->len - 8);
1072
1073 /* ICV */
1074 if (status->flag & RX_FLAG_ICV_STRIPPED &&
1075 enctype != HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
1076 skb_trim(msdu, msdu->len -
1077 ath10k_htt_rx_crypto_tail_len(ar, enctype));
1078 }
1057 1079
1058 /* MMIC */ 1080 /* MMIC */
1059 if ((status->flag & RX_FLAG_MMIC_STRIPPED) && 1081 if ((status->flag & RX_FLAG_MMIC_STRIPPED) &&
@@ -1075,7 +1097,8 @@ static void ath10k_htt_rx_h_undecap_raw(struct ath10k *ar,
1075static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar, 1097static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
1076 struct sk_buff *msdu, 1098 struct sk_buff *msdu,
1077 struct ieee80211_rx_status *status, 1099 struct ieee80211_rx_status *status,
1078 const u8 first_hdr[64]) 1100 const u8 first_hdr[64],
1101 enum htt_rx_mpdu_encrypt_type enctype)
1079{ 1102{
1080 struct ieee80211_hdr *hdr; 1103 struct ieee80211_hdr *hdr;
1081 struct htt_rx_desc *rxd; 1104 struct htt_rx_desc *rxd;
@@ -1083,6 +1106,7 @@ static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
1083 u8 da[ETH_ALEN]; 1106 u8 da[ETH_ALEN];
1084 u8 sa[ETH_ALEN]; 1107 u8 sa[ETH_ALEN];
1085 int l3_pad_bytes; 1108 int l3_pad_bytes;
1109 int bytes_aligned = ar->hw_params.decap_align_bytes;
1086 1110
1087 /* Delivered decapped frame: 1111 /* Delivered decapped frame:
1088 * [nwifi 802.11 header] <-- replaced with 802.11 hdr 1112 * [nwifi 802.11 header] <-- replaced with 802.11 hdr
@@ -1111,6 +1135,14 @@ static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
1111 /* push original 802.11 header */ 1135 /* push original 802.11 header */
1112 hdr = (struct ieee80211_hdr *)first_hdr; 1136 hdr = (struct ieee80211_hdr *)first_hdr;
1113 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1137 hdr_len = ieee80211_hdrlen(hdr->frame_control);
1138
1139 if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
1140 memcpy(skb_push(msdu,
1141 ath10k_htt_rx_crypto_param_len(ar, enctype)),
1142 (void *)hdr + round_up(hdr_len, bytes_aligned),
1143 ath10k_htt_rx_crypto_param_len(ar, enctype));
1144 }
1145
1114 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1146 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len);
1115 1147
1116 /* original 802.11 header has a different DA and in 1148 /* original 802.11 header has a different DA and in
@@ -1171,6 +1203,7 @@ static void ath10k_htt_rx_h_undecap_eth(struct ath10k *ar,
1171 u8 sa[ETH_ALEN]; 1203 u8 sa[ETH_ALEN];
1172 int l3_pad_bytes; 1204 int l3_pad_bytes;
1173 struct htt_rx_desc *rxd; 1205 struct htt_rx_desc *rxd;
1206 int bytes_aligned = ar->hw_params.decap_align_bytes;
1174 1207
1175 /* Delivered decapped frame: 1208 /* Delivered decapped frame:
1176 * [eth header] <-- replaced with 802.11 hdr & rfc1042/llc 1209 * [eth header] <-- replaced with 802.11 hdr & rfc1042/llc
@@ -1199,6 +1232,14 @@ static void ath10k_htt_rx_h_undecap_eth(struct ath10k *ar,
1199 /* push original 802.11 header */ 1232 /* push original 802.11 header */
1200 hdr = (struct ieee80211_hdr *)first_hdr; 1233 hdr = (struct ieee80211_hdr *)first_hdr;
1201 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1234 hdr_len = ieee80211_hdrlen(hdr->frame_control);
1235
1236 if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
1237 memcpy(skb_push(msdu,
1238 ath10k_htt_rx_crypto_param_len(ar, enctype)),
1239 (void *)hdr + round_up(hdr_len, bytes_aligned),
1240 ath10k_htt_rx_crypto_param_len(ar, enctype));
1241 }
1242
1202 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1243 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len);
1203 1244
1204 /* original 802.11 header has a different DA and in 1245 /* original 802.11 header has a different DA and in
@@ -1212,12 +1253,14 @@ static void ath10k_htt_rx_h_undecap_eth(struct ath10k *ar,
1212static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar, 1253static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar,
1213 struct sk_buff *msdu, 1254 struct sk_buff *msdu,
1214 struct ieee80211_rx_status *status, 1255 struct ieee80211_rx_status *status,
1215 const u8 first_hdr[64]) 1256 const u8 first_hdr[64],
1257 enum htt_rx_mpdu_encrypt_type enctype)
1216{ 1258{
1217 struct ieee80211_hdr *hdr; 1259 struct ieee80211_hdr *hdr;
1218 size_t hdr_len; 1260 size_t hdr_len;
1219 int l3_pad_bytes; 1261 int l3_pad_bytes;
1220 struct htt_rx_desc *rxd; 1262 struct htt_rx_desc *rxd;
1263 int bytes_aligned = ar->hw_params.decap_align_bytes;
1221 1264
1222 /* Delivered decapped frame: 1265 /* Delivered decapped frame:
1223 * [amsdu header] <-- replaced with 802.11 hdr 1266 * [amsdu header] <-- replaced with 802.11 hdr
@@ -1233,6 +1276,14 @@ static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar,
1233 1276
1234 hdr = (struct ieee80211_hdr *)first_hdr; 1277 hdr = (struct ieee80211_hdr *)first_hdr;
1235 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1278 hdr_len = ieee80211_hdrlen(hdr->frame_control);
1279
1280 if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
1281 memcpy(skb_push(msdu,
1282 ath10k_htt_rx_crypto_param_len(ar, enctype)),
1283 (void *)hdr + round_up(hdr_len, bytes_aligned),
1284 ath10k_htt_rx_crypto_param_len(ar, enctype));
1285 }
1286
1236 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); 1287 memcpy(skb_push(msdu, hdr_len), hdr, hdr_len);
1237} 1288}
1238 1289
@@ -1267,13 +1318,15 @@ static void ath10k_htt_rx_h_undecap(struct ath10k *ar,
1267 is_decrypted); 1318 is_decrypted);
1268 break; 1319 break;
1269 case RX_MSDU_DECAP_NATIVE_WIFI: 1320 case RX_MSDU_DECAP_NATIVE_WIFI:
1270 ath10k_htt_rx_h_undecap_nwifi(ar, msdu, status, first_hdr); 1321 ath10k_htt_rx_h_undecap_nwifi(ar, msdu, status, first_hdr,
1322 enctype);
1271 break; 1323 break;
1272 case RX_MSDU_DECAP_ETHERNET2_DIX: 1324 case RX_MSDU_DECAP_ETHERNET2_DIX:
1273 ath10k_htt_rx_h_undecap_eth(ar, msdu, status, first_hdr, enctype); 1325 ath10k_htt_rx_h_undecap_eth(ar, msdu, status, first_hdr, enctype);
1274 break; 1326 break;
1275 case RX_MSDU_DECAP_8023_SNAP_LLC: 1327 case RX_MSDU_DECAP_8023_SNAP_LLC:
1276 ath10k_htt_rx_h_undecap_snap(ar, msdu, status, first_hdr); 1328 ath10k_htt_rx_h_undecap_snap(ar, msdu, status, first_hdr,
1329 enctype);
1277 break; 1330 break;
1278 } 1331 }
1279} 1332}
@@ -1316,7 +1369,8 @@ static void ath10k_htt_rx_h_csum_offload(struct sk_buff *msdu)
1316 1369
1317static void ath10k_htt_rx_h_mpdu(struct ath10k *ar, 1370static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
1318 struct sk_buff_head *amsdu, 1371 struct sk_buff_head *amsdu,
1319 struct ieee80211_rx_status *status) 1372 struct ieee80211_rx_status *status,
1373 bool fill_crypt_header)
1320{ 1374{
1321 struct sk_buff *first; 1375 struct sk_buff *first;
1322 struct sk_buff *last; 1376 struct sk_buff *last;
@@ -1326,7 +1380,6 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
1326 enum htt_rx_mpdu_encrypt_type enctype; 1380 enum htt_rx_mpdu_encrypt_type enctype;
1327 u8 first_hdr[64]; 1381 u8 first_hdr[64];
1328 u8 *qos; 1382 u8 *qos;
1329 size_t hdr_len;
1330 bool has_fcs_err; 1383 bool has_fcs_err;
1331 bool has_crypto_err; 1384 bool has_crypto_err;
1332 bool has_tkip_err; 1385 bool has_tkip_err;
@@ -1351,15 +1404,17 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
1351 * decapped header. It'll be used for undecapping of each MSDU. 1404 * decapped header. It'll be used for undecapping of each MSDU.
1352 */ 1405 */
1353 hdr = (void *)rxd->rx_hdr_status; 1406 hdr = (void *)rxd->rx_hdr_status;
1354 hdr_len = ieee80211_hdrlen(hdr->frame_control); 1407 memcpy(first_hdr, hdr, RX_HTT_HDR_STATUS_LEN);
1355 memcpy(first_hdr, hdr, hdr_len);
1356 1408
1357 /* Each A-MSDU subframe will use the original header as the base and be 1409 /* Each A-MSDU subframe will use the original header as the base and be
1358 * reported as a separate MSDU so strip the A-MSDU bit from QoS Ctl. 1410 * reported as a separate MSDU so strip the A-MSDU bit from QoS Ctl.
1359 */ 1411 */
1360 hdr = (void *)first_hdr; 1412 hdr = (void *)first_hdr;
1361 qos = ieee80211_get_qos_ctl(hdr); 1413
1362 qos[0] &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; 1414 if (ieee80211_is_data_qos(hdr->frame_control)) {
1415 qos = ieee80211_get_qos_ctl(hdr);
1416 qos[0] &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT;
1417 }
1363 1418
1364 /* Some attention flags are valid only in the last MSDU. */ 1419 /* Some attention flags are valid only in the last MSDU. */
1365 last = skb_peek_tail(amsdu); 1420 last = skb_peek_tail(amsdu);
@@ -1406,9 +1461,14 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
1406 status->flag |= RX_FLAG_DECRYPTED; 1461 status->flag |= RX_FLAG_DECRYPTED;
1407 1462
1408 if (likely(!is_mgmt)) 1463 if (likely(!is_mgmt))
1409 status->flag |= RX_FLAG_IV_STRIPPED | 1464 status->flag |= RX_FLAG_MMIC_STRIPPED;
1410 RX_FLAG_MMIC_STRIPPED; 1465
1411} 1466 if (fill_crypt_header)
1467 status->flag |= RX_FLAG_MIC_STRIPPED |
1468 RX_FLAG_ICV_STRIPPED;
1469 else
1470 status->flag |= RX_FLAG_IV_STRIPPED;
1471 }
1412 1472
1413 skb_queue_walk(amsdu, msdu) { 1473 skb_queue_walk(amsdu, msdu) {
1414 ath10k_htt_rx_h_csum_offload(msdu); 1474 ath10k_htt_rx_h_csum_offload(msdu);
@@ -1424,6 +1484,9 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
1424 if (is_mgmt) 1484 if (is_mgmt)
1425 continue; 1485 continue;
1426 1486
1487 if (fill_crypt_header)
1488 continue;
1489
1427 hdr = (void *)msdu->data; 1490 hdr = (void *)msdu->data;
1428 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); 1491 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED);
1429 } 1492 }
@@ -1434,6 +1497,9 @@ static void ath10k_htt_rx_h_deliver(struct ath10k *ar,
1434 struct ieee80211_rx_status *status) 1497 struct ieee80211_rx_status *status)
1435{ 1498{
1436 struct sk_buff *msdu; 1499 struct sk_buff *msdu;
1500 struct sk_buff *first_subframe;
1501
1502 first_subframe = skb_peek(amsdu);
1437 1503
1438 while ((msdu = __skb_dequeue(amsdu))) { 1504 while ((msdu = __skb_dequeue(amsdu))) {
1439 /* Setup per-MSDU flags */ 1505 /* Setup per-MSDU flags */
@@ -1442,6 +1508,13 @@ static void ath10k_htt_rx_h_deliver(struct ath10k *ar,
1442 else 1508 else
1443 status->flag |= RX_FLAG_AMSDU_MORE; 1509 status->flag |= RX_FLAG_AMSDU_MORE;
1444 1510
1511 if (msdu == first_subframe) {
1512 first_subframe = NULL;
1513 status->flag &= ~RX_FLAG_ALLOW_SAME_PN;
1514 } else {
1515 status->flag |= RX_FLAG_ALLOW_SAME_PN;
1516 }
1517
1445 ath10k_process_rx(ar, status, msdu); 1518 ath10k_process_rx(ar, status, msdu);
1446 } 1519 }
1447} 1520}
@@ -1584,7 +1657,7 @@ static int ath10k_htt_rx_handle_amsdu(struct ath10k_htt *htt)
1584 ath10k_htt_rx_h_unchain(ar, &amsdu); 1657 ath10k_htt_rx_h_unchain(ar, &amsdu);
1585 1658
1586 ath10k_htt_rx_h_filter(ar, &amsdu, rx_status); 1659 ath10k_htt_rx_h_filter(ar, &amsdu, rx_status);
1587 ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status); 1660 ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true);
1588 ath10k_htt_rx_h_deliver(ar, &amsdu, rx_status); 1661 ath10k_htt_rx_h_deliver(ar, &amsdu, rx_status);
1589 1662
1590 return num_msdus; 1663 return num_msdus;
@@ -1745,8 +1818,7 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp)
1745} 1818}
1746 1819
1747static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list, 1820static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list,
1748 struct sk_buff_head *amsdu, 1821 struct sk_buff_head *amsdu)
1749 int budget_left)
1750{ 1822{
1751 struct sk_buff *msdu; 1823 struct sk_buff *msdu;
1752 struct htt_rx_desc *rxd; 1824 struct htt_rx_desc *rxd;
@@ -1757,9 +1829,8 @@ static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list,
1757 if (WARN_ON(!skb_queue_empty(amsdu))) 1829 if (WARN_ON(!skb_queue_empty(amsdu)))
1758 return -EINVAL; 1830 return -EINVAL;
1759 1831
1760 while ((msdu = __skb_dequeue(list)) && budget_left) { 1832 while ((msdu = __skb_dequeue(list))) {
1761 __skb_queue_tail(amsdu, msdu); 1833 __skb_queue_tail(amsdu, msdu);
1762 budget_left--;
1763 1834
1764 rxd = (void *)msdu->data - sizeof(*rxd); 1835 rxd = (void *)msdu->data - sizeof(*rxd);
1765 if (rxd->msdu_end.common.info0 & 1836 if (rxd->msdu_end.common.info0 &
@@ -1850,8 +1921,7 @@ static int ath10k_htt_rx_h_rx_offload(struct ath10k *ar,
1850 return num_msdu; 1921 return num_msdu;
1851} 1922}
1852 1923
1853static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb, 1924static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb)
1854 int budget_left)
1855{ 1925{
1856 struct ath10k_htt *htt = &ar->htt; 1926 struct ath10k_htt *htt = &ar->htt;
1857 struct htt_resp *resp = (void *)skb->data; 1927 struct htt_resp *resp = (void *)skb->data;
@@ -1908,9 +1978,9 @@ static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb,
1908 if (offload) 1978 if (offload)
1909 num_msdus = ath10k_htt_rx_h_rx_offload(ar, &list); 1979 num_msdus = ath10k_htt_rx_h_rx_offload(ar, &list);
1910 1980
1911 while (!skb_queue_empty(&list) && budget_left) { 1981 while (!skb_queue_empty(&list)) {
1912 __skb_queue_head_init(&amsdu); 1982 __skb_queue_head_init(&amsdu);
1913 ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu, budget_left); 1983 ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu);
1914 switch (ret) { 1984 switch (ret) {
1915 case 0: 1985 case 0:
1916 /* Note: The in-order indication may report interleaved 1986 /* Note: The in-order indication may report interleaved
@@ -1920,10 +1990,9 @@ static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb,
1920 * should still give an idea about rx rate to the user. 1990 * should still give an idea about rx rate to the user.
1921 */ 1991 */
1922 num_msdus += skb_queue_len(&amsdu); 1992 num_msdus += skb_queue_len(&amsdu);
1923 budget_left -= skb_queue_len(&amsdu);
1924 ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id); 1993 ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id);
1925 ath10k_htt_rx_h_filter(ar, &amsdu, status); 1994 ath10k_htt_rx_h_filter(ar, &amsdu, status);
1926 ath10k_htt_rx_h_mpdu(ar, &amsdu, status); 1995 ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false);
1927 ath10k_htt_rx_h_deliver(ar, &amsdu, status); 1996 ath10k_htt_rx_h_deliver(ar, &amsdu, status);
1928 break; 1997 break;
1929 case -EAGAIN: 1998 case -EAGAIN:
@@ -2563,8 +2632,7 @@ int ath10k_htt_txrx_compl_task(struct ath10k *ar, int budget)
2563 } 2632 }
2564 2633
2565 spin_lock_bh(&htt->rx_ring.lock); 2634 spin_lock_bh(&htt->rx_ring.lock);
2566 num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb, 2635 num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb);
2567 (budget - quota));
2568 spin_unlock_bh(&htt->rx_ring.lock); 2636 spin_unlock_bh(&htt->rx_ring.lock);
2569 if (num_rx_msdus < 0) { 2637 if (num_rx_msdus < 0) {
2570 resched_napi = true; 2638 resched_napi = true;
diff --git a/drivers/net/wireless/ath/ath10k/rx_desc.h b/drivers/net/wireless/ath/ath10k/rx_desc.h
index c1022a1cf855..28da14398951 100644
--- a/drivers/net/wireless/ath/ath10k/rx_desc.h
+++ b/drivers/net/wireless/ath/ath10k/rx_desc.h
@@ -239,6 +239,9 @@ enum htt_rx_mpdu_encrypt_type {
239 HTT_RX_MPDU_ENCRYPT_WAPI = 5, 239 HTT_RX_MPDU_ENCRYPT_WAPI = 5,
240 HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2 = 6, 240 HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2 = 6,
241 HTT_RX_MPDU_ENCRYPT_NONE = 7, 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#define RX_MPDU_START_INFO0_PEER_IDX_MASK 0x000007ff 247#define RX_MPDU_START_INFO0_PEER_IDX_MASK 0x000007ff
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 35bd50bcbbd5..b83f01d6e3dd 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -812,7 +812,6 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
812 if (!sta) { 812 if (!sta) {
813 wcn36xx_err("sta %pM is not found\n", 813 wcn36xx_err("sta %pM is not found\n",
814 bss_conf->bssid); 814 bss_conf->bssid);
815 rcu_read_unlock();
816 goto out; 815 goto out;
817 } 816 }
818 sta_priv = wcn36xx_sta_to_priv(sta); 817 sta_priv = wcn36xx_sta_to_priv(sta);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 33599d17522d..e6d0002a1b0b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1771,12 +1771,12 @@ static inline void tcp_highest_sack_reset(struct sock *sk)
1771 tcp_sk(sk)->highest_sack = tcp_write_queue_head(sk); 1771 tcp_sk(sk)->highest_sack = tcp_write_queue_head(sk);
1772} 1772}
1773 1773
1774/* Called when old skb is about to be deleted (to be combined with new skb) */ 1774/* Called when old skb is about to be deleted and replaced by new skb */
1775static inline void tcp_highest_sack_combine(struct sock *sk, 1775static inline void tcp_highest_sack_replace(struct sock *sk,
1776 struct sk_buff *old, 1776 struct sk_buff *old,
1777 struct sk_buff *new) 1777 struct sk_buff *new)
1778{ 1778{
1779 if (tcp_sk(sk)->sacked_out && (old == tcp_sk(sk)->highest_sack)) 1779 if (old == tcp_highest_sack(sk))
1780 tcp_sk(sk)->highest_sack = new; 1780 tcp_sk(sk)->highest_sack = new;
1781} 1781}
1782 1782
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 0d7948ce2128..7bf4c750dd3a 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -788,7 +788,6 @@ struct xdp_md {
788enum sk_action { 788enum sk_action {
789 SK_DROP = 0, 789 SK_DROP = 0,
790 SK_PASS, 790 SK_PASS,
791 SK_REDIRECT,
792}; 791};
793 792
794#define BPF_TAG_SIZE 8 793#define BPF_TAG_SIZE 8
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 66f00a2b27f4..dbd7b322a86b 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -101,13 +101,19 @@ static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb)
101 TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb); 101 TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb);
102} 102}
103 103
104enum __sk_action {
105 __SK_DROP = 0,
106 __SK_PASS,
107 __SK_REDIRECT,
108};
109
104static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb) 110static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb)
105{ 111{
106 struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict); 112 struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict);
107 int rc; 113 int rc;
108 114
109 if (unlikely(!prog)) 115 if (unlikely(!prog))
110 return SK_DROP; 116 return __SK_DROP;
111 117
112 skb_orphan(skb); 118 skb_orphan(skb);
113 /* We need to ensure that BPF metadata for maps is also cleared 119 /* We need to ensure that BPF metadata for maps is also cleared
@@ -122,8 +128,10 @@ static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb)
122 preempt_enable(); 128 preempt_enable();
123 skb->sk = NULL; 129 skb->sk = NULL;
124 130
131 /* Moving return codes from UAPI namespace into internal namespace */
125 return rc == SK_PASS ? 132 return rc == SK_PASS ?
126 (TCP_SKB_CB(skb)->bpf.map ? SK_REDIRECT : SK_PASS) : SK_DROP; 133 (TCP_SKB_CB(skb)->bpf.map ? __SK_REDIRECT : __SK_PASS) :
134 __SK_DROP;
127} 135}
128 136
129static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) 137static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
@@ -133,7 +141,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
133 141
134 rc = smap_verdict_func(psock, skb); 142 rc = smap_verdict_func(psock, skb);
135 switch (rc) { 143 switch (rc) {
136 case SK_REDIRECT: 144 case __SK_REDIRECT:
137 sk = do_sk_redirect_map(skb); 145 sk = do_sk_redirect_map(skb);
138 if (likely(sk)) { 146 if (likely(sk)) {
139 struct smap_psock *peer = smap_psock_sk(sk); 147 struct smap_psock *peer = smap_psock_sk(sk);
@@ -149,7 +157,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb)
149 } 157 }
150 } 158 }
151 /* Fall through and free skb otherwise */ 159 /* Fall through and free skb otherwise */
152 case SK_DROP: 160 case __SK_DROP:
153 default: 161 default:
154 kfree_skb(skb); 162 kfree_skb(skb);
155 } 163 }
diff --git a/net/ife/ife.c b/net/ife/ife.c
index f360341c72eb..7d1ec76e7f43 100644
--- a/net/ife/ife.c
+++ b/net/ife/ife.c
@@ -137,6 +137,6 @@ int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen, const void *dval)
137EXPORT_SYMBOL_GPL(ife_tlv_meta_encode); 137EXPORT_SYMBOL_GPL(ife_tlv_meta_encode);
138 138
139MODULE_AUTHOR("Jamal Hadi Salim <jhs@mojatatu.com>"); 139MODULE_AUTHOR("Jamal Hadi Salim <jhs@mojatatu.com>");
140MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 140MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>");
141MODULE_DESCRIPTION("Inter-FE LFB action"); 141MODULE_DESCRIPTION("Inter-FE LFB action");
142MODULE_LICENSE("GPL"); 142MODULE_LICENSE("GPL");
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ae60dd3faed0..823003eef3a2 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2062,6 +2062,7 @@ static int tcp_mtu_probe(struct sock *sk)
2062 nskb->ip_summed = skb->ip_summed; 2062 nskb->ip_summed = skb->ip_summed;
2063 2063
2064 tcp_insert_write_queue_before(nskb, skb, sk); 2064 tcp_insert_write_queue_before(nskb, skb, sk);
2065 tcp_highest_sack_replace(sk, skb, nskb);
2065 2066
2066 len = 0; 2067 len = 0;
2067 tcp_for_write_queue_from_safe(skb, next, sk) { 2068 tcp_for_write_queue_from_safe(skb, next, sk) {
@@ -2665,7 +2666,7 @@ static bool tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb)
2665 else if (!skb_shift(skb, next_skb, next_skb_size)) 2666 else if (!skb_shift(skb, next_skb, next_skb_size))
2666 return false; 2667 return false;
2667 } 2668 }
2668 tcp_highest_sack_combine(sk, next_skb, skb); 2669 tcp_highest_sack_replace(sk, next_skb, skb);
2669 2670
2670 tcp_unlink_write_queue(next_skb, sk); 2671 tcp_unlink_write_queue(next_skb, sk);
2671 2672
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4a96ebbf8eda..8a1c846d3df9 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3335,6 +3335,7 @@ static void addrconf_permanent_addr(struct net_device *dev)
3335 if ((ifp->flags & IFA_F_PERMANENT) && 3335 if ((ifp->flags & IFA_F_PERMANENT) &&
3336 fixup_permanent_addr(idev, ifp) < 0) { 3336 fixup_permanent_addr(idev, ifp) < 0) {
3337 write_unlock_bh(&idev->lock); 3337 write_unlock_bh(&idev->lock);
3338 in6_ifa_hold(ifp);
3338 ipv6_del_addr(ifp); 3339 ipv6_del_addr(ifp);
3339 write_lock_bh(&idev->lock); 3340 write_lock_bh(&idev->lock);
3340 3341
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index f50452b919d5..0c2738349442 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -584,6 +584,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
584 u32 tunnel_id, peer_tunnel_id; 584 u32 tunnel_id, peer_tunnel_id;
585 u32 session_id, peer_session_id; 585 u32 session_id, peer_session_id;
586 bool drop_refcnt = false; 586 bool drop_refcnt = false;
587 bool drop_tunnel = false;
587 int ver = 2; 588 int ver = 2;
588 int fd; 589 int fd;
589 590
@@ -652,7 +653,9 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
652 if (tunnel_id == 0) 653 if (tunnel_id == 0)
653 goto end; 654 goto end;
654 655
655 tunnel = l2tp_tunnel_find(sock_net(sk), tunnel_id); 656 tunnel = l2tp_tunnel_get(sock_net(sk), tunnel_id);
657 if (tunnel)
658 drop_tunnel = true;
656 659
657 /* Special case: create tunnel context if session_id and 660 /* Special case: create tunnel context if session_id and
658 * peer_session_id is 0. Otherwise look up tunnel using supplied 661 * peer_session_id is 0. Otherwise look up tunnel using supplied
@@ -781,6 +784,8 @@ out_no_ppp:
781end: 784end:
782 if (drop_refcnt) 785 if (drop_refcnt)
783 l2tp_session_dec_refcount(session); 786 l2tp_session_dec_refcount(session);
787 if (drop_tunnel)
788 l2tp_tunnel_dec_refcount(tunnel);
784 release_sock(sk); 789 release_sock(sk);
785 790
786 return error; 791 return error;
diff --git a/net/psample/psample.c b/net/psample/psample.c
index 3a6ad0f438dc..64f95624f219 100644
--- a/net/psample/psample.c
+++ b/net/psample/psample.c
@@ -296,6 +296,6 @@ static void __exit psample_module_exit(void)
296module_init(psample_module_init); 296module_init(psample_module_init);
297module_exit(psample_module_exit); 297module_exit(psample_module_exit);
298 298
299MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 299MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>");
300MODULE_DESCRIPTION("netlink channel for packet sampling"); 300MODULE_DESCRIPTION("netlink channel for packet sampling");
301MODULE_LICENSE("GPL v2"); 301MODULE_LICENSE("GPL v2");
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c
index a9f9a2ccc664..8b5abcd2f32f 100644
--- a/net/sched/act_sample.c
+++ b/net/sched/act_sample.c
@@ -271,6 +271,6 @@ static void __exit sample_cleanup_module(void)
271module_init(sample_init_module); 271module_init(sample_init_module);
272module_exit(sample_cleanup_module); 272module_exit(sample_cleanup_module);
273 273
274MODULE_AUTHOR("Yotam Gigi <yotamg@mellanox.com>"); 274MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>");
275MODULE_DESCRIPTION("Packet sampling action"); 275MODULE_DESCRIPTION("Packet sampling action");
276MODULE_LICENSE("GPL v2"); 276MODULE_LICENSE("GPL v2");
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 231181c602ed..b2d310745487 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -280,8 +280,8 @@ static void tcf_block_put_final(struct work_struct *work)
280 struct tcf_block *block = container_of(work, struct tcf_block, work); 280 struct tcf_block *block = container_of(work, struct tcf_block, work);
281 struct tcf_chain *chain, *tmp; 281 struct tcf_chain *chain, *tmp;
282 282
283 /* At this point, all the chains should have refcnt == 1. */
284 rtnl_lock(); 283 rtnl_lock();
284 /* Only chain 0 should be still here. */
285 list_for_each_entry_safe(chain, tmp, &block->chain_list, list) 285 list_for_each_entry_safe(chain, tmp, &block->chain_list, list)
286 tcf_chain_put(chain); 286 tcf_chain_put(chain);
287 rtnl_unlock(); 287 rtnl_unlock();
@@ -289,23 +289,17 @@ static void tcf_block_put_final(struct work_struct *work)
289} 289}
290 290
291/* XXX: Standalone actions are not allowed to jump to any chain, and bound 291/* XXX: Standalone actions are not allowed to jump to any chain, and bound
292 * actions should be all removed after flushing. However, filters are destroyed 292 * actions should be all removed after flushing. However, filters are now
293 * in RCU callbacks, we have to hold the chains first, otherwise we would 293 * destroyed in tc filter workqueue with RTNL lock, they can not race here.
294 * always race with RCU callbacks on this list without proper locking.
295 */ 294 */
296static void tcf_block_put_deferred(struct work_struct *work) 295void tcf_block_put(struct tcf_block *block)
297{ 296{
298 struct tcf_block *block = container_of(work, struct tcf_block, work); 297 struct tcf_chain *chain, *tmp;
299 struct tcf_chain *chain;
300 298
301 rtnl_lock(); 299 if (!block)
302 /* Hold a refcnt for all chains, except 0, in case they are gone. */ 300 return;
303 list_for_each_entry(chain, &block->chain_list, list)
304 if (chain->index)
305 tcf_chain_hold(chain);
306 301
307 /* No race on the list, because no chain could be destroyed. */ 302 list_for_each_entry_safe(chain, tmp, &block->chain_list, list)
308 list_for_each_entry(chain, &block->chain_list, list)
309 tcf_chain_flush(chain); 303 tcf_chain_flush(chain);
310 304
311 INIT_WORK(&block->work, tcf_block_put_final); 305 INIT_WORK(&block->work, tcf_block_put_final);
@@ -314,21 +308,6 @@ static void tcf_block_put_deferred(struct work_struct *work)
314 */ 308 */
315 rcu_barrier(); 309 rcu_barrier();
316 tcf_queue_work(&block->work); 310 tcf_queue_work(&block->work);
317 rtnl_unlock();
318}
319
320void tcf_block_put(struct tcf_block *block)
321{
322 if (!block)
323 return;
324
325 INIT_WORK(&block->work, tcf_block_put_deferred);
326 /* Wait for existing RCU callbacks to cool down, make sure their works
327 * have been queued before this. We can not flush pending works here
328 * because we are holding the RTNL lock.
329 */
330 rcu_barrier();
331 tcf_queue_work(&block->work);
332} 311}
333EXPORT_SYMBOL(tcf_block_put); 312EXPORT_SYMBOL(tcf_block_put);
334 313
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 31a2e6d34dba..73ad8c8ef344 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -105,6 +105,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
105 if (xfrm_offload(skb)) { 105 if (xfrm_offload(skb)) {
106 x->type_offload->encap(x, skb); 106 x->type_offload->encap(x, skb);
107 } else { 107 } else {
108 /* Inner headers are invalid now. */
109 skb->encapsulation = 0;
110
108 err = x->type->output(x, skb); 111 err = x->type->output(x, skb);
109 if (err == -EINPROGRESS) 112 if (err == -EINPROGRESS)
110 goto out; 113 goto out;
@@ -208,7 +211,6 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
208 int err; 211 int err;
209 212
210 secpath_reset(skb); 213 secpath_reset(skb);
211 skb->encapsulation = 0;
212 214
213 if (xfrm_dev_offload_ok(skb, x)) { 215 if (xfrm_dev_offload_ok(skb, x)) {
214 struct sec_path *sp; 216 struct sec_path *sp;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 2746b62a8944..8cafb3c0a4ac 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2076,7 +2076,6 @@ make_dummy_bundle:
2076 xdst->num_xfrms = num_xfrms; 2076 xdst->num_xfrms = num_xfrms;
2077 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); 2077 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2078 2078
2079 dst_hold(&xdst->u.dst);
2080 return xdst; 2079 return xdst;
2081 2080
2082inc_error: 2081inc_error:
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 12213477cd3a..1f5cee2269af 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2069,6 +2069,7 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen
2069 if (err >= 0) { 2069 if (err >= 0) {
2070 xfrm_sk_policy_insert(sk, err, pol); 2070 xfrm_sk_policy_insert(sk, err, pol);
2071 xfrm_pol_put(pol); 2071 xfrm_pol_put(pol);
2072 __sk_dst_reset(sk);
2072 err = 0; 2073 err = 0;
2073 } 2074 }
2074 2075
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index c174971afbe6..01cc7ba39924 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -576,7 +576,7 @@ union bpf_attr {
576 * @map: pointer to sockmap 576 * @map: pointer to sockmap
577 * @key: key to lookup sock in map 577 * @key: key to lookup sock in map
578 * @flags: reserved for future use 578 * @flags: reserved for future use
579 * Return: SK_REDIRECT 579 * Return: SK_PASS
580 * 580 *
581 * int bpf_sock_map_update(skops, map, key, flags) 581 * int bpf_sock_map_update(skops, map, key, flags)
582 * @skops: pointer to bpf_sock_ops 582 * @skops: pointer to bpf_sock_ops
@@ -789,7 +789,6 @@ struct xdp_md {
789enum sk_action { 789enum sk_action {
790 SK_DROP = 0, 790 SK_DROP = 0,
791 SK_PASS, 791 SK_PASS,
792 SK_REDIRECT,
793}; 792};
794 793
795#define BPF_TAG_SIZE 8 794#define BPF_TAG_SIZE 8
diff --git a/tools/testing/selftests/tc-testing/tdc.py b/tools/testing/selftests/tc-testing/tdc.py
index 5f11f5d7456e..a8981c5d0aaf 100755
--- a/tools/testing/selftests/tc-testing/tdc.py
+++ b/tools/testing/selftests/tc-testing/tdc.py
@@ -152,11 +152,11 @@ def ns_create():
152 exec_cmd(cmd, False) 152 exec_cmd(cmd, False)
153 cmd = 'ip link set $DEV0 up' 153 cmd = 'ip link set $DEV0 up'
154 exec_cmd(cmd, False) 154 exec_cmd(cmd, False)
155 cmd = 'ip -s $NS link set $DEV1 up' 155 cmd = 'ip -n $NS link set $DEV1 up'
156 exec_cmd(cmd, False) 156 exec_cmd(cmd, False)
157 cmd = 'ip link set $DEV2 netns $NS' 157 cmd = 'ip link set $DEV2 netns $NS'
158 exec_cmd(cmd, False) 158 exec_cmd(cmd, False)
159 cmd = 'ip -s $NS link set $DEV2 up' 159 cmd = 'ip -n $NS link set $DEV2 up'
160 exec_cmd(cmd, False) 160 exec_cmd(cmd, False)
161 161
162 162