summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-07-08 22:48:57 -0400
committerDavid S. Miller <davem@davemloft.net>2019-07-08 22:48:57 -0400
commitaf144a983402f7fd324ce556d9f9011a8b3e01fe (patch)
tree7a0250b960a36976bc683789d9fe86b9f60a97a5
parent6413139dfc641aaaa30580b59696a5f7ea274194 (diff)
parente858faf556d4e14c750ba1e8852783c6f9520a0e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Two cases of overlapping changes, nothing fancy. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/mpls-sysctl.txt2
-rw-r--r--MAINTAINERS1
-rw-r--r--arch/x86/net/bpf_jit_comp32.c284
-rw-r--r--drivers/net/bonding/bond_main.c37
-rw-r--r--drivers/net/dsa/b53/b53_common.c4
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c2
-rw-r--r--drivers/net/ethernet/allwinner/sun4i-emac.c4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c5
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c33
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h3
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c20
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c6
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c4
-rw-r--r--drivers/net/ethernet/cadence/macb.h9
-rw-r--r--drivers/net/ethernet/cadence/macb_ptp.c7
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c1
-rw-r--r--drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c10
-rw-r--r--drivers/net/ethernet/ni/nixge.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c28
-rw-r--r--drivers/net/ethernet/ti/cpsw.c3
-rw-r--r--drivers/net/ethernet/ti/cpsw_priv.h1
-rw-r--r--drivers/net/gtp.c37
-rw-r--r--drivers/net/macsec.c6
-rw-r--r--drivers/net/usb/asix_devices.c6
-rw-r--r--drivers/net/usb/r8152.c101
-rw-r--r--drivers/net/vxlan.c37
-rw-r--r--drivers/net/wireless/ath/Kconfig2
-rw-r--r--drivers/net/wireless/ath/Makefile2
-rw-r--r--drivers/net/wireless/ath/ar5523/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ar5523/Makefile2
-rw-r--r--drivers/net/wireless/ath/ath10k/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ath5k/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ath5k/Makefile2
-rw-r--r--drivers/net/wireless/ath/ath6kl/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ath6kl/trace.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ath9k/Makefile2
-rw-r--r--drivers/net/wireless/ath/wcn36xx/Kconfig2
-rw-r--r--drivers/net/wireless/ath/wcn36xx/Makefile2
-rw-r--r--drivers/net/wireless/ath/wil6210/Kconfig2
-rw-r--r--drivers/net/wireless/ath/wil6210/Makefile2
-rw-r--r--drivers/net/wireless/intel/iwlwifi/cfg/22000.c144
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-config.h14
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-csr.h1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/pcie/drv.c241
-rw-r--r--drivers/net/wireless/intel/iwlwifi/pcie/trans.c17
-rw-r--r--drivers/net/wireless/marvell/mwifiex/fw.h12
-rw-r--r--drivers/net/wireless/marvell/mwifiex/scan.c18
-rw-r--r--drivers/net/wireless/marvell/mwifiex/sta_ioctl.c4
-rw-r--r--drivers/net/wireless/marvell/mwifiex/wmm.c2
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76.h1
-rw-r--r--drivers/net/wireless/mediatek/mt76/usb.c46
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c38
-rw-r--r--include/linux/idr.h21
-rw-r--r--include/linux/phylink.h11
-rw-r--r--include/net/dst.h7
-rw-r--r--include/net/gue.h2
-rw-r--r--include/net/ip_vs.h6
-rw-r--r--include/net/tls.h1
-rw-r--r--include/net/xdp_sock.h5
-rw-r--r--include/trace/events/rxrpc.h2
-rw-r--r--include/uapi/linux/bpf.h1
-rw-r--r--include/uapi/linux/if_packet.h2
-rw-r--r--include/uapi/linux/nl80211.h2
-rw-r--r--kernel/bpf/btf.c12
-rw-r--r--kernel/bpf/core.c4
-rw-r--r--net/batman-adv/bat_iv_ogm.c4
-rw-r--r--net/batman-adv/hard-interface.c3
-rw-r--r--net/batman-adv/translation-table.c2
-rw-r--r--net/batman-adv/types.h3
-rw-r--r--net/bpfilter/main.c2
-rw-r--r--net/bridge/br_input.c8
-rw-r--r--net/bridge/br_multicast.c23
-rw-r--r--net/bridge/br_stp_bpdu.c3
-rw-r--r--net/core/filter.c2
-rw-r--r--net/hsr/hsr_device.c29
-rw-r--r--net/hsr/hsr_device.h1
-rw-r--r--net/hsr/hsr_framereg.c11
-rw-r--r--net/hsr/hsr_framereg.h3
-rw-r--r--net/hsr/hsr_netlink.c7
-rw-r--r--net/hsr/hsr_slave.c1
-rw-r--r--net/ipv4/devinet.c8
-rw-r--r--net/ipv4/igmp.c8
-rw-r--r--net/ipv4/raw_diag.c3
-rw-r--r--net/ipv4/route.c2
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/key/af_key.c8
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c21
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_sync.c134
-rw-r--r--net/netfilter/nf_conntrack_netlink.c7
-rw-r--r--net/netfilter/nf_conntrack_proto_icmp.c2
-rw-r--r--net/netfilter/nf_nat_proto.c2
-rw-r--r--net/netfilter/nf_queue.c6
-rw-r--r--net/netfilter/utils.c5
-rw-r--r--net/netrom/af_netrom.c3
-rw-r--r--net/nfc/nci/data.c2
-rw-r--r--net/openvswitch/actions.c6
-rw-r--r--net/rxrpc/af_rxrpc.c4
-rw-r--r--net/sched/act_api.c9
-rw-r--r--net/sched/cls_flower.c27
-rw-r--r--net/sctp/output.c3
-rw-r--r--net/sctp/socket.c24
-rw-r--r--net/sctp/stream.c9
-rw-r--r--net/tls/tls_device.c10
-rw-r--r--net/tls/tls_main.c4
-rw-r--r--net/tls/tls_sw.c3
-rw-r--r--net/xdp/xdp_umem.c21
-rw-r--r--net/xdp/xdp_umem.h1
-rw-r--r--net/xdp/xsk.c87
-rw-r--r--net/xdp/xsk_queue.h2
-rw-r--r--net/xfrm/Kconfig2
-rw-r--r--net/xfrm/xfrm_interface.c98
-rw-r--r--net/xfrm/xfrm_policy.c15
-rw-r--r--net/xfrm/xfrm_user.c19
-rw-r--r--samples/bpf/xdp_redirect_user.c2
-rw-r--r--tools/bpf/bpftool/cgroup.c6
-rw-r--r--tools/include/uapi/linux/bpf.h1
-rw-r--r--tools/testing/selftests/bpf/progs/test_lwt_seg6local.c12
-rw-r--r--tools/testing/selftests/bpf/verifier/basic_instr.c85
-rw-r--r--tools/testing/selftests/net/config1
-rwxr-xr-xtools/testing/selftests/net/run_afpackettests14
-rw-r--r--tools/testing/selftests/net/tls.c26
-rw-r--r--tools/testing/selftests/net/txring_overwrite.c2
-rwxr-xr-xtools/testing/selftests/net/xfrm_policy.sh27
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/filters/tests.json19
129 files changed, 1265 insertions, 899 deletions
diff --git a/Documentation/networking/mpls-sysctl.txt b/Documentation/networking/mpls-sysctl.txt
index 2f24a1912a48..025cc9b96992 100644
--- a/Documentation/networking/mpls-sysctl.txt
+++ b/Documentation/networking/mpls-sysctl.txt
@@ -30,7 +30,7 @@ ip_ttl_propagate - BOOL
30 0 - disabled / RFC 3443 [Short] Pipe Model 30 0 - disabled / RFC 3443 [Short] Pipe Model
31 1 - enabled / RFC 3443 Uniform Model (default) 31 1 - enabled / RFC 3443 Uniform Model (default)
32 32
33default_ttl - BOOL 33default_ttl - INTEGER
34 Default TTL value to use for MPLS packets where it cannot be 34 Default TTL value to use for MPLS packets where it cannot be
35 propagated from an IP header, either because one isn't present 35 propagated from an IP header, either because one isn't present
36 or ip_ttl_propagate has been disabled. 36 or ip_ttl_propagate has been disabled.
diff --git a/MAINTAINERS b/MAINTAINERS
index 22655aa84a46..cfa9ed89c031 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17312,6 +17312,7 @@ N: xdp
17312XDP SOCKETS (AF_XDP) 17312XDP SOCKETS (AF_XDP)
17313M: Björn Töpel <bjorn.topel@intel.com> 17313M: Björn Töpel <bjorn.topel@intel.com>
17314M: Magnus Karlsson <magnus.karlsson@intel.com> 17314M: Magnus Karlsson <magnus.karlsson@intel.com>
17315R: Jonathan Lemon <jonathan.lemon@gmail.com>
17315L: netdev@vger.kernel.org 17316L: netdev@vger.kernel.org
17316L: bpf@vger.kernel.org 17317L: bpf@vger.kernel.org
17317S: Maintained 17318S: Maintained
diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c
index 133433d181ba..393d251798c0 100644
--- a/arch/x86/net/bpf_jit_comp32.c
+++ b/arch/x86/net/bpf_jit_comp32.c
@@ -732,9 +732,6 @@ static inline void emit_ia32_lsh_r64(const u8 dst[], const u8 src[],
732{ 732{
733 u8 *prog = *pprog; 733 u8 *prog = *pprog;
734 int cnt = 0; 734 int cnt = 0;
735 static int jmp_label1 = -1;
736 static int jmp_label2 = -1;
737 static int jmp_label3 = -1;
738 u8 dreg_lo = dstk ? IA32_EAX : dst_lo; 735 u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
739 u8 dreg_hi = dstk ? IA32_EDX : dst_hi; 736 u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
740 737
@@ -753,79 +750,23 @@ static inline void emit_ia32_lsh_r64(const u8 dst[], const u8 src[],
753 /* mov ecx,src_lo */ 750 /* mov ecx,src_lo */
754 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX)); 751 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX));
755 752
756 /* cmp ecx,32 */ 753 /* shld dreg_hi,dreg_lo,cl */
757 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32); 754 EMIT3(0x0F, 0xA5, add_2reg(0xC0, dreg_hi, dreg_lo));
758 /* Jumps when >= 32 */
759 if (is_imm8(jmp_label(jmp_label1, 2)))
760 EMIT2(IA32_JAE, jmp_label(jmp_label1, 2));
761 else
762 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label1, 6));
763
764 /* < 32 */
765 /* shl dreg_hi,cl */
766 EMIT2(0xD3, add_1reg(0xE0, dreg_hi));
767 /* mov ebx,dreg_lo */
768 EMIT2(0x8B, add_2reg(0xC0, dreg_lo, IA32_EBX));
769 /* shl dreg_lo,cl */ 755 /* shl dreg_lo,cl */
770 EMIT2(0xD3, add_1reg(0xE0, dreg_lo)); 756 EMIT2(0xD3, add_1reg(0xE0, dreg_lo));
771 757
772 /* IA32_ECX = -IA32_ECX + 32 */ 758 /* if ecx >= 32, mov dreg_lo into dreg_hi and clear dreg_lo */
773 /* neg ecx */
774 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
775 /* add ecx,32 */
776 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
777 759
778 /* shr ebx,cl */ 760 /* cmp ecx,32 */
779 EMIT2(0xD3, add_1reg(0xE8, IA32_EBX)); 761 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32);
780 /* or dreg_hi,ebx */ 762 /* skip the next two instructions (4 bytes) when < 32 */
781 EMIT2(0x09, add_2reg(0xC0, dreg_hi, IA32_EBX)); 763 EMIT2(IA32_JB, 4);
782
783 /* goto out; */
784 if (is_imm8(jmp_label(jmp_label3, 2)))
785 EMIT2(0xEB, jmp_label(jmp_label3, 2));
786 else
787 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
788
789 /* >= 32 */
790 if (jmp_label1 == -1)
791 jmp_label1 = cnt;
792
793 /* cmp ecx,64 */
794 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 64);
795 /* Jumps when >= 64 */
796 if (is_imm8(jmp_label(jmp_label2, 2)))
797 EMIT2(IA32_JAE, jmp_label(jmp_label2, 2));
798 else
799 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label2, 6));
800 764
801 /* >= 32 && < 64 */
802 /* sub ecx,32 */
803 EMIT3(0x83, add_1reg(0xE8, IA32_ECX), 32);
804 /* shl dreg_lo,cl */
805 EMIT2(0xD3, add_1reg(0xE0, dreg_lo));
806 /* mov dreg_hi,dreg_lo */ 765 /* mov dreg_hi,dreg_lo */
807 EMIT2(0x89, add_2reg(0xC0, dreg_hi, dreg_lo)); 766 EMIT2(0x89, add_2reg(0xC0, dreg_hi, dreg_lo));
808
809 /* xor dreg_lo,dreg_lo */ 767 /* xor dreg_lo,dreg_lo */
810 EMIT2(0x33, add_2reg(0xC0, dreg_lo, dreg_lo)); 768 EMIT2(0x33, add_2reg(0xC0, dreg_lo, dreg_lo));
811 769
812 /* goto out; */
813 if (is_imm8(jmp_label(jmp_label3, 2)))
814 EMIT2(0xEB, jmp_label(jmp_label3, 2));
815 else
816 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
817
818 /* >= 64 */
819 if (jmp_label2 == -1)
820 jmp_label2 = cnt;
821 /* xor dreg_lo,dreg_lo */
822 EMIT2(0x33, add_2reg(0xC0, dreg_lo, dreg_lo));
823 /* xor dreg_hi,dreg_hi */
824 EMIT2(0x33, add_2reg(0xC0, dreg_hi, dreg_hi));
825
826 if (jmp_label3 == -1)
827 jmp_label3 = cnt;
828
829 if (dstk) { 770 if (dstk) {
830 /* mov dword ptr [ebp+off],dreg_lo */ 771 /* mov dword ptr [ebp+off],dreg_lo */
831 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo), 772 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo),
@@ -844,9 +785,6 @@ static inline void emit_ia32_arsh_r64(const u8 dst[], const u8 src[],
844{ 785{
845 u8 *prog = *pprog; 786 u8 *prog = *pprog;
846 int cnt = 0; 787 int cnt = 0;
847 static int jmp_label1 = -1;
848 static int jmp_label2 = -1;
849 static int jmp_label3 = -1;
850 u8 dreg_lo = dstk ? IA32_EAX : dst_lo; 788 u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
851 u8 dreg_hi = dstk ? IA32_EDX : dst_hi; 789 u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
852 790
@@ -865,79 +803,23 @@ static inline void emit_ia32_arsh_r64(const u8 dst[], const u8 src[],
865 /* mov ecx,src_lo */ 803 /* mov ecx,src_lo */
866 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX)); 804 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX));
867 805
868 /* cmp ecx,32 */ 806 /* shrd dreg_lo,dreg_hi,cl */
869 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32); 807 EMIT3(0x0F, 0xAD, add_2reg(0xC0, dreg_lo, dreg_hi));
870 /* Jumps when >= 32 */ 808 /* sar dreg_hi,cl */
871 if (is_imm8(jmp_label(jmp_label1, 2)))
872 EMIT2(IA32_JAE, jmp_label(jmp_label1, 2));
873 else
874 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label1, 6));
875
876 /* < 32 */
877 /* lshr dreg_lo,cl */
878 EMIT2(0xD3, add_1reg(0xE8, dreg_lo));
879 /* mov ebx,dreg_hi */
880 EMIT2(0x8B, add_2reg(0xC0, dreg_hi, IA32_EBX));
881 /* ashr dreg_hi,cl */
882 EMIT2(0xD3, add_1reg(0xF8, dreg_hi)); 809 EMIT2(0xD3, add_1reg(0xF8, dreg_hi));
883 810
884 /* IA32_ECX = -IA32_ECX + 32 */ 811 /* if ecx >= 32, mov dreg_hi to dreg_lo and set/clear dreg_hi depending on sign */
885 /* neg ecx */
886 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
887 /* add ecx,32 */
888 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
889
890 /* shl ebx,cl */
891 EMIT2(0xD3, add_1reg(0xE0, IA32_EBX));
892 /* or dreg_lo,ebx */
893 EMIT2(0x09, add_2reg(0xC0, dreg_lo, IA32_EBX));
894 812
895 /* goto out; */ 813 /* cmp ecx,32 */
896 if (is_imm8(jmp_label(jmp_label3, 2))) 814 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32);
897 EMIT2(0xEB, jmp_label(jmp_label3, 2)); 815 /* skip the next two instructions (5 bytes) when < 32 */
898 else 816 EMIT2(IA32_JB, 5);
899 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
900
901 /* >= 32 */
902 if (jmp_label1 == -1)
903 jmp_label1 = cnt;
904
905 /* cmp ecx,64 */
906 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 64);
907 /* Jumps when >= 64 */
908 if (is_imm8(jmp_label(jmp_label2, 2)))
909 EMIT2(IA32_JAE, jmp_label(jmp_label2, 2));
910 else
911 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label2, 6));
912 817
913 /* >= 32 && < 64 */
914 /* sub ecx,32 */
915 EMIT3(0x83, add_1reg(0xE8, IA32_ECX), 32);
916 /* ashr dreg_hi,cl */
917 EMIT2(0xD3, add_1reg(0xF8, dreg_hi));
918 /* mov dreg_lo,dreg_hi */ 818 /* mov dreg_lo,dreg_hi */
919 EMIT2(0x89, add_2reg(0xC0, dreg_lo, dreg_hi)); 819 EMIT2(0x89, add_2reg(0xC0, dreg_lo, dreg_hi));
920 820 /* sar dreg_hi,31 */
921 /* ashr dreg_hi,imm8 */
922 EMIT3(0xC1, add_1reg(0xF8, dreg_hi), 31); 821 EMIT3(0xC1, add_1reg(0xF8, dreg_hi), 31);
923 822
924 /* goto out; */
925 if (is_imm8(jmp_label(jmp_label3, 2)))
926 EMIT2(0xEB, jmp_label(jmp_label3, 2));
927 else
928 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
929
930 /* >= 64 */
931 if (jmp_label2 == -1)
932 jmp_label2 = cnt;
933 /* ashr dreg_hi,imm8 */
934 EMIT3(0xC1, add_1reg(0xF8, dreg_hi), 31);
935 /* mov dreg_lo,dreg_hi */
936 EMIT2(0x89, add_2reg(0xC0, dreg_lo, dreg_hi));
937
938 if (jmp_label3 == -1)
939 jmp_label3 = cnt;
940
941 if (dstk) { 823 if (dstk) {
942 /* mov dword ptr [ebp+off],dreg_lo */ 824 /* mov dword ptr [ebp+off],dreg_lo */
943 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo), 825 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo),
@@ -956,9 +838,6 @@ static inline void emit_ia32_rsh_r64(const u8 dst[], const u8 src[], bool dstk,
956{ 838{
957 u8 *prog = *pprog; 839 u8 *prog = *pprog;
958 int cnt = 0; 840 int cnt = 0;
959 static int jmp_label1 = -1;
960 static int jmp_label2 = -1;
961 static int jmp_label3 = -1;
962 u8 dreg_lo = dstk ? IA32_EAX : dst_lo; 841 u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
963 u8 dreg_hi = dstk ? IA32_EDX : dst_hi; 842 u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
964 843
@@ -977,77 +856,23 @@ static inline void emit_ia32_rsh_r64(const u8 dst[], const u8 src[], bool dstk,
977 /* mov ecx,src_lo */ 856 /* mov ecx,src_lo */
978 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX)); 857 EMIT2(0x8B, add_2reg(0xC0, src_lo, IA32_ECX));
979 858
980 /* cmp ecx,32 */ 859 /* shrd dreg_lo,dreg_hi,cl */
981 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32); 860 EMIT3(0x0F, 0xAD, add_2reg(0xC0, dreg_lo, dreg_hi));
982 /* Jumps when >= 32 */
983 if (is_imm8(jmp_label(jmp_label1, 2)))
984 EMIT2(IA32_JAE, jmp_label(jmp_label1, 2));
985 else
986 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label1, 6));
987
988 /* < 32 */
989 /* lshr dreg_lo,cl */
990 EMIT2(0xD3, add_1reg(0xE8, dreg_lo));
991 /* mov ebx,dreg_hi */
992 EMIT2(0x8B, add_2reg(0xC0, dreg_hi, IA32_EBX));
993 /* shr dreg_hi,cl */ 861 /* shr dreg_hi,cl */
994 EMIT2(0xD3, add_1reg(0xE8, dreg_hi)); 862 EMIT2(0xD3, add_1reg(0xE8, dreg_hi));
995 863
996 /* IA32_ECX = -IA32_ECX + 32 */ 864 /* if ecx >= 32, mov dreg_hi to dreg_lo and clear dreg_hi */
997 /* neg ecx */
998 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
999 /* add ecx,32 */
1000 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
1001
1002 /* shl ebx,cl */
1003 EMIT2(0xD3, add_1reg(0xE0, IA32_EBX));
1004 /* or dreg_lo,ebx */
1005 EMIT2(0x09, add_2reg(0xC0, dreg_lo, IA32_EBX));
1006
1007 /* goto out; */
1008 if (is_imm8(jmp_label(jmp_label3, 2)))
1009 EMIT2(0xEB, jmp_label(jmp_label3, 2));
1010 else
1011 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
1012 865
1013 /* >= 32 */ 866 /* cmp ecx,32 */
1014 if (jmp_label1 == -1) 867 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 32);
1015 jmp_label1 = cnt; 868 /* skip the next two instructions (4 bytes) when < 32 */
1016 /* cmp ecx,64 */ 869 EMIT2(IA32_JB, 4);
1017 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), 64);
1018 /* Jumps when >= 64 */
1019 if (is_imm8(jmp_label(jmp_label2, 2)))
1020 EMIT2(IA32_JAE, jmp_label(jmp_label2, 2));
1021 else
1022 EMIT2_off32(0x0F, IA32_JAE + 0x10, jmp_label(jmp_label2, 6));
1023 870
1024 /* >= 32 && < 64 */
1025 /* sub ecx,32 */
1026 EMIT3(0x83, add_1reg(0xE8, IA32_ECX), 32);
1027 /* shr dreg_hi,cl */
1028 EMIT2(0xD3, add_1reg(0xE8, dreg_hi));
1029 /* mov dreg_lo,dreg_hi */ 871 /* mov dreg_lo,dreg_hi */
1030 EMIT2(0x89, add_2reg(0xC0, dreg_lo, dreg_hi)); 872 EMIT2(0x89, add_2reg(0xC0, dreg_lo, dreg_hi));
1031 /* xor dreg_hi,dreg_hi */ 873 /* xor dreg_hi,dreg_hi */
1032 EMIT2(0x33, add_2reg(0xC0, dreg_hi, dreg_hi)); 874 EMIT2(0x33, add_2reg(0xC0, dreg_hi, dreg_hi));
1033 875
1034 /* goto out; */
1035 if (is_imm8(jmp_label(jmp_label3, 2)))
1036 EMIT2(0xEB, jmp_label(jmp_label3, 2));
1037 else
1038 EMIT1_off32(0xE9, jmp_label(jmp_label3, 5));
1039
1040 /* >= 64 */
1041 if (jmp_label2 == -1)
1042 jmp_label2 = cnt;
1043 /* xor dreg_lo,dreg_lo */
1044 EMIT2(0x33, add_2reg(0xC0, dreg_lo, dreg_lo));
1045 /* xor dreg_hi,dreg_hi */
1046 EMIT2(0x33, add_2reg(0xC0, dreg_hi, dreg_hi));
1047
1048 if (jmp_label3 == -1)
1049 jmp_label3 = cnt;
1050
1051 if (dstk) { 876 if (dstk) {
1052 /* mov dword ptr [ebp+off],dreg_lo */ 877 /* mov dword ptr [ebp+off],dreg_lo */
1053 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo), 878 EMIT3(0x89, add_2reg(0x40, IA32_EBP, dreg_lo),
@@ -1077,27 +902,10 @@ static inline void emit_ia32_lsh_i64(const u8 dst[], const u32 val,
1077 } 902 }
1078 /* Do LSH operation */ 903 /* Do LSH operation */
1079 if (val < 32) { 904 if (val < 32) {
1080 /* shl dreg_hi,imm8 */ 905 /* shld dreg_hi,dreg_lo,imm8 */
1081 EMIT3(0xC1, add_1reg(0xE0, dreg_hi), val); 906 EMIT4(0x0F, 0xA4, add_2reg(0xC0, dreg_hi, dreg_lo), val);
1082 /* mov ebx,dreg_lo */
1083 EMIT2(0x8B, add_2reg(0xC0, dreg_lo, IA32_EBX));
1084 /* shl dreg_lo,imm8 */ 907 /* shl dreg_lo,imm8 */
1085 EMIT3(0xC1, add_1reg(0xE0, dreg_lo), val); 908 EMIT3(0xC1, add_1reg(0xE0, dreg_lo), val);
1086
1087 /* IA32_ECX = 32 - val */
1088 /* mov ecx,val */
1089 EMIT2(0xB1, val);
1090 /* movzx ecx,ecx */
1091 EMIT3(0x0F, 0xB6, add_2reg(0xC0, IA32_ECX, IA32_ECX));
1092 /* neg ecx */
1093 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
1094 /* add ecx,32 */
1095 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
1096
1097 /* shr ebx,cl */
1098 EMIT2(0xD3, add_1reg(0xE8, IA32_EBX));
1099 /* or dreg_hi,ebx */
1100 EMIT2(0x09, add_2reg(0xC0, dreg_hi, IA32_EBX));
1101 } else if (val >= 32 && val < 64) { 909 } else if (val >= 32 && val < 64) {
1102 u32 value = val - 32; 910 u32 value = val - 32;
1103 911
@@ -1143,27 +951,10 @@ static inline void emit_ia32_rsh_i64(const u8 dst[], const u32 val,
1143 951
1144 /* Do RSH operation */ 952 /* Do RSH operation */
1145 if (val < 32) { 953 if (val < 32) {
1146 /* shr dreg_lo,imm8 */ 954 /* shrd dreg_lo,dreg_hi,imm8 */
1147 EMIT3(0xC1, add_1reg(0xE8, dreg_lo), val); 955 EMIT4(0x0F, 0xAC, add_2reg(0xC0, dreg_lo, dreg_hi), val);
1148 /* mov ebx,dreg_hi */
1149 EMIT2(0x8B, add_2reg(0xC0, dreg_hi, IA32_EBX));
1150 /* shr dreg_hi,imm8 */ 956 /* shr dreg_hi,imm8 */
1151 EMIT3(0xC1, add_1reg(0xE8, dreg_hi), val); 957 EMIT3(0xC1, add_1reg(0xE8, dreg_hi), val);
1152
1153 /* IA32_ECX = 32 - val */
1154 /* mov ecx,val */
1155 EMIT2(0xB1, val);
1156 /* movzx ecx,ecx */
1157 EMIT3(0x0F, 0xB6, add_2reg(0xC0, IA32_ECX, IA32_ECX));
1158 /* neg ecx */
1159 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
1160 /* add ecx,32 */
1161 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
1162
1163 /* shl ebx,cl */
1164 EMIT2(0xD3, add_1reg(0xE0, IA32_EBX));
1165 /* or dreg_lo,ebx */
1166 EMIT2(0x09, add_2reg(0xC0, dreg_lo, IA32_EBX));
1167 } else if (val >= 32 && val < 64) { 958 } else if (val >= 32 && val < 64) {
1168 u32 value = val - 32; 959 u32 value = val - 32;
1169 960
@@ -1208,27 +999,10 @@ static inline void emit_ia32_arsh_i64(const u8 dst[], const u32 val,
1208 } 999 }
1209 /* Do RSH operation */ 1000 /* Do RSH operation */
1210 if (val < 32) { 1001 if (val < 32) {
1211 /* shr dreg_lo,imm8 */ 1002 /* shrd dreg_lo,dreg_hi,imm8 */
1212 EMIT3(0xC1, add_1reg(0xE8, dreg_lo), val); 1003 EMIT4(0x0F, 0xAC, add_2reg(0xC0, dreg_lo, dreg_hi), val);
1213 /* mov ebx,dreg_hi */
1214 EMIT2(0x8B, add_2reg(0xC0, dreg_hi, IA32_EBX));
1215 /* ashr dreg_hi,imm8 */ 1004 /* ashr dreg_hi,imm8 */
1216 EMIT3(0xC1, add_1reg(0xF8, dreg_hi), val); 1005 EMIT3(0xC1, add_1reg(0xF8, dreg_hi), val);
1217
1218 /* IA32_ECX = 32 - val */
1219 /* mov ecx,val */
1220 EMIT2(0xB1, val);
1221 /* movzx ecx,ecx */
1222 EMIT3(0x0F, 0xB6, add_2reg(0xC0, IA32_ECX, IA32_ECX));
1223 /* neg ecx */
1224 EMIT2(0xF7, add_1reg(0xD8, IA32_ECX));
1225 /* add ecx,32 */
1226 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 32);
1227
1228 /* shl ebx,cl */
1229 EMIT2(0xD3, add_1reg(0xE0, IA32_EBX));
1230 /* or dreg_lo,ebx */
1231 EMIT2(0x09, add_2reg(0xC0, dreg_lo, IA32_EBX));
1232 } else if (val >= 32 && val < 64) { 1006 } else if (val >= 32 && val < 64) {
1233 u32 value = val - 32; 1007 u32 value = val - 32;
1234 1008
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 302499ae05e6..9b7016abca2f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3859,8 +3859,8 @@ static netdev_tx_t bond_xmit_roundrobin(struct sk_buff *skb,
3859 struct net_device *bond_dev) 3859 struct net_device *bond_dev)
3860{ 3860{
3861 struct bonding *bond = netdev_priv(bond_dev); 3861 struct bonding *bond = netdev_priv(bond_dev);
3862 struct iphdr *iph = ip_hdr(skb);
3863 struct slave *slave; 3862 struct slave *slave;
3863 int slave_cnt;
3864 u32 slave_id; 3864 u32 slave_id;
3865 3865
3866 /* Start with the curr_active_slave that joined the bond as the 3866 /* Start with the curr_active_slave that joined the bond as the
@@ -3869,23 +3869,32 @@ static netdev_tx_t bond_xmit_roundrobin(struct sk_buff *skb,
3869 * send the join/membership reports. The curr_active_slave found 3869 * send the join/membership reports. The curr_active_slave found
3870 * will send all of this type of traffic. 3870 * will send all of this type of traffic.
3871 */ 3871 */
3872 if (iph->protocol == IPPROTO_IGMP && skb->protocol == htons(ETH_P_IP)) { 3872 if (skb->protocol == htons(ETH_P_IP)) {
3873 slave = rcu_dereference(bond->curr_active_slave); 3873 int noff = skb_network_offset(skb);
3874 if (slave) 3874 struct iphdr *iph;
3875 bond_dev_queue_xmit(bond, skb, slave->dev);
3876 else
3877 bond_xmit_slave_id(bond, skb, 0);
3878 } else {
3879 int slave_cnt = READ_ONCE(bond->slave_cnt);
3880 3875
3881 if (likely(slave_cnt)) { 3876 if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph))))
3882 slave_id = bond_rr_gen_slave_id(bond); 3877 goto non_igmp;
3883 bond_xmit_slave_id(bond, skb, slave_id % slave_cnt); 3878
3884 } else { 3879 iph = ip_hdr(skb);
3885 bond_tx_drop(bond_dev, skb); 3880 if (iph->protocol == IPPROTO_IGMP) {
3881 slave = rcu_dereference(bond->curr_active_slave);
3882 if (slave)
3883 bond_dev_queue_xmit(bond, skb, slave->dev);
3884 else
3885 bond_xmit_slave_id(bond, skb, 0);
3886 return NETDEV_TX_OK;
3886 } 3887 }
3887 } 3888 }
3888 3889
3890non_igmp:
3891 slave_cnt = READ_ONCE(bond->slave_cnt);
3892 if (likely(slave_cnt)) {
3893 slave_id = bond_rr_gen_slave_id(bond);
3894 bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
3895 } else {
3896 bond_tx_drop(bond_dev, skb);
3897 }
3889 return NETDEV_TX_OK; 3898 return NETDEV_TX_OK;
3890} 3899}
3891 3900
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index c8040ecf4425..907af62846ba 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -955,13 +955,13 @@ static int b53_setup(struct dsa_switch *ds)
955 if (ret) 955 if (ret)
956 dev_err(ds->dev, "failed to apply configuration\n"); 956 dev_err(ds->dev, "failed to apply configuration\n");
957 957
958 /* Configure IMP/CPU port, disable unused ports. Enabled 958 /* Configure IMP/CPU port, disable all other ports. Enabled
959 * ports will be configured with .port_enable 959 * ports will be configured with .port_enable
960 */ 960 */
961 for (port = 0; port < dev->num_ports; port++) { 961 for (port = 0; port < dev->num_ports; port++) {
962 if (dsa_is_cpu_port(ds, port)) 962 if (dsa_is_cpu_port(ds, port))
963 b53_enable_cpu_port(dev, port); 963 b53_enable_cpu_port(dev, port);
964 else if (dsa_is_unused_port(ds, port)) 964 else
965 b53_disable_port(ds, port); 965 b53_disable_port(ds, port);
966 } 966 }
967 967
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 40b1fb22d8df..6b17cd961d06 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4786,6 +4786,8 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
4786 err = PTR_ERR(chip->reset); 4786 err = PTR_ERR(chip->reset);
4787 goto out; 4787 goto out;
4788 } 4788 }
4789 if (chip->reset)
4790 usleep_range(1000, 2000);
4789 4791
4790 err = mv88e6xxx_detect(chip); 4792 err = mv88e6xxx_detect(chip);
4791 if (err) 4793 if (err)
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 6253e5ed6e16..3434730a7699 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -224,8 +224,8 @@ static int emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
224static void emac_get_drvinfo(struct net_device *dev, 224static void emac_get_drvinfo(struct net_device *dev,
225 struct ethtool_drvinfo *info) 225 struct ethtool_drvinfo *info)
226{ 226{
227 strlcpy(info->driver, DRV_NAME, sizeof(DRV_NAME)); 227 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
228 strlcpy(info->version, DRV_VERSION, sizeof(DRV_VERSION)); 228 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
229 strlcpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info)); 229 strlcpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
230} 230}
231 231
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index c4986b519191..656ed80647f0 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3857,9 +3857,12 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3857 3857
3858 if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { 3858 if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
3859 if (!(bp->flags & TX_TIMESTAMPING_EN)) { 3859 if (!(bp->flags & TX_TIMESTAMPING_EN)) {
3860 bp->eth_stats.ptp_skip_tx_ts++;
3860 BNX2X_ERR("Tx timestamping was not enabled, this packet will not be timestamped\n"); 3861 BNX2X_ERR("Tx timestamping was not enabled, this packet will not be timestamped\n");
3861 } else if (bp->ptp_tx_skb) { 3862 } else if (bp->ptp_tx_skb) {
3862 BNX2X_ERR("The device supports only a single outstanding packet to timestamp, this packet will not be timestamped\n"); 3863 bp->eth_stats.ptp_skip_tx_ts++;
3864 netdev_err_once(bp->dev,
3865 "Device supports only a single outstanding packet to timestamp, this packet won't be timestamped\n");
3863 } else { 3866 } else {
3864 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; 3867 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
3865 /* schedule check for Tx timestamp */ 3868 /* schedule check for Tx timestamp */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 51fc845de31a..4a0ba6801c9e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -182,7 +182,9 @@ static const struct {
182 { STATS_OFFSET32(driver_filtered_tx_pkt), 182 { STATS_OFFSET32(driver_filtered_tx_pkt),
183 4, false, "driver_filtered_tx_pkt" }, 183 4, false, "driver_filtered_tx_pkt" },
184 { STATS_OFFSET32(eee_tx_lpi), 184 { STATS_OFFSET32(eee_tx_lpi),
185 4, true, "Tx LPI entry count"} 185 4, true, "Tx LPI entry count"},
186 { STATS_OFFSET32(ptp_skip_tx_ts),
187 4, false, "ptp_skipped_tx_tstamp" },
186}; 188};
187 189
188#define BNX2X_NUM_STATS ARRAY_SIZE(bnx2x_stats_arr) 190#define BNX2X_NUM_STATS ARRAY_SIZE(bnx2x_stats_arr)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 03ac10b1cd1e..2cc14db8f0ec 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -15214,11 +15214,24 @@ static void bnx2x_ptp_task(struct work_struct *work)
15214 u32 val_seq; 15214 u32 val_seq;
15215 u64 timestamp, ns; 15215 u64 timestamp, ns;
15216 struct skb_shared_hwtstamps shhwtstamps; 15216 struct skb_shared_hwtstamps shhwtstamps;
15217 bool bail = true;
15218 int i;
15219
15220 /* FW may take a while to complete timestamping; try a bit and if it's
15221 * still not complete, may indicate an error state - bail out then.
15222 */
15223 for (i = 0; i < 10; i++) {
15224 /* Read Tx timestamp registers */
15225 val_seq = REG_RD(bp, port ? NIG_REG_P1_TLLH_PTP_BUF_SEQID :
15226 NIG_REG_P0_TLLH_PTP_BUF_SEQID);
15227 if (val_seq & 0x10000) {
15228 bail = false;
15229 break;
15230 }
15231 msleep(1 << i);
15232 }
15217 15233
15218 /* Read Tx timestamp registers */ 15234 if (!bail) {
15219 val_seq = REG_RD(bp, port ? NIG_REG_P1_TLLH_PTP_BUF_SEQID :
15220 NIG_REG_P0_TLLH_PTP_BUF_SEQID);
15221 if (val_seq & 0x10000) {
15222 /* There is a valid timestamp value */ 15235 /* There is a valid timestamp value */
15223 timestamp = REG_RD(bp, port ? NIG_REG_P1_TLLH_PTP_BUF_TS_MSB : 15236 timestamp = REG_RD(bp, port ? NIG_REG_P1_TLLH_PTP_BUF_TS_MSB :
15224 NIG_REG_P0_TLLH_PTP_BUF_TS_MSB); 15237 NIG_REG_P0_TLLH_PTP_BUF_TS_MSB);
@@ -15233,16 +15246,18 @@ static void bnx2x_ptp_task(struct work_struct *work)
15233 memset(&shhwtstamps, 0, sizeof(shhwtstamps)); 15246 memset(&shhwtstamps, 0, sizeof(shhwtstamps));
15234 shhwtstamps.hwtstamp = ns_to_ktime(ns); 15247 shhwtstamps.hwtstamp = ns_to_ktime(ns);
15235 skb_tstamp_tx(bp->ptp_tx_skb, &shhwtstamps); 15248 skb_tstamp_tx(bp->ptp_tx_skb, &shhwtstamps);
15236 dev_kfree_skb_any(bp->ptp_tx_skb);
15237 bp->ptp_tx_skb = NULL;
15238 15249
15239 DP(BNX2X_MSG_PTP, "Tx timestamp, timestamp cycles = %llu, ns = %llu\n", 15250 DP(BNX2X_MSG_PTP, "Tx timestamp, timestamp cycles = %llu, ns = %llu\n",
15240 timestamp, ns); 15251 timestamp, ns);
15241 } else { 15252 } else {
15242 DP(BNX2X_MSG_PTP, "There is no valid Tx timestamp yet\n"); 15253 DP(BNX2X_MSG_PTP,
15243 /* Reschedule to keep checking for a valid timestamp value */ 15254 "Tx timestamp is not recorded (register read=%u)\n",
15244 schedule_work(&bp->ptp_task); 15255 val_seq);
15256 bp->eth_stats.ptp_skip_tx_ts++;
15245 } 15257 }
15258
15259 dev_kfree_skb_any(bp->ptp_tx_skb);
15260 bp->ptp_tx_skb = NULL;
15246} 15261}
15247 15262
15248void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb) 15263void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
index b2644ed13d06..d55e63692cf3 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
@@ -207,6 +207,9 @@ struct bnx2x_eth_stats {
207 u32 driver_filtered_tx_pkt; 207 u32 driver_filtered_tx_pkt;
208 /* src: Clear-on-Read register; Will not survive PMF Migration */ 208 /* src: Clear-on-Read register; Will not survive PMF Migration */
209 u32 eee_tx_lpi; 209 u32 eee_tx_lpi;
210
211 /* PTP */
212 u32 ptp_skip_tx_ts;
210}; 213};
211 214
212struct bnx2x_eth_q_stats { 215struct bnx2x_eth_q_stats {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d25bb385b3b9..e9d3bd80f2dd 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5567,7 +5567,16 @@ static int bnxt_cp_rings_in_use(struct bnxt *bp)
5567 5567
5568static int bnxt_get_func_stat_ctxs(struct bnxt *bp) 5568static int bnxt_get_func_stat_ctxs(struct bnxt *bp)
5569{ 5569{
5570 return bp->cp_nr_rings + bnxt_get_ulp_stat_ctxs(bp); 5570 int ulp_stat = bnxt_get_ulp_stat_ctxs(bp);
5571 int cp = bp->cp_nr_rings;
5572
5573 if (!ulp_stat)
5574 return cp;
5575
5576 if (bnxt_nq_rings_in_use(bp) > cp + bnxt_get_ulp_msix_num(bp))
5577 return bnxt_get_ulp_msix_base(bp) + ulp_stat;
5578
5579 return cp + ulp_stat;
5571} 5580}
5572 5581
5573static bool bnxt_need_reserve_rings(struct bnxt *bp) 5582static bool bnxt_need_reserve_rings(struct bnxt *bp)
@@ -7536,11 +7545,7 @@ unsigned int bnxt_get_avail_cp_rings_for_en(struct bnxt *bp)
7536 7545
7537unsigned int bnxt_get_avail_stat_ctxs_for_en(struct bnxt *bp) 7546unsigned int bnxt_get_avail_stat_ctxs_for_en(struct bnxt *bp)
7538{ 7547{
7539 unsigned int stat; 7548 return bnxt_get_max_func_stat_ctxs(bp) - bnxt_get_func_stat_ctxs(bp);
7540
7541 stat = bnxt_get_max_func_stat_ctxs(bp) - bnxt_get_ulp_stat_ctxs(bp);
7542 stat -= bp->cp_nr_rings;
7543 return stat;
7544} 7549}
7545 7550
7546int bnxt_get_avail_msix(struct bnxt *bp, int num) 7551int bnxt_get_avail_msix(struct bnxt *bp, int num)
@@ -10322,10 +10327,10 @@ static void bnxt_remove_one(struct pci_dev *pdev)
10322 bnxt_dcb_free(bp); 10327 bnxt_dcb_free(bp);
10323 kfree(bp->edev); 10328 kfree(bp->edev);
10324 bp->edev = NULL; 10329 bp->edev = NULL;
10330 bnxt_cleanup_pci(bp);
10325 bnxt_free_ctx_mem(bp); 10331 bnxt_free_ctx_mem(bp);
10326 kfree(bp->ctx); 10332 kfree(bp->ctx);
10327 bp->ctx = NULL; 10333 bp->ctx = NULL;
10328 bnxt_cleanup_pci(bp);
10329 bnxt_free_port_stats(bp); 10334 bnxt_free_port_stats(bp);
10330 free_netdev(dev); 10335 free_netdev(dev);
10331} 10336}
@@ -10919,6 +10924,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
10919 10924
10920 if (system_state == SYSTEM_POWER_OFF) { 10925 if (system_state == SYSTEM_POWER_OFF) {
10921 bnxt_clear_int_mode(bp); 10926 bnxt_clear_int_mode(bp);
10927 pci_disable_device(pdev);
10922 pci_wake_from_d3(pdev, bp->wol); 10928 pci_wake_from_d3(pdev, bp->wol);
10923 pci_set_power_state(pdev, PCI_D3hot); 10929 pci_set_power_state(pdev, PCI_D3hot);
10924 } 10930 }
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
index 70775158c8c4..07301cb87c03 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
@@ -396,7 +396,7 @@ static int bnxt_hwrm_queue_dscp_qcaps(struct bnxt *bp)
396 396
397 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_DSCP_QCAPS, -1, -1); 397 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_DSCP_QCAPS, -1, -1);
398 mutex_lock(&bp->hwrm_cmd_lock); 398 mutex_lock(&bp->hwrm_cmd_lock);
399 rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); 399 rc = _hwrm_send_message_silent(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
400 if (!rc) { 400 if (!rc) {
401 bp->max_dscp_value = (1 << resp->num_dscp_bits) - 1; 401 bp->max_dscp_value = (1 << resp->num_dscp_bits) - 1;
402 if (bp->max_dscp_value < 0x3f) 402 if (bp->max_dscp_value < 0x3f)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index a0f3277447f5..c7ee63d69679 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2842,7 +2842,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
2842 bool offline = false; 2842 bool offline = false;
2843 u8 test_results = 0; 2843 u8 test_results = 0;
2844 u8 test_mask = 0; 2844 u8 test_mask = 0;
2845 int rc, i; 2845 int rc = 0, i;
2846 2846
2847 if (!bp->num_tests || !BNXT_SINGLE_PF(bp)) 2847 if (!bp->num_tests || !BNXT_SINGLE_PF(bp))
2848 return; 2848 return;
@@ -2913,9 +2913,9 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
2913 } 2913 }
2914 bnxt_hwrm_phy_loopback(bp, false, false); 2914 bnxt_hwrm_phy_loopback(bp, false, false);
2915 bnxt_half_close_nic(bp); 2915 bnxt_half_close_nic(bp);
2916 bnxt_open_nic(bp, false, true); 2916 rc = bnxt_open_nic(bp, false, true);
2917 } 2917 }
2918 if (bnxt_test_irq(bp)) { 2918 if (rc || bnxt_test_irq(bp)) {
2919 buf[BNXT_IRQ_TEST_IDX] = 1; 2919 buf[BNXT_IRQ_TEST_IDX] = 1;
2920 etest->flags |= ETH_TEST_FL_FAILED; 2920 etest->flags |= ETH_TEST_FL_FAILED;
2921 } 2921 }
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
index bfa342a98d08..fc77caf0a076 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
@@ -157,8 +157,10 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
157 157
158 if (BNXT_NEW_RM(bp)) { 158 if (BNXT_NEW_RM(bp)) {
159 struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 159 struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
160 int resv_msix;
160 161
161 avail_msix = hw_resc->resv_irqs - bp->cp_nr_rings; 162 resv_msix = hw_resc->resv_irqs - bp->cp_nr_rings;
163 avail_msix = min_t(int, resv_msix, avail_msix);
162 edev->ulp_tbl[ulp_id].msix_requested = avail_msix; 164 edev->ulp_tbl[ulp_id].msix_requested = avail_msix;
163 } 165 }
164 bnxt_fill_msix_vecs(bp, ent); 166 bnxt_fill_msix_vecs(bp, ent);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 515bfd2c9e3f..03983bd46eef 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -496,7 +496,11 @@
496 496
497/* Bitfields in TISUBN */ 497/* Bitfields in TISUBN */
498#define GEM_SUBNSINCR_OFFSET 0 498#define GEM_SUBNSINCR_OFFSET 0
499#define GEM_SUBNSINCR_SIZE 16 499#define GEM_SUBNSINCRL_OFFSET 24
500#define GEM_SUBNSINCRL_SIZE 8
501#define GEM_SUBNSINCRH_OFFSET 0
502#define GEM_SUBNSINCRH_SIZE 16
503#define GEM_SUBNSINCR_SIZE 24
500 504
501/* Bitfields in TI */ 505/* Bitfields in TI */
502#define GEM_NSINCR_OFFSET 0 506#define GEM_NSINCR_OFFSET 0
@@ -834,6 +838,9 @@ struct gem_tx_ts {
834/* limit RX checksum offload to TCP and UDP packets */ 838/* limit RX checksum offload to TCP and UDP packets */
835#define GEM_RX_CSUM_CHECKED_MASK 2 839#define GEM_RX_CSUM_CHECKED_MASK 2
836 840
841/* Scaled PPM fraction */
842#define PPM_FRACTION 16
843
837/* struct macb_tx_skb - data about an skb which is being transmitted 844/* struct macb_tx_skb - data about an skb which is being transmitted
838 * @skb: skb currently being transmitted, only set for the last buffer 845 * @skb: skb currently being transmitted, only set for the last buffer
839 * of the frame 846 * of the frame
diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c
index 0a8aca8d3634..43a3f0dbf857 100644
--- a/drivers/net/ethernet/cadence/macb_ptp.c
+++ b/drivers/net/ethernet/cadence/macb_ptp.c
@@ -104,7 +104,10 @@ static int gem_tsu_incr_set(struct macb *bp, struct tsu_incr *incr_spec)
104 * to take effect. 104 * to take effect.
105 */ 105 */
106 spin_lock_irqsave(&bp->tsu_clk_lock, flags); 106 spin_lock_irqsave(&bp->tsu_clk_lock, flags);
107 gem_writel(bp, TISUBN, GEM_BF(SUBNSINCR, incr_spec->sub_ns)); 107 /* RegBit[15:0] = Subns[23:8]; RegBit[31:24] = Subns[7:0] */
108 gem_writel(bp, TISUBN, GEM_BF(SUBNSINCRL, incr_spec->sub_ns) |
109 GEM_BF(SUBNSINCRH, (incr_spec->sub_ns >>
110 GEM_SUBNSINCRL_SIZE)));
108 gem_writel(bp, TI, GEM_BF(NSINCR, incr_spec->ns)); 111 gem_writel(bp, TI, GEM_BF(NSINCR, incr_spec->ns));
109 spin_unlock_irqrestore(&bp->tsu_clk_lock, flags); 112 spin_unlock_irqrestore(&bp->tsu_clk_lock, flags);
110 113
@@ -135,7 +138,7 @@ static int gem_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
135 * (temp / USEC_PER_SEC) + 0.5 138 * (temp / USEC_PER_SEC) + 0.5
136 */ 139 */
137 adj += (USEC_PER_SEC >> 1); 140 adj += (USEC_PER_SEC >> 1);
138 adj >>= GEM_SUBNSINCR_SIZE; /* remove fractions */ 141 adj >>= PPM_FRACTION; /* remove fractions */
139 adj = div_u64(adj, USEC_PER_SEC); 142 adj = div_u64(adj, USEC_PER_SEC);
140 adj = neg_adj ? (word - adj) : (word + adj); 143 adj = neg_adj ? (word - adj) : (word + adj);
141 144
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index fe879c07ae3c..2235dd55fab2 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -2370,6 +2370,7 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
2370 ndev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 2370 ndev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
2371 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO | 2371 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO |
2372 NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6; 2372 NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6;
2373 ndev->vlan_features |= NETIF_F_TSO | NETIF_F_TSO6;
2373 ndev->max_mtu = MAC_MAX_MTU_V2 - 2374 ndev->max_mtu = MAC_MAX_MTU_V2 -
2374 (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN); 2375 (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
2375 break; 2376 break;
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
index ae2240074d8e..5692c6087bbb 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
@@ -312,7 +312,8 @@ static void mvpp2_prs_sram_shift_set(struct mvpp2_prs_entry *pe, int shift,
312 } 312 }
313 313
314 /* Set value */ 314 /* Set value */
315 pe->sram[MVPP2_BIT_TO_WORD(MVPP2_PRS_SRAM_SHIFT_OFFS)] = shift & MVPP2_PRS_SRAM_SHIFT_MASK; 315 pe->sram[MVPP2_BIT_TO_WORD(MVPP2_PRS_SRAM_SHIFT_OFFS)] |=
316 shift & MVPP2_PRS_SRAM_SHIFT_MASK;
316 317
317 /* Reset and set operation */ 318 /* Reset and set operation */
318 mvpp2_prs_sram_bits_clear(pe, MVPP2_PRS_SRAM_OP_SEL_SHIFT_OFFS, 319 mvpp2_prs_sram_bits_clear(pe, MVPP2_PRS_SRAM_OP_SEL_SHIFT_OFFS,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
index c6c28f56aa29..b3762123a69c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
@@ -102,13 +102,15 @@ static struct list_head *mlx5_fc_counters_lookup_next(struct mlx5_core_dev *dev,
102 struct mlx5_fc_stats *fc_stats = &dev->priv.fc_stats; 102 struct mlx5_fc_stats *fc_stats = &dev->priv.fc_stats;
103 unsigned long next_id = (unsigned long)id + 1; 103 unsigned long next_id = (unsigned long)id + 1;
104 struct mlx5_fc *counter; 104 struct mlx5_fc *counter;
105 unsigned long tmp;
105 106
106 rcu_read_lock(); 107 rcu_read_lock();
107 /* skip counters that are in idr, but not yet in counters list */ 108 /* skip counters that are in idr, but not yet in counters list */
108 while ((counter = idr_get_next_ul(&fc_stats->counters_idr, 109 idr_for_each_entry_continue_ul(&fc_stats->counters_idr,
109 &next_id)) != NULL && 110 counter, tmp, next_id) {
110 list_empty(&counter->list)) 111 if (!list_empty(&counter->list))
111 next_id++; 112 break;
113 }
112 rcu_read_unlock(); 114 rcu_read_unlock();
113 115
114 return counter ? &counter->list : &fc_stats->counters; 116 return counter ? &counter->list : &fc_stats->counters;
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c
index 96f7a9818294..0b384f97d2fd 100644
--- a/drivers/net/ethernet/ni/nixge.c
+++ b/drivers/net/ethernet/ni/nixge.c
@@ -990,7 +990,7 @@ static void nixge_ethtools_get_drvinfo(struct net_device *ndev,
990 struct ethtool_drvinfo *ed) 990 struct ethtool_drvinfo *ed)
991{ 991{
992 strlcpy(ed->driver, "nixge", sizeof(ed->driver)); 992 strlcpy(ed->driver, "nixge", sizeof(ed->driver));
993 strlcpy(ed->bus_info, "platform", sizeof(ed->driver)); 993 strlcpy(ed->bus_info, "platform", sizeof(ed->bus_info));
994} 994}
995 995
996static int nixge_ethtools_get_coalesce(struct net_device *ndev, 996static int nixge_ethtools_get_coalesce(struct net_device *ndev,
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3425d4dda03d..bdedde99148a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3058,17 +3058,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
3058 3058
3059 /* Manage oversized TCP frames for GMAC4 device */ 3059 /* Manage oversized TCP frames for GMAC4 device */
3060 if (skb_is_gso(skb) && priv->tso) { 3060 if (skb_is_gso(skb) && priv->tso) {
3061 if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { 3061 if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))
3062 /*
3063 * There is no way to determine the number of TSO
3064 * capable Queues. Let's use always the Queue 0
3065 * because if TSO is supported then at least this
3066 * one will be capable.
3067 */
3068 skb_set_queue_mapping(skb, 0);
3069
3070 return stmmac_tso_xmit(skb, dev); 3062 return stmmac_tso_xmit(skb, dev);
3071 }
3072 } 3063 }
3073 3064
3074 if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) { 3065 if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) {
@@ -3886,6 +3877,22 @@ static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type,
3886 } 3877 }
3887} 3878}
3888 3879
3880static u16 stmmac_select_queue(struct net_device *dev, struct sk_buff *skb,
3881 struct net_device *sb_dev)
3882{
3883 if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
3884 /*
3885 * There is no way to determine the number of TSO
3886 * capable Queues. Let's use always the Queue 0
3887 * because if TSO is supported then at least this
3888 * one will be capable.
3889 */
3890 return 0;
3891 }
3892
3893 return netdev_pick_tx(dev, skb, NULL) % dev->real_num_tx_queues;
3894}
3895
3889static int stmmac_set_mac_address(struct net_device *ndev, void *addr) 3896static int stmmac_set_mac_address(struct net_device *ndev, void *addr)
3890{ 3897{
3891 struct stmmac_priv *priv = netdev_priv(ndev); 3898 struct stmmac_priv *priv = netdev_priv(ndev);
@@ -4102,6 +4109,7 @@ static const struct net_device_ops stmmac_netdev_ops = {
4102 .ndo_tx_timeout = stmmac_tx_timeout, 4109 .ndo_tx_timeout = stmmac_tx_timeout,
4103 .ndo_do_ioctl = stmmac_ioctl, 4110 .ndo_do_ioctl = stmmac_ioctl,
4104 .ndo_setup_tc = stmmac_setup_tc, 4111 .ndo_setup_tc = stmmac_setup_tc,
4112 .ndo_select_queue = stmmac_select_queue,
4105#ifdef CONFIG_NET_POLL_CONTROLLER 4113#ifdef CONFIG_NET_POLL_CONTROLLER
4106 .ndo_poll_controller = stmmac_poll_controller, 4114 .ndo_poll_controller = stmmac_poll_controller,
4107#endif 4115#endif
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index f16aefd8870b..f320f9a0de8b 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2573,6 +2573,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
2573 return ret; 2573 return ret;
2574 } 2574 }
2575 2575
2576 slave_data->slave_node = slave_node;
2576 slave_data->phy_node = of_parse_phandle(slave_node, 2577 slave_data->phy_node = of_parse_phandle(slave_node,
2577 "phy-handle", 0); 2578 "phy-handle", 0);
2578 parp = of_get_property(slave_node, "phy_id", &lenp); 2579 parp = of_get_property(slave_node, "phy_id", &lenp);
@@ -2723,6 +2724,7 @@ static int cpsw_probe_dual_emac(struct cpsw_priv *priv)
2723 2724
2724 /* register the network device */ 2725 /* register the network device */
2725 SET_NETDEV_DEV(ndev, cpsw->dev); 2726 SET_NETDEV_DEV(ndev, cpsw->dev);
2727 ndev->dev.of_node = cpsw->slaves[1].data->slave_node;
2726 ret = register_netdev(ndev); 2728 ret = register_netdev(ndev);
2727 if (ret) 2729 if (ret)
2728 dev_err(cpsw->dev, "cpsw: error registering net device\n"); 2730 dev_err(cpsw->dev, "cpsw: error registering net device\n");
@@ -2900,6 +2902,7 @@ static int cpsw_probe(struct platform_device *pdev)
2900 2902
2901 /* register the network device */ 2903 /* register the network device */
2902 SET_NETDEV_DEV(ndev, dev); 2904 SET_NETDEV_DEV(ndev, dev);
2905 ndev->dev.of_node = cpsw->slaves[0].data->slave_node;
2903 ret = register_netdev(ndev); 2906 ret = register_netdev(ndev);
2904 if (ret) { 2907 if (ret) {
2905 dev_err(dev, "error registering net device\n"); 2908 dev_err(dev, "error registering net device\n");
diff --git a/drivers/net/ethernet/ti/cpsw_priv.h b/drivers/net/ethernet/ti/cpsw_priv.h
index 086bf38a4736..362c5a986869 100644
--- a/drivers/net/ethernet/ti/cpsw_priv.h
+++ b/drivers/net/ethernet/ti/cpsw_priv.h
@@ -272,6 +272,7 @@ struct cpsw_host_regs {
272}; 272};
273 273
274struct cpsw_slave_data { 274struct cpsw_slave_data {
275 struct device_node *slave_node;
275 struct device_node *phy_node; 276 struct device_node *phy_node;
276 char phy_id[MII_BUS_ID_SIZE]; 277 char phy_id[MII_BUS_ID_SIZE];
277 int phy_if; 278 int phy_if;
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index fc45b749db46..ecfe26215935 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -285,16 +285,29 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb)
285 return gtp_rx(pctx, skb, hdrlen, gtp->role); 285 return gtp_rx(pctx, skb, hdrlen, gtp->role);
286} 286}
287 287
288static void gtp_encap_destroy(struct sock *sk) 288static void __gtp_encap_destroy(struct sock *sk)
289{ 289{
290 struct gtp_dev *gtp; 290 struct gtp_dev *gtp;
291 291
292 gtp = rcu_dereference_sk_user_data(sk); 292 lock_sock(sk);
293 gtp = sk->sk_user_data;
293 if (gtp) { 294 if (gtp) {
295 if (gtp->sk0 == sk)
296 gtp->sk0 = NULL;
297 else
298 gtp->sk1u = NULL;
294 udp_sk(sk)->encap_type = 0; 299 udp_sk(sk)->encap_type = 0;
295 rcu_assign_sk_user_data(sk, NULL); 300 rcu_assign_sk_user_data(sk, NULL);
296 sock_put(sk); 301 sock_put(sk);
297 } 302 }
303 release_sock(sk);
304}
305
306static void gtp_encap_destroy(struct sock *sk)
307{
308 rtnl_lock();
309 __gtp_encap_destroy(sk);
310 rtnl_unlock();
298} 311}
299 312
300static void gtp_encap_disable_sock(struct sock *sk) 313static void gtp_encap_disable_sock(struct sock *sk)
@@ -302,7 +315,7 @@ static void gtp_encap_disable_sock(struct sock *sk)
302 if (!sk) 315 if (!sk)
303 return; 316 return;
304 317
305 gtp_encap_destroy(sk); 318 __gtp_encap_destroy(sk);
306} 319}
307 320
308static void gtp_encap_disable(struct gtp_dev *gtp) 321static void gtp_encap_disable(struct gtp_dev *gtp)
@@ -681,7 +694,6 @@ static void gtp_dellink(struct net_device *dev, struct list_head *head)
681{ 694{
682 struct gtp_dev *gtp = netdev_priv(dev); 695 struct gtp_dev *gtp = netdev_priv(dev);
683 696
684 gtp_encap_disable(gtp);
685 gtp_hashtable_free(gtp); 697 gtp_hashtable_free(gtp);
686 list_del_rcu(&gtp->list); 698 list_del_rcu(&gtp->list);
687 unregister_netdevice_queue(dev, head); 699 unregister_netdevice_queue(dev, head);
@@ -796,7 +808,8 @@ static struct sock *gtp_encap_enable_socket(int fd, int type,
796 goto out_sock; 808 goto out_sock;
797 } 809 }
798 810
799 if (rcu_dereference_sk_user_data(sock->sk)) { 811 lock_sock(sock->sk);
812 if (sock->sk->sk_user_data) {
800 sk = ERR_PTR(-EBUSY); 813 sk = ERR_PTR(-EBUSY);
801 goto out_sock; 814 goto out_sock;
802 } 815 }
@@ -812,6 +825,7 @@ static struct sock *gtp_encap_enable_socket(int fd, int type,
812 setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg); 825 setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg);
813 826
814out_sock: 827out_sock:
828 release_sock(sock->sk);
815 sockfd_put(sock); 829 sockfd_put(sock);
816 return sk; 830 return sk;
817} 831}
@@ -843,8 +857,13 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[])
843 857
844 if (data[IFLA_GTP_ROLE]) { 858 if (data[IFLA_GTP_ROLE]) {
845 role = nla_get_u32(data[IFLA_GTP_ROLE]); 859 role = nla_get_u32(data[IFLA_GTP_ROLE]);
846 if (role > GTP_ROLE_SGSN) 860 if (role > GTP_ROLE_SGSN) {
861 if (sk0)
862 gtp_encap_disable_sock(sk0);
863 if (sk1u)
864 gtp_encap_disable_sock(sk1u);
847 return -EINVAL; 865 return -EINVAL;
866 }
848 } 867 }
849 868
850 gtp->sk0 = sk0; 869 gtp->sk0 = sk0;
@@ -945,7 +964,7 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct sock *sk,
945 964
946 } 965 }
947 966
948 pctx = kmalloc(sizeof(struct pdp_ctx), GFP_KERNEL); 967 pctx = kmalloc(sizeof(*pctx), GFP_ATOMIC);
949 if (pctx == NULL) 968 if (pctx == NULL)
950 return -ENOMEM; 969 return -ENOMEM;
951 970
@@ -1034,6 +1053,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
1034 return -EINVAL; 1053 return -EINVAL;
1035 } 1054 }
1036 1055
1056 rtnl_lock();
1037 rcu_read_lock(); 1057 rcu_read_lock();
1038 1058
1039 gtp = gtp_find_dev(sock_net(skb->sk), info->attrs); 1059 gtp = gtp_find_dev(sock_net(skb->sk), info->attrs);
@@ -1058,6 +1078,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
1058 1078
1059out_unlock: 1079out_unlock:
1060 rcu_read_unlock(); 1080 rcu_read_unlock();
1081 rtnl_unlock();
1061 return err; 1082 return err;
1062} 1083}
1063 1084
@@ -1360,9 +1381,9 @@ late_initcall(gtp_init);
1360 1381
1361static void __exit gtp_fini(void) 1382static void __exit gtp_fini(void)
1362{ 1383{
1363 unregister_pernet_subsys(&gtp_net_ops);
1364 genl_unregister_family(&gtp_genl_family); 1384 genl_unregister_family(&gtp_genl_family);
1365 rtnl_link_unregister(&gtp_link_ops); 1385 rtnl_link_unregister(&gtp_link_ops);
1386 unregister_pernet_subsys(&gtp_net_ops);
1366 1387
1367 pr_info("GTP module unloaded\n"); 1388 pr_info("GTP module unloaded\n");
1368} 1389}
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 75aebf65cd09..8f46aa1ddec0 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -865,6 +865,7 @@ static void macsec_reset_skb(struct sk_buff *skb, struct net_device *dev)
865 865
866static void macsec_finalize_skb(struct sk_buff *skb, u8 icv_len, u8 hdr_len) 866static void macsec_finalize_skb(struct sk_buff *skb, u8 icv_len, u8 hdr_len)
867{ 867{
868 skb->ip_summed = CHECKSUM_NONE;
868 memmove(skb->data + hdr_len, skb->data, 2 * ETH_ALEN); 869 memmove(skb->data + hdr_len, skb->data, 2 * ETH_ALEN);
869 skb_pull(skb, hdr_len); 870 skb_pull(skb, hdr_len);
870 pskb_trim_unique(skb, skb->len - icv_len); 871 pskb_trim_unique(skb, skb->len - icv_len);
@@ -1099,10 +1100,9 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
1099 } 1100 }
1100 1101
1101 skb = skb_unshare(skb, GFP_ATOMIC); 1102 skb = skb_unshare(skb, GFP_ATOMIC);
1102 if (!skb) { 1103 *pskb = skb;
1103 *pskb = NULL; 1104 if (!skb)
1104 return RX_HANDLER_CONSUMED; 1105 return RX_HANDLER_CONSUMED;
1105 }
1106 1106
1107 pulled_sci = pskb_may_pull(skb, macsec_extra_len(true)); 1107 pulled_sci = pskb_may_pull(skb, macsec_extra_len(true));
1108 if (!pulled_sci) { 1108 if (!pulled_sci) {
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index c9bc96310ed4..ef548beba684 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -226,7 +226,7 @@ static void asix_phy_reset(struct usbnet *dev, unsigned int reset_bits)
226static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf) 226static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
227{ 227{
228 int ret = 0; 228 int ret = 0;
229 u8 buf[ETH_ALEN]; 229 u8 buf[ETH_ALEN] = {0};
230 int i; 230 int i;
231 unsigned long gpio_bits = dev->driver_info->data; 231 unsigned long gpio_bits = dev->driver_info->data;
232 232
@@ -677,7 +677,7 @@ static int asix_resume(struct usb_interface *intf)
677static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 677static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
678{ 678{
679 int ret, i; 679 int ret, i;
680 u8 buf[ETH_ALEN], chipcode = 0; 680 u8 buf[ETH_ALEN] = {0}, chipcode = 0;
681 u32 phyid; 681 u32 phyid;
682 struct asix_common_private *priv; 682 struct asix_common_private *priv;
683 683
@@ -1061,7 +1061,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
1061static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf) 1061static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
1062{ 1062{
1063 int ret; 1063 int ret;
1064 u8 buf[ETH_ALEN]; 1064 u8 buf[ETH_ALEN] = {0};
1065 1065
1066 usbnet_get_endpoints(dev,intf); 1066 usbnet_get_endpoints(dev,intf);
1067 1067
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index e0dcb681cfe5..39e0768d734d 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -28,7 +28,7 @@
28#define NETNEXT_VERSION "09" 28#define NETNEXT_VERSION "09"
29 29
30/* Information for net */ 30/* Information for net */
31#define NET_VERSION "9" 31#define NET_VERSION "10"
32 32
33#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION 33#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION
34#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" 34#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
@@ -53,6 +53,9 @@
53#define PAL_BDC_CR 0xd1a0 53#define PAL_BDC_CR 0xd1a0
54#define PLA_TEREDO_TIMER 0xd2cc 54#define PLA_TEREDO_TIMER 0xd2cc
55#define PLA_REALWOW_TIMER 0xd2e8 55#define PLA_REALWOW_TIMER 0xd2e8
56#define PLA_SUSPEND_FLAG 0xd38a
57#define PLA_INDICATE_FALG 0xd38c
58#define PLA_EXTRA_STATUS 0xd398
56#define PLA_EFUSE_DATA 0xdd00 59#define PLA_EFUSE_DATA 0xdd00
57#define PLA_EFUSE_CMD 0xdd02 60#define PLA_EFUSE_CMD 0xdd02
58#define PLA_LEDSEL 0xdd90 61#define PLA_LEDSEL 0xdd90
@@ -336,6 +339,15 @@
336/* PLA_BOOT_CTRL */ 339/* PLA_BOOT_CTRL */
337#define AUTOLOAD_DONE 0x0002 340#define AUTOLOAD_DONE 0x0002
338 341
342/* PLA_SUSPEND_FLAG */
343#define LINK_CHG_EVENT BIT(0)
344
345/* PLA_INDICATE_FALG */
346#define UPCOMING_RUNTIME_D3 BIT(0)
347
348/* PLA_EXTRA_STATUS */
349#define LINK_CHANGE_FLAG BIT(8)
350
339/* USB_USB2PHY */ 351/* USB_USB2PHY */
340#define USB2PHY_SUSPEND 0x0001 352#define USB2PHY_SUSPEND 0x0001
341#define USB2PHY_L1 0x0002 353#define USB2PHY_L1 0x0002
@@ -813,6 +825,14 @@ int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
813 return ret; 825 return ret;
814} 826}
815 827
828static void rtl_set_unplug(struct r8152 *tp)
829{
830 if (tp->udev->state == USB_STATE_NOTATTACHED) {
831 set_bit(RTL8152_UNPLUG, &tp->flags);
832 smp_mb__after_atomic();
833 }
834}
835
816static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, 836static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
817 void *data, u16 type) 837 void *data, u16 type)
818{ 838{
@@ -851,7 +871,7 @@ static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
851 } 871 }
852 872
853 if (ret == -ENODEV) 873 if (ret == -ENODEV)
854 set_bit(RTL8152_UNPLUG, &tp->flags); 874 rtl_set_unplug(tp);
855 875
856 return ret; 876 return ret;
857} 877}
@@ -921,7 +941,7 @@ static int generic_ocp_write(struct r8152 *tp, u16 index, u16 byteen,
921 941
922error1: 942error1:
923 if (ret == -ENODEV) 943 if (ret == -ENODEV)
924 set_bit(RTL8152_UNPLUG, &tp->flags); 944 rtl_set_unplug(tp);
925 945
926 return ret; 946 return ret;
927} 947}
@@ -1309,7 +1329,7 @@ static void read_bulk_callback(struct urb *urb)
1309 napi_schedule(&tp->napi); 1329 napi_schedule(&tp->napi);
1310 return; 1330 return;
1311 case -ESHUTDOWN: 1331 case -ESHUTDOWN:
1312 set_bit(RTL8152_UNPLUG, &tp->flags); 1332 rtl_set_unplug(tp);
1313 netif_device_detach(tp->netdev); 1333 netif_device_detach(tp->netdev);
1314 return; 1334 return;
1315 case -ENOENT: 1335 case -ENOENT:
@@ -1429,7 +1449,7 @@ static void intr_callback(struct urb *urb)
1429resubmit: 1449resubmit:
1430 res = usb_submit_urb(urb, GFP_ATOMIC); 1450 res = usb_submit_urb(urb, GFP_ATOMIC);
1431 if (res == -ENODEV) { 1451 if (res == -ENODEV) {
1432 set_bit(RTL8152_UNPLUG, &tp->flags); 1452 rtl_set_unplug(tp);
1433 netif_device_detach(tp->netdev); 1453 netif_device_detach(tp->netdev);
1434 } else if (res) { 1454 } else if (res) {
1435 netif_err(tp, intr, tp->netdev, 1455 netif_err(tp, intr, tp->netdev,
@@ -2024,7 +2044,7 @@ static void tx_bottom(struct r8152 *tp)
2024 struct net_device *netdev = tp->netdev; 2044 struct net_device *netdev = tp->netdev;
2025 2045
2026 if (res == -ENODEV) { 2046 if (res == -ENODEV) {
2027 set_bit(RTL8152_UNPLUG, &tp->flags); 2047 rtl_set_unplug(tp);
2028 netif_device_detach(netdev); 2048 netif_device_detach(netdev);
2029 } else { 2049 } else {
2030 struct net_device_stats *stats = &netdev->stats; 2050 struct net_device_stats *stats = &netdev->stats;
@@ -2098,7 +2118,7 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
2098 2118
2099 ret = usb_submit_urb(agg->urb, mem_flags); 2119 ret = usb_submit_urb(agg->urb, mem_flags);
2100 if (ret == -ENODEV) { 2120 if (ret == -ENODEV) {
2101 set_bit(RTL8152_UNPLUG, &tp->flags); 2121 rtl_set_unplug(tp);
2102 netif_device_detach(tp->netdev); 2122 netif_device_detach(tp->netdev);
2103 } else if (ret) { 2123 } else if (ret) {
2104 struct urb *urb = agg->urb; 2124 struct urb *urb = agg->urb;
@@ -2355,6 +2375,12 @@ static int rtl_stop_rx(struct r8152 *tp)
2355 return 0; 2375 return 0;
2356} 2376}
2357 2377
2378static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
2379{
2380 ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
2381 OWN_UPDATE | OWN_CLEAR);
2382}
2383
2358static int rtl_enable(struct r8152 *tp) 2384static int rtl_enable(struct r8152 *tp)
2359{ 2385{
2360 u32 ocp_data; 2386 u32 ocp_data;
@@ -2365,6 +2391,15 @@ static int rtl_enable(struct r8152 *tp)
2365 ocp_data |= CR_RE | CR_TE; 2391 ocp_data |= CR_RE | CR_TE;
2366 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data); 2392 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
2367 2393
2394 switch (tp->version) {
2395 case RTL_VER_08:
2396 case RTL_VER_09:
2397 r8153b_rx_agg_chg_indicate(tp);
2398 break;
2399 default:
2400 break;
2401 }
2402
2368 rxdy_gated_en(tp, false); 2403 rxdy_gated_en(tp, false);
2369 2404
2370 return 0; 2405 return 0;
@@ -2381,12 +2416,6 @@ static int rtl8152_enable(struct r8152 *tp)
2381 return rtl_enable(tp); 2416 return rtl_enable(tp);
2382} 2417}
2383 2418
2384static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
2385{
2386 ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
2387 OWN_UPDATE | OWN_CLEAR);
2388}
2389
2390static void r8153_set_rx_early_timeout(struct r8152 *tp) 2419static void r8153_set_rx_early_timeout(struct r8152 *tp)
2391{ 2420{
2392 u32 ocp_data = tp->coalesce / 8; 2421 u32 ocp_data = tp->coalesce / 8;
@@ -2409,7 +2438,6 @@ static void r8153_set_rx_early_timeout(struct r8152 *tp)
2409 128 / 8); 2438 128 / 8);
2410 ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EXTRA_AGGR_TMR, 2439 ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EXTRA_AGGR_TMR,
2411 ocp_data); 2440 ocp_data);
2412 r8153b_rx_agg_chg_indicate(tp);
2413 break; 2441 break;
2414 2442
2415 default: 2443 default:
@@ -2433,7 +2461,6 @@ static void r8153_set_rx_early_size(struct r8152 *tp)
2433 case RTL_VER_09: 2461 case RTL_VER_09:
2434 ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE, 2462 ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE,
2435 ocp_data / 8); 2463 ocp_data / 8);
2436 r8153b_rx_agg_chg_indicate(tp);
2437 break; 2464 break;
2438 default: 2465 default:
2439 WARN_ON_ONCE(1); 2466 WARN_ON_ONCE(1);
@@ -2806,20 +2833,24 @@ static void r8153b_power_cut_en(struct r8152 *tp, bool enable)
2806 ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data); 2833 ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data);
2807} 2834}
2808 2835
2809static void r8153b_queue_wake(struct r8152 *tp, bool enable) 2836static void r8153_queue_wake(struct r8152 *tp, bool enable)
2810{ 2837{
2811 u32 ocp_data; 2838 u32 ocp_data;
2812 2839
2813 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, 0xd38a); 2840 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_INDICATE_FALG);
2814 if (enable) 2841 if (enable)
2815 ocp_data |= BIT(0); 2842 ocp_data |= UPCOMING_RUNTIME_D3;
2816 else 2843 else
2817 ocp_data &= ~BIT(0); 2844 ocp_data &= ~UPCOMING_RUNTIME_D3;
2818 ocp_write_byte(tp, MCU_TYPE_PLA, 0xd38a, ocp_data); 2845 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_INDICATE_FALG, ocp_data);
2846
2847 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_SUSPEND_FLAG);
2848 ocp_data &= ~LINK_CHG_EVENT;
2849 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_SUSPEND_FLAG, ocp_data);
2819 2850
2820 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, 0xd38c); 2851 ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS);
2821 ocp_data &= ~BIT(0); 2852 ocp_data &= ~LINK_CHANGE_FLAG;
2822 ocp_write_byte(tp, MCU_TYPE_PLA, 0xd38c, ocp_data); 2853 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data);
2823} 2854}
2824 2855
2825static bool rtl_can_wakeup(struct r8152 *tp) 2856static bool rtl_can_wakeup(struct r8152 *tp)
@@ -2887,14 +2918,14 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
2887static void rtl8153b_runtime_enable(struct r8152 *tp, bool enable) 2918static void rtl8153b_runtime_enable(struct r8152 *tp, bool enable)
2888{ 2919{
2889 if (enable) { 2920 if (enable) {
2890 r8153b_queue_wake(tp, true); 2921 r8153_queue_wake(tp, true);
2891 r8153b_u1u2en(tp, false); 2922 r8153b_u1u2en(tp, false);
2892 r8153_u2p3en(tp, false); 2923 r8153_u2p3en(tp, false);
2893 rtl_runtime_suspend_enable(tp, true); 2924 rtl_runtime_suspend_enable(tp, true);
2894 r8153b_ups_en(tp, true); 2925 r8153b_ups_en(tp, true);
2895 } else { 2926 } else {
2896 r8153b_ups_en(tp, false); 2927 r8153b_ups_en(tp, false);
2897 r8153b_queue_wake(tp, false); 2928 r8153_queue_wake(tp, false);
2898 rtl_runtime_suspend_enable(tp, false); 2929 rtl_runtime_suspend_enable(tp, false);
2899 r8153_u2p3en(tp, true); 2930 r8153_u2p3en(tp, true);
2900 r8153b_u1u2en(tp, true); 2931 r8153b_u1u2en(tp, true);
@@ -4221,7 +4252,7 @@ static void r8153b_init(struct r8152 *tp)
4221 4252
4222 r8153b_power_cut_en(tp, false); 4253 r8153b_power_cut_en(tp, false);
4223 r8153b_ups_en(tp, false); 4254 r8153b_ups_en(tp, false);
4224 r8153b_queue_wake(tp, false); 4255 r8153_queue_wake(tp, false);
4225 rtl_runtime_suspend_enable(tp, false); 4256 rtl_runtime_suspend_enable(tp, false);
4226 r8153b_u1u2en(tp, true); 4257 r8153b_u1u2en(tp, true);
4227 usb_enable_lpm(tp->udev); 4258 usb_enable_lpm(tp->udev);
@@ -4903,8 +4934,17 @@ static int rtl8152_set_coalesce(struct net_device *netdev,
4903 if (tp->coalesce != coalesce->rx_coalesce_usecs) { 4934 if (tp->coalesce != coalesce->rx_coalesce_usecs) {
4904 tp->coalesce = coalesce->rx_coalesce_usecs; 4935 tp->coalesce = coalesce->rx_coalesce_usecs;
4905 4936
4906 if (netif_running(tp->netdev) && netif_carrier_ok(netdev)) 4937 if (netif_running(netdev) && netif_carrier_ok(netdev)) {
4907 r8153_set_rx_early_timeout(tp); 4938 netif_stop_queue(netdev);
4939 napi_disable(&tp->napi);
4940 tp->rtl_ops.disable(tp);
4941 tp->rtl_ops.enable(tp);
4942 rtl_start_rx(tp);
4943 clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
4944 _rtl8152_set_rx_mode(netdev);
4945 napi_enable(&tp->napi);
4946 netif_wake_queue(netdev);
4947 }
4908 } 4948 }
4909 4949
4910 mutex_unlock(&tp->control); 4950 mutex_unlock(&tp->control);
@@ -5323,10 +5363,7 @@ static void rtl8152_disconnect(struct usb_interface *intf)
5323 5363
5324 usb_set_intfdata(intf, NULL); 5364 usb_set_intfdata(intf, NULL);
5325 if (tp) { 5365 if (tp) {
5326 struct usb_device *udev = tp->udev; 5366 rtl_set_unplug(tp);
5327
5328 if (udev->state == USB_STATE_NOTATTACHED)
5329 set_bit(RTL8152_UNPLUG, &tp->flags);
5330 5367
5331 netif_napi_del(&tp->napi); 5368 netif_napi_del(&tp->napi);
5332 unregister_netdev(tp->netdev); 5369 unregister_netdev(tp->netdev);
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 5e2323592e08..3d9bcc957f7d 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -812,6 +812,14 @@ static struct vxlan_fdb *vxlan_fdb_alloc(struct vxlan_dev *vxlan,
812 return f; 812 return f;
813} 813}
814 814
815static void vxlan_fdb_insert(struct vxlan_dev *vxlan, const u8 *mac,
816 __be32 src_vni, struct vxlan_fdb *f)
817{
818 ++vxlan->addrcnt;
819 hlist_add_head_rcu(&f->hlist,
820 vxlan_fdb_head(vxlan, mac, src_vni));
821}
822
815static int vxlan_fdb_create(struct vxlan_dev *vxlan, 823static int vxlan_fdb_create(struct vxlan_dev *vxlan,
816 const u8 *mac, union vxlan_addr *ip, 824 const u8 *mac, union vxlan_addr *ip,
817 __u16 state, __be16 port, __be32 src_vni, 825 __u16 state, __be16 port, __be32 src_vni,
@@ -837,18 +845,13 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
837 return rc; 845 return rc;
838 } 846 }
839 847
840 ++vxlan->addrcnt;
841 hlist_add_head_rcu(&f->hlist,
842 vxlan_fdb_head(vxlan, mac, src_vni));
843
844 *fdb = f; 848 *fdb = f;
845 849
846 return 0; 850 return 0;
847} 851}
848 852
849static void vxlan_fdb_free(struct rcu_head *head) 853static void __vxlan_fdb_free(struct vxlan_fdb *f)
850{ 854{
851 struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu);
852 struct vxlan_rdst *rd, *nd; 855 struct vxlan_rdst *rd, *nd;
853 856
854 list_for_each_entry_safe(rd, nd, &f->remotes, list) { 857 list_for_each_entry_safe(rd, nd, &f->remotes, list) {
@@ -858,6 +861,13 @@ static void vxlan_fdb_free(struct rcu_head *head)
858 kfree(f); 861 kfree(f);
859} 862}
860 863
864static void vxlan_fdb_free(struct rcu_head *head)
865{
866 struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu);
867
868 __vxlan_fdb_free(f);
869}
870
861static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f, 871static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
862 bool do_notify, bool swdev_notify) 872 bool do_notify, bool swdev_notify)
863{ 873{
@@ -985,6 +995,7 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan,
985 if (rc < 0) 995 if (rc < 0)
986 return rc; 996 return rc;
987 997
998 vxlan_fdb_insert(vxlan, mac, src_vni, f);
988 rc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH, 999 rc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH,
989 swdev_notify, extack); 1000 swdev_notify, extack);
990 if (rc) 1001 if (rc)
@@ -3588,12 +3599,17 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev,
3588 if (err) 3599 if (err)
3589 goto errout; 3600 goto errout;
3590 3601
3591 /* notify default fdb entry */
3592 if (f) { 3602 if (f) {
3603 vxlan_fdb_insert(vxlan, all_zeros_mac,
3604 vxlan->default_dst.remote_vni, f);
3605
3606 /* notify default fdb entry */
3593 err = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), 3607 err = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f),
3594 RTM_NEWNEIGH, true, extack); 3608 RTM_NEWNEIGH, true, extack);
3595 if (err) 3609 if (err) {
3596 goto errout; 3610 vxlan_fdb_destroy(vxlan, f, false, false);
3611 goto unregister;
3612 }
3597 } 3613 }
3598 3614
3599 list_add(&vxlan->next, &vn->vxlan_list); 3615 list_add(&vxlan->next, &vn->vxlan_list);
@@ -3605,7 +3621,8 @@ errout:
3605 * destroy the entry by hand here. 3621 * destroy the entry by hand here.
3606 */ 3622 */
3607 if (f) 3623 if (f)
3608 vxlan_fdb_destroy(vxlan, f, false, false); 3624 __vxlan_fdb_free(f);
3625unregister:
3609 if (unregister) 3626 if (unregister)
3610 unregister_netdevice(dev); 3627 unregister_netdevice(dev);
3611 return err; 3628 return err;
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig
index af2049e99188..d98d6ac90f3d 100644
--- a/drivers/net/wireless/ath/Kconfig
+++ b/drivers/net/wireless/ath/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config ATH_COMMON 2config ATH_COMMON
3 tristate 3 tristate
4 4
diff --git a/drivers/net/wireless/ath/Makefile b/drivers/net/wireless/ath/Makefile
index e4e460b5498e..ee2b2431e5a3 100644
--- a/drivers/net/wireless/ath/Makefile
+++ b/drivers/net/wireless/ath/Makefile
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: ISC
2obj-$(CONFIG_ATH5K) += ath5k/ 2obj-$(CONFIG_ATH5K) += ath5k/
3obj-$(CONFIG_ATH9K_HW) += ath9k/ 3obj-$(CONFIG_ATH9K_HW) += ath9k/
4obj-$(CONFIG_CARL9170) += carl9170/ 4obj-$(CONFIG_CARL9170) += carl9170/
diff --git a/drivers/net/wireless/ath/ar5523/Kconfig b/drivers/net/wireless/ath/ar5523/Kconfig
index 75fc66983da5..41d3c9a48b08 100644
--- a/drivers/net/wireless/ath/ar5523/Kconfig
+++ b/drivers/net/wireless/ath/ar5523/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config AR5523 2config AR5523
3 tristate "Atheros AR5523 wireless driver support" 3 tristate "Atheros AR5523 wireless driver support"
4 depends on MAC80211 && USB 4 depends on MAC80211 && USB
diff --git a/drivers/net/wireless/ath/ar5523/Makefile b/drivers/net/wireless/ath/ar5523/Makefile
index 84fc88aa109e..34efa5772096 100644
--- a/drivers/net/wireless/ath/ar5523/Makefile
+++ b/drivers/net/wireless/ath/ar5523/Makefile
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2obj-$(CONFIG_AR5523) := ar5523.o 2obj-$(CONFIG_AR5523) := ar5523.o
diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
index 3522f251fa7f..6b3ff02a373d 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config ATH10K 2config ATH10K
3 tristate "Atheros 802.11ac wireless cards support" 3 tristate "Atheros 802.11ac wireless cards support"
4 depends on MAC80211 && HAS_DMA 4 depends on MAC80211 && HAS_DMA
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig
index c587146795f6..802f8f87773a 100644
--- a/drivers/net/wireless/ath/ath5k/Kconfig
+++ b/drivers/net/wireless/ath/ath5k/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config ATH5K 2config ATH5K
3 tristate "Atheros 5xxx wireless cards support" 3 tristate "Atheros 5xxx wireless cards support"
4 depends on (PCI || ATH25) && MAC80211 4 depends on (PCI || ATH25) && MAC80211
diff --git a/drivers/net/wireless/ath/ath5k/Makefile b/drivers/net/wireless/ath/ath5k/Makefile
index a8724eee21f8..78f318d49af5 100644
--- a/drivers/net/wireless/ath/ath5k/Makefile
+++ b/drivers/net/wireless/ath/ath5k/Makefile
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: ISC
2ath5k-y += caps.o 2ath5k-y += caps.o
3ath5k-y += initvals.o 3ath5k-y += initvals.o
4ath5k-y += eeprom.o 4ath5k-y += eeprom.o
diff --git a/drivers/net/wireless/ath/ath6kl/Kconfig b/drivers/net/wireless/ath/ath6kl/Kconfig
index 2b27a87e74f5..dcf8ca0dcc52 100644
--- a/drivers/net/wireless/ath/ath6kl/Kconfig
+++ b/drivers/net/wireless/ath/ath6kl/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config ATH6KL 2config ATH6KL
3 tristate "Atheros mobile chipsets support" 3 tristate "Atheros mobile chipsets support"
4 depends on CFG80211 4 depends on CFG80211
diff --git a/drivers/net/wireless/ath/ath6kl/trace.h b/drivers/net/wireless/ath/ath6kl/trace.h
index 91e735cfdef7..a3d3740419eb 100644
--- a/drivers/net/wireless/ath/ath6kl/trace.h
+++ b/drivers/net/wireless/ath/ath6kl/trace.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: ISC */
2#if !defined(_ATH6KL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 2#if !defined(_ATH6KL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
3 3
4#include <net/cfg80211.h> 4#include <net/cfg80211.h>
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index a1ef8769983a..5601cfd6a293 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config ATH9K_HW 2config ATH9K_HW
3 tristate 3 tristate
4config ATH9K_COMMON 4config ATH9K_COMMON
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile
index f71b2ad8275c..15af0a836925 100644
--- a/drivers/net/wireless/ath/ath9k/Makefile
+++ b/drivers/net/wireless/ath/ath9k/Makefile
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: ISC
2ath9k-y += beacon.o \ 2ath9k-y += beacon.o \
3 gpio.o \ 3 gpio.o \
4 init.o \ 4 init.o \
diff --git a/drivers/net/wireless/ath/wcn36xx/Kconfig b/drivers/net/wireless/ath/wcn36xx/Kconfig
index 4ab2d59ff2ca..a4b153470a2c 100644
--- a/drivers/net/wireless/ath/wcn36xx/Kconfig
+++ b/drivers/net/wireless/ath/wcn36xx/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config WCN36XX 2config WCN36XX
3 tristate "Qualcomm Atheros WCN3660/3680 support" 3 tristate "Qualcomm Atheros WCN3660/3680 support"
4 depends on MAC80211 && HAS_DMA 4 depends on MAC80211 && HAS_DMA
diff --git a/drivers/net/wireless/ath/wcn36xx/Makefile b/drivers/net/wireless/ath/wcn36xx/Makefile
index 582049f65735..27413703ad69 100644
--- a/drivers/net/wireless/ath/wcn36xx/Makefile
+++ b/drivers/net/wireless/ath/wcn36xx/Makefile
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: ISC
2obj-$(CONFIG_WCN36XX) := wcn36xx.o 2obj-$(CONFIG_WCN36XX) := wcn36xx.o
3wcn36xx-y += main.o \ 3wcn36xx-y += main.o \
4 dxe.o \ 4 dxe.o \
diff --git a/drivers/net/wireless/ath/wil6210/Kconfig b/drivers/net/wireless/ath/wil6210/Kconfig
index b1a339859feb..0d1a8dab30ed 100644
--- a/drivers/net/wireless/ath/wil6210/Kconfig
+++ b/drivers/net/wireless/ath/wil6210/Kconfig
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: ISC
2config WIL6210 2config WIL6210
3 tristate "Wilocity 60g WiFi card wil6210 support" 3 tristate "Wilocity 60g WiFi card wil6210 support"
4 select WANT_DEV_COREDUMP 4 select WANT_DEV_COREDUMP
diff --git a/drivers/net/wireless/ath/wil6210/Makefile b/drivers/net/wireless/ath/wil6210/Makefile
index d3d61ae459e2..53a0d995ddb0 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: ISC
2obj-$(CONFIG_WIL6210) += wil6210.o 2obj-$(CONFIG_WIL6210) += wil6210.o
3 3
4wil6210-y := main.o 4wil6210-y := main.o
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index a9c846c59289..93526dfaf791 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -82,6 +82,7 @@
82#define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-" 82#define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
83#define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-" 83#define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"
84#define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0-" 84#define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0-"
85#define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0-"
85#define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-" 86#define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-"
86#define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-" 87#define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-"
87#define IWL_22000_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-" 88#define IWL_22000_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-"
@@ -106,6 +107,8 @@
106 IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode" 107 IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode"
107#define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \ 108#define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \
108 IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode" 109 IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode"
110#define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \
111 IWL_QUZ_A_JF_B_FW_PRE __stringify(api) ".ucode"
109#define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \ 112#define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \
110 IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode" 113 IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"
111#define IWL_QNJ_B_JF_B_MODULE_FIRMWARE(api) \ 114#define IWL_QNJ_B_JF_B_MODULE_FIRMWARE(api) \
@@ -241,6 +244,18 @@ const struct iwl_cfg iwl_ax101_cfg_qu_hr = {
241 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 244 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
242}; 245};
243 246
247const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
248 .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
249 .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE,
250 IWL_DEVICE_22500,
251 /*
252 * This device doesn't support receiving BlockAck with a large bitmap
253 * so we need to restrict the size of transmitted aggregation to the
254 * HT size; mac80211 would otherwise pick the HE max (256) by default.
255 */
256 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
257};
258
244const struct iwl_cfg iwl_ax101_cfg_quz_hr = { 259const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
245 .name = "Intel(R) Wi-Fi 6 AX101", 260 .name = "Intel(R) Wi-Fi 6 AX101",
246 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 261 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
@@ -253,6 +268,42 @@ const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
253 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 268 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
254}; 269};
255 270
271const struct iwl_cfg iwl_ax201_cfg_quz_hr = {
272 .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
273 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
274 IWL_DEVICE_22500,
275 /*
276 * This device doesn't support receiving BlockAck with a large bitmap
277 * so we need to restrict the size of transmitted aggregation to the
278 * HT size; mac80211 would otherwise pick the HE max (256) by default.
279 */
280 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
281};
282
283const struct iwl_cfg iwl_ax1650s_cfg_quz_hr = {
284 .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)",
285 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
286 IWL_DEVICE_22500,
287 /*
288 * This device doesn't support receiving BlockAck with a large bitmap
289 * so we need to restrict the size of transmitted aggregation to the
290 * HT size; mac80211 would otherwise pick the HE max (256) by default.
291 */
292 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
293};
294
295const struct iwl_cfg iwl_ax1650i_cfg_quz_hr = {
296 .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)",
297 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
298 IWL_DEVICE_22500,
299 /*
300 * This device doesn't support receiving BlockAck with a large bitmap
301 * so we need to restrict the size of transmitted aggregation to the
302 * HT size; mac80211 would otherwise pick the HE max (256) by default.
303 */
304 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
305};
306
256const struct iwl_cfg iwl_ax200_cfg_cc = { 307const struct iwl_cfg iwl_ax200_cfg_cc = {
257 .name = "Intel(R) Wi-Fi 6 AX200 160MHz", 308 .name = "Intel(R) Wi-Fi 6 AX200 160MHz",
258 .fw_name_pre = IWL_CC_A_FW_PRE, 309 .fw_name_pre = IWL_CC_A_FW_PRE,
@@ -333,6 +384,90 @@ const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0 = {
333 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 384 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
334}; 385};
335 386
387const struct iwl_cfg iwl9560_2ac_cfg_quz_a0_jf_b0_soc = {
388 .name = "Intel(R) Wireless-AC 9560 160MHz",
389 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
390 IWL_DEVICE_22500,
391 /*
392 * This device doesn't support receiving BlockAck with a large bitmap
393 * so we need to restrict the size of transmitted aggregation to the
394 * HT size; mac80211 would otherwise pick the HE max (256) by default.
395 */
396 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
397 .integrated = true,
398 .soc_latency = 5000,
399};
400
401const struct iwl_cfg iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc = {
402 .name = "Intel(R) Wireless-AC 9560 160MHz",
403 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
404 IWL_DEVICE_22500,
405 /*
406 * This device doesn't support receiving BlockAck with a large bitmap
407 * so we need to restrict the size of transmitted aggregation to the
408 * HT size; mac80211 would otherwise pick the HE max (256) by default.
409 */
410 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
411 .integrated = true,
412 .soc_latency = 5000,
413};
414
415const struct iwl_cfg iwl9461_2ac_cfg_quz_a0_jf_b0_soc = {
416 .name = "Intel(R) Dual Band Wireless AC 9461",
417 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
418 IWL_DEVICE_22500,
419 /*
420 * This device doesn't support receiving BlockAck with a large bitmap
421 * so we need to restrict the size of transmitted aggregation to the
422 * HT size; mac80211 would otherwise pick the HE max (256) by default.
423 */
424 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
425 .integrated = true,
426 .soc_latency = 5000,
427};
428
429const struct iwl_cfg iwl9462_2ac_cfg_quz_a0_jf_b0_soc = {
430 .name = "Intel(R) Dual Band Wireless AC 9462",
431 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
432 IWL_DEVICE_22500,
433 /*
434 * This device doesn't support receiving BlockAck with a large bitmap
435 * so we need to restrict the size of transmitted aggregation to the
436 * HT size; mac80211 would otherwise pick the HE max (256) by default.
437 */
438 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
439 .integrated = true,
440 .soc_latency = 5000,
441};
442
443const struct iwl_cfg iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc = {
444 .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)",
445 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
446 IWL_DEVICE_22500,
447 /*
448 * This device doesn't support receiving BlockAck with a large bitmap
449 * so we need to restrict the size of transmitted aggregation to the
450 * HT size; mac80211 would otherwise pick the HE max (256) by default.
451 */
452 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
453 .integrated = true,
454 .soc_latency = 5000,
455};
456
457const struct iwl_cfg iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc = {
458 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)",
459 .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
460 IWL_DEVICE_22500,
461 /*
462 * This device doesn't support receiving BlockAck with a large bitmap
463 * so we need to restrict the size of transmitted aggregation to the
464 * HT size; mac80211 would otherwise pick the HE max (256) by default.
465 */
466 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
467 .integrated = true,
468 .soc_latency = 5000,
469};
470
336const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0 = { 471const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0 = {
337 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)", 472 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)",
338 .fw_name_pre = IWL_QU_B_JF_B_FW_PRE, 473 .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
@@ -424,12 +559,12 @@ const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = {
424}; 559};
425 560
426const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = { 561const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = {
427 .name = "Intel(R) Wi-Fi 6 AX201 160MHz", 562 .name = "Intel(R) Wi-Fi 7 AX210 160MHz",
428 .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE, 563 .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE,
429 IWL_DEVICE_AX210, 564 IWL_DEVICE_AX210,
430}; 565};
431 566
432const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0 = { 567const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = {
433 .name = "Intel(R) Wi-Fi 7 AX211 160MHz", 568 .name = "Intel(R) Wi-Fi 7 AX211 160MHz",
434 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, 569 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE,
435 .uhb_supported = true, 570 .uhb_supported = true,
@@ -443,8 +578,8 @@ const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = {
443 IWL_DEVICE_AX210, 578 IWL_DEVICE_AX210,
444}; 579};
445 580
446const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0 = { 581const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = {
447 .name = "Intel(R) Wi-Fi 7 AX210 160MHz", 582 .name = "Intel(R) Wi-Fi 7 AX411 160MHz",
448 .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, 583 .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE,
449 IWL_DEVICE_AX210, 584 IWL_DEVICE_AX210,
450}; 585};
@@ -457,6 +592,7 @@ MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
457MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 592MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
458MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 593MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
459MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 594MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
595MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
460MODULE_FIRMWARE(IWL_QNJ_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 596MODULE_FIRMWARE(IWL_QNJ_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
461MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 597MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
462MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 598MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index f3e69edf8907..bc267bd2c3b0 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -540,14 +540,20 @@ extern const struct iwl_cfg iwl9260_killer_2ac_cfg;
540extern const struct iwl_cfg iwl9270_2ac_cfg; 540extern const struct iwl_cfg iwl9270_2ac_cfg;
541extern const struct iwl_cfg iwl9460_2ac_cfg; 541extern const struct iwl_cfg iwl9460_2ac_cfg;
542extern const struct iwl_cfg iwl9560_2ac_cfg; 542extern const struct iwl_cfg iwl9560_2ac_cfg;
543extern const struct iwl_cfg iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
543extern const struct iwl_cfg iwl9560_2ac_160_cfg; 544extern const struct iwl_cfg iwl9560_2ac_160_cfg;
545extern const struct iwl_cfg iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
544extern const struct iwl_cfg iwl9460_2ac_cfg_soc; 546extern const struct iwl_cfg iwl9460_2ac_cfg_soc;
545extern const struct iwl_cfg iwl9461_2ac_cfg_soc; 547extern const struct iwl_cfg iwl9461_2ac_cfg_soc;
548extern const struct iwl_cfg iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
546extern const struct iwl_cfg iwl9462_2ac_cfg_soc; 549extern const struct iwl_cfg iwl9462_2ac_cfg_soc;
550extern const struct iwl_cfg iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
547extern const struct iwl_cfg iwl9560_2ac_cfg_soc; 551extern const struct iwl_cfg iwl9560_2ac_cfg_soc;
548extern const struct iwl_cfg iwl9560_2ac_160_cfg_soc; 552extern const struct iwl_cfg iwl9560_2ac_160_cfg_soc;
549extern const struct iwl_cfg iwl9560_killer_2ac_cfg_soc; 553extern const struct iwl_cfg iwl9560_killer_2ac_cfg_soc;
550extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc; 554extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc;
555extern const struct iwl_cfg iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc;
556extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc;
551extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk; 557extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk;
552extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk; 558extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk;
553extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk; 559extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk;
@@ -562,6 +568,10 @@ extern const struct iwl_cfg iwl_ax101_cfg_qu_hr;
562extern const struct iwl_cfg iwl_ax101_cfg_quz_hr; 568extern const struct iwl_cfg iwl_ax101_cfg_quz_hr;
563extern const struct iwl_cfg iwl22000_2ax_cfg_hr; 569extern const struct iwl_cfg iwl22000_2ax_cfg_hr;
564extern const struct iwl_cfg iwl_ax200_cfg_cc; 570extern const struct iwl_cfg iwl_ax200_cfg_cc;
571extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;
572extern const struct iwl_cfg iwl_ax201_cfg_quz_hr;
573extern const struct iwl_cfg iwl_ax1650i_cfg_quz_hr;
574extern const struct iwl_cfg iwl_ax1650s_cfg_quz_hr;
565extern const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0; 575extern const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0;
566extern const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0; 576extern const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0;
567extern const struct iwl_cfg killer1650x_2ax_cfg; 577extern const struct iwl_cfg killer1650x_2ax_cfg;
@@ -580,9 +590,9 @@ extern const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0;
580extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0; 590extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0;
581extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0; 591extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0;
582extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0; 592extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0;
583extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0; 593extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0;
584extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0; 594extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0;
585extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0; 595extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0;
586#endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */ 596#endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */
587 597
588#endif /* __IWL_CONFIG_H__ */ 598#endif /* __IWL_CONFIG_H__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index 553554846009..93da96a7247c 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -336,6 +336,7 @@ enum {
336/* RF_ID value */ 336/* RF_ID value */
337#define CSR_HW_RF_ID_TYPE_JF (0x00105100) 337#define CSR_HW_RF_ID_TYPE_JF (0x00105100)
338#define CSR_HW_RF_ID_TYPE_HR (0x0010A000) 338#define CSR_HW_RF_ID_TYPE_HR (0x0010A000)
339#define CSR_HW_RF_ID_TYPE_HR1 (0x0010c100)
339#define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00) 340#define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00)
340#define CSR_HW_RF_ID_TYPE_GF (0x0010D000) 341#define CSR_HW_RF_ID_TYPE_GF (0x0010D000)
341#define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000) 342#define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index cd035061cdd5..ccc83fd74649 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -513,62 +513,56 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
513 {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)}, 513 {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)},
514 514
515/* 9000 Series */ 515/* 9000 Series */
516 {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 516 {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
517 {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_soc)}, 517 {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
518 {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 518 {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
519 {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 519 {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
520 {IWL_PCI_DEVICE(0x02F0, 0x0040, iwl_ax101_cfg_qu_hr)}, 520 {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
521 {IWL_PCI_DEVICE(0x02F0, 0x0044, iwl_ax101_cfg_qu_hr)}, 521 {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
522 {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_soc)}, 522 {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
523 {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_soc)}, 523 {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
524 {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_soc)}, 524 {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
525 {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_soc)}, 525 {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
526 {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_soc)}, 526 {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
527 {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_soc)}, 527 {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
528 {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_soc)}, 528 {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
529 {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_soc)}, 529 {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
530 {IWL_PCI_DEVICE(0x02F0, 0x0244, iwl_ax101_cfg_qu_hr)}, 530 {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
531 {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_soc)}, 531 {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
532 {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_soc)}, 532 {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)},
533 {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_soc)}, 533 {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)},
534 {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_soc)}, 534 {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
535 {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 535 {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
536 {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 536 {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
537 {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 537 {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
538 {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 538 {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
539 {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 539 {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
540 {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 540 {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
541 {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_soc)}, 541 {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
542 {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_soc)}, 542 {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
543 {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_soc)}, 543 {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
544 {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 544 {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
545 {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_soc)}, 545 {IWL_PCI_DEVICE(0x06F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
546 {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 546 {IWL_PCI_DEVICE(0x06F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
547 {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 547 {IWL_PCI_DEVICE(0x06F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
548 {IWL_PCI_DEVICE(0x06F0, 0x0040, iwl_ax101_cfg_qu_hr)}, 548 {IWL_PCI_DEVICE(0x06F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
549 {IWL_PCI_DEVICE(0x06F0, 0x0044, iwl_ax101_cfg_qu_hr)}, 549 {IWL_PCI_DEVICE(0x06F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
550 {IWL_PCI_DEVICE(0x06F0, 0x0060, iwl9461_2ac_cfg_soc)}, 550 {IWL_PCI_DEVICE(0x06F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
551 {IWL_PCI_DEVICE(0x06F0, 0x0064, iwl9461_2ac_cfg_soc)}, 551 {IWL_PCI_DEVICE(0x06F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
552 {IWL_PCI_DEVICE(0x06F0, 0x00A0, iwl9462_2ac_cfg_soc)}, 552 {IWL_PCI_DEVICE(0x06F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
553 {IWL_PCI_DEVICE(0x06F0, 0x00A4, iwl9462_2ac_cfg_soc)}, 553 {IWL_PCI_DEVICE(0x06F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
554 {IWL_PCI_DEVICE(0x06F0, 0x0230, iwl9560_2ac_cfg_soc)}, 554 {IWL_PCI_DEVICE(0x06F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
555 {IWL_PCI_DEVICE(0x06F0, 0x0234, iwl9560_2ac_cfg_soc)}, 555 {IWL_PCI_DEVICE(0x06F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
556 {IWL_PCI_DEVICE(0x06F0, 0x0238, iwl9560_2ac_cfg_soc)}, 556 {IWL_PCI_DEVICE(0x06F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
557 {IWL_PCI_DEVICE(0x06F0, 0x023C, iwl9560_2ac_cfg_soc)}, 557 {IWL_PCI_DEVICE(0x06F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)},
558 {IWL_PCI_DEVICE(0x06F0, 0x0244, iwl_ax101_cfg_qu_hr)}, 558 {IWL_PCI_DEVICE(0x06F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)},
559 {IWL_PCI_DEVICE(0x06F0, 0x0260, iwl9461_2ac_cfg_soc)}, 559 {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
560 {IWL_PCI_DEVICE(0x06F0, 0x0264, iwl9461_2ac_cfg_soc)}, 560 {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
561 {IWL_PCI_DEVICE(0x06F0, 0x02A0, iwl9462_2ac_cfg_soc)}, 561 {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
562 {IWL_PCI_DEVICE(0x06F0, 0x02A4, iwl9462_2ac_cfg_soc)}, 562 {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
563 {IWL_PCI_DEVICE(0x06F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 563 {IWL_PCI_DEVICE(0x06F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
564 {IWL_PCI_DEVICE(0x06F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 564 {IWL_PCI_DEVICE(0x06F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
565 {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 565 {IWL_PCI_DEVICE(0x06F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
566 {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_160_cfg_soc)},
567 {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_160_cfg_soc)},
568 {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_160_cfg_soc)},
569 {IWL_PCI_DEVICE(0x06F0, 0x40A4, iwl9462_2ac_cfg_soc)},
570 {IWL_PCI_DEVICE(0x06F0, 0x4234, iwl9560_2ac_cfg_soc)},
571 {IWL_PCI_DEVICE(0x06F0, 0x42A4, iwl9462_2ac_cfg_soc)},
572 {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_160_cfg)}, 566 {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_160_cfg)},
573 {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_160_cfg)}, 567 {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_160_cfg)},
574 {IWL_PCI_DEVICE(0x2526, 0x0018, iwl9260_2ac_160_cfg)}, 568 {IWL_PCI_DEVICE(0x2526, 0x0018, iwl9260_2ac_160_cfg)},
@@ -621,7 +615,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
621 {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_160_cfg)}, 615 {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_160_cfg)},
622 {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_160_cfg)}, 616 {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_160_cfg)},
623 {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_160_cfg)}, 617 {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_160_cfg)},
624 {IWL_PCI_DEVICE(0x2720, 0x0044, iwl_ax101_cfg_qu_hr)},
625 {IWL_PCI_DEVICE(0x2720, 0x0060, iwl9461_2ac_cfg_soc)}, 618 {IWL_PCI_DEVICE(0x2720, 0x0060, iwl9461_2ac_cfg_soc)},
626 {IWL_PCI_DEVICE(0x2720, 0x0064, iwl9461_2ac_cfg_soc)}, 619 {IWL_PCI_DEVICE(0x2720, 0x0064, iwl9461_2ac_cfg_soc)},
627 {IWL_PCI_DEVICE(0x2720, 0x00A0, iwl9462_2ac_cfg_soc)}, 620 {IWL_PCI_DEVICE(0x2720, 0x00A0, iwl9462_2ac_cfg_soc)},
@@ -630,7 +623,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
630 {IWL_PCI_DEVICE(0x2720, 0x0234, iwl9560_2ac_cfg)}, 623 {IWL_PCI_DEVICE(0x2720, 0x0234, iwl9560_2ac_cfg)},
631 {IWL_PCI_DEVICE(0x2720, 0x0238, iwl9560_2ac_cfg)}, 624 {IWL_PCI_DEVICE(0x2720, 0x0238, iwl9560_2ac_cfg)},
632 {IWL_PCI_DEVICE(0x2720, 0x023C, iwl9560_2ac_cfg)}, 625 {IWL_PCI_DEVICE(0x2720, 0x023C, iwl9560_2ac_cfg)},
633 {IWL_PCI_DEVICE(0x2720, 0x0244, iwl_ax101_cfg_qu_hr)},
634 {IWL_PCI_DEVICE(0x2720, 0x0260, iwl9461_2ac_cfg_soc)}, 626 {IWL_PCI_DEVICE(0x2720, 0x0260, iwl9461_2ac_cfg_soc)},
635 {IWL_PCI_DEVICE(0x2720, 0x0264, iwl9461_2ac_cfg_soc)}, 627 {IWL_PCI_DEVICE(0x2720, 0x0264, iwl9461_2ac_cfg_soc)},
636 {IWL_PCI_DEVICE(0x2720, 0x02A0, iwl9462_2ac_cfg_soc)}, 628 {IWL_PCI_DEVICE(0x2720, 0x02A0, iwl9462_2ac_cfg_soc)},
@@ -708,7 +700,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
708 {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 700 {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)},
709 {IWL_PCI_DEVICE(0x34F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 701 {IWL_PCI_DEVICE(0x34F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)},
710 {IWL_PCI_DEVICE(0x34F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 702 {IWL_PCI_DEVICE(0x34F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)},
711 {IWL_PCI_DEVICE(0x34F0, 0x0044, iwl_ax101_cfg_qu_hr)},
712 {IWL_PCI_DEVICE(0x34F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 703 {IWL_PCI_DEVICE(0x34F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)},
713 {IWL_PCI_DEVICE(0x34F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 704 {IWL_PCI_DEVICE(0x34F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)},
714 {IWL_PCI_DEVICE(0x34F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, 705 {IWL_PCI_DEVICE(0x34F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)},
@@ -717,7 +708,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
717 {IWL_PCI_DEVICE(0x34F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 708 {IWL_PCI_DEVICE(0x34F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)},
718 {IWL_PCI_DEVICE(0x34F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 709 {IWL_PCI_DEVICE(0x34F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)},
719 {IWL_PCI_DEVICE(0x34F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 710 {IWL_PCI_DEVICE(0x34F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)},
720 {IWL_PCI_DEVICE(0x34F0, 0x0244, iwl_ax101_cfg_qu_hr)},
721 {IWL_PCI_DEVICE(0x34F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 711 {IWL_PCI_DEVICE(0x34F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)},
722 {IWL_PCI_DEVICE(0x34F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 712 {IWL_PCI_DEVICE(0x34F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)},
723 {IWL_PCI_DEVICE(0x34F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, 713 {IWL_PCI_DEVICE(0x34F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)},
@@ -764,7 +754,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
764 {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)}, 754 {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)},
765 {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 755 {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
766 {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 756 {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
767 {IWL_PCI_DEVICE(0x43F0, 0x0044, iwl_ax101_cfg_qu_hr)},
768 {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)}, 757 {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)},
769 {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)}, 758 {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)},
770 {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)}, 759 {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)},
@@ -773,7 +762,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
773 {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)}, 762 {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)},
774 {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)}, 763 {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)},
775 {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)}, 764 {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)},
776 {IWL_PCI_DEVICE(0x43F0, 0x0244, iwl_ax101_cfg_qu_hr)},
777 {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)}, 765 {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)},
778 {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)}, 766 {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)},
779 {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)}, 767 {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)},
@@ -833,7 +821,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
833 {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)}, 821 {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)},
834 {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 822 {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
835 {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 823 {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
836 {IWL_PCI_DEVICE(0xA0F0, 0x0044, iwl_ax101_cfg_qu_hr)},
837 {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)}, 824 {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)},
838 {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)}, 825 {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)},
839 {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)}, 826 {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)},
@@ -842,7 +829,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
842 {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)}, 829 {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)},
843 {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)}, 830 {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)},
844 {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)}, 831 {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)},
845 {IWL_PCI_DEVICE(0xA0F0, 0x0244, iwl_ax101_cfg_qu_hr)},
846 {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)}, 832 {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)},
847 {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)}, 833 {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)},
848 {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)}, 834 {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)},
@@ -890,63 +876,80 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
890 {IWL_PCI_DEVICE(0x2720, 0x0030, iwl9560_2ac_cfg_qnj_jf_b0)}, 876 {IWL_PCI_DEVICE(0x2720, 0x0030, iwl9560_2ac_cfg_qnj_jf_b0)},
891 877
892/* 22000 Series */ 878/* 22000 Series */
893 {IWL_PCI_DEVICE(0x02F0, 0x0070, iwl_ax101_cfg_qu_hr)}, 879 {IWL_PCI_DEVICE(0x02F0, 0x0070, iwl_ax201_cfg_quz_hr)},
894 {IWL_PCI_DEVICE(0x02F0, 0x0074, iwl_ax101_cfg_qu_hr)}, 880 {IWL_PCI_DEVICE(0x02F0, 0x0074, iwl_ax201_cfg_quz_hr)},
895 {IWL_PCI_DEVICE(0x02F0, 0x0078, iwl_ax101_cfg_qu_hr)}, 881 {IWL_PCI_DEVICE(0x02F0, 0x0078, iwl_ax201_cfg_quz_hr)},
896 {IWL_PCI_DEVICE(0x02F0, 0x007C, iwl_ax101_cfg_qu_hr)}, 882 {IWL_PCI_DEVICE(0x02F0, 0x007C, iwl_ax201_cfg_quz_hr)},
897 {IWL_PCI_DEVICE(0x02F0, 0x0310, iwl_ax101_cfg_qu_hr)}, 883 {IWL_PCI_DEVICE(0x02F0, 0x0244, iwl_ax101_cfg_quz_hr)},
898 {IWL_PCI_DEVICE(0x02F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 884 {IWL_PCI_DEVICE(0x02F0, 0x0310, iwl_ax201_cfg_quz_hr)},
899 {IWL_PCI_DEVICE(0x02F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 885 {IWL_PCI_DEVICE(0x02F0, 0x1651, iwl_ax1650s_cfg_quz_hr)},
900 {IWL_PCI_DEVICE(0x02F0, 0x4070, iwl_ax101_cfg_qu_hr)}, 886 {IWL_PCI_DEVICE(0x02F0, 0x1652, iwl_ax1650i_cfg_quz_hr)},
901 {IWL_PCI_DEVICE(0x06F0, 0x0070, iwl_ax101_cfg_qu_hr)}, 887 {IWL_PCI_DEVICE(0x02F0, 0x2074, iwl_ax201_cfg_quz_hr)},
902 {IWL_PCI_DEVICE(0x06F0, 0x0074, iwl_ax101_cfg_qu_hr)}, 888 {IWL_PCI_DEVICE(0x02F0, 0x4070, iwl_ax201_cfg_quz_hr)},
903 {IWL_PCI_DEVICE(0x06F0, 0x0078, iwl_ax101_cfg_qu_hr)}, 889 {IWL_PCI_DEVICE(0x02F0, 0x4244, iwl_ax101_cfg_quz_hr)},
904 {IWL_PCI_DEVICE(0x06F0, 0x007C, iwl_ax101_cfg_qu_hr)}, 890 {IWL_PCI_DEVICE(0x06F0, 0x0070, iwl_ax201_cfg_quz_hr)},
905 {IWL_PCI_DEVICE(0x06F0, 0x0310, iwl_ax101_cfg_qu_hr)}, 891 {IWL_PCI_DEVICE(0x06F0, 0x0074, iwl_ax201_cfg_quz_hr)},
906 {IWL_PCI_DEVICE(0x06F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 892 {IWL_PCI_DEVICE(0x06F0, 0x0078, iwl_ax201_cfg_quz_hr)},
907 {IWL_PCI_DEVICE(0x06F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 893 {IWL_PCI_DEVICE(0x06F0, 0x007C, iwl_ax201_cfg_quz_hr)},
908 {IWL_PCI_DEVICE(0x06F0, 0x4070, iwl_ax101_cfg_qu_hr)}, 894 {IWL_PCI_DEVICE(0x06F0, 0x0244, iwl_ax101_cfg_quz_hr)},
895 {IWL_PCI_DEVICE(0x06F0, 0x0310, iwl_ax201_cfg_quz_hr)},
896 {IWL_PCI_DEVICE(0x06F0, 0x1651, iwl_ax1650s_cfg_quz_hr)},
897 {IWL_PCI_DEVICE(0x06F0, 0x1652, iwl_ax1650i_cfg_quz_hr)},
898 {IWL_PCI_DEVICE(0x06F0, 0x2074, iwl_ax201_cfg_quz_hr)},
899 {IWL_PCI_DEVICE(0x06F0, 0x4070, iwl_ax201_cfg_quz_hr)},
900 {IWL_PCI_DEVICE(0x06F0, 0x4244, iwl_ax101_cfg_quz_hr)},
909 {IWL_PCI_DEVICE(0x2720, 0x0000, iwl_ax101_cfg_qu_hr)}, 901 {IWL_PCI_DEVICE(0x2720, 0x0000, iwl_ax101_cfg_qu_hr)},
910 {IWL_PCI_DEVICE(0x2720, 0x0040, iwl_ax101_cfg_qu_hr)}, 902 {IWL_PCI_DEVICE(0x2720, 0x0040, iwl_ax101_cfg_qu_hr)},
911 {IWL_PCI_DEVICE(0x2720, 0x0070, iwl22000_2ac_cfg_hr_cdb)}, 903 {IWL_PCI_DEVICE(0x2720, 0x0044, iwl_ax101_cfg_qu_hr)},
912 {IWL_PCI_DEVICE(0x2720, 0x0074, iwl_ax101_cfg_qu_hr)}, 904 {IWL_PCI_DEVICE(0x2720, 0x0070, iwl_ax201_cfg_qu_hr)},
913 {IWL_PCI_DEVICE(0x2720, 0x0078, iwl_ax101_cfg_qu_hr)}, 905 {IWL_PCI_DEVICE(0x2720, 0x0074, iwl_ax201_cfg_qu_hr)},
914 {IWL_PCI_DEVICE(0x2720, 0x007C, iwl_ax101_cfg_qu_hr)}, 906 {IWL_PCI_DEVICE(0x2720, 0x0078, iwl_ax201_cfg_qu_hr)},
907 {IWL_PCI_DEVICE(0x2720, 0x007C, iwl_ax201_cfg_qu_hr)},
915 {IWL_PCI_DEVICE(0x2720, 0x0090, iwl22000_2ac_cfg_hr_cdb)}, 908 {IWL_PCI_DEVICE(0x2720, 0x0090, iwl22000_2ac_cfg_hr_cdb)},
916 {IWL_PCI_DEVICE(0x2720, 0x0310, iwl22000_2ac_cfg_hr_cdb)}, 909 {IWL_PCI_DEVICE(0x2720, 0x0244, iwl_ax101_cfg_qu_hr)},
917 {IWL_PCI_DEVICE(0x2720, 0x0A10, iwl22000_2ac_cfg_hr_cdb)}, 910 {IWL_PCI_DEVICE(0x2720, 0x0310, iwl_ax201_cfg_qu_hr)},
911 {IWL_PCI_DEVICE(0x2720, 0x0A10, iwl_ax201_cfg_qu_hr)},
918 {IWL_PCI_DEVICE(0x2720, 0x1080, iwl_ax101_cfg_qu_hr)}, 912 {IWL_PCI_DEVICE(0x2720, 0x1080, iwl_ax101_cfg_qu_hr)},
919 {IWL_PCI_DEVICE(0x2720, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 913 {IWL_PCI_DEVICE(0x2720, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
920 {IWL_PCI_DEVICE(0x2720, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 914 {IWL_PCI_DEVICE(0x2720, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
921 {IWL_PCI_DEVICE(0x2720, 0x4070, iwl_ax101_cfg_qu_hr)}, 915 {IWL_PCI_DEVICE(0x2720, 0x2074, iwl_ax201_cfg_qu_hr)},
922 {IWL_PCI_DEVICE(0x34F0, 0x0040, iwl_ax101_cfg_qu_hr)}, 916 {IWL_PCI_DEVICE(0x2720, 0x4070, iwl_ax201_cfg_qu_hr)},
923 {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl_ax101_cfg_qu_hr)}, 917 {IWL_PCI_DEVICE(0x2720, 0x4244, iwl_ax101_cfg_qu_hr)},
924 {IWL_PCI_DEVICE(0x34F0, 0x0074, iwl_ax101_cfg_qu_hr)}, 918 {IWL_PCI_DEVICE(0x34F0, 0x0044, iwl_ax101_cfg_qu_hr)},
925 {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl_ax101_cfg_qu_hr)}, 919 {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl_ax201_cfg_qu_hr)},
926 {IWL_PCI_DEVICE(0x34F0, 0x007C, iwl_ax101_cfg_qu_hr)}, 920 {IWL_PCI_DEVICE(0x34F0, 0x0074, iwl_ax201_cfg_qu_hr)},
927 {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl_ax101_cfg_qu_hr)}, 921 {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl_ax201_cfg_qu_hr)},
922 {IWL_PCI_DEVICE(0x34F0, 0x007C, iwl_ax201_cfg_qu_hr)},
923 {IWL_PCI_DEVICE(0x34F0, 0x0244, iwl_ax101_cfg_qu_hr)},
924 {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl_ax201_cfg_qu_hr)},
928 {IWL_PCI_DEVICE(0x34F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 925 {IWL_PCI_DEVICE(0x34F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
929 {IWL_PCI_DEVICE(0x34F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 926 {IWL_PCI_DEVICE(0x34F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
930 {IWL_PCI_DEVICE(0x34F0, 0x4070, iwl_ax101_cfg_qu_hr)}, 927 {IWL_PCI_DEVICE(0x34F0, 0x2074, iwl_ax201_cfg_qu_hr)},
931 {IWL_PCI_DEVICE(0x43F0, 0x0040, iwl_ax101_cfg_qu_hr)}, 928 {IWL_PCI_DEVICE(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr)},
932 {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl_ax101_cfg_qu_hr)}, 929 {IWL_PCI_DEVICE(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr)},
933 {IWL_PCI_DEVICE(0x43F0, 0x0074, iwl_ax101_cfg_qu_hr)}, 930 {IWL_PCI_DEVICE(0x43F0, 0x0044, iwl_ax101_cfg_qu_hr)},
934 {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl_ax101_cfg_qu_hr)}, 931 {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl_ax201_cfg_qu_hr)},
935 {IWL_PCI_DEVICE(0x43F0, 0x007C, iwl_ax101_cfg_qu_hr)}, 932 {IWL_PCI_DEVICE(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr)},
933 {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr)},
934 {IWL_PCI_DEVICE(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr)},
935 {IWL_PCI_DEVICE(0x43F0, 0x0244, iwl_ax101_cfg_qu_hr)},
936 {IWL_PCI_DEVICE(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 936 {IWL_PCI_DEVICE(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
937 {IWL_PCI_DEVICE(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 937 {IWL_PCI_DEVICE(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
938 {IWL_PCI_DEVICE(0x43F0, 0x4070, iwl_ax101_cfg_qu_hr)}, 938 {IWL_PCI_DEVICE(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr)},
939 {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwl_ax101_cfg_qu_hr)}, 939 {IWL_PCI_DEVICE(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr)},
940 {IWL_PCI_DEVICE(0xA0F0, 0x0040, iwl_ax101_cfg_qu_hr)}, 940 {IWL_PCI_DEVICE(0x43F0, 0x4244, iwl_ax101_cfg_qu_hr)},
941 {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl_ax101_cfg_qu_hr)}, 941 {IWL_PCI_DEVICE(0xA0F0, 0x0044, iwl_ax101_cfg_qu_hr)},
942 {IWL_PCI_DEVICE(0xA0F0, 0x0074, iwl_ax101_cfg_qu_hr)}, 942 {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr)},
943 {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl_ax101_cfg_qu_hr)}, 943 {IWL_PCI_DEVICE(0xA0F0, 0x0074, iwl_ax201_cfg_qu_hr)},
944 {IWL_PCI_DEVICE(0xA0F0, 0x007C, iwl_ax101_cfg_qu_hr)}, 944 {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl_ax201_cfg_qu_hr)},
945 {IWL_PCI_DEVICE(0xA0F0, 0x00B0, iwl_ax101_cfg_qu_hr)}, 945 {IWL_PCI_DEVICE(0xA0F0, 0x007C, iwl_ax201_cfg_qu_hr)},
946 {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl_ax101_cfg_qu_hr)}, 946 {IWL_PCI_DEVICE(0xA0F0, 0x0244, iwl_ax101_cfg_qu_hr)},
947 {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl_ax201_cfg_qu_hr)},
947 {IWL_PCI_DEVICE(0xA0F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 948 {IWL_PCI_DEVICE(0xA0F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
948 {IWL_PCI_DEVICE(0xA0F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 949 {IWL_PCI_DEVICE(0xA0F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
949 {IWL_PCI_DEVICE(0xA0F0, 0x4070, iwl_ax101_cfg_qu_hr)}, 950 {IWL_PCI_DEVICE(0xA0F0, 0x2074, iwl_ax201_cfg_qu_hr)},
951 {IWL_PCI_DEVICE(0xA0F0, 0x4070, iwl_ax201_cfg_qu_hr)},
952 {IWL_PCI_DEVICE(0xA0F0, 0x4244, iwl_ax101_cfg_qu_hr)},
950 953
951 {IWL_PCI_DEVICE(0x2723, 0x0080, iwl_ax200_cfg_cc)}, 954 {IWL_PCI_DEVICE(0x2723, 0x0080, iwl_ax200_cfg_cc)},
952 {IWL_PCI_DEVICE(0x2723, 0x0084, iwl_ax200_cfg_cc)}, 955 {IWL_PCI_DEVICE(0x2723, 0x0084, iwl_ax200_cfg_cc)},
@@ -958,13 +961,19 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
958 {IWL_PCI_DEVICE(0x2723, 0x4080, iwl_ax200_cfg_cc)}, 961 {IWL_PCI_DEVICE(0x2723, 0x4080, iwl_ax200_cfg_cc)},
959 {IWL_PCI_DEVICE(0x2723, 0x4088, iwl_ax200_cfg_cc)}, 962 {IWL_PCI_DEVICE(0x2723, 0x4088, iwl_ax200_cfg_cc)},
960 963
961 {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, 964 {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
962 {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, 965 {IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_ty_gf_a0)},
963 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax210_2ax_cfg_so_hr_a0)}, 966 {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},
964 {IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_so_hr_a0)}, 967 {IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},
965 {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_so_hr_a0)}, 968 {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},
966 {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_so_hr_a0)}, 969 {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)},
967 {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax210_2ax_cfg_so_hr_a0)}, 970 {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
971 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
972 {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
973 {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
974 {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
975 {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
976 {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
968 977
969#endif /* CONFIG_IWLMVM */ 978#endif /* CONFIG_IWLMVM */
970 979
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 602c31b3992a..f5df5b370d78 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -3571,15 +3571,17 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
3571 trans->cfg = &iwlax210_2ax_cfg_so_jf_a0; 3571 trans->cfg = &iwlax210_2ax_cfg_so_jf_a0;
3572 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3572 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3573 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF)) { 3573 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF)) {
3574 trans->cfg = &iwlax210_2ax_cfg_so_gf_a0; 3574 trans->cfg = &iwlax211_2ax_cfg_so_gf_a0;
3575 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3575 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3576 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) { 3576 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) {
3577 trans->cfg = &iwlax210_2ax_cfg_so_gf4_a0; 3577 trans->cfg = &iwlax411_2ax_cfg_so_gf4_a0;
3578 } 3578 }
3579 } else if (cfg == &iwl_ax101_cfg_qu_hr) { 3579 } else if (cfg == &iwl_ax101_cfg_qu_hr) {
3580 if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3580 if ((CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3581 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && 3581 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
3582 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0) { 3582 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0) ||
3583 (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3584 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR1))) {
3583 trans->cfg = &iwl22000_2ax_cfg_qnj_hr_b0; 3585 trans->cfg = &iwl22000_2ax_cfg_qnj_hr_b0;
3584 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3586 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3585 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) { 3587 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) {
@@ -3601,8 +3603,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
3601 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3603 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3602 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && 3604 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
3603 ((trans->cfg != &iwl_ax200_cfg_cc && 3605 ((trans->cfg != &iwl_ax200_cfg_cc &&
3604 trans->cfg != &killer1650x_2ax_cfg && 3606 trans->cfg != &killer1650x_2ax_cfg &&
3605 trans->cfg != &killer1650w_2ax_cfg) || 3607 trans->cfg != &killer1650w_2ax_cfg &&
3608 trans->cfg != &iwl_ax201_cfg_quz_hr) ||
3606 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) { 3609 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) {
3607 u32 hw_status; 3610 u32 hw_status;
3608 3611
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index b73f99dc5a72..1fb76d2f5d3f 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -1759,9 +1759,10 @@ struct mwifiex_ie_types_wmm_queue_status {
1759struct ieee_types_vendor_header { 1759struct ieee_types_vendor_header {
1760 u8 element_id; 1760 u8 element_id;
1761 u8 len; 1761 u8 len;
1762 u8 oui[4]; /* 0~2: oui, 3: oui_type */ 1762 struct {
1763 u8 oui_subtype; 1763 u8 oui[3];
1764 u8 version; 1764 u8 oui_type;
1765 } __packed oui;
1765} __packed; 1766} __packed;
1766 1767
1767struct ieee_types_wmm_parameter { 1768struct ieee_types_wmm_parameter {
@@ -1775,6 +1776,9 @@ struct ieee_types_wmm_parameter {
1775 * Version [1] 1776 * Version [1]
1776 */ 1777 */
1777 struct ieee_types_vendor_header vend_hdr; 1778 struct ieee_types_vendor_header vend_hdr;
1779 u8 oui_subtype;
1780 u8 version;
1781
1778 u8 qos_info_bitmap; 1782 u8 qos_info_bitmap;
1779 u8 reserved; 1783 u8 reserved;
1780 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS]; 1784 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
@@ -1792,6 +1796,8 @@ struct ieee_types_wmm_info {
1792 * Version [1] 1796 * Version [1]
1793 */ 1797 */
1794 struct ieee_types_vendor_header vend_hdr; 1798 struct ieee_types_vendor_header vend_hdr;
1799 u8 oui_subtype;
1800 u8 version;
1795 1801
1796 u8 qos_info_bitmap; 1802 u8 qos_info_bitmap;
1797} __packed; 1803} __packed;
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index d870d4b2e03d..0d6d41727037 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -1361,21 +1361,25 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
1361 break; 1361 break;
1362 1362
1363 case WLAN_EID_VENDOR_SPECIFIC: 1363 case WLAN_EID_VENDOR_SPECIFIC:
1364 if (element_len + 2 < sizeof(vendor_ie->vend_hdr))
1365 return -EINVAL;
1366
1367 vendor_ie = (struct ieee_types_vendor_specific *) 1364 vendor_ie = (struct ieee_types_vendor_specific *)
1368 current_ptr; 1365 current_ptr;
1369 1366
1370 if (!memcmp 1367 /* 802.11 requires at least 3-byte OUI. */
1371 (vendor_ie->vend_hdr.oui, wpa_oui, 1368 if (element_len < sizeof(vendor_ie->vend_hdr.oui.oui))
1372 sizeof(wpa_oui))) { 1369 return -EINVAL;
1370
1371 /* Not long enough for a match? Skip it. */
1372 if (element_len < sizeof(wpa_oui))
1373 break;
1374
1375 if (!memcmp(&vendor_ie->vend_hdr.oui, wpa_oui,
1376 sizeof(wpa_oui))) {
1373 bss_entry->bcn_wpa_ie = 1377 bss_entry->bcn_wpa_ie =
1374 (struct ieee_types_vendor_specific *) 1378 (struct ieee_types_vendor_specific *)
1375 current_ptr; 1379 current_ptr;
1376 bss_entry->wpa_offset = (u16) 1380 bss_entry->wpa_offset = (u16)
1377 (current_ptr - bss_entry->beacon_buf); 1381 (current_ptr - bss_entry->beacon_buf);
1378 } else if (!memcmp(vendor_ie->vend_hdr.oui, wmm_oui, 1382 } else if (!memcmp(&vendor_ie->vend_hdr.oui, wmm_oui,
1379 sizeof(wmm_oui))) { 1383 sizeof(wmm_oui))) {
1380 if (total_ie_len == 1384 if (total_ie_len ==
1381 sizeof(struct ieee_types_wmm_parameter) || 1385 sizeof(struct ieee_types_wmm_parameter) ||
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index ebc0e41e5d3b..74e50566db1f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -1351,7 +1351,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
1351 /* Test to see if it is a WPA IE, if not, then 1351 /* Test to see if it is a WPA IE, if not, then
1352 * it is a gen IE 1352 * it is a gen IE
1353 */ 1353 */
1354 if (!memcmp(pvendor_ie->oui, wpa_oui, 1354 if (!memcmp(&pvendor_ie->oui, wpa_oui,
1355 sizeof(wpa_oui))) { 1355 sizeof(wpa_oui))) {
1356 /* IE is a WPA/WPA2 IE so call set_wpa function 1356 /* IE is a WPA/WPA2 IE so call set_wpa function
1357 */ 1357 */
@@ -1361,7 +1361,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
1361 goto next_ie; 1361 goto next_ie;
1362 } 1362 }
1363 1363
1364 if (!memcmp(pvendor_ie->oui, wps_oui, 1364 if (!memcmp(&pvendor_ie->oui, wps_oui,
1365 sizeof(wps_oui))) { 1365 sizeof(wps_oui))) {
1366 /* Test to see if it is a WPS IE, 1366 /* Test to see if it is a WPS IE,
1367 * if so, enable wps session flag 1367 * if so, enable wps session flag
diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wireless/marvell/mwifiex/wmm.c
index 0301bc33f554..41f0231376c0 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -239,7 +239,7 @@ mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv,
239 mwifiex_dbg(priv->adapter, INFO, 239 mwifiex_dbg(priv->adapter, INFO,
240 "info: WMM Parameter IE: version=%d,\t" 240 "info: WMM Parameter IE: version=%d,\t"
241 "qos_info Parameter Set Count=%d, Reserved=%#x\n", 241 "qos_info Parameter Set Count=%d, Reserved=%#x\n",
242 wmm_ie->vend_hdr.version, wmm_ie->qos_info_bitmap & 242 wmm_ie->version, wmm_ie->qos_info_bitmap &
243 IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK, 243 IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK,
244 wmm_ie->reserved); 244 wmm_ie->reserved);
245 245
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 56bf93a8988e..989386ecb5e4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -30,6 +30,7 @@
30#define MT_TX_RING_SIZE 256 30#define MT_TX_RING_SIZE 256
31#define MT_MCU_RING_SIZE 32 31#define MT_MCU_RING_SIZE 32
32#define MT_RX_BUF_SIZE 2048 32#define MT_RX_BUF_SIZE 2048
33#define MT_SKB_HEAD_LEN 128
33 34
34struct mt76_dev; 35struct mt76_dev;
35struct mt76_wcid; 36struct mt76_wcid;
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 61b27f3ec6e4..fb87ce7fbdf6 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -429,6 +429,42 @@ static int mt76u_get_rx_entry_len(u8 *data, u32 data_len)
429 return dma_len; 429 return dma_len;
430} 430}
431 431
432static struct sk_buff *
433mt76u_build_rx_skb(void *data, int len, int buf_size)
434{
435 struct sk_buff *skb;
436
437 if (SKB_WITH_OVERHEAD(buf_size) < MT_DMA_HDR_LEN + len) {
438 struct page *page;
439
440 /* slow path, not enough space for data and
441 * skb_shared_info
442 */
443 skb = alloc_skb(MT_SKB_HEAD_LEN, GFP_ATOMIC);
444 if (!skb)
445 return NULL;
446
447 skb_put_data(skb, data + MT_DMA_HDR_LEN, MT_SKB_HEAD_LEN);
448 data += (MT_DMA_HDR_LEN + MT_SKB_HEAD_LEN);
449 page = virt_to_head_page(data);
450 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
451 page, data - page_address(page),
452 len - MT_SKB_HEAD_LEN, buf_size);
453
454 return skb;
455 }
456
457 /* fast path */
458 skb = build_skb(data, buf_size);
459 if (!skb)
460 return NULL;
461
462 skb_reserve(skb, MT_DMA_HDR_LEN);
463 __skb_put(skb, len);
464
465 return skb;
466}
467
432static int 468static int
433mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb) 469mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb)
434{ 470{
@@ -446,19 +482,11 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb)
446 return 0; 482 return 0;
447 483
448 data_len = min_t(int, len, data_len - MT_DMA_HDR_LEN); 484 data_len = min_t(int, len, data_len - MT_DMA_HDR_LEN);
449 if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) { 485 skb = mt76u_build_rx_skb(data, data_len, q->buf_size);
450 dev_err_ratelimited(dev->dev, "rx data too big %d\n", data_len);
451 return 0;
452 }
453
454 skb = build_skb(data, q->buf_size);
455 if (!skb) 486 if (!skb)
456 return 0; 487 return 0;
457 488
458 skb_reserve(skb, MT_DMA_HDR_LEN);
459 __skb_put(skb, data_len);
460 len -= data_len; 489 len -= data_len;
461
462 while (len > 0 && nsgs < urb->num_sgs) { 490 while (len > 0 && nsgs < urb->num_sgs) {
463 data_len = min_t(int, len, urb->sg[nsgs].length); 491 data_len = min_t(int, len, urb->sg[nsgs].length);
464 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, 492 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index a5e0604d3009..0b3cf8477c6c 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1847,44 +1847,6 @@ static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
1847 }, 1847 },
1848}; 1848};
1849 1849
1850static const struct ieee80211_iface_limit wl18xx_iface_ap_cl_limits[] = {
1851 {
1852 .max = 1,
1853 .types = BIT(NL80211_IFTYPE_STATION),
1854 },
1855 {
1856 .max = 1,
1857 .types = BIT(NL80211_IFTYPE_AP),
1858 },
1859 {
1860 .max = 1,
1861 .types = BIT(NL80211_IFTYPE_P2P_CLIENT),
1862 },
1863 {
1864 .max = 1,
1865 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1866 },
1867};
1868
1869static const struct ieee80211_iface_limit wl18xx_iface_ap_go_limits[] = {
1870 {
1871 .max = 1,
1872 .types = BIT(NL80211_IFTYPE_STATION),
1873 },
1874 {
1875 .max = 1,
1876 .types = BIT(NL80211_IFTYPE_AP),
1877 },
1878 {
1879 .max = 1,
1880 .types = BIT(NL80211_IFTYPE_P2P_GO),
1881 },
1882 {
1883 .max = 1,
1884 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1885 },
1886};
1887
1888static const struct ieee80211_iface_combination 1850static const struct ieee80211_iface_combination
1889wl18xx_iface_combinations[] = { 1851wl18xx_iface_combinations[] = {
1890 { 1852 {
diff --git a/include/linux/idr.h b/include/linux/idr.h
index ee7abae143d3..4ec8986e5dfb 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -191,14 +191,17 @@ static inline void idr_preload_end(void)
191 * idr_for_each_entry_ul() - Iterate over an IDR's elements of a given type. 191 * idr_for_each_entry_ul() - Iterate over an IDR's elements of a given type.
192 * @idr: IDR handle. 192 * @idr: IDR handle.
193 * @entry: The type * to use as cursor. 193 * @entry: The type * to use as cursor.
194 * @tmp: A temporary placeholder for ID.
194 * @id: Entry ID. 195 * @id: Entry ID.
195 * 196 *
196 * @entry and @id do not need to be initialized before the loop, and 197 * @entry and @id do not need to be initialized before the loop, and
197 * after normal termination @entry is left with the value NULL. This 198 * after normal termination @entry is left with the value NULL. This
198 * is convenient for a "not found" value. 199 * is convenient for a "not found" value.
199 */ 200 */
200#define idr_for_each_entry_ul(idr, entry, id) \ 201#define idr_for_each_entry_ul(idr, entry, tmp, id) \
201 for (id = 0; ((entry) = idr_get_next_ul(idr, &(id))) != NULL; ++id) 202 for (tmp = 0, id = 0; \
203 tmp <= id && ((entry) = idr_get_next_ul(idr, &(id))) != NULL; \
204 tmp = id, ++id)
202 205
203/** 206/**
204 * idr_for_each_entry_continue() - Continue iteration over an IDR's elements of a given type 207 * idr_for_each_entry_continue() - Continue iteration over an IDR's elements of a given type
@@ -213,6 +216,20 @@ static inline void idr_preload_end(void)
213 entry; \ 216 entry; \
214 ++id, (entry) = idr_get_next((idr), &(id))) 217 ++id, (entry) = idr_get_next((idr), &(id)))
215 218
219/**
220 * idr_for_each_entry_continue_ul() - Continue iteration over an IDR's elements of a given type
221 * @idr: IDR handle.
222 * @entry: The type * to use as a cursor.
223 * @tmp: A temporary placeholder for ID.
224 * @id: Entry ID.
225 *
226 * Continue to iterate over entries, continuing after the current position.
227 */
228#define idr_for_each_entry_continue_ul(idr, entry, tmp, id) \
229 for (tmp = id; \
230 tmp <= id && ((entry) = idr_get_next_ul(idr, &(id))) != NULL; \
231 tmp = id, ++id)
232
216/* 233/*
217 * IDA - ID Allocator, use when translation from id to pointer isn't necessary. 234 * IDA - ID Allocator, use when translation from id to pointer isn't necessary.
218 */ 235 */
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index 0fe57a261c9c..300ecdb6790a 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -109,12 +109,19 @@ struct phylink_mac_ops {
109 * Note that the PHY may be able to transform from one connection 109 * Note that the PHY may be able to transform from one connection
110 * technology to another, so, eg, don't clear 1000BaseX just 110 * technology to another, so, eg, don't clear 1000BaseX just
111 * because the MAC is unable to BaseX mode. This is more about 111 * because the MAC is unable to BaseX mode. This is more about
112 * clearing unsupported speeds and duplex settings. 112 * clearing unsupported speeds and duplex settings. The port modes
113 * should not be cleared; phylink_set_port_modes() will help with this.
113 * 114 *
114 * If the @state->interface mode is %PHY_INTERFACE_MODE_1000BASEX 115 * If the @state->interface mode is %PHY_INTERFACE_MODE_1000BASEX
115 * or %PHY_INTERFACE_MODE_2500BASEX, select the appropriate mode 116 * or %PHY_INTERFACE_MODE_2500BASEX, select the appropriate mode
116 * based on @state->advertising and/or @state->speed and update 117 * based on @state->advertising and/or @state->speed and update
117 * @state->interface accordingly. 118 * @state->interface accordingly. See phylink_helper_basex_speed().
119 *
120 * When @state->interface is %PHY_INTERFACE_MODE_NA, phylink expects the
121 * MAC driver to return all supported link modes.
122 *
123 * If the @state->interface mode is not supported, then the @supported
124 * mask must be cleared.
118 */ 125 */
119void validate(struct phylink_config *config, unsigned long *supported, 126void validate(struct phylink_config *config, unsigned long *supported,
120 struct phylink_link_state *state); 127 struct phylink_link_state *state);
diff --git a/include/net/dst.h b/include/net/dst.h
index 12b31c602cb0..fe62fe2eb781 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -183,7 +183,7 @@ static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
183} 183}
184 184
185/* Kernel-internal feature bits that are unallocated in user space. */ 185/* Kernel-internal feature bits that are unallocated in user space. */
186#define DST_FEATURE_ECN_CA (1 << 31) 186#define DST_FEATURE_ECN_CA (1U << 31)
187 187
188#define DST_FEATURE_MASK (DST_FEATURE_ECN_CA) 188#define DST_FEATURE_MASK (DST_FEATURE_ECN_CA)
189#define DST_FEATURE_ECN_MASK (DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN) 189#define DST_FEATURE_ECN_MASK (DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN)
@@ -302,8 +302,9 @@ static inline bool dst_hold_safe(struct dst_entry *dst)
302 * @skb: buffer 302 * @skb: buffer
303 * 303 *
304 * If dst is not yet refcounted and not destroyed, grab a ref on it. 304 * If dst is not yet refcounted and not destroyed, grab a ref on it.
305 * Returns true if dst is refcounted.
305 */ 306 */
306static inline void skb_dst_force(struct sk_buff *skb) 307static inline bool skb_dst_force(struct sk_buff *skb)
307{ 308{
308 if (skb_dst_is_noref(skb)) { 309 if (skb_dst_is_noref(skb)) {
309 struct dst_entry *dst = skb_dst(skb); 310 struct dst_entry *dst = skb_dst(skb);
@@ -314,6 +315,8 @@ static inline void skb_dst_force(struct sk_buff *skb)
314 315
315 skb->_skb_refdst = (unsigned long)dst; 316 skb->_skb_refdst = (unsigned long)dst;
316 } 317 }
318
319 return skb->_skb_refdst != 0UL;
317} 320}
318 321
319 322
diff --git a/include/net/gue.h b/include/net/gue.h
index fdad41469b65..3a6595bfa641 100644
--- a/include/net/gue.h
+++ b/include/net/gue.h
@@ -60,7 +60,7 @@ struct guehdr {
60 60
61/* Private flags in the private option extension */ 61/* Private flags in the private option extension */
62 62
63#define GUE_PFLAG_REMCSUM htonl(1 << 31) 63#define GUE_PFLAG_REMCSUM htonl(1U << 31)
64#define GUE_PLEN_REMCSUM 4 64#define GUE_PLEN_REMCSUM 4
65 65
66#define GUE_PFLAGS_ALL (GUE_PFLAG_REMCSUM) 66#define GUE_PFLAGS_ALL (GUE_PFLAG_REMCSUM)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index cb1ad0cc5c7b..3759167f91f5 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -810,11 +810,12 @@ struct ipvs_master_sync_state {
810 struct ip_vs_sync_buff *sync_buff; 810 struct ip_vs_sync_buff *sync_buff;
811 unsigned long sync_queue_len; 811 unsigned long sync_queue_len;
812 unsigned int sync_queue_delay; 812 unsigned int sync_queue_delay;
813 struct task_struct *master_thread;
814 struct delayed_work master_wakeup_work; 813 struct delayed_work master_wakeup_work;
815 struct netns_ipvs *ipvs; 814 struct netns_ipvs *ipvs;
816}; 815};
817 816
817struct ip_vs_sync_thread_data;
818
818/* How much time to keep dests in trash */ 819/* How much time to keep dests in trash */
819#define IP_VS_DEST_TRASH_PERIOD (120 * HZ) 820#define IP_VS_DEST_TRASH_PERIOD (120 * HZ)
820 821
@@ -945,7 +946,8 @@ struct netns_ipvs {
945 spinlock_t sync_lock; 946 spinlock_t sync_lock;
946 struct ipvs_master_sync_state *ms; 947 struct ipvs_master_sync_state *ms;
947 spinlock_t sync_buff_lock; 948 spinlock_t sync_buff_lock;
948 struct task_struct **backup_threads; 949 struct ip_vs_sync_thread_data *master_tinfo;
950 struct ip_vs_sync_thread_data *backup_tinfo;
949 int threads_mask; 951 int threads_mask;
950 volatile int sync_state; 952 volatile int sync_state;
951 struct mutex sync_mutex; 953 struct mutex sync_mutex;
diff --git a/include/net/tls.h b/include/net/tls.h
index 0279938386ab..176d0b039f32 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -347,6 +347,7 @@ struct tls_offload_context_rx {
347#define TLS_OFFLOAD_CONTEXT_SIZE_RX \ 347#define TLS_OFFLOAD_CONTEXT_SIZE_RX \
348 (sizeof(struct tls_offload_context_rx) + TLS_DRIVER_STATE_SIZE_RX) 348 (sizeof(struct tls_offload_context_rx) + TLS_DRIVER_STATE_SIZE_RX)
349 349
350void tls_ctx_free(struct tls_context *ctx);
350int wait_on_pending_writer(struct sock *sk, long *timeo); 351int wait_on_pending_writer(struct sock *sk, long *timeo);
351int tls_sk_query(struct sock *sk, int optname, char __user *optval, 352int tls_sk_query(struct sock *sk, int optname, char __user *optval,
352 int __user *optlen); 353 int __user *optlen);
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index de4e3a353df3..69796d264f06 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -59,6 +59,11 @@ struct xdp_sock {
59 struct list_head flush_node; 59 struct list_head flush_node;
60 u16 queue_id; 60 u16 queue_id;
61 bool zc; 61 bool zc;
62 enum {
63 XSK_READY = 0,
64 XSK_BOUND,
65 XSK_UNBOUND,
66 } state;
62 /* Protects multiple processes in the control path */ 67 /* Protects multiple processes in the control path */
63 struct mutex mutex; 68 struct mutex mutex;
64 struct xsk_queue *tx ____cacheline_aligned_in_smp; 69 struct xsk_queue *tx ____cacheline_aligned_in_smp;
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index d85816878a52..cc1d060cbf13 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -1379,7 +1379,7 @@ TRACE_EVENT(rxrpc_rx_eproto,
1379 ), 1379 ),
1380 1380
1381 TP_fast_assign( 1381 TP_fast_assign(
1382 __entry->call = call->debug_id; 1382 __entry->call = call ? call->debug_id : 0;
1383 __entry->serial = serial; 1383 __entry->serial = serial;
1384 __entry->why = why; 1384 __entry->why = why;
1385 ), 1385 ),
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c318385aba51..5695ab53e354 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3193,6 +3193,7 @@ struct bpf_prog_info {
3193 char name[BPF_OBJ_NAME_LEN]; 3193 char name[BPF_OBJ_NAME_LEN];
3194 __u32 ifindex; 3194 __u32 ifindex;
3195 __u32 gpl_compatible:1; 3195 __u32 gpl_compatible:1;
3196 __u32 :31; /* alignment pad */
3196 __u64 netns_dev; 3197 __u64 netns_dev;
3197 __u64 netns_ino; 3198 __u64 netns_ino;
3198 __u32 nr_jited_ksyms; 3199 __u32 nr_jited_ksyms;
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index 467b654bd4c7..3d884d68eb30 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -123,7 +123,7 @@ struct tpacket_auxdata {
123/* Rx and Tx ring - header status */ 123/* Rx and Tx ring - header status */
124#define TP_STATUS_TS_SOFTWARE (1 << 29) 124#define TP_STATUS_TS_SOFTWARE (1 << 29)
125#define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */ 125#define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */
126#define TP_STATUS_TS_RAW_HARDWARE (1 << 31) 126#define TP_STATUS_TS_RAW_HARDWARE (1U << 31)
127 127
128/* Rx ring - feature request bits */ 128/* Rx ring - feature request bits */
129#define TP_FT_REQ_FILL_RXHASH 0x1 129#define TP_FT_REQ_FILL_RXHASH 0x1
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 8fc3a43cac75..75758ec26c8b 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -5334,7 +5334,7 @@ enum nl80211_feature_flags {
5334 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28, 5334 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,
5335 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29, 5335 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,
5336 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30, 5336 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,
5337 NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1 << 31, 5337 NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1U << 31,
5338}; 5338};
5339 5339
5340/** 5340/**
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index cad09858a5f2..546ebee39e2a 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -1928,8 +1928,8 @@ static int btf_array_resolve(struct btf_verifier_env *env,
1928 /* Check array->index_type */ 1928 /* Check array->index_type */
1929 index_type_id = array->index_type; 1929 index_type_id = array->index_type;
1930 index_type = btf_type_by_id(btf, index_type_id); 1930 index_type = btf_type_by_id(btf, index_type_id);
1931 if (btf_type_is_resolve_source_only(index_type) || 1931 if (btf_type_nosize_or_null(index_type) ||
1932 btf_type_nosize_or_null(index_type)) { 1932 btf_type_is_resolve_source_only(index_type)) {
1933 btf_verifier_log_type(env, v->t, "Invalid index"); 1933 btf_verifier_log_type(env, v->t, "Invalid index");
1934 return -EINVAL; 1934 return -EINVAL;
1935 } 1935 }
@@ -1948,8 +1948,8 @@ static int btf_array_resolve(struct btf_verifier_env *env,
1948 /* Check array->type */ 1948 /* Check array->type */
1949 elem_type_id = array->type; 1949 elem_type_id = array->type;
1950 elem_type = btf_type_by_id(btf, elem_type_id); 1950 elem_type = btf_type_by_id(btf, elem_type_id);
1951 if (btf_type_is_resolve_source_only(elem_type) || 1951 if (btf_type_nosize_or_null(elem_type) ||
1952 btf_type_nosize_or_null(elem_type)) { 1952 btf_type_is_resolve_source_only(elem_type)) {
1953 btf_verifier_log_type(env, v->t, 1953 btf_verifier_log_type(env, v->t,
1954 "Invalid elem"); 1954 "Invalid elem");
1955 return -EINVAL; 1955 return -EINVAL;
@@ -2170,8 +2170,8 @@ static int btf_struct_resolve(struct btf_verifier_env *env,
2170 const struct btf_type *member_type = btf_type_by_id(env->btf, 2170 const struct btf_type *member_type = btf_type_by_id(env->btf,
2171 member_type_id); 2171 member_type_id);
2172 2172
2173 if (btf_type_is_resolve_source_only(member_type) || 2173 if (btf_type_nosize_or_null(member_type) ||
2174 btf_type_nosize_or_null(member_type)) { 2174 btf_type_is_resolve_source_only(member_type)) {
2175 btf_verifier_log_member(env, v->t, member, 2175 btf_verifier_log_member(env, v->t, member,
2176 "Invalid member"); 2176 "Invalid member");
2177 return -EINVAL; 2177 return -EINVAL;
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index e2c1b43728da..16079550db6d 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1364,10 +1364,10 @@ select_insn:
1364 insn++; 1364 insn++;
1365 CONT; 1365 CONT;
1366 ALU_ARSH_X: 1366 ALU_ARSH_X:
1367 DST = (u64) (u32) ((*(s32 *) &DST) >> SRC); 1367 DST = (u64) (u32) (((s32) DST) >> SRC);
1368 CONT; 1368 CONT;
1369 ALU_ARSH_K: 1369 ALU_ARSH_K:
1370 DST = (u64) (u32) ((*(s32 *) &DST) >> IMM); 1370 DST = (u64) (u32) (((s32) DST) >> IMM);
1371 CONT; 1371 CONT;
1372 ALU64_ARSH_X: 1372 ALU64_ARSH_X:
1373 (*(s64 *) &DST) >>= SRC; 1373 (*(s64 *) &DST) >>= SRC;
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index bd4138ddf7e0..240ed70912d6 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -2337,7 +2337,7 @@ batadv_iv_ogm_neigh_is_sob(struct batadv_neigh_node *neigh1,
2337 return ret; 2337 return ret;
2338} 2338}
2339 2339
2340static void batadv_iv_iface_activate(struct batadv_hard_iface *hard_iface) 2340static void batadv_iv_iface_enabled(struct batadv_hard_iface *hard_iface)
2341{ 2341{
2342 /* begin scheduling originator messages on that interface */ 2342 /* begin scheduling originator messages on that interface */
2343 batadv_iv_ogm_schedule(hard_iface); 2343 batadv_iv_ogm_schedule(hard_iface);
@@ -2683,8 +2683,8 @@ unlock:
2683static struct batadv_algo_ops batadv_batman_iv __read_mostly = { 2683static struct batadv_algo_ops batadv_batman_iv __read_mostly = {
2684 .name = "BATMAN_IV", 2684 .name = "BATMAN_IV",
2685 .iface = { 2685 .iface = {
2686 .activate = batadv_iv_iface_activate,
2687 .enable = batadv_iv_ogm_iface_enable, 2686 .enable = batadv_iv_ogm_iface_enable,
2687 .enabled = batadv_iv_iface_enabled,
2688 .disable = batadv_iv_ogm_iface_disable, 2688 .disable = batadv_iv_ogm_iface_disable,
2689 .update_mac = batadv_iv_ogm_iface_update_mac, 2689 .update_mac = batadv_iv_ogm_iface_update_mac,
2690 .primary_set = batadv_iv_ogm_primary_iface_set, 2690 .primary_set = batadv_iv_ogm_primary_iface_set,
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index b5465e6e380d..c90e47342bb0 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -796,6 +796,9 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
796 796
797 batadv_hardif_recalc_extra_skbroom(soft_iface); 797 batadv_hardif_recalc_extra_skbroom(soft_iface);
798 798
799 if (bat_priv->algo_ops->iface.enabled)
800 bat_priv->algo_ops->iface.enabled(hard_iface);
801
799out: 802out:
800 return 0; 803 return 0;
801 804
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 1ddfd5e011ee..8a482c5ec67b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -3813,6 +3813,8 @@ static void batadv_tt_purge(struct work_struct *work)
3813 */ 3813 */
3814void batadv_tt_free(struct batadv_priv *bat_priv) 3814void batadv_tt_free(struct batadv_priv *bat_priv)
3815{ 3815{
3816 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_ROAM, 1);
3817
3816 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1); 3818 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1);
3817 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1); 3819 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1);
3818 3820
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index c2996296b953..6ae139d74e0f 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -2170,6 +2170,9 @@ struct batadv_algo_iface_ops {
2170 /** @enable: init routing info when hard-interface is enabled */ 2170 /** @enable: init routing info when hard-interface is enabled */
2171 int (*enable)(struct batadv_hard_iface *hard_iface); 2171 int (*enable)(struct batadv_hard_iface *hard_iface);
2172 2172
2173 /** @enabled: notification when hard-interface was enabled (optional) */
2174 void (*enabled)(struct batadv_hard_iface *hard_iface);
2175
2173 /** @disable: de-init routing info when hard-interface is disabled */ 2176 /** @disable: de-init routing info when hard-interface is disabled */
2174 void (*disable)(struct batadv_hard_iface *hard_iface); 2177 void (*disable)(struct batadv_hard_iface *hard_iface);
2175 2178
diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
index 61ce8454a88e..77396a098fbe 100644
--- a/net/bpfilter/main.c
+++ b/net/bpfilter/main.c
@@ -55,7 +55,7 @@ static void loop(void)
55 55
56int main(void) 56int main(void)
57{ 57{
58 debug_fd = open("/dev/console", 00000002); 58 debug_fd = open("/dev/kmsg", 00000002);
59 dprintf(debug_fd, "Started bpfilter\n"); 59 dprintf(debug_fd, "Started bpfilter\n");
60 loop(); 60 loop();
61 close(debug_fd); 61 close(debug_fd);
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 512383d5e53f..09b1dd8cd853 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -74,7 +74,6 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
74 struct net_bridge_fdb_entry *dst = NULL; 74 struct net_bridge_fdb_entry *dst = NULL;
75 struct net_bridge_mdb_entry *mdst; 75 struct net_bridge_mdb_entry *mdst;
76 bool local_rcv, mcast_hit = false; 76 bool local_rcv, mcast_hit = false;
77 const unsigned char *dest;
78 struct net_bridge *br; 77 struct net_bridge *br;
79 u16 vid = 0; 78 u16 vid = 0;
80 79
@@ -92,10 +91,9 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
92 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, false); 91 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, false);
93 92
94 local_rcv = !!(br->dev->flags & IFF_PROMISC); 93 local_rcv = !!(br->dev->flags & IFF_PROMISC);
95 dest = eth_hdr(skb)->h_dest; 94 if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) {
96 if (is_multicast_ether_addr(dest)) {
97 /* by definition the broadcast is also a multicast address */ 95 /* by definition the broadcast is also a multicast address */
98 if (is_broadcast_ether_addr(dest)) { 96 if (is_broadcast_ether_addr(eth_hdr(skb)->h_dest)) {
99 pkt_type = BR_PKT_BROADCAST; 97 pkt_type = BR_PKT_BROADCAST;
100 local_rcv = true; 98 local_rcv = true;
101 } else { 99 } else {
@@ -145,7 +143,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
145 } 143 }
146 break; 144 break;
147 case BR_PKT_UNICAST: 145 case BR_PKT_UNICAST:
148 dst = br_fdb_find_rcu(br, dest, vid); 146 dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
149 default: 147 default:
150 break; 148 break;
151 } 149 }
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index de22c8fbbb15..3d8deac2353d 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -911,6 +911,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
911 int type; 911 int type;
912 int err = 0; 912 int err = 0;
913 __be32 group; 913 __be32 group;
914 u16 nsrcs;
914 915
915 ih = igmpv3_report_hdr(skb); 916 ih = igmpv3_report_hdr(skb);
916 num = ntohs(ih->ngrec); 917 num = ntohs(ih->ngrec);
@@ -924,8 +925,9 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
924 grec = (void *)(skb->data + len - sizeof(*grec)); 925 grec = (void *)(skb->data + len - sizeof(*grec));
925 group = grec->grec_mca; 926 group = grec->grec_mca;
926 type = grec->grec_type; 927 type = grec->grec_type;
928 nsrcs = ntohs(grec->grec_nsrcs);
927 929
928 len += ntohs(grec->grec_nsrcs) * 4; 930 len += nsrcs * 4;
929 if (!ip_mc_may_pull(skb, len)) 931 if (!ip_mc_may_pull(skb, len))
930 return -EINVAL; 932 return -EINVAL;
931 933
@@ -946,7 +948,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
946 src = eth_hdr(skb)->h_source; 948 src = eth_hdr(skb)->h_source;
947 if ((type == IGMPV3_CHANGE_TO_INCLUDE || 949 if ((type == IGMPV3_CHANGE_TO_INCLUDE ||
948 type == IGMPV3_MODE_IS_INCLUDE) && 950 type == IGMPV3_MODE_IS_INCLUDE) &&
949 ntohs(grec->grec_nsrcs) == 0) { 951 nsrcs == 0) {
950 br_ip4_multicast_leave_group(br, port, group, vid, src); 952 br_ip4_multicast_leave_group(br, port, group, vid, src);
951 } else { 953 } else {
952 err = br_ip4_multicast_add_group(br, port, group, vid, 954 err = br_ip4_multicast_add_group(br, port, group, vid,
@@ -983,7 +985,8 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
983 len = skb_transport_offset(skb) + sizeof(*icmp6h); 985 len = skb_transport_offset(skb) + sizeof(*icmp6h);
984 986
985 for (i = 0; i < num; i++) { 987 for (i = 0; i < num; i++) {
986 __be16 *nsrcs, _nsrcs; 988 __be16 *_nsrcs, __nsrcs;
989 u16 nsrcs;
987 990
988 nsrcs_offset = len + offsetof(struct mld2_grec, grec_nsrcs); 991 nsrcs_offset = len + offsetof(struct mld2_grec, grec_nsrcs);
989 992
@@ -991,12 +994,13 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
991 nsrcs_offset + sizeof(_nsrcs)) 994 nsrcs_offset + sizeof(_nsrcs))
992 return -EINVAL; 995 return -EINVAL;
993 996
994 nsrcs = skb_header_pointer(skb, nsrcs_offset, 997 _nsrcs = skb_header_pointer(skb, nsrcs_offset,
995 sizeof(_nsrcs), &_nsrcs); 998 sizeof(__nsrcs), &__nsrcs);
996 if (!nsrcs) 999 if (!_nsrcs)
997 return -EINVAL; 1000 return -EINVAL;
998 1001
999 grec_len = struct_size(grec, grec_src, ntohs(*nsrcs)); 1002 nsrcs = ntohs(*_nsrcs);
1003 grec_len = struct_size(grec, grec_src, nsrcs);
1000 1004
1001 if (!ipv6_mc_may_pull(skb, len + grec_len)) 1005 if (!ipv6_mc_may_pull(skb, len + grec_len))
1002 return -EINVAL; 1006 return -EINVAL;
@@ -1021,7 +1025,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
1021 src = eth_hdr(skb)->h_source; 1025 src = eth_hdr(skb)->h_source;
1022 if ((grec->grec_type == MLD2_CHANGE_TO_INCLUDE || 1026 if ((grec->grec_type == MLD2_CHANGE_TO_INCLUDE ||
1023 grec->grec_type == MLD2_MODE_IS_INCLUDE) && 1027 grec->grec_type == MLD2_MODE_IS_INCLUDE) &&
1024 ntohs(*nsrcs) == 0) { 1028 nsrcs == 0) {
1025 br_ip6_multicast_leave_group(br, port, &grec->grec_mca, 1029 br_ip6_multicast_leave_group(br, port, &grec->grec_mca,
1026 vid, src); 1030 vid, src);
1027 } else { 1031 } else {
@@ -1275,7 +1279,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1275 u16 vid) 1279 u16 vid)
1276{ 1280{
1277 unsigned int transport_len = ipv6_transport_len(skb); 1281 unsigned int transport_len = ipv6_transport_len(skb);
1278 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
1279 struct mld_msg *mld; 1282 struct mld_msg *mld;
1280 struct net_bridge_mdb_entry *mp; 1283 struct net_bridge_mdb_entry *mp;
1281 struct mld2_query *mld2q; 1284 struct mld2_query *mld2q;
@@ -1319,7 +1322,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1319 1322
1320 if (is_general_query) { 1323 if (is_general_query) {
1321 saddr.proto = htons(ETH_P_IPV6); 1324 saddr.proto = htons(ETH_P_IPV6);
1322 saddr.u.ip6 = ip6h->saddr; 1325 saddr.u.ip6 = ipv6_hdr(skb)->saddr;
1323 1326
1324 br_multicast_query_received(br, port, &br->ip6_other_query, 1327 br_multicast_query_received(br, port, &br->ip6_other_query,
1325 &saddr, max_delay); 1328 &saddr, max_delay);
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 68a6922b4141..7796dd9d42d7 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -143,7 +143,6 @@ void br_send_tcn_bpdu(struct net_bridge_port *p)
143void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb, 143void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
144 struct net_device *dev) 144 struct net_device *dev)
145{ 145{
146 const unsigned char *dest = eth_hdr(skb)->h_dest;
147 struct net_bridge_port *p; 146 struct net_bridge_port *p;
148 struct net_bridge *br; 147 struct net_bridge *br;
149 const unsigned char *buf; 148 const unsigned char *buf;
@@ -172,7 +171,7 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
172 if (p->state == BR_STATE_DISABLED) 171 if (p->state == BR_STATE_DISABLED)
173 goto out; 172 goto out;
174 173
175 if (!ether_addr_equal(dest, br->group_addr)) 174 if (!ether_addr_equal(eth_hdr(skb)->h_dest, br->group_addr))
176 goto out; 175 goto out;
177 176
178 if (p->flags & BR_BPDU_GUARD) { 177 if (p->flags & BR_BPDU_GUARD) {
diff --git a/net/core/filter.c b/net/core/filter.c
index 4481e950f020..47f6386fb17a 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4740,7 +4740,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
4740 return -ENODEV; 4740 return -ENODEV;
4741 4741
4742 idev = __in6_dev_get_safely(dev); 4742 idev = __in6_dev_get_safely(dev);
4743 if (unlikely(!idev || !net->ipv6.devconf_all->forwarding)) 4743 if (unlikely(!idev || !idev->cnf.forwarding))
4744 return BPF_FIB_LKUP_RET_FWD_DISABLED; 4744 return BPF_FIB_LKUP_RET_FWD_DISABLED;
4745 4745
4746 if (flags & BPF_FIB_LOOKUP_OUTPUT) { 4746 if (flags & BPF_FIB_LOOKUP_OUTPUT) {
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 15c72065df79..f0f9b493c47b 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -227,9 +227,13 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
227 struct hsr_port *master; 227 struct hsr_port *master;
228 228
229 master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); 229 master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
230 skb->dev = master->dev; 230 if (master) {
231 hsr_forward_skb(skb, master); 231 skb->dev = master->dev;
232 232 hsr_forward_skb(skb, master);
233 } else {
234 atomic_long_inc(&dev->tx_dropped);
235 dev_kfree_skb_any(skb);
236 }
233 return NETDEV_TX_OK; 237 return NETDEV_TX_OK;
234} 238}
235 239
@@ -344,27 +348,26 @@ static void hsr_announce(struct timer_list *t)
344 rcu_read_unlock(); 348 rcu_read_unlock();
345} 349}
346 350
347/* According to comments in the declaration of struct net_device, this function 351void hsr_dev_destroy(struct net_device *hsr_dev)
348 * is "Called from unregister, can be used to call free_netdev". Ok then...
349 */
350static void hsr_dev_destroy(struct net_device *hsr_dev)
351{ 352{
352 struct hsr_priv *hsr; 353 struct hsr_priv *hsr;
353 struct hsr_port *port; 354 struct hsr_port *port;
355 struct hsr_port *tmp;
354 356
355 hsr = netdev_priv(hsr_dev); 357 hsr = netdev_priv(hsr_dev);
356 358
357 hsr_debugfs_term(hsr); 359 hsr_debugfs_term(hsr);
358 360
359 rtnl_lock(); 361 list_for_each_entry_safe(port, tmp, &hsr->ports, port_list)
360 hsr_for_each_port(hsr, port)
361 hsr_del_port(port); 362 hsr_del_port(port);
362 rtnl_unlock();
363 363
364 del_timer_sync(&hsr->prune_timer); 364 del_timer_sync(&hsr->prune_timer);
365 del_timer_sync(&hsr->announce_timer); 365 del_timer_sync(&hsr->announce_timer);
366 366
367 synchronize_rcu(); 367 synchronize_rcu();
368
369 hsr_del_self_node(&hsr->self_node_db);
370 hsr_del_nodes(&hsr->node_db);
368} 371}
369 372
370static const struct net_device_ops hsr_device_ops = { 373static const struct net_device_ops hsr_device_ops = {
@@ -391,7 +394,6 @@ void hsr_dev_setup(struct net_device *dev)
391 dev->priv_flags |= IFF_NO_QUEUE; 394 dev->priv_flags |= IFF_NO_QUEUE;
392 395
393 dev->needs_free_netdev = true; 396 dev->needs_free_netdev = true;
394 dev->priv_destructor = hsr_dev_destroy;
395 397
396 dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | 398 dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
397 NETIF_F_GSO_MASK | NETIF_F_HW_CSUM | 399 NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
@@ -428,6 +430,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
428{ 430{
429 struct hsr_priv *hsr; 431 struct hsr_priv *hsr;
430 struct hsr_port *port; 432 struct hsr_port *port;
433 struct hsr_port *tmp;
431 int res; 434 int res;
432 435
433 hsr = netdev_priv(hsr_dev); 436 hsr = netdev_priv(hsr_dev);
@@ -492,10 +495,10 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
492 return 0; 495 return 0;
493 496
494fail: 497fail:
495 hsr_for_each_port(hsr, port) 498 list_for_each_entry_safe(port, tmp, &hsr->ports, port_list)
496 hsr_del_port(port); 499 hsr_del_port(port);
497err_add_port: 500err_add_port:
498 hsr_del_node(&hsr->self_node_db); 501 hsr_del_self_node(&hsr->self_node_db);
499 502
500 return res; 503 return res;
501} 504}
diff --git a/net/hsr/hsr_device.h b/net/hsr/hsr_device.h
index 6d7759c4f5f9..d0fa6b0696d2 100644
--- a/net/hsr/hsr_device.h
+++ b/net/hsr/hsr_device.h
@@ -14,6 +14,7 @@
14void hsr_dev_setup(struct net_device *dev); 14void hsr_dev_setup(struct net_device *dev);
15int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], 15int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
16 unsigned char multicast_spec, u8 protocol_version); 16 unsigned char multicast_spec, u8 protocol_version);
17void hsr_dev_destroy(struct net_device *hsr_dev);
17void hsr_check_carrier_and_operstate(struct hsr_priv *hsr); 18void hsr_check_carrier_and_operstate(struct hsr_priv *hsr);
18bool is_hsr_master(struct net_device *dev); 19bool is_hsr_master(struct net_device *dev);
19int hsr_get_max_mtu(struct hsr_priv *hsr); 20int hsr_get_max_mtu(struct hsr_priv *hsr);
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 2d7a19750436..292be446007b 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -104,7 +104,7 @@ int hsr_create_self_node(struct list_head *self_node_db,
104 return 0; 104 return 0;
105} 105}
106 106
107void hsr_del_node(struct list_head *self_node_db) 107void hsr_del_self_node(struct list_head *self_node_db)
108{ 108{
109 struct hsr_node *node; 109 struct hsr_node *node;
110 110
@@ -117,6 +117,15 @@ void hsr_del_node(struct list_head *self_node_db)
117 } 117 }
118} 118}
119 119
120void hsr_del_nodes(struct list_head *node_db)
121{
122 struct hsr_node *node;
123 struct hsr_node *tmp;
124
125 list_for_each_entry_safe(node, tmp, node_db, mac_list)
126 kfree(node);
127}
128
120/* Allocate an hsr_node and add it to node_db. 'addr' is the node's address_A; 129/* Allocate an hsr_node and add it to node_db. 'addr' is the node's address_A;
121 * seq_out is used to initialize filtering of outgoing duplicate frames 130 * seq_out is used to initialize filtering of outgoing duplicate frames
122 * originating from the newly added node. 131 * originating from the newly added node.
diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h
index a3bdcdab469d..89a3ce38151d 100644
--- a/net/hsr/hsr_framereg.h
+++ b/net/hsr/hsr_framereg.h
@@ -12,7 +12,8 @@
12 12
13struct hsr_node; 13struct hsr_node;
14 14
15void hsr_del_node(struct list_head *self_node_db); 15void hsr_del_self_node(struct list_head *self_node_db);
16void hsr_del_nodes(struct list_head *node_db);
16struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], 17struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[],
17 u16 seq_out); 18 u16 seq_out);
18struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, 19struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb,
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index 8f8337f893ba..160edd24de4e 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -69,6 +69,12 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev,
69 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version); 69 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version);
70} 70}
71 71
72static void hsr_dellink(struct net_device *hsr_dev, struct list_head *head)
73{
74 hsr_dev_destroy(hsr_dev);
75 unregister_netdevice_queue(hsr_dev, head);
76}
77
72static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev) 78static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
73{ 79{
74 struct hsr_priv *hsr; 80 struct hsr_priv *hsr;
@@ -113,6 +119,7 @@ static struct rtnl_link_ops hsr_link_ops __read_mostly = {
113 .priv_size = sizeof(struct hsr_priv), 119 .priv_size = sizeof(struct hsr_priv),
114 .setup = hsr_dev_setup, 120 .setup = hsr_dev_setup,
115 .newlink = hsr_newlink, 121 .newlink = hsr_newlink,
122 .dellink = hsr_dellink,
116 .fill_info = hsr_fill_info, 123 .fill_info = hsr_fill_info,
117}; 124};
118 125
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index 88b6705ded83..ee561297d8a7 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -193,4 +193,5 @@ void hsr_del_port(struct hsr_port *port)
193 193
194 if (port != master) 194 if (port != master)
195 dev_put(port->dev); 195 dev_put(port->dev);
196 kfree(port);
196} 197}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 137d1892395d..a4b5bd4d2c89 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -62,6 +62,11 @@
62#include <net/net_namespace.h> 62#include <net/net_namespace.h>
63#include <net/addrconf.h> 63#include <net/addrconf.h>
64 64
65#define IPV6ONLY_FLAGS \
66 (IFA_F_NODAD | IFA_F_OPTIMISTIC | IFA_F_DADFAILED | \
67 IFA_F_HOMEADDRESS | IFA_F_TENTATIVE | \
68 IFA_F_MANAGETEMPADDR | IFA_F_STABLE_PRIVACY)
69
65static struct ipv4_devconf ipv4_devconf = { 70static struct ipv4_devconf ipv4_devconf = {
66 .data = { 71 .data = {
67 [IPV4_DEVCONF_ACCEPT_REDIRECTS - 1] = 1, 72 [IPV4_DEVCONF_ACCEPT_REDIRECTS - 1] = 1,
@@ -482,6 +487,9 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
482 ifa->ifa_flags &= ~IFA_F_SECONDARY; 487 ifa->ifa_flags &= ~IFA_F_SECONDARY;
483 last_primary = &in_dev->ifa_list; 488 last_primary = &in_dev->ifa_list;
484 489
490 /* Don't set IPv6 only flags to IPv4 addresses */
491 ifa->ifa_flags &= ~IPV6ONLY_FLAGS;
492
485 ifap = &in_dev->ifa_list; 493 ifap = &in_dev->ifa_list;
486 ifa1 = rtnl_dereference(*ifap); 494 ifa1 = rtnl_dereference(*ifap);
487 495
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 9a206931a342..180f6896b98b 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1229,12 +1229,8 @@ static void igmpv3_del_delrec(struct in_device *in_dev, struct ip_mc_list *im)
1229 if (pmc) { 1229 if (pmc) {
1230 im->interface = pmc->interface; 1230 im->interface = pmc->interface;
1231 if (im->sfmode == MCAST_INCLUDE) { 1231 if (im->sfmode == MCAST_INCLUDE) {
1232 im->tomb = pmc->tomb; 1232 swap(im->tomb, pmc->tomb);
1233 pmc->tomb = NULL; 1233 swap(im->sources, pmc->sources);
1234
1235 im->sources = pmc->sources;
1236 pmc->sources = NULL;
1237
1238 for (psf = im->sources; psf; psf = psf->sf_next) 1234 for (psf = im->sources; psf; psf = psf->sf_next)
1239 psf->sf_crcount = in_dev->mr_qrv ?: net->ipv4.sysctl_igmp_qrv; 1235 psf->sf_crcount = in_dev->mr_qrv ?: net->ipv4.sysctl_igmp_qrv;
1240 } else { 1236 } else {
diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c
index 899e34ceb560..e35736b99300 100644
--- a/net/ipv4/raw_diag.c
+++ b/net/ipv4/raw_diag.c
@@ -24,9 +24,6 @@ raw_get_hashinfo(const struct inet_diag_req_v2 *r)
24 return &raw_v6_hashinfo; 24 return &raw_v6_hashinfo;
25#endif 25#endif
26 } else { 26 } else {
27 pr_warn_once("Unexpected inet family %d\n",
28 r->sdiag_family);
29 WARN_ON_ONCE(1);
30 return ERR_PTR(-EINVAL); 27 return ERR_PTR(-EINVAL);
31 } 28 }
32} 29}
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index abaa7f9371e5..517300d587a7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -448,7 +448,7 @@ static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
448 n = ip_neigh_gw4(dev, pkey); 448 n = ip_neigh_gw4(dev, pkey);
449 } 449 }
450 450
451 if (n && !refcount_inc_not_zero(&n->refcnt)) 451 if (!IS_ERR(n) && !refcount_inc_not_zero(&n->refcnt))
452 n = NULL; 452 n = NULL;
453 453
454 rcu_read_unlock_bh(); 454 rcu_read_unlock_bh();
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 47c217905864..7846afacdf0b 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2614,6 +2614,8 @@ int tcp_disconnect(struct sock *sk, int flags)
2614 tcp_saved_syn_free(tp); 2614 tcp_saved_syn_free(tp);
2615 tp->compressed_ack = 0; 2615 tp->compressed_ack = 0;
2616 tp->bytes_sent = 0; 2616 tp->bytes_sent = 0;
2617 tp->bytes_acked = 0;
2618 tp->bytes_received = 0;
2617 tp->bytes_retrans = 0; 2619 tp->bytes_retrans = 0;
2618 tp->duplicate_sack[0].start_seq = 0; 2620 tp->duplicate_sack[0].start_seq = 0;
2619 tp->duplicate_sack[0].end_seq = 0; 2621 tp->duplicate_sack[0].end_seq = 0;
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 39b3d95094eb..b67ed3a8486c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2436,8 +2436,10 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc
2436 goto out; 2436 goto out;
2437 } 2437 }
2438 err = pfkey_xfrm_policy2msg(out_skb, xp, dir); 2438 err = pfkey_xfrm_policy2msg(out_skb, xp, dir);
2439 if (err < 0) 2439 if (err < 0) {
2440 kfree_skb(out_skb);
2440 goto out; 2441 goto out;
2442 }
2441 2443
2442 out_hdr = (struct sadb_msg *) out_skb->data; 2444 out_hdr = (struct sadb_msg *) out_skb->data;
2443 out_hdr->sadb_msg_version = hdr->sadb_msg_version; 2445 out_hdr->sadb_msg_version = hdr->sadb_msg_version;
@@ -2688,8 +2690,10 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr)
2688 return PTR_ERR(out_skb); 2690 return PTR_ERR(out_skb);
2689 2691
2690 err = pfkey_xfrm_policy2msg(out_skb, xp, dir); 2692 err = pfkey_xfrm_policy2msg(out_skb, xp, dir);
2691 if (err < 0) 2693 if (err < 0) {
2694 kfree_skb(out_skb);
2692 return err; 2695 return err;
2696 }
2693 2697
2694 out_hdr = (struct sadb_msg *) out_skb->data; 2698 out_hdr = (struct sadb_msg *) out_skb->data;
2695 out_hdr->sadb_msg_version = pfk->dump.msg_version; 2699 out_hdr->sadb_msg_version = pfk->dump.msg_version;
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index dd4727a5d6ec..46f06f92ab8f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -2351,7 +2351,6 @@ static const struct nf_hook_ops ip_vs_ops[] = {
2351static int __net_init __ip_vs_init(struct net *net) 2351static int __net_init __ip_vs_init(struct net *net)
2352{ 2352{
2353 struct netns_ipvs *ipvs; 2353 struct netns_ipvs *ipvs;
2354 int ret;
2355 2354
2356 ipvs = net_generic(net, ip_vs_net_id); 2355 ipvs = net_generic(net, ip_vs_net_id);
2357 if (ipvs == NULL) 2356 if (ipvs == NULL)
@@ -2383,17 +2382,11 @@ static int __net_init __ip_vs_init(struct net *net)
2383 if (ip_vs_sync_net_init(ipvs) < 0) 2382 if (ip_vs_sync_net_init(ipvs) < 0)
2384 goto sync_fail; 2383 goto sync_fail;
2385 2384
2386 ret = nf_register_net_hooks(net, ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
2387 if (ret < 0)
2388 goto hook_fail;
2389
2390 return 0; 2385 return 0;
2391/* 2386/*
2392 * Error handling 2387 * Error handling
2393 */ 2388 */
2394 2389
2395hook_fail:
2396 ip_vs_sync_net_cleanup(ipvs);
2397sync_fail: 2390sync_fail:
2398 ip_vs_conn_net_cleanup(ipvs); 2391 ip_vs_conn_net_cleanup(ipvs);
2399conn_fail: 2392conn_fail:
@@ -2423,6 +2416,19 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
2423 net->ipvs = NULL; 2416 net->ipvs = NULL;
2424} 2417}
2425 2418
2419static int __net_init __ip_vs_dev_init(struct net *net)
2420{
2421 int ret;
2422
2423 ret = nf_register_net_hooks(net, ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
2424 if (ret < 0)
2425 goto hook_fail;
2426 return 0;
2427
2428hook_fail:
2429 return ret;
2430}
2431
2426static void __net_exit __ip_vs_dev_cleanup(struct net *net) 2432static void __net_exit __ip_vs_dev_cleanup(struct net *net)
2427{ 2433{
2428 struct netns_ipvs *ipvs = net_ipvs(net); 2434 struct netns_ipvs *ipvs = net_ipvs(net);
@@ -2442,6 +2448,7 @@ static struct pernet_operations ipvs_core_ops = {
2442}; 2448};
2443 2449
2444static struct pernet_operations ipvs_core_dev_ops = { 2450static struct pernet_operations ipvs_core_dev_ops = {
2451 .init = __ip_vs_dev_init,
2445 .exit = __ip_vs_dev_cleanup, 2452 .exit = __ip_vs_dev_cleanup,
2446}; 2453};
2447 2454
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 998353bec74f..07e0967bf129 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2454,9 +2454,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
2454 cfg.syncid = dm->syncid; 2454 cfg.syncid = dm->syncid;
2455 ret = start_sync_thread(ipvs, &cfg, dm->state); 2455 ret = start_sync_thread(ipvs, &cfg, dm->state);
2456 } else { 2456 } else {
2457 mutex_lock(&ipvs->sync_mutex);
2458 ret = stop_sync_thread(ipvs, dm->state); 2457 ret = stop_sync_thread(ipvs, dm->state);
2459 mutex_unlock(&ipvs->sync_mutex);
2460 } 2458 }
2461 goto out_dec; 2459 goto out_dec;
2462 } 2460 }
@@ -3581,10 +3579,8 @@ static int ip_vs_genl_del_daemon(struct netns_ipvs *ipvs, struct nlattr **attrs)
3581 if (!attrs[IPVS_DAEMON_ATTR_STATE]) 3579 if (!attrs[IPVS_DAEMON_ATTR_STATE])
3582 return -EINVAL; 3580 return -EINVAL;
3583 3581
3584 mutex_lock(&ipvs->sync_mutex);
3585 ret = stop_sync_thread(ipvs, 3582 ret = stop_sync_thread(ipvs,
3586 nla_get_u32(attrs[IPVS_DAEMON_ATTR_STATE])); 3583 nla_get_u32(attrs[IPVS_DAEMON_ATTR_STATE]));
3587 mutex_unlock(&ipvs->sync_mutex);
3588 return ret; 3584 return ret;
3589} 3585}
3590 3586
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 2526be6b3d90..a4a78c4b06de 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -195,6 +195,7 @@ union ip_vs_sync_conn {
195#define IPVS_OPT_F_PARAM (1 << (IPVS_OPT_PARAM-1)) 195#define IPVS_OPT_F_PARAM (1 << (IPVS_OPT_PARAM-1))
196 196
197struct ip_vs_sync_thread_data { 197struct ip_vs_sync_thread_data {
198 struct task_struct *task;
198 struct netns_ipvs *ipvs; 199 struct netns_ipvs *ipvs;
199 struct socket *sock; 200 struct socket *sock;
200 char *buf; 201 char *buf;
@@ -374,8 +375,11 @@ static inline void sb_queue_tail(struct netns_ipvs *ipvs,
374 max(IPVS_SYNC_SEND_DELAY, 1)); 375 max(IPVS_SYNC_SEND_DELAY, 1));
375 ms->sync_queue_len++; 376 ms->sync_queue_len++;
376 list_add_tail(&sb->list, &ms->sync_queue); 377 list_add_tail(&sb->list, &ms->sync_queue);
377 if ((++ms->sync_queue_delay) == IPVS_SYNC_WAKEUP_RATE) 378 if ((++ms->sync_queue_delay) == IPVS_SYNC_WAKEUP_RATE) {
378 wake_up_process(ms->master_thread); 379 int id = (int)(ms - ipvs->ms);
380
381 wake_up_process(ipvs->master_tinfo[id].task);
382 }
379 } else 383 } else
380 ip_vs_sync_buff_release(sb); 384 ip_vs_sync_buff_release(sb);
381 spin_unlock(&ipvs->sync_lock); 385 spin_unlock(&ipvs->sync_lock);
@@ -1636,8 +1640,10 @@ static void master_wakeup_work_handler(struct work_struct *work)
1636 spin_lock_bh(&ipvs->sync_lock); 1640 spin_lock_bh(&ipvs->sync_lock);
1637 if (ms->sync_queue_len && 1641 if (ms->sync_queue_len &&
1638 ms->sync_queue_delay < IPVS_SYNC_WAKEUP_RATE) { 1642 ms->sync_queue_delay < IPVS_SYNC_WAKEUP_RATE) {
1643 int id = (int)(ms - ipvs->ms);
1644
1639 ms->sync_queue_delay = IPVS_SYNC_WAKEUP_RATE; 1645 ms->sync_queue_delay = IPVS_SYNC_WAKEUP_RATE;
1640 wake_up_process(ms->master_thread); 1646 wake_up_process(ipvs->master_tinfo[id].task);
1641 } 1647 }
1642 spin_unlock_bh(&ipvs->sync_lock); 1648 spin_unlock_bh(&ipvs->sync_lock);
1643} 1649}
@@ -1703,10 +1709,6 @@ done:
1703 if (sb) 1709 if (sb)
1704 ip_vs_sync_buff_release(sb); 1710 ip_vs_sync_buff_release(sb);
1705 1711
1706 /* release the sending multicast socket */
1707 sock_release(tinfo->sock);
1708 kfree(tinfo);
1709
1710 return 0; 1712 return 0;
1711} 1713}
1712 1714
@@ -1740,11 +1742,6 @@ static int sync_thread_backup(void *data)
1740 } 1742 }
1741 } 1743 }
1742 1744
1743 /* release the sending multicast socket */
1744 sock_release(tinfo->sock);
1745 kfree(tinfo->buf);
1746 kfree(tinfo);
1747
1748 return 0; 1745 return 0;
1749} 1746}
1750 1747
@@ -1752,8 +1749,8 @@ static int sync_thread_backup(void *data)
1752int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, 1749int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
1753 int state) 1750 int state)
1754{ 1751{
1755 struct ip_vs_sync_thread_data *tinfo = NULL; 1752 struct ip_vs_sync_thread_data *ti = NULL, *tinfo;
1756 struct task_struct **array = NULL, *task; 1753 struct task_struct *task;
1757 struct net_device *dev; 1754 struct net_device *dev;
1758 char *name; 1755 char *name;
1759 int (*threadfn)(void *data); 1756 int (*threadfn)(void *data);
@@ -1822,7 +1819,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
1822 threadfn = sync_thread_master; 1819 threadfn = sync_thread_master;
1823 } else if (state == IP_VS_STATE_BACKUP) { 1820 } else if (state == IP_VS_STATE_BACKUP) {
1824 result = -EEXIST; 1821 result = -EEXIST;
1825 if (ipvs->backup_threads) 1822 if (ipvs->backup_tinfo)
1826 goto out_early; 1823 goto out_early;
1827 1824
1828 ipvs->bcfg = *c; 1825 ipvs->bcfg = *c;
@@ -1849,28 +1846,22 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
1849 master_wakeup_work_handler); 1846 master_wakeup_work_handler);
1850 ms->ipvs = ipvs; 1847 ms->ipvs = ipvs;
1851 } 1848 }
1852 } else {
1853 array = kcalloc(count, sizeof(struct task_struct *),
1854 GFP_KERNEL);
1855 result = -ENOMEM;
1856 if (!array)
1857 goto out;
1858 } 1849 }
1850 result = -ENOMEM;
1851 ti = kcalloc(count, sizeof(struct ip_vs_sync_thread_data),
1852 GFP_KERNEL);
1853 if (!ti)
1854 goto out;
1859 1855
1860 for (id = 0; id < count; id++) { 1856 for (id = 0; id < count; id++) {
1861 result = -ENOMEM; 1857 tinfo = &ti[id];
1862 tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL);
1863 if (!tinfo)
1864 goto out;
1865 tinfo->ipvs = ipvs; 1858 tinfo->ipvs = ipvs;
1866 tinfo->sock = NULL;
1867 if (state == IP_VS_STATE_BACKUP) { 1859 if (state == IP_VS_STATE_BACKUP) {
1860 result = -ENOMEM;
1868 tinfo->buf = kmalloc(ipvs->bcfg.sync_maxlen, 1861 tinfo->buf = kmalloc(ipvs->bcfg.sync_maxlen,
1869 GFP_KERNEL); 1862 GFP_KERNEL);
1870 if (!tinfo->buf) 1863 if (!tinfo->buf)
1871 goto out; 1864 goto out;
1872 } else {
1873 tinfo->buf = NULL;
1874 } 1865 }
1875 tinfo->id = id; 1866 tinfo->id = id;
1876 if (state == IP_VS_STATE_MASTER) 1867 if (state == IP_VS_STATE_MASTER)
@@ -1885,17 +1876,15 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
1885 result = PTR_ERR(task); 1876 result = PTR_ERR(task);
1886 goto out; 1877 goto out;
1887 } 1878 }
1888 tinfo = NULL; 1879 tinfo->task = task;
1889 if (state == IP_VS_STATE_MASTER)
1890 ipvs->ms[id].master_thread = task;
1891 else
1892 array[id] = task;
1893 } 1880 }
1894 1881
1895 /* mark as active */ 1882 /* mark as active */
1896 1883
1897 if (state == IP_VS_STATE_BACKUP) 1884 if (state == IP_VS_STATE_MASTER)
1898 ipvs->backup_threads = array; 1885 ipvs->master_tinfo = ti;
1886 else
1887 ipvs->backup_tinfo = ti;
1899 spin_lock_bh(&ipvs->sync_buff_lock); 1888 spin_lock_bh(&ipvs->sync_buff_lock);
1900 ipvs->sync_state |= state; 1889 ipvs->sync_state |= state;
1901 spin_unlock_bh(&ipvs->sync_buff_lock); 1890 spin_unlock_bh(&ipvs->sync_buff_lock);
@@ -1910,29 +1899,31 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
1910 1899
1911out: 1900out:
1912 /* We do not need RTNL lock anymore, release it here so that 1901 /* We do not need RTNL lock anymore, release it here so that
1913 * sock_release below and in the kthreads can use rtnl_lock 1902 * sock_release below can use rtnl_lock to leave the mcast group.
1914 * to leave the mcast group.
1915 */ 1903 */
1916 rtnl_unlock(); 1904 rtnl_unlock();
1917 count = id; 1905 id = min(id, count - 1);
1918 while (count-- > 0) { 1906 if (ti) {
1919 if (state == IP_VS_STATE_MASTER) 1907 for (tinfo = ti + id; tinfo >= ti; tinfo--) {
1920 kthread_stop(ipvs->ms[count].master_thread); 1908 if (tinfo->task)
1921 else 1909 kthread_stop(tinfo->task);
1922 kthread_stop(array[count]); 1910 }
1923 } 1911 }
1924 if (!(ipvs->sync_state & IP_VS_STATE_MASTER)) { 1912 if (!(ipvs->sync_state & IP_VS_STATE_MASTER)) {
1925 kfree(ipvs->ms); 1913 kfree(ipvs->ms);
1926 ipvs->ms = NULL; 1914 ipvs->ms = NULL;
1927 } 1915 }
1928 mutex_unlock(&ipvs->sync_mutex); 1916 mutex_unlock(&ipvs->sync_mutex);
1929 if (tinfo) { 1917
1930 if (tinfo->sock) 1918 /* No more mutexes, release socks */
1931 sock_release(tinfo->sock); 1919 if (ti) {
1932 kfree(tinfo->buf); 1920 for (tinfo = ti + id; tinfo >= ti; tinfo--) {
1933 kfree(tinfo); 1921 if (tinfo->sock)
1922 sock_release(tinfo->sock);
1923 kfree(tinfo->buf);
1924 }
1925 kfree(ti);
1934 } 1926 }
1935 kfree(array);
1936 return result; 1927 return result;
1937 1928
1938out_early: 1929out_early:
@@ -1944,15 +1935,18 @@ out_early:
1944 1935
1945int stop_sync_thread(struct netns_ipvs *ipvs, int state) 1936int stop_sync_thread(struct netns_ipvs *ipvs, int state)
1946{ 1937{
1947 struct task_struct **array; 1938 struct ip_vs_sync_thread_data *ti, *tinfo;
1948 int id; 1939 int id;
1949 int retc = -EINVAL; 1940 int retc = -EINVAL;
1950 1941
1951 IP_VS_DBG(7, "%s(): pid %d\n", __func__, task_pid_nr(current)); 1942 IP_VS_DBG(7, "%s(): pid %d\n", __func__, task_pid_nr(current));
1952 1943
1944 mutex_lock(&ipvs->sync_mutex);
1953 if (state == IP_VS_STATE_MASTER) { 1945 if (state == IP_VS_STATE_MASTER) {
1946 retc = -ESRCH;
1954 if (!ipvs->ms) 1947 if (!ipvs->ms)
1955 return -ESRCH; 1948 goto err;
1949 ti = ipvs->master_tinfo;
1956 1950
1957 /* 1951 /*
1958 * The lock synchronizes with sb_queue_tail(), so that we don't 1952 * The lock synchronizes with sb_queue_tail(), so that we don't
@@ -1971,38 +1965,56 @@ int stop_sync_thread(struct netns_ipvs *ipvs, int state)
1971 struct ipvs_master_sync_state *ms = &ipvs->ms[id]; 1965 struct ipvs_master_sync_state *ms = &ipvs->ms[id];
1972 int ret; 1966 int ret;
1973 1967
1968 tinfo = &ti[id];
1974 pr_info("stopping master sync thread %d ...\n", 1969 pr_info("stopping master sync thread %d ...\n",
1975 task_pid_nr(ms->master_thread)); 1970 task_pid_nr(tinfo->task));
1976 cancel_delayed_work_sync(&ms->master_wakeup_work); 1971 cancel_delayed_work_sync(&ms->master_wakeup_work);
1977 ret = kthread_stop(ms->master_thread); 1972 ret = kthread_stop(tinfo->task);
1978 if (retc >= 0) 1973 if (retc >= 0)
1979 retc = ret; 1974 retc = ret;
1980 } 1975 }
1981 kfree(ipvs->ms); 1976 kfree(ipvs->ms);
1982 ipvs->ms = NULL; 1977 ipvs->ms = NULL;
1978 ipvs->master_tinfo = NULL;
1983 } else if (state == IP_VS_STATE_BACKUP) { 1979 } else if (state == IP_VS_STATE_BACKUP) {
1984 if (!ipvs->backup_threads) 1980 retc = -ESRCH;
1985 return -ESRCH; 1981 if (!ipvs->backup_tinfo)
1982 goto err;
1983 ti = ipvs->backup_tinfo;
1986 1984
1987 ipvs->sync_state &= ~IP_VS_STATE_BACKUP; 1985 ipvs->sync_state &= ~IP_VS_STATE_BACKUP;
1988 array = ipvs->backup_threads;
1989 retc = 0; 1986 retc = 0;
1990 for (id = ipvs->threads_mask; id >= 0; id--) { 1987 for (id = ipvs->threads_mask; id >= 0; id--) {
1991 int ret; 1988 int ret;
1992 1989
1990 tinfo = &ti[id];
1993 pr_info("stopping backup sync thread %d ...\n", 1991 pr_info("stopping backup sync thread %d ...\n",
1994 task_pid_nr(array[id])); 1992 task_pid_nr(tinfo->task));
1995 ret = kthread_stop(array[id]); 1993 ret = kthread_stop(tinfo->task);
1996 if (retc >= 0) 1994 if (retc >= 0)
1997 retc = ret; 1995 retc = ret;
1998 } 1996 }
1999 kfree(array); 1997 ipvs->backup_tinfo = NULL;
2000 ipvs->backup_threads = NULL; 1998 } else {
1999 goto err;
2001 } 2000 }
2001 id = ipvs->threads_mask;
2002 mutex_unlock(&ipvs->sync_mutex);
2003
2004 /* No more mutexes, release socks */
2005 for (tinfo = ti + id; tinfo >= ti; tinfo--) {
2006 if (tinfo->sock)
2007 sock_release(tinfo->sock);
2008 kfree(tinfo->buf);
2009 }
2010 kfree(ti);
2002 2011
2003 /* decrease the module use count */ 2012 /* decrease the module use count */
2004 ip_vs_use_count_dec(); 2013 ip_vs_use_count_dec();
2014 return retc;
2005 2015
2016err:
2017 mutex_unlock(&ipvs->sync_mutex);
2006 return retc; 2018 return retc;
2007} 2019}
2008 2020
@@ -2021,7 +2033,6 @@ void ip_vs_sync_net_cleanup(struct netns_ipvs *ipvs)
2021{ 2033{
2022 int retc; 2034 int retc;
2023 2035
2024 mutex_lock(&ipvs->sync_mutex);
2025 retc = stop_sync_thread(ipvs, IP_VS_STATE_MASTER); 2036 retc = stop_sync_thread(ipvs, IP_VS_STATE_MASTER);
2026 if (retc && retc != -ESRCH) 2037 if (retc && retc != -ESRCH)
2027 pr_err("Failed to stop Master Daemon\n"); 2038 pr_err("Failed to stop Master Daemon\n");
@@ -2029,5 +2040,4 @@ void ip_vs_sync_net_cleanup(struct netns_ipvs *ipvs)
2029 retc = stop_sync_thread(ipvs, IP_VS_STATE_BACKUP); 2040 retc = stop_sync_thread(ipvs, IP_VS_STATE_BACKUP);
2030 if (retc && retc != -ESRCH) 2041 if (retc && retc != -ESRCH)
2031 pr_err("Failed to stop Backup Daemon\n"); 2042 pr_err("Failed to stop Backup Daemon\n");
2032 mutex_unlock(&ipvs->sync_mutex);
2033} 2043}
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 7db79c1b8084..1b77444d5b52 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1256,7 +1256,6 @@ static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl,
1256 struct nf_conntrack_tuple tuple; 1256 struct nf_conntrack_tuple tuple;
1257 struct nf_conn *ct; 1257 struct nf_conn *ct;
1258 struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1258 struct nfgenmsg *nfmsg = nlmsg_data(nlh);
1259 u_int8_t u3 = nfmsg->version ? nfmsg->nfgen_family : AF_UNSPEC;
1260 struct nf_conntrack_zone zone; 1259 struct nf_conntrack_zone zone;
1261 int err; 1260 int err;
1262 1261
@@ -1266,11 +1265,13 @@ static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl,
1266 1265
1267 if (cda[CTA_TUPLE_ORIG]) 1266 if (cda[CTA_TUPLE_ORIG])
1268 err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_ORIG, 1267 err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_ORIG,
1269 u3, &zone); 1268 nfmsg->nfgen_family, &zone);
1270 else if (cda[CTA_TUPLE_REPLY]) 1269 else if (cda[CTA_TUPLE_REPLY])
1271 err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_REPLY, 1270 err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_REPLY,
1272 u3, &zone); 1271 nfmsg->nfgen_family, &zone);
1273 else { 1272 else {
1273 u_int8_t u3 = nfmsg->version ? nfmsg->nfgen_family : AF_UNSPEC;
1274
1274 return ctnetlink_flush_conntrack(net, cda, 1275 return ctnetlink_flush_conntrack(net, cda,
1275 NETLINK_CB(skb).portid, 1276 NETLINK_CB(skb).portid,
1276 nlmsg_report(nlh), u3); 1277 nlmsg_report(nlh), u3);
diff --git a/net/netfilter/nf_conntrack_proto_icmp.c b/net/netfilter/nf_conntrack_proto_icmp.c
index a824367ed518..dd53e2b20f6b 100644
--- a/net/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/netfilter/nf_conntrack_proto_icmp.c
@@ -218,7 +218,7 @@ int nf_conntrack_icmpv4_error(struct nf_conn *tmpl,
218 /* See ip_conntrack_proto_tcp.c */ 218 /* See ip_conntrack_proto_tcp.c */
219 if (state->net->ct.sysctl_checksum && 219 if (state->net->ct.sysctl_checksum &&
220 state->hook == NF_INET_PRE_ROUTING && 220 state->hook == NF_INET_PRE_ROUTING &&
221 nf_ip_checksum(skb, state->hook, dataoff, 0)) { 221 nf_ip_checksum(skb, state->hook, dataoff, IPPROTO_ICMP)) {
222 icmp_error_log(skb, state, "bad hw icmp checksum"); 222 icmp_error_log(skb, state, "bad hw icmp checksum");
223 return -NF_ACCEPT; 223 return -NF_ACCEPT;
224 } 224 }
diff --git a/net/netfilter/nf_nat_proto.c b/net/netfilter/nf_nat_proto.c
index 888292e8fbb2..7ac733ebd060 100644
--- a/net/netfilter/nf_nat_proto.c
+++ b/net/netfilter/nf_nat_proto.c
@@ -564,7 +564,7 @@ int nf_nat_icmp_reply_translation(struct sk_buff *skb,
564 564
565 if (skb_ensure_writable(skb, hdrlen + sizeof(*inside))) 565 if (skb_ensure_writable(skb, hdrlen + sizeof(*inside)))
566 return 0; 566 return 0;
567 if (nf_ip_checksum(skb, hooknum, hdrlen, 0)) 567 if (nf_ip_checksum(skb, hooknum, hdrlen, IPPROTO_ICMP))
568 return 0; 568 return 0;
569 569
570 inside = (void *)skb->data + hdrlen; 570 inside = (void *)skb->data + hdrlen;
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index c72a5bdd123f..a2b58de82600 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -189,6 +189,11 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state,
189 goto err; 189 goto err;
190 } 190 }
191 191
192 if (!skb_dst_force(skb) && state->hook != NF_INET_PRE_ROUTING) {
193 status = -ENETDOWN;
194 goto err;
195 }
196
192 *entry = (struct nf_queue_entry) { 197 *entry = (struct nf_queue_entry) {
193 .skb = skb, 198 .skb = skb,
194 .state = *state, 199 .state = *state,
@@ -197,7 +202,6 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state,
197 }; 202 };
198 203
199 nf_queue_entry_get_refs(entry); 204 nf_queue_entry_get_refs(entry);
200 skb_dst_force(skb);
201 205
202 switch (entry->state.pf) { 206 switch (entry->state.pf) {
203 case AF_INET: 207 case AF_INET:
diff --git a/net/netfilter/utils.c b/net/netfilter/utils.c
index 06dc55590441..51b454d8fa9c 100644
--- a/net/netfilter/utils.c
+++ b/net/netfilter/utils.c
@@ -17,7 +17,8 @@ __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
17 case CHECKSUM_COMPLETE: 17 case CHECKSUM_COMPLETE:
18 if (hook != NF_INET_PRE_ROUTING && hook != NF_INET_LOCAL_IN) 18 if (hook != NF_INET_PRE_ROUTING && hook != NF_INET_LOCAL_IN)
19 break; 19 break;
20 if ((protocol == 0 && !csum_fold(skb->csum)) || 20 if ((protocol != IPPROTO_TCP && protocol != IPPROTO_UDP &&
21 !csum_fold(skb->csum)) ||
21 !csum_tcpudp_magic(iph->saddr, iph->daddr, 22 !csum_tcpudp_magic(iph->saddr, iph->daddr,
22 skb->len - dataoff, protocol, 23 skb->len - dataoff, protocol,
23 skb->csum)) { 24 skb->csum)) {
@@ -26,7 +27,7 @@ __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
26 } 27 }
27 /* fall through */ 28 /* fall through */
28 case CHECKSUM_NONE: 29 case CHECKSUM_NONE:
29 if (protocol == 0) 30 if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP)
30 skb->csum = 0; 31 skb->csum = 0;
31 else 32 else
32 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, 33 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr,
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 86b87925ef34..96740d389377 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -869,7 +869,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
869 unsigned short frametype, flags, window, timeout; 869 unsigned short frametype, flags, window, timeout;
870 int ret; 870 int ret;
871 871
872 skb->sk = NULL; /* Initially we don't know who it's for */ 872 skb_orphan(skb);
873 873
874 /* 874 /*
875 * skb->data points to the netrom frame start 875 * skb->data points to the netrom frame start
@@ -968,6 +968,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
968 window = skb->data[20]; 968 window = skb->data[20];
969 969
970 skb->sk = make; 970 skb->sk = make;
971 skb->destructor = sock_efree;
971 make->sk_state = TCP_ESTABLISHED; 972 make->sk_state = TCP_ESTABLISHED;
972 973
973 /* Fill in his circuit details */ 974 /* Fill in his circuit details */
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 0a0c265baaa4..ce3382be937f 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -107,7 +107,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
107 conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id); 107 conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id);
108 if (!conn_info) { 108 if (!conn_info) {
109 rc = -EPROTO; 109 rc = -EPROTO;
110 goto free_exit; 110 goto exit;
111 } 111 }
112 112
113 __skb_queue_head_init(&frags_q); 113 __skb_queue_head_init(&frags_q);
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 151518dbabad..bd131469e4ca 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -166,8 +166,7 @@ static void update_ethertype(struct sk_buff *skb, struct ethhdr *hdr,
166 if (skb->ip_summed == CHECKSUM_COMPLETE) { 166 if (skb->ip_summed == CHECKSUM_COMPLETE) {
167 __be16 diff[] = { ~(hdr->h_proto), ethertype }; 167 __be16 diff[] = { ~(hdr->h_proto), ethertype };
168 168
169 skb->csum = ~csum_partial((char *)diff, sizeof(diff), 169 skb->csum = csum_partial((char *)diff, sizeof(diff), skb->csum);
170 ~skb->csum);
171 } 170 }
172 171
173 hdr->h_proto = ethertype; 172 hdr->h_proto = ethertype;
@@ -259,8 +258,7 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key,
259 if (skb->ip_summed == CHECKSUM_COMPLETE) { 258 if (skb->ip_summed == CHECKSUM_COMPLETE) {
260 __be32 diff[] = { ~(stack->label_stack_entry), lse }; 259 __be32 diff[] = { ~(stack->label_stack_entry), lse };
261 260
262 skb->csum = ~csum_partial((char *)diff, sizeof(diff), 261 skb->csum = csum_partial((char *)diff, sizeof(diff), skb->csum);
263 ~skb->csum);
264 } 262 }
265 263
266 stack->label_stack_entry = lse; 264 stack->label_stack_entry = lse;
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index f9f4721cdfa7..d09eaf153544 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -545,6 +545,7 @@ static int rxrpc_sendmsg(struct socket *sock, struct msghdr *m, size_t len)
545 545
546 switch (rx->sk.sk_state) { 546 switch (rx->sk.sk_state) {
547 case RXRPC_UNBOUND: 547 case RXRPC_UNBOUND:
548 case RXRPC_CLIENT_UNBOUND:
548 rx->srx.srx_family = AF_RXRPC; 549 rx->srx.srx_family = AF_RXRPC;
549 rx->srx.srx_service = 0; 550 rx->srx.srx_service = 0;
550 rx->srx.transport_type = SOCK_DGRAM; 551 rx->srx.transport_type = SOCK_DGRAM;
@@ -569,10 +570,9 @@ static int rxrpc_sendmsg(struct socket *sock, struct msghdr *m, size_t len)
569 } 570 }
570 571
571 rx->local = local; 572 rx->local = local;
572 rx->sk.sk_state = RXRPC_CLIENT_UNBOUND; 573 rx->sk.sk_state = RXRPC_CLIENT_BOUND;
573 /* Fall through */ 574 /* Fall through */
574 575
575 case RXRPC_CLIENT_UNBOUND:
576 case RXRPC_CLIENT_BOUND: 576 case RXRPC_CLIENT_BOUND:
577 if (!m->msg_name && 577 if (!m->msg_name &&
578 test_bit(RXRPC_SOCK_CONNECTED, &rx->flags)) { 578 test_bit(RXRPC_SOCK_CONNECTED, &rx->flags)) {
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 4e5d2e9ace5d..339712296164 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -221,12 +221,13 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
221 struct idr *idr = &idrinfo->action_idr; 221 struct idr *idr = &idrinfo->action_idr;
222 struct tc_action *p; 222 struct tc_action *p;
223 unsigned long id = 1; 223 unsigned long id = 1;
224 unsigned long tmp;
224 225
225 mutex_lock(&idrinfo->lock); 226 mutex_lock(&idrinfo->lock);
226 227
227 s_i = cb->args[0]; 228 s_i = cb->args[0];
228 229
229 idr_for_each_entry_ul(idr, p, id) { 230 idr_for_each_entry_ul(idr, p, tmp, id) {
230 index++; 231 index++;
231 if (index < s_i) 232 if (index < s_i)
232 continue; 233 continue;
@@ -292,6 +293,7 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
292 struct idr *idr = &idrinfo->action_idr; 293 struct idr *idr = &idrinfo->action_idr;
293 struct tc_action *p; 294 struct tc_action *p;
294 unsigned long id = 1; 295 unsigned long id = 1;
296 unsigned long tmp;
295 297
296 nest = nla_nest_start_noflag(skb, 0); 298 nest = nla_nest_start_noflag(skb, 0);
297 if (nest == NULL) 299 if (nest == NULL)
@@ -300,7 +302,7 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
300 goto nla_put_failure; 302 goto nla_put_failure;
301 303
302 mutex_lock(&idrinfo->lock); 304 mutex_lock(&idrinfo->lock);
303 idr_for_each_entry_ul(idr, p, id) { 305 idr_for_each_entry_ul(idr, p, tmp, id) {
304 ret = tcf_idr_release_unsafe(p); 306 ret = tcf_idr_release_unsafe(p);
305 if (ret == ACT_P_DELETED) { 307 if (ret == ACT_P_DELETED) {
306 module_put(ops->owner); 308 module_put(ops->owner);
@@ -533,8 +535,9 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,
533 struct tc_action *p; 535 struct tc_action *p;
534 int ret; 536 int ret;
535 unsigned long id = 1; 537 unsigned long id = 1;
538 unsigned long tmp;
536 539
537 idr_for_each_entry_ul(idr, p, id) { 540 idr_for_each_entry_ul(idr, p, tmp, id) {
538 ret = __tcf_idr_release(p, false, true); 541 ret = __tcf_idr_release(p, false, true);
539 if (ret == ACT_P_DELETED) 542 if (ret == ACT_P_DELETED)
540 module_put(ops->owner); 543 module_put(ops->owner);
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index ce2e9b1c9850..5d4935b51e6f 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -524,24 +524,6 @@ static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle)
524 return f; 524 return f;
525} 525}
526 526
527static struct cls_fl_filter *fl_get_next_filter(struct tcf_proto *tp,
528 unsigned long *handle)
529{
530 struct cls_fl_head *head = fl_head_dereference(tp);
531 struct cls_fl_filter *f;
532
533 rcu_read_lock();
534 while ((f = idr_get_next_ul(&head->handle_idr, handle))) {
535 /* don't return filters that are being deleted */
536 if (refcount_inc_not_zero(&f->refcnt))
537 break;
538 ++(*handle);
539 }
540 rcu_read_unlock();
541
542 return f;
543}
544
545static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f, 527static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
546 bool *last, bool rtnl_held, 528 bool *last, bool rtnl_held,
547 struct netlink_ext_ack *extack) 529 struct netlink_ext_ack *extack)
@@ -1692,20 +1674,25 @@ static int fl_delete(struct tcf_proto *tp, void *arg, bool *last,
1692static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg, 1674static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg,
1693 bool rtnl_held) 1675 bool rtnl_held)
1694{ 1676{
1677 struct cls_fl_head *head = fl_head_dereference(tp);
1678 unsigned long id = arg->cookie, tmp;
1695 struct cls_fl_filter *f; 1679 struct cls_fl_filter *f;
1696 1680
1697 arg->count = arg->skip; 1681 arg->count = arg->skip;
1698 1682
1699 while ((f = fl_get_next_filter(tp, &arg->cookie)) != NULL) { 1683 idr_for_each_entry_continue_ul(&head->handle_idr, f, tmp, id) {
1684 /* don't return filters that are being deleted */
1685 if (!refcount_inc_not_zero(&f->refcnt))
1686 continue;
1700 if (arg->fn(tp, f, arg) < 0) { 1687 if (arg->fn(tp, f, arg) < 0) {
1701 __fl_put(f); 1688 __fl_put(f);
1702 arg->stop = 1; 1689 arg->stop = 1;
1703 break; 1690 break;
1704 } 1691 }
1705 __fl_put(f); 1692 __fl_put(f);
1706 arg->cookie++;
1707 arg->count++; 1693 arg->count++;
1708 } 1694 }
1695 arg->cookie = id;
1709} 1696}
1710 1697
1711static struct cls_fl_filter * 1698static struct cls_fl_filter *
diff --git a/net/sctp/output.c b/net/sctp/output.c
index e0c27477788d..dbda7e7927fd 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -282,6 +282,9 @@ static enum sctp_xmit sctp_packet_bundle_sack(struct sctp_packet *pkt,
282 sctp_chunk_free(sack); 282 sctp_chunk_free(sack);
283 goto out; 283 goto out;
284 } 284 }
285 SCTP_INC_STATS(sock_net(asoc->base.sk),
286 SCTP_MIB_OUTCTRLCHUNKS);
287 asoc->stats.octrlchunks++;
285 asoc->peer.sack_needed = 0; 288 asoc->peer.sack_needed = 0;
286 if (del_timer(timer)) 289 if (del_timer(timer))
287 sctp_association_put(asoc); 290 sctp_association_put(asoc);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 39ea0a37af09..f33aa9ee9e27 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4816,35 +4816,17 @@ out_nounlock:
4816static int sctp_connect(struct sock *sk, struct sockaddr *addr, 4816static int sctp_connect(struct sock *sk, struct sockaddr *addr,
4817 int addr_len, int flags) 4817 int addr_len, int flags)
4818{ 4818{
4819 struct inet_sock *inet = inet_sk(sk);
4820 struct sctp_af *af; 4819 struct sctp_af *af;
4821 int err = 0; 4820 int err = -EINVAL;
4822 4821
4823 lock_sock(sk); 4822 lock_sock(sk);
4824
4825 pr_debug("%s: sk:%p, sockaddr:%p, addr_len:%d\n", __func__, sk, 4823 pr_debug("%s: sk:%p, sockaddr:%p, addr_len:%d\n", __func__, sk,
4826 addr, addr_len); 4824 addr, addr_len);
4827 4825
4828 /* We may need to bind the socket. */
4829 if (!inet->inet_num) {
4830 if (sk->sk_prot->get_port(sk, 0)) {
4831 release_sock(sk);
4832 return -EAGAIN;
4833 }
4834 inet->inet_sport = htons(inet->inet_num);
4835 }
4836
4837 /* Validate addr_len before calling common connect/connectx routine. */ 4826 /* Validate addr_len before calling common connect/connectx routine. */
4838 af = addr_len < offsetofend(struct sockaddr, sa_family) ? NULL : 4827 af = sctp_get_af_specific(addr->sa_family);
4839 sctp_get_af_specific(addr->sa_family); 4828 if (af && addr_len >= af->sockaddr_len)
4840 if (!af || addr_len < af->sockaddr_len) {
4841 err = -EINVAL;
4842 } else {
4843 /* Pass correct addr len to common routine (so it knows there
4844 * is only one address being passed.
4845 */
4846 err = __sctp_connect(sk, addr, af->sockaddr_len, flags, NULL); 4829 err = __sctp_connect(sk, addr, af->sockaddr_len, flags, NULL);
4847 }
4848 4830
4849 release_sock(sk); 4831 release_sock(sk);
4850 return err; 4832 return err;
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index 93ed07877337..25946604af85 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -153,13 +153,20 @@ out:
153int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid) 153int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid)
154{ 154{
155 struct sctp_stream_out_ext *soute; 155 struct sctp_stream_out_ext *soute;
156 int ret;
156 157
157 soute = kzalloc(sizeof(*soute), GFP_KERNEL); 158 soute = kzalloc(sizeof(*soute), GFP_KERNEL);
158 if (!soute) 159 if (!soute)
159 return -ENOMEM; 160 return -ENOMEM;
160 SCTP_SO(stream, sid)->ext = soute; 161 SCTP_SO(stream, sid)->ext = soute;
161 162
162 return sctp_sched_init_sid(stream, sid, GFP_KERNEL); 163 ret = sctp_sched_init_sid(stream, sid, GFP_KERNEL);
164 if (ret) {
165 kfree(SCTP_SO(stream, sid)->ext);
166 SCTP_SO(stream, sid)->ext = NULL;
167 }
168
169 return ret;
163} 170}
164 171
165void sctp_stream_free(struct sctp_stream *stream) 172void sctp_stream_free(struct sctp_stream *stream)
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 40076f423dcb..92fd1352c037 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -61,7 +61,7 @@ static void tls_device_free_ctx(struct tls_context *ctx)
61 if (ctx->rx_conf == TLS_HW) 61 if (ctx->rx_conf == TLS_HW)
62 kfree(tls_offload_ctx_rx(ctx)); 62 kfree(tls_offload_ctx_rx(ctx));
63 63
64 kfree(ctx); 64 tls_ctx_free(ctx);
65} 65}
66 66
67static void tls_device_gc_task(struct work_struct *work) 67static void tls_device_gc_task(struct work_struct *work)
@@ -853,6 +853,11 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
853 } 853 }
854 854
855 crypto_info = &ctx->crypto_send.info; 855 crypto_info = &ctx->crypto_send.info;
856 if (crypto_info->version != TLS_1_2_VERSION) {
857 rc = -EOPNOTSUPP;
858 goto free_offload_ctx;
859 }
860
856 switch (crypto_info->cipher_type) { 861 switch (crypto_info->cipher_type) {
857 case TLS_CIPHER_AES_GCM_128: 862 case TLS_CIPHER_AES_GCM_128:
858 nonce_size = TLS_CIPHER_AES_GCM_128_IV_SIZE; 863 nonce_size = TLS_CIPHER_AES_GCM_128_IV_SIZE;
@@ -993,6 +998,9 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
993 struct net_device *netdev; 998 struct net_device *netdev;
994 int rc = 0; 999 int rc = 0;
995 1000
1001 if (ctx->crypto_recv.info.version != TLS_1_2_VERSION)
1002 return -EOPNOTSUPP;
1003
996 /* We support starting offload on multiple sockets 1004 /* We support starting offload on multiple sockets
997 * concurrently, so we only need a read lock here. 1005 * concurrently, so we only need a read lock here.
998 * This lock must precede get_netdev_for_sock to prevent races between 1006 * This lock must precede get_netdev_for_sock to prevent races between
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index e2b69e805d46..4674e57e66b0 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -251,7 +251,7 @@ static void tls_write_space(struct sock *sk)
251 ctx->sk_write_space(sk); 251 ctx->sk_write_space(sk);
252} 252}
253 253
254static void tls_ctx_free(struct tls_context *ctx) 254void tls_ctx_free(struct tls_context *ctx)
255{ 255{
256 if (!ctx) 256 if (!ctx)
257 return; 257 return;
@@ -643,7 +643,7 @@ static void tls_hw_sk_destruct(struct sock *sk)
643 643
644 ctx->sk_destruct(sk); 644 ctx->sk_destruct(sk);
645 /* Free ctx */ 645 /* Free ctx */
646 kfree(ctx); 646 tls_ctx_free(ctx);
647 icsk->icsk_ulp_data = NULL; 647 icsk->icsk_ulp_data = NULL;
648} 648}
649 649
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index db585964b52b..53b4ad94e74a 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1959,7 +1959,8 @@ bool tls_sw_stream_read(const struct sock *sk)
1959 ingress_empty = list_empty(&psock->ingress_msg); 1959 ingress_empty = list_empty(&psock->ingress_msg);
1960 rcu_read_unlock(); 1960 rcu_read_unlock();
1961 1961
1962 return !ingress_empty || ctx->recv_pkt; 1962 return !ingress_empty || ctx->recv_pkt ||
1963 !skb_queue_empty(&ctx->rx_list);
1963} 1964}
1964 1965
1965static int tls_read_size(struct strparser *strp, struct sk_buff *skb) 1966static int tls_read_size(struct strparser *strp, struct sk_buff *skb)
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index 9c6de4f114f8..20c91f02d3d8 100644
--- a/net/xdp/xdp_umem.c
+++ b/net/xdp/xdp_umem.c
@@ -105,6 +105,9 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
105 105
106 umem->dev = dev; 106 umem->dev = dev;
107 umem->queue_id = queue_id; 107 umem->queue_id = queue_id;
108
109 dev_hold(dev);
110
108 if (force_copy) 111 if (force_copy)
109 /* For copy-mode, we are done. */ 112 /* For copy-mode, we are done. */
110 goto out_rtnl_unlock; 113 goto out_rtnl_unlock;
@@ -124,7 +127,6 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
124 goto err_unreg_umem; 127 goto err_unreg_umem;
125 rtnl_unlock(); 128 rtnl_unlock();
126 129
127 dev_hold(dev);
128 umem->zc = true; 130 umem->zc = true;
129 return 0; 131 return 0;
130 132
@@ -138,11 +140,13 @@ out_rtnl_unlock:
138 return err; 140 return err;
139} 141}
140 142
141static void xdp_umem_clear_dev(struct xdp_umem *umem) 143void xdp_umem_clear_dev(struct xdp_umem *umem)
142{ 144{
143 struct netdev_bpf bpf; 145 struct netdev_bpf bpf;
144 int err; 146 int err;
145 147
148 ASSERT_RTNL();
149
146 if (!umem->dev) 150 if (!umem->dev)
147 return; 151 return;
148 152
@@ -151,22 +155,17 @@ static void xdp_umem_clear_dev(struct xdp_umem *umem)
151 bpf.xsk.umem = NULL; 155 bpf.xsk.umem = NULL;
152 bpf.xsk.queue_id = umem->queue_id; 156 bpf.xsk.queue_id = umem->queue_id;
153 157
154 rtnl_lock();
155 err = umem->dev->netdev_ops->ndo_bpf(umem->dev, &bpf); 158 err = umem->dev->netdev_ops->ndo_bpf(umem->dev, &bpf);
156 rtnl_unlock();
157 159
158 if (err) 160 if (err)
159 WARN(1, "failed to disable umem!\n"); 161 WARN(1, "failed to disable umem!\n");
160 } 162 }
161 163
162 rtnl_lock();
163 xdp_clear_umem_at_qid(umem->dev, umem->queue_id); 164 xdp_clear_umem_at_qid(umem->dev, umem->queue_id);
164 rtnl_unlock();
165 165
166 if (umem->zc) { 166 dev_put(umem->dev);
167 dev_put(umem->dev); 167 umem->dev = NULL;
168 umem->zc = false; 168 umem->zc = false;
169 }
170} 169}
171 170
172static void xdp_umem_unpin_pages(struct xdp_umem *umem) 171static void xdp_umem_unpin_pages(struct xdp_umem *umem)
@@ -194,7 +193,9 @@ static void xdp_umem_unaccount_pages(struct xdp_umem *umem)
194 193
195static void xdp_umem_release(struct xdp_umem *umem) 194static void xdp_umem_release(struct xdp_umem *umem)
196{ 195{
196 rtnl_lock();
197 xdp_umem_clear_dev(umem); 197 xdp_umem_clear_dev(umem);
198 rtnl_unlock();
198 199
199 ida_simple_remove(&umem_ida, umem->id); 200 ida_simple_remove(&umem_ida, umem->id);
200 201
diff --git a/net/xdp/xdp_umem.h b/net/xdp/xdp_umem.h
index 27603227601b..a63a9fb251f5 100644
--- a/net/xdp/xdp_umem.h
+++ b/net/xdp/xdp_umem.h
@@ -10,6 +10,7 @@
10 10
11int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev, 11int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
12 u16 queue_id, u16 flags); 12 u16 queue_id, u16 flags);
13void xdp_umem_clear_dev(struct xdp_umem *umem);
13bool xdp_umem_validate_queues(struct xdp_umem *umem); 14bool xdp_umem_validate_queues(struct xdp_umem *umem);
14void xdp_get_umem(struct xdp_umem *umem); 15void xdp_get_umem(struct xdp_umem *umem);
15void xdp_put_umem(struct xdp_umem *umem); 16void xdp_put_umem(struct xdp_umem *umem);
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 0574f008954c..d4d6f10aa936 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -349,6 +349,22 @@ static int xsk_init_queue(u32 entries, struct xsk_queue **queue,
349 return 0; 349 return 0;
350} 350}
351 351
352static void xsk_unbind_dev(struct xdp_sock *xs)
353{
354 struct net_device *dev = xs->dev;
355
356 if (!dev || xs->state != XSK_BOUND)
357 return;
358
359 xs->state = XSK_UNBOUND;
360
361 /* Wait for driver to stop using the xdp socket. */
362 xdp_del_sk_umem(xs->umem, xs);
363 xs->dev = NULL;
364 synchronize_net();
365 dev_put(dev);
366}
367
352static int xsk_release(struct socket *sock) 368static int xsk_release(struct socket *sock)
353{ 369{
354 struct sock *sk = sock->sk; 370 struct sock *sk = sock->sk;
@@ -368,15 +384,7 @@ static int xsk_release(struct socket *sock)
368 sock_prot_inuse_add(net, sk->sk_prot, -1); 384 sock_prot_inuse_add(net, sk->sk_prot, -1);
369 local_bh_enable(); 385 local_bh_enable();
370 386
371 if (xs->dev) { 387 xsk_unbind_dev(xs);
372 struct net_device *dev = xs->dev;
373
374 /* Wait for driver to stop using the xdp socket. */
375 xdp_del_sk_umem(xs->umem, xs);
376 xs->dev = NULL;
377 synchronize_net();
378 dev_put(dev);
379 }
380 388
381 xskq_destroy(xs->rx); 389 xskq_destroy(xs->rx);
382 xskq_destroy(xs->tx); 390 xskq_destroy(xs->tx);
@@ -426,7 +434,7 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
426 return -EINVAL; 434 return -EINVAL;
427 435
428 mutex_lock(&xs->mutex); 436 mutex_lock(&xs->mutex);
429 if (xs->dev) { 437 if (xs->state != XSK_READY) {
430 err = -EBUSY; 438 err = -EBUSY;
431 goto out_release; 439 goto out_release;
432 } 440 }
@@ -506,6 +514,8 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
506out_unlock: 514out_unlock:
507 if (err) 515 if (err)
508 dev_put(dev); 516 dev_put(dev);
517 else
518 xs->state = XSK_BOUND;
509out_release: 519out_release:
510 mutex_unlock(&xs->mutex); 520 mutex_unlock(&xs->mutex);
511 return err; 521 return err;
@@ -534,6 +544,10 @@ static int xsk_setsockopt(struct socket *sock, int level, int optname,
534 return -EFAULT; 544 return -EFAULT;
535 545
536 mutex_lock(&xs->mutex); 546 mutex_lock(&xs->mutex);
547 if (xs->state != XSK_READY) {
548 mutex_unlock(&xs->mutex);
549 return -EBUSY;
550 }
537 q = (optname == XDP_TX_RING) ? &xs->tx : &xs->rx; 551 q = (optname == XDP_TX_RING) ? &xs->tx : &xs->rx;
538 err = xsk_init_queue(entries, q, false); 552 err = xsk_init_queue(entries, q, false);
539 mutex_unlock(&xs->mutex); 553 mutex_unlock(&xs->mutex);
@@ -548,7 +562,7 @@ static int xsk_setsockopt(struct socket *sock, int level, int optname,
548 return -EFAULT; 562 return -EFAULT;
549 563
550 mutex_lock(&xs->mutex); 564 mutex_lock(&xs->mutex);
551 if (xs->umem) { 565 if (xs->state != XSK_READY || xs->umem) {
552 mutex_unlock(&xs->mutex); 566 mutex_unlock(&xs->mutex);
553 return -EBUSY; 567 return -EBUSY;
554 } 568 }
@@ -575,6 +589,10 @@ static int xsk_setsockopt(struct socket *sock, int level, int optname,
575 return -EFAULT; 589 return -EFAULT;
576 590
577 mutex_lock(&xs->mutex); 591 mutex_lock(&xs->mutex);
592 if (xs->state != XSK_READY) {
593 mutex_unlock(&xs->mutex);
594 return -EBUSY;
595 }
578 if (!xs->umem) { 596 if (!xs->umem) {
579 mutex_unlock(&xs->mutex); 597 mutex_unlock(&xs->mutex);
580 return -EINVAL; 598 return -EINVAL;
@@ -696,6 +714,9 @@ static int xsk_mmap(struct file *file, struct socket *sock,
696 unsigned long pfn; 714 unsigned long pfn;
697 struct page *qpg; 715 struct page *qpg;
698 716
717 if (xs->state != XSK_READY)
718 return -EBUSY;
719
699 if (offset == XDP_PGOFF_RX_RING) { 720 if (offset == XDP_PGOFF_RX_RING) {
700 q = READ_ONCE(xs->rx); 721 q = READ_ONCE(xs->rx);
701 } else if (offset == XDP_PGOFF_TX_RING) { 722 } else if (offset == XDP_PGOFF_TX_RING) {
@@ -727,6 +748,38 @@ static int xsk_mmap(struct file *file, struct socket *sock,
727 size, vma->vm_page_prot); 748 size, vma->vm_page_prot);
728} 749}
729 750
751static int xsk_notifier(struct notifier_block *this,
752 unsigned long msg, void *ptr)
753{
754 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
755 struct net *net = dev_net(dev);
756 struct sock *sk;
757
758 switch (msg) {
759 case NETDEV_UNREGISTER:
760 mutex_lock(&net->xdp.lock);
761 sk_for_each(sk, &net->xdp.list) {
762 struct xdp_sock *xs = xdp_sk(sk);
763
764 mutex_lock(&xs->mutex);
765 if (xs->dev == dev) {
766 sk->sk_err = ENETDOWN;
767 if (!sock_flag(sk, SOCK_DEAD))
768 sk->sk_error_report(sk);
769
770 xsk_unbind_dev(xs);
771
772 /* Clear device references in umem. */
773 xdp_umem_clear_dev(xs->umem);
774 }
775 mutex_unlock(&xs->mutex);
776 }
777 mutex_unlock(&net->xdp.lock);
778 break;
779 }
780 return NOTIFY_DONE;
781}
782
730static struct proto xsk_proto = { 783static struct proto xsk_proto = {
731 .name = "XDP", 784 .name = "XDP",
732 .owner = THIS_MODULE, 785 .owner = THIS_MODULE,
@@ -798,6 +851,7 @@ static int xsk_create(struct net *net, struct socket *sock, int protocol,
798 sock_set_flag(sk, SOCK_RCU_FREE); 851 sock_set_flag(sk, SOCK_RCU_FREE);
799 852
800 xs = xdp_sk(sk); 853 xs = xdp_sk(sk);
854 xs->state = XSK_READY;
801 mutex_init(&xs->mutex); 855 mutex_init(&xs->mutex);
802 spin_lock_init(&xs->rx_lock); 856 spin_lock_init(&xs->rx_lock);
803 spin_lock_init(&xs->tx_completion_lock); 857 spin_lock_init(&xs->tx_completion_lock);
@@ -819,6 +873,10 @@ static const struct net_proto_family xsk_family_ops = {
819 .owner = THIS_MODULE, 873 .owner = THIS_MODULE,
820}; 874};
821 875
876static struct notifier_block xsk_netdev_notifier = {
877 .notifier_call = xsk_notifier,
878};
879
822static int __net_init xsk_net_init(struct net *net) 880static int __net_init xsk_net_init(struct net *net)
823{ 881{
824 mutex_init(&net->xdp.lock); 882 mutex_init(&net->xdp.lock);
@@ -851,8 +909,15 @@ static int __init xsk_init(void)
851 err = register_pernet_subsys(&xsk_net_ops); 909 err = register_pernet_subsys(&xsk_net_ops);
852 if (err) 910 if (err)
853 goto out_sk; 911 goto out_sk;
912
913 err = register_netdevice_notifier(&xsk_netdev_notifier);
914 if (err)
915 goto out_pernet;
916
854 return 0; 917 return 0;
855 918
919out_pernet:
920 unregister_pernet_subsys(&xsk_net_ops);
856out_sk: 921out_sk:
857 sock_unregister(PF_XDP); 922 sock_unregister(PF_XDP);
858out_proto: 923out_proto:
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
index 12b49784a6d5..909c5168ed0f 100644
--- a/net/xdp/xsk_queue.h
+++ b/net/xdp/xsk_queue.h
@@ -302,7 +302,7 @@ static inline void xskq_produce_flush_desc(struct xsk_queue *q)
302 /* Order producer and data */ 302 /* Order producer and data */
303 smp_wmb(); /* B, matches C */ 303 smp_wmb(); /* B, matches C */
304 304
305 q->prod_tail = q->prod_head, 305 q->prod_tail = q->prod_head;
306 WRITE_ONCE(q->ring->producer, q->prod_tail); 306 WRITE_ONCE(q->ring->producer, q->prod_tail);
307} 307}
308 308
diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig
index c967fc3c38c8..51bb6018f3bf 100644
--- a/net/xfrm/Kconfig
+++ b/net/xfrm/Kconfig
@@ -15,6 +15,8 @@ config XFRM_ALGO
15 tristate 15 tristate
16 select XFRM 16 select XFRM
17 select CRYPTO 17 select CRYPTO
18 select CRYPTO_HASH
19 select CRYPTO_BLKCIPHER
18 20
19if INET 21if INET
20config XFRM_USER 22config XFRM_USER
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index f8eb9e342173..74868f9d81fb 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -133,7 +133,7 @@ static void xfrmi_dev_free(struct net_device *dev)
133 free_percpu(dev->tstats); 133 free_percpu(dev->tstats);
134} 134}
135 135
136static int xfrmi_create2(struct net_device *dev) 136static int xfrmi_create(struct net_device *dev)
137{ 137{
138 struct xfrm_if *xi = netdev_priv(dev); 138 struct xfrm_if *xi = netdev_priv(dev);
139 struct net *net = dev_net(dev); 139 struct net *net = dev_net(dev);
@@ -156,54 +156,7 @@ out:
156 return err; 156 return err;
157} 157}
158 158
159static struct xfrm_if *xfrmi_create(struct net *net, struct xfrm_if_parms *p) 159static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p)
160{
161 struct net_device *dev;
162 struct xfrm_if *xi;
163 char name[IFNAMSIZ];
164 int err;
165
166 if (p->name[0]) {
167 strlcpy(name, p->name, IFNAMSIZ);
168 } else {
169 err = -EINVAL;
170 goto failed;
171 }
172
173 dev = alloc_netdev(sizeof(*xi), name, NET_NAME_UNKNOWN, xfrmi_dev_setup);
174 if (!dev) {
175 err = -EAGAIN;
176 goto failed;
177 }
178
179 dev_net_set(dev, net);
180
181 xi = netdev_priv(dev);
182 xi->p = *p;
183 xi->net = net;
184 xi->dev = dev;
185 xi->phydev = dev_get_by_index(net, p->link);
186 if (!xi->phydev) {
187 err = -ENODEV;
188 goto failed_free;
189 }
190
191 err = xfrmi_create2(dev);
192 if (err < 0)
193 goto failed_dev_put;
194
195 return xi;
196
197failed_dev_put:
198 dev_put(xi->phydev);
199failed_free:
200 free_netdev(dev);
201failed:
202 return ERR_PTR(err);
203}
204
205static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p,
206 int create)
207{ 160{
208 struct xfrm_if __rcu **xip; 161 struct xfrm_if __rcu **xip;
209 struct xfrm_if *xi; 162 struct xfrm_if *xi;
@@ -211,17 +164,11 @@ static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p,
211 164
212 for (xip = &xfrmn->xfrmi[0]; 165 for (xip = &xfrmn->xfrmi[0];
213 (xi = rtnl_dereference(*xip)) != NULL; 166 (xi = rtnl_dereference(*xip)) != NULL;
214 xip = &xi->next) { 167 xip = &xi->next)
215 if (xi->p.if_id == p->if_id) { 168 if (xi->p.if_id == p->if_id)
216 if (create)
217 return ERR_PTR(-EEXIST);
218
219 return xi; 169 return xi;
220 } 170
221 } 171 return NULL;
222 if (!create)
223 return ERR_PTR(-ENODEV);
224 return xfrmi_create(net, p);
225} 172}
226 173
227static void xfrmi_dev_uninit(struct net_device *dev) 174static void xfrmi_dev_uninit(struct net_device *dev)
@@ -686,21 +633,33 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev,
686 struct netlink_ext_ack *extack) 633 struct netlink_ext_ack *extack)
687{ 634{
688 struct net *net = dev_net(dev); 635 struct net *net = dev_net(dev);
689 struct xfrm_if_parms *p; 636 struct xfrm_if_parms p;
690 struct xfrm_if *xi; 637 struct xfrm_if *xi;
638 int err;
691 639
692 xi = netdev_priv(dev); 640 xfrmi_netlink_parms(data, &p);
693 p = &xi->p;
694
695 xfrmi_netlink_parms(data, p);
696 641
697 if (!tb[IFLA_IFNAME]) 642 if (!tb[IFLA_IFNAME])
698 return -EINVAL; 643 return -EINVAL;
699 644
700 nla_strlcpy(p->name, tb[IFLA_IFNAME], IFNAMSIZ); 645 nla_strlcpy(p.name, tb[IFLA_IFNAME], IFNAMSIZ);
701 646
702 xi = xfrmi_locate(net, p, 1); 647 xi = xfrmi_locate(net, &p);
703 return PTR_ERR_OR_ZERO(xi); 648 if (xi)
649 return -EEXIST;
650
651 xi = netdev_priv(dev);
652 xi->p = p;
653 xi->net = net;
654 xi->dev = dev;
655 xi->phydev = dev_get_by_index(net, p.link);
656 if (!xi->phydev)
657 return -ENODEV;
658
659 err = xfrmi_create(dev);
660 if (err < 0)
661 dev_put(xi->phydev);
662 return err;
704} 663}
705 664
706static void xfrmi_dellink(struct net_device *dev, struct list_head *head) 665static void xfrmi_dellink(struct net_device *dev, struct list_head *head)
@@ -717,9 +676,8 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
717 676
718 xfrmi_netlink_parms(data, &xi->p); 677 xfrmi_netlink_parms(data, &xi->p);
719 678
720 xi = xfrmi_locate(net, &xi->p, 0); 679 xi = xfrmi_locate(net, &xi->p);
721 680 if (!xi) {
722 if (IS_ERR_OR_NULL(xi)) {
723 xi = netdev_priv(dev); 681 xi = netdev_priv(dev);
724 } else { 682 } else {
725 if (xi->dev != dev) 683 if (xi->dev != dev)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 1070dfece76b..8ca637a72697 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -585,9 +585,6 @@ static void xfrm_bydst_resize(struct net *net, int dir)
585 odst = rcu_dereference_protected(net->xfrm.policy_bydst[dir].table, 585 odst = rcu_dereference_protected(net->xfrm.policy_bydst[dir].table,
586 lockdep_is_held(&net->xfrm.xfrm_policy_lock)); 586 lockdep_is_held(&net->xfrm.xfrm_policy_lock));
587 587
588 odst = rcu_dereference_protected(net->xfrm.policy_bydst[dir].table,
589 lockdep_is_held(&net->xfrm.xfrm_policy_lock));
590
591 for (i = hmask; i >= 0; i--) 588 for (i = hmask; i >= 0; i--)
592 xfrm_dst_hash_transfer(net, odst + i, ndst, nhashmask, dir); 589 xfrm_dst_hash_transfer(net, odst + i, ndst, nhashmask, dir);
593 590
@@ -1280,13 +1277,17 @@ static void xfrm_hash_rebuild(struct work_struct *work)
1280 1277
1281 hlist_for_each_entry_safe(policy, n, 1278 hlist_for_each_entry_safe(policy, n,
1282 &net->xfrm.policy_inexact[dir], 1279 &net->xfrm.policy_inexact[dir],
1283 bydst_inexact_list) 1280 bydst_inexact_list) {
1281 hlist_del_rcu(&policy->bydst);
1284 hlist_del_init(&policy->bydst_inexact_list); 1282 hlist_del_init(&policy->bydst_inexact_list);
1283 }
1285 1284
1286 hmask = net->xfrm.policy_bydst[dir].hmask; 1285 hmask = net->xfrm.policy_bydst[dir].hmask;
1287 odst = net->xfrm.policy_bydst[dir].table; 1286 odst = net->xfrm.policy_bydst[dir].table;
1288 for (i = hmask; i >= 0; i--) 1287 for (i = hmask; i >= 0; i--) {
1289 INIT_HLIST_HEAD(odst + i); 1288 hlist_for_each_entry_safe(policy, n, odst + i, bydst)
1289 hlist_del_rcu(&policy->bydst);
1290 }
1290 if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) { 1291 if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) {
1291 /* dir out => dst = remote, src = local */ 1292 /* dir out => dst = remote, src = local */
1292 net->xfrm.policy_bydst[dir].dbits4 = rbits4; 1293 net->xfrm.policy_bydst[dir].dbits4 = rbits4;
@@ -1315,8 +1316,6 @@ static void xfrm_hash_rebuild(struct work_struct *work)
1315 chain = policy_hash_bysel(net, &policy->selector, 1316 chain = policy_hash_bysel(net, &policy->selector,
1316 policy->family, dir); 1317 policy->family, dir);
1317 1318
1318 hlist_del_rcu(&policy->bydst);
1319
1320 if (!chain) { 1319 if (!chain) {
1321 void *p = xfrm_policy_inexact_insert(policy, dir, 0); 1320 void *p = xfrm_policy_inexact_insert(policy, dir, 0);
1322 1321
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 173477211e40..b88ba45ff1ac 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -152,6 +152,25 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
152 err = -EINVAL; 152 err = -EINVAL;
153 switch (p->family) { 153 switch (p->family) {
154 case AF_INET: 154 case AF_INET:
155 break;
156
157 case AF_INET6:
158#if IS_ENABLED(CONFIG_IPV6)
159 break;
160#else
161 err = -EAFNOSUPPORT;
162 goto out;
163#endif
164
165 default:
166 goto out;
167 }
168
169 switch (p->sel.family) {
170 case AF_UNSPEC:
171 break;
172
173 case AF_INET:
155 if (p->sel.prefixlen_d > 32 || p->sel.prefixlen_s > 32) 174 if (p->sel.prefixlen_d > 32 || p->sel.prefixlen_s > 32)
156 goto out; 175 goto out;
157 176
diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c
index 39de06f3ec25..5440cd620607 100644
--- a/samples/bpf/xdp_redirect_user.c
+++ b/samples/bpf/xdp_redirect_user.c
@@ -196,7 +196,7 @@ int main(int argc, char **argv)
196 } 196 }
197 197
198 memset(&info, 0, sizeof(info)); 198 memset(&info, 0, sizeof(info));
199 ret = bpf_obj_get_info_by_fd(prog_fd, &info, &info_len); 199 ret = bpf_obj_get_info_by_fd(dummy_prog_fd, &info, &info_len);
200 if (ret) { 200 if (ret) {
201 printf("can't get prog info - %s\n", strerror(errno)); 201 printf("can't get prog info - %s\n", strerror(errno));
202 return ret; 202 return ret;
diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c
index 390b89a224f1..f3c05b08c68c 100644
--- a/tools/bpf/bpftool/cgroup.c
+++ b/tools/bpf/bpftool/cgroup.c
@@ -171,7 +171,7 @@ static int do_show(int argc, char **argv)
171 171
172 cgroup_fd = open(argv[0], O_RDONLY); 172 cgroup_fd = open(argv[0], O_RDONLY);
173 if (cgroup_fd < 0) { 173 if (cgroup_fd < 0) {
174 p_err("can't open cgroup %s", argv[1]); 174 p_err("can't open cgroup %s", argv[0]);
175 goto exit; 175 goto exit;
176 } 176 }
177 177
@@ -359,7 +359,7 @@ static int do_attach(int argc, char **argv)
359 359
360 cgroup_fd = open(argv[0], O_RDONLY); 360 cgroup_fd = open(argv[0], O_RDONLY);
361 if (cgroup_fd < 0) { 361 if (cgroup_fd < 0) {
362 p_err("can't open cgroup %s", argv[1]); 362 p_err("can't open cgroup %s", argv[0]);
363 goto exit; 363 goto exit;
364 } 364 }
365 365
@@ -417,7 +417,7 @@ static int do_detach(int argc, char **argv)
417 417
418 cgroup_fd = open(argv[0], O_RDONLY); 418 cgroup_fd = open(argv[0], O_RDONLY);
419 if (cgroup_fd < 0) { 419 if (cgroup_fd < 0) {
420 p_err("can't open cgroup %s", argv[1]); 420 p_err("can't open cgroup %s", argv[0]);
421 goto exit; 421 goto exit;
422 } 422 }
423 423
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index e692bb21846f..402208581b2d 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -3190,6 +3190,7 @@ struct bpf_prog_info {
3190 char name[BPF_OBJ_NAME_LEN]; 3190 char name[BPF_OBJ_NAME_LEN];
3191 __u32 ifindex; 3191 __u32 ifindex;
3192 __u32 gpl_compatible:1; 3192 __u32 gpl_compatible:1;
3193 __u32 :31; /* alignment pad */
3193 __u64 netns_dev; 3194 __u64 netns_dev;
3194 __u64 netns_ino; 3195 __u64 netns_ino;
3195 __u32 nr_jited_ksyms; 3196 __u32 nr_jited_ksyms;
diff --git a/tools/testing/selftests/bpf/progs/test_lwt_seg6local.c b/tools/testing/selftests/bpf/progs/test_lwt_seg6local.c
index 7c7cb3177463..a334a0e882e4 100644
--- a/tools/testing/selftests/bpf/progs/test_lwt_seg6local.c
+++ b/tools/testing/selftests/bpf/progs/test_lwt_seg6local.c
@@ -54,7 +54,7 @@ struct sr6_tlv_t {
54 unsigned char value[0]; 54 unsigned char value[0];
55} BPF_PACKET_HEADER; 55} BPF_PACKET_HEADER;
56 56
57__attribute__((always_inline)) struct ip6_srh_t *get_srh(struct __sk_buff *skb) 57static __always_inline struct ip6_srh_t *get_srh(struct __sk_buff *skb)
58{ 58{
59 void *cursor, *data_end; 59 void *cursor, *data_end;
60 struct ip6_srh_t *srh; 60 struct ip6_srh_t *srh;
@@ -88,7 +88,7 @@ __attribute__((always_inline)) struct ip6_srh_t *get_srh(struct __sk_buff *skb)
88 return srh; 88 return srh;
89} 89}
90 90
91__attribute__((always_inline)) 91static __always_inline
92int update_tlv_pad(struct __sk_buff *skb, uint32_t new_pad, 92int update_tlv_pad(struct __sk_buff *skb, uint32_t new_pad,
93 uint32_t old_pad, uint32_t pad_off) 93 uint32_t old_pad, uint32_t pad_off)
94{ 94{
@@ -118,7 +118,7 @@ int update_tlv_pad(struct __sk_buff *skb, uint32_t new_pad,
118 return 0; 118 return 0;
119} 119}
120 120
121__attribute__((always_inline)) 121static __always_inline
122int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh, 122int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh,
123 uint32_t *tlv_off, uint32_t *pad_size, 123 uint32_t *tlv_off, uint32_t *pad_size,
124 uint32_t *pad_off) 124 uint32_t *pad_off)
@@ -177,7 +177,7 @@ int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh,
177 return 0; 177 return 0;
178} 178}
179 179
180__attribute__((always_inline)) 180static __always_inline
181int add_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, uint32_t tlv_off, 181int add_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, uint32_t tlv_off,
182 struct sr6_tlv_t *itlv, uint8_t tlv_size) 182 struct sr6_tlv_t *itlv, uint8_t tlv_size)
183{ 183{
@@ -221,7 +221,7 @@ int add_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, uint32_t tlv_off,
221 return update_tlv_pad(skb, new_pad, pad_size, pad_off); 221 return update_tlv_pad(skb, new_pad, pad_size, pad_off);
222} 222}
223 223
224__attribute__((always_inline)) 224static __always_inline
225int delete_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, 225int delete_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh,
226 uint32_t tlv_off) 226 uint32_t tlv_off)
227{ 227{
@@ -259,7 +259,7 @@ int delete_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh,
259 return update_tlv_pad(skb, new_pad, pad_size, pad_off); 259 return update_tlv_pad(skb, new_pad, pad_size, pad_off);
260} 260}
261 261
262__attribute__((always_inline)) 262static __always_inline
263int has_egr_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh) 263int has_egr_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh)
264{ 264{
265 int tlv_offset = sizeof(struct ip6_t) + sizeof(struct ip6_srh_t) + 265 int tlv_offset = sizeof(struct ip6_t) + sizeof(struct ip6_srh_t) +
diff --git a/tools/testing/selftests/bpf/verifier/basic_instr.c b/tools/testing/selftests/bpf/verifier/basic_instr.c
index ed91a7b9a456..071dbc889e8c 100644
--- a/tools/testing/selftests/bpf/verifier/basic_instr.c
+++ b/tools/testing/selftests/bpf/verifier/basic_instr.c
@@ -91,6 +91,91 @@
91 .result = ACCEPT, 91 .result = ACCEPT,
92}, 92},
93{ 93{
94 "lsh64 by 0 imm",
95 .insns = {
96 BPF_LD_IMM64(BPF_REG_0, 1),
97 BPF_LD_IMM64(BPF_REG_1, 1),
98 BPF_ALU64_IMM(BPF_LSH, BPF_REG_1, 0),
99 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1, 1),
100 BPF_MOV64_IMM(BPF_REG_0, 2),
101 BPF_EXIT_INSN(),
102 },
103 .result = ACCEPT,
104 .retval = 1,
105},
106{
107 "rsh64 by 0 imm",
108 .insns = {
109 BPF_LD_IMM64(BPF_REG_0, 1),
110 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
111 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
112 BPF_ALU64_IMM(BPF_RSH, BPF_REG_1, 0),
113 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
114 BPF_MOV64_IMM(BPF_REG_0, 2),
115 BPF_EXIT_INSN(),
116 },
117 .result = ACCEPT,
118 .retval = 1,
119},
120{
121 "arsh64 by 0 imm",
122 .insns = {
123 BPF_LD_IMM64(BPF_REG_0, 1),
124 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
125 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
126 BPF_ALU64_IMM(BPF_ARSH, BPF_REG_1, 0),
127 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
128 BPF_MOV64_IMM(BPF_REG_0, 2),
129 BPF_EXIT_INSN(),
130 },
131 .result = ACCEPT,
132 .retval = 1,
133},
134{
135 "lsh64 by 0 reg",
136 .insns = {
137 BPF_LD_IMM64(BPF_REG_0, 1),
138 BPF_LD_IMM64(BPF_REG_1, 1),
139 BPF_LD_IMM64(BPF_REG_2, 0),
140 BPF_ALU64_REG(BPF_LSH, BPF_REG_1, BPF_REG_2),
141 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1, 1),
142 BPF_MOV64_IMM(BPF_REG_0, 2),
143 BPF_EXIT_INSN(),
144 },
145 .result = ACCEPT,
146 .retval = 1,
147},
148{
149 "rsh64 by 0 reg",
150 .insns = {
151 BPF_LD_IMM64(BPF_REG_0, 1),
152 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
153 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
154 BPF_LD_IMM64(BPF_REG_3, 0),
155 BPF_ALU64_REG(BPF_RSH, BPF_REG_1, BPF_REG_3),
156 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
157 BPF_MOV64_IMM(BPF_REG_0, 2),
158 BPF_EXIT_INSN(),
159 },
160 .result = ACCEPT,
161 .retval = 1,
162},
163{
164 "arsh64 by 0 reg",
165 .insns = {
166 BPF_LD_IMM64(BPF_REG_0, 1),
167 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
168 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
169 BPF_LD_IMM64(BPF_REG_3, 0),
170 BPF_ALU64_REG(BPF_ARSH, BPF_REG_1, BPF_REG_3),
171 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
172 BPF_MOV64_IMM(BPF_REG_0, 2),
173 BPF_EXIT_INSN(),
174 },
175 .result = ACCEPT,
176 .retval = 1,
177},
178{
94 "invalid 64-bit BPF_END", 179 "invalid 64-bit BPF_END",
95 .insns = { 180 .insns = {
96 BPF_MOV32_IMM(BPF_REG_0, 0), 181 BPF_MOV32_IMM(BPF_REG_0, 0),
diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
index e4b878d95ba0..b8503a8119b0 100644
--- a/tools/testing/selftests/net/config
+++ b/tools/testing/selftests/net/config
@@ -28,3 +28,4 @@ CONFIG_NFT_CHAIN_NAT_IPV4=m
28CONFIG_NET_SCH_FQ=m 28CONFIG_NET_SCH_FQ=m
29CONFIG_NET_SCH_ETF=m 29CONFIG_NET_SCH_ETF=m
30CONFIG_TEST_BLACKHOLE_DEV=m 30CONFIG_TEST_BLACKHOLE_DEV=m
31CONFIG_KALLSYMS=y
diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests
index ea5938ec009a..8b42e8b04e0f 100755
--- a/tools/testing/selftests/net/run_afpackettests
+++ b/tools/testing/selftests/net/run_afpackettests
@@ -21,12 +21,16 @@ fi
21echo "--------------------" 21echo "--------------------"
22echo "running psock_tpacket test" 22echo "running psock_tpacket test"
23echo "--------------------" 23echo "--------------------"
24./in_netns.sh ./psock_tpacket 24if [ -f /proc/kallsyms ]; then
25if [ $? -ne 0 ]; then 25 ./in_netns.sh ./psock_tpacket
26 echo "[FAIL]" 26 if [ $? -ne 0 ]; then
27 ret=1 27 echo "[FAIL]"
28 ret=1
29 else
30 echo "[PASS]"
31 fi
28else 32else
29 echo "[PASS]" 33 echo "[SKIP] CONFIG_KALLSYMS not enabled"
30fi 34fi
31 35
32echo "--------------------" 36echo "--------------------"
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index 278c86134556..090fff9dbc48 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -644,6 +644,32 @@ TEST_F(tls, poll_wait)
644 EXPECT_EQ(recv(self->cfd, recv_mem, send_len, MSG_WAITALL), send_len); 644 EXPECT_EQ(recv(self->cfd, recv_mem, send_len, MSG_WAITALL), send_len);
645} 645}
646 646
647TEST_F(tls, poll_wait_split)
648{
649 struct pollfd fd = { 0, 0, 0 };
650 char send_mem[20] = {};
651 char recv_mem[15];
652
653 fd.fd = self->cfd;
654 fd.events = POLLIN;
655 /* Send 20 bytes */
656 EXPECT_EQ(send(self->fd, send_mem, sizeof(send_mem), 0),
657 sizeof(send_mem));
658 /* Poll with inf. timeout */
659 EXPECT_EQ(poll(&fd, 1, -1), 1);
660 EXPECT_EQ(fd.revents & POLLIN, 1);
661 EXPECT_EQ(recv(self->cfd, recv_mem, sizeof(recv_mem), MSG_WAITALL),
662 sizeof(recv_mem));
663
664 /* Now the remaining 5 bytes of record data are in TLS ULP */
665 fd.fd = self->cfd;
666 fd.events = POLLIN;
667 EXPECT_EQ(poll(&fd, 1, -1), 1);
668 EXPECT_EQ(fd.revents & POLLIN, 1);
669 EXPECT_EQ(recv(self->cfd, recv_mem, sizeof(recv_mem), 0),
670 sizeof(send_mem) - sizeof(recv_mem));
671}
672
647TEST_F(tls, blocking) 673TEST_F(tls, blocking)
648{ 674{
649 size_t data = 100000; 675 size_t data = 100000;
diff --git a/tools/testing/selftests/net/txring_overwrite.c b/tools/testing/selftests/net/txring_overwrite.c
index fd8b1c663c39..7d9ea039450a 100644
--- a/tools/testing/selftests/net/txring_overwrite.c
+++ b/tools/testing/selftests/net/txring_overwrite.c
@@ -113,7 +113,7 @@ static int setup_tx(char **ring)
113 113
114 *ring = mmap(0, req.tp_block_size * req.tp_block_nr, 114 *ring = mmap(0, req.tp_block_size * req.tp_block_nr,
115 PROT_READ | PROT_WRITE, MAP_SHARED, fdt, 0); 115 PROT_READ | PROT_WRITE, MAP_SHARED, fdt, 0);
116 if (!*ring) 116 if (*ring == MAP_FAILED)
117 error(1, errno, "mmap"); 117 error(1, errno, "mmap");
118 118
119 return fdt; 119 return fdt;
diff --git a/tools/testing/selftests/net/xfrm_policy.sh b/tools/testing/selftests/net/xfrm_policy.sh
index 71d7fdc513c1..5445943bf07f 100755
--- a/tools/testing/selftests/net/xfrm_policy.sh
+++ b/tools/testing/selftests/net/xfrm_policy.sh
@@ -257,6 +257,29 @@ check_exceptions()
257 return $lret 257 return $lret
258} 258}
259 259
260check_hthresh_repeat()
261{
262 local log=$1
263 i=0
264
265 for i in $(seq 1 10);do
266 ip -net ns1 xfrm policy update src e000:0001::0000 dst ff01::0014:0000:0001 dir in tmpl src :: dst :: proto esp mode tunnel priority 100 action allow || break
267 ip -net ns1 xfrm policy set hthresh6 0 28 || break
268
269 ip -net ns1 xfrm policy update src e000:0001::0000 dst ff01::01 dir in tmpl src :: dst :: proto esp mode tunnel priority 100 action allow || break
270 ip -net ns1 xfrm policy set hthresh6 0 28 || break
271 done
272
273 if [ $i -ne 10 ] ;then
274 echo "FAIL: $log" 1>&2
275 ret=1
276 return 1
277 fi
278
279 echo "PASS: $log"
280 return 0
281}
282
260#check for needed privileges 283#check for needed privileges
261if [ "$(id -u)" -ne 0 ];then 284if [ "$(id -u)" -ne 0 ];then
262 echo "SKIP: Need root privileges" 285 echo "SKIP: Need root privileges"
@@ -404,7 +427,9 @@ for n in ns3 ns4;do
404 ip -net $n xfrm policy set hthresh4 32 32 hthresh6 128 128 427 ip -net $n xfrm policy set hthresh4 32 32 hthresh6 128 128
405 sleep $((RANDOM%5)) 428 sleep $((RANDOM%5))
406done 429done
407check_exceptions "exceptions and block policies after hresh change to normal" 430check_exceptions "exceptions and block policies after htresh change to normal"
431
432check_hthresh_repeat "policies with repeated htresh change"
408 433
409for i in 1 2 3 4;do ip netns del ns$i;done 434for i in 1 2 3 4;do ip netns del ns$i;done
410 435
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
index 8135778040c2..0f89cd50a94b 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
@@ -45,6 +45,25 @@
45 ] 45 ]
46 }, 46 },
47 { 47 {
48 "id": "2ff3",
49 "name": "Add flower with max handle and then dump it",
50 "category": [
51 "filter",
52 "flower"
53 ],
54 "setup": [
55 "$TC qdisc add dev $DEV2 ingress"
56 ],
57 "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 parent ffff: handle 0xffffffff flower action ok",
58 "expExitCode": "0",
59 "verifyCmd": "$TC filter show dev $DEV2 ingress",
60 "matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
61 "matchCount": "1",
62 "teardown": [
63 "$TC qdisc del dev $DEV2 ingress"
64 ]
65 },
66 {
48 "id": "d052", 67 "id": "d052",
49 "name": "Add 1M filters with the same action", 68 "name": "Add 1M filters with the same action",
50 "category": [ 69 "category": [