Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 18:53:28 +0000 (10:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 19:53:36 +0000 (11:53 -0800)
Lots of conflicts, by happily all cases of overlapping
changes, parallel adds, things of that nature.

Thanks to Stephen Rothwell, Saeed Mahameed, and others
for their guidance in these resolutions.

Signed-off-by: David S. Miller <davem@davemloft.net>
68 files changed:
1  2 
MAINTAINERS
arch/arm64/include/asm/memory.h
drivers/crypto/chelsio/chtls/chtls_cm.c
drivers/infiniband/hw/mlx5/odp.c
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/cadence/macb_main.c
drivers/net/ethernet/hisilicon/hns/hns_enet.c
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
drivers/net/ethernet/netronome/nfp/flower/offload.c
drivers/net/ethernet/qlogic/qed/qed_hsi.h
drivers/net/ethernet/qlogic/qed/qed_ll2.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/phy/phy_device.c
drivers/net/usb/lan78xx.c
drivers/net/vxlan.c
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/wmi-tlv.h
drivers/net/wireless/ath/ath10k/wmi.h
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
drivers/net/xen-netfront.c
drivers/vhost/net.c
include/linux/filter.h
include/linux/mlx5/mlx5_ifc.h
include/net/ip_tunnels.h
include/net/sock.h
include/net/xfrm.h
kernel/bpf/core.c
kernel/bpf/verifier.c
net/core/flow_dissector.c
net/core/neighbour.c
net/ipv4/devinet.c
net/ipv4/ip_forward.c
net/ipv4/ipconfig.c
net/ipv4/ipmr.c
net/ipv4/raw.c
net/ipv6/ip6_output.c
net/ipv6/ip6_udp_tunnel.c
net/ipv6/ip6mr.c
net/ipv6/raw.c
net/mac80211/iface.c
net/mac80211/main.c
net/sched/cls_flower.c
net/sctp/ipv6.c
net/smc/af_smc.c
net/tipc/socket.c
net/wireless/nl80211.c
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c
tools/testing/selftests/bpf/bpf_flow.c
tools/testing/selftests/bpf/test_verifier.c
tools/testing/selftests/net/Makefile

diff --cc MAINTAINERS
index 95baadb0b62bc4d3528b8d6ea034a1ad437cc765,21ce799084182b62e4ce37ccba6ab3dccc2d24e7..6de660a5efe7d72b0358f6848796359467dbdfd7
@@@ -6902,9 -6906,11 +6907,11 @@@ Hyper-V CORE AND DRIVER
  M:    "K. Y. Srinivasan" <kys@microsoft.com>
  M:    Haiyang Zhang <haiyangz@microsoft.com>
  M:    Stephen Hemminger <sthemmin@microsoft.com>
+ M:    Sasha Levin <sashal@kernel.org>
+ T:    git git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
  L:    devel@linuxdriverproject.org
- S:    Maintained
+ S:    Supported
 -F:    Documentation/networking/netvsc.txt
 +F:    Documentation/networking/device_drivers/microsoft/netvsc.txt
  F:    arch/x86/include/asm/mshyperv.h
  F:    arch/x86/include/asm/trace/hyperv.h
  F:    arch/x86/include/asm/hyperv-tlfs.h
Simple merge
index 228b91b7d6b5b12b931620c0d486e5ef7c165a82,931b96c220af973f450cf0b34a37924d40656e9f..59b75299fcbca290777299b97de2ce51071a2640
@@@ -1074,10 -1079,11 +1079,10 @@@ static struct sock *chtls_recv_sock(str
        csk->txq_idx = (rxq_idx < cdev->lldi->ntxq) ? rxq_idx :
                        port_id * step;
        csk->sndbuf = newsk->sk_sndbuf;
 -      csk->smac_idx = cxgb4_tp_smt_idx(cdev->lldi->adapter_type,
 -                                       cxgb4_port_viid(ndev));
 +      csk->smac_idx = ((struct port_info *)netdev_priv(ndev))->smt_idx;
-       tp->rcv_wnd = select_rcv_wnd(csk);
        RCV_WSCALE(tp) = select_rcv_wscale(tcp_full_space(newsk),
-                                          WSCALE_OK(tp),
+                                          sock_net(newsk)->
+                                               ipv4.sysctl_tcp_window_scaling,
                                           tp->window_clamp);
        neigh_release(n);
        inet_inherit_port(&tcp_hashinfo, lsk, newsk);
Simple merge
Simple merge
Simple merge
Simple merge
index ed1158b58798761f40d1790bdb197769bbc9e2ea,820fe85100b08dffd406a863f2e1f50f7879cfda..3a177133e230f92c730acbd3f83369e3ccc95f50
@@@ -1393,17 -1064,14 +1394,8 @@@ static void mlx5e_build_rep_netdev(stru
        netdev->hw_features    |= NETIF_F_RXCSUM;
  
        netdev->features |= netdev->hw_features;
 -
 -      eth_hw_addr_random(netdev);
 -
 -      netdev->min_mtu = ETH_MIN_MTU;
 -      mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
 -      netdev->max_mtu = MLX5E_HW2SW_MTU(&priv->channels.params, max_mtu);
  }
  
- static int mlx5e_rep_get_default_num_channels(struct mlx5_eswitch_rep *rep,
-                                             struct net_device *netdev)
- {
-       if (rep->vport == FDB_UPLINK_VPORT)
-               return mlx5e_get_netdev_max_channels(netdev);
-       else
-               return 1;
- }
  static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
                          struct net_device *netdev,
                          const struct mlx5e_profile *profile,
        if (err)
                return err;
  
-       priv->channels.params.num_channels =
-                       mlx5e_rep_get_default_num_channels(rpriv->rep, netdev);
+       priv->channels.params.num_channels = MLX5E_REP_PARAMS_DEF_NUM_CHANNELS;
  
 -      mlx5e_build_rep_params(mdev, &priv->channels.params, netdev->mtu);
 +      mlx5e_build_rep_params(netdev);
        mlx5e_build_rep_netdev(netdev);
  
        mlx5e_timestamp_init(priv);
index c1a9120412b8cc3a943a2fb1b315a1409062c231,9dabe9d4b2798bc0b41f77761b8fb1126279ea39..59255aeec5ed60e68ae793a6c81c8fd93794de01
@@@ -903,9 -870,9 +903,9 @@@ mlx5e_tc_offload_to_slow_path(struct ml
        struct mlx5_flow_handle *rule;
  
        memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
-       slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
-       slow_attr->split_count = 0,
-       slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN,
+       slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 -      slow_attr->mirror_count = 0;
++      slow_attr->split_count = 0;
+       slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
  
        rule = mlx5e_tc_offload_fdb_rules(esw, flow, spec, slow_attr);
        if (!IS_ERR(rule))
@@@ -920,6 -887,9 +920,9 @@@ mlx5e_tc_unoffload_from_slow_path(struc
                                  struct mlx5_esw_flow_attr *slow_attr)
  {
        memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
 -      slow_attr->mirror_count = 0;
+       slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
++      slow_attr->split_count = 0;
+       slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
        mlx5e_tc_unoffload_fdb_rules(esw, flow, slow_attr);
        flow->flags &= ~MLX5E_TC_FLOW_SLOW;
  }
@@@ -939,13 -909,11 +942,12 @@@ mlx5e_tc_add_fdb_flow(struct mlx5e_pri
        struct mlx5e_rep_priv *rpriv;
        struct mlx5e_priv *out_priv;
        int err = 0, encap_err = 0;
 +      int out_index;
  
-       /* if prios are not supported, keep the old behaviour of using same prio
-        * for all offloaded rules.
-        */
-       if (!mlx5_eswitch_prios_supported(esw))
-               attr->prio = 1;
+       if (!mlx5_eswitch_prios_supported(esw) && attr->prio != 1) {
+               NL_SET_ERR_MSG(extack, "E-switch priorities unsupported, upgrade FW");
+               return -EOPNOTSUPP;
+       }
  
        if (attr->chain > max_chain) {
                NL_SET_ERR_MSG(extack, "Requested chain is out of supported range");
@@@ -2667,7 -2980,15 +2667,15 @@@ static int parse_tc_fdb_actions(struct 
        if (!actions_match_supported(priv, exts, parse_attr, flow, extack))
                return -EOPNOTSUPP;
  
 -      if (attr->mirror_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) {
+       if (attr->dest_chain) {
+               if (attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
+                       NL_SET_ERR_MSG(extack, "Mirroring goto chain rules isn't supported");
+                       return -EOPNOTSUPP;
+               }
+               attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+       }
 +      if (attr->split_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "current firmware doesn't support split rule for port mirroring");
                netdev_warn_once(priv->netdev, "current firmware doesn't support split rule for port mirroring\n");
index 4197b29a9bda5ba18de5ad41d85e11c831308622,f84b9c02fcc5eea8a0a1806831c4b559b31ea4d8..9bfcb9c060a93fdbf8f78ce0720b9d567118f827
@@@ -3668,9 -3523,10 +3673,10 @@@ static const struct mlxsw_listener mlxs
        MLXSW_SP_RXL_MARK(IPV6_PIM, TRAP_TO_CPU, PIM, false),
        MLXSW_SP_RXL_MARK(RPF, TRAP_TO_CPU, RPF, false),
        MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
 -      MLXSW_SP_RXL_MR_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
 +      MLXSW_SP_RXL_L3_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
        /* NVE traps */
        MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, ARP, false),
+       MLXSW_SP_RXL_NO_MARK(NVE_DECAP_ARP, TRAP_TO_CPU, ARP, false),
  };
  
  static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
Simple merge
Simple merge
Simple merge
index 71c3b7b6b1abcda672eda8dbc4e71495bc6b1fe1,0565f8880199d217ad63c574f058bf1b724524f5..3d773634a8e240b9877e94a5de14fffd66507e28
@@@ -3483,9 -3297,16 +3484,16 @@@ static int __vxlan_dev_create(struct ne
  
        list_add(&vxlan->next, &vn->vxlan_list);
        return 0;
  errout:
+       /* unregister_netdevice() destroys the default FDB entry with deletion
+        * notification. But the addition notification was not sent yet, so
+        * destroy the entry by hand here.
+        */
        if (f)
 -              vxlan_fdb_destroy(vxlan, f, false);
 +              vxlan_fdb_destroy(vxlan, f, false, false);
+       if (unregister)
+               unregister_netdevice(dev);
        return err;
  }
  
@@@ -3719,10 -3540,8 +3727,9 @@@ static int vxlan_changelink(struct net_
  {
        struct vxlan_dev *vxlan = netdev_priv(dev);
        struct vxlan_rdst *dst = &vxlan->default_dst;
 +      unsigned long old_age_interval;
        struct vxlan_rdst old_dst;
        struct vxlan_config conf;
-       struct vxlan_fdb *f = NULL;
        int err;
  
        err = vxlan_nl2conf(tb, data,
                                           vxlan->cfg.dst_port,
                                           old_dst.remote_vni,
                                           old_dst.remote_vni,
 -                                         old_dst.remote_ifindex, 0);
 +                                         old_dst.remote_ifindex,
 +                                         true);
  
                if (!vxlan_addr_any(&dst->remote_ip)) {
-                       err = vxlan_fdb_create(vxlan, all_zeros_mac,
+                       err = vxlan_fdb_update(vxlan, all_zeros_mac,
                                               &dst->remote_ip,
                                               NUD_REACHABLE | NUD_PERMANENT,
+                                              NLM_F_APPEND | NLM_F_CREATE,
                                               vxlan->cfg.dst_port,
                                               dst->remote_vni,
                                               dst->remote_vni,
                                               dst->remote_ifindex,
-                                              NTF_SELF, &f);
 -                                             NTF_SELF);
++                                             NTF_SELF, false);
                        if (err) {
                                spin_unlock_bh(&vxlan->hash_lock);
                                return err;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8baa9ab01db6f57616a3682fa07230d30277c476,5fa32c064bafdff8e83dff2bfe081e1fa0090229..fa384f775f1a2afebd586c1ba8607a331e637b83
@@@ -2634,11 -2499,16 +2634,16 @@@ static int neigh_valid_dump_req(const s
                        return -EINVAL;
                }
  
+               if (ndm->ndm_flags & ~NTF_PROXY) {
+                       NL_SET_ERR_MSG(extack, "Invalid flags in header for neighbor dump request");
+                       return -EINVAL;
+               }
                err = nlmsg_parse_strict(nlh, sizeof(struct ndmsg), tb, NDA_MAX,
 -                                       NULL, extack);
 +                                       nda_policy, extack);
        } else {
                err = nlmsg_parse(nlh, sizeof(struct ndmsg), tb, NDA_MAX,
 -                                NULL, extack);
 +                                nda_policy, extack);
        }
        if (err < 0)
                return err;
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/ipmr.c
Simple merge
diff --cc net/ipv4/raw.c
Simple merge
index 703a8e801c5cb3ec4a09378c16fb2d4b3d9f555e,4591ca4bdbe8831f8183c4df0d4237d023b5bb68..5f9fa0302b5a97af835b6f9ff10f53f1b6e1c9be
@@@ -378,13 -378,7 +378,14 @@@ static inline int ip6_forward_finish(st
        __IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS);
        __IP6_ADD_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTOCTETS, skb->len);
  
 +#ifdef CONFIG_NET_SWITCHDEV
 +      if (skb->offload_l3_fwd_mark) {
 +              consume_skb(skb);
 +              return 0;
 +      }
 +#endif
 +
+       skb->tstamp = 0;
        return dst_output(net, sk, skb);
  }
  
Simple merge
Simple merge
diff --cc net/ipv6/raw.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/sctp/ipv6.c
Simple merge
Simple merge
Simple merge
Simple merge
index 6bc817359b58047a8ef0bd7e8e1cc2936cdc39aa,d5635908587f4de80396831f24cdf7591522f511..b3b613660d441605a8c8383cf05119db82af1ea0
@@@ -313,8 -344,14 +313,14 @@@ int xfrm_input(struct sk_buff *skb, in
  
                skb->mark = xfrm_smark_get(skb->mark, x);
  
 -              skb->sp->xvec[skb->sp->len++] = x;
 +              sp->xvec[sp->len++] = x;
  
+               skb_dst_force(skb);
+               if (!skb_dst(skb)) {
+                       XFRM_INC_STATS(net, LINUX_MIB_XFRMINERROR);
+                       goto drop;
+               }
  lock:
                spin_lock(&x->lock);
  
Simple merge
index a08c67c8767ee7447745cccb2c476236e9cfbf58,f8eac4a544f450b4ae8acbfa7d57ab1b55675f97..c3b799c1ee97923c0835516607953803de43825b
@@@ -14068,37 -13916,33 +14068,64 @@@ static struct bpf_test tests[] = 
                .result = ACCEPT,
        },
        {
 +              "check wire_len is not readable by sockets",
 +              .insns = {
 +                      BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
 +                                  offsetof(struct __sk_buff, wire_len)),
 +                      BPF_EXIT_INSN(),
 +              },
 +              .errstr = "invalid bpf_context access",
 +              .result = REJECT,
 +      },
 +      {
 +              "check wire_len is readable by tc classifier",
 +              .insns = {
 +                      BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
 +                                  offsetof(struct __sk_buff, wire_len)),
 +                      BPF_EXIT_INSN(),
 +              },
 +              .prog_type = BPF_PROG_TYPE_SCHED_CLS,
 +              .result = ACCEPT,
 +      },
 +      {
 +              "check wire_len is not writable by tc classifier",
 +              .insns = {
 +                      BPF_STX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
 +                                  offsetof(struct __sk_buff, wire_len)),
 +                      BPF_EXIT_INSN(),
 +              },
 +              .prog_type = BPF_PROG_TYPE_SCHED_CLS,
 +              .errstr = "invalid bpf_context access",
 +              .errstr_unpriv = "R1 leaks addr",
 +              .result = REJECT,
 +      },
+               "calls: cross frame pruning",
+               .insns = {
+                       /* r8 = !!random();
+                        * call pruner()
+                        * if (r8)
+                        *     do something bad;
+                        */
+                       BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+                                    BPF_FUNC_get_prandom_u32),
+                       BPF_MOV64_IMM(BPF_REG_8, 0),
+                       BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+                       BPF_MOV64_IMM(BPF_REG_8, 1),
+                       BPF_MOV64_REG(BPF_REG_1, BPF_REG_8),
+                       BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
+                       BPF_JMP_IMM(BPF_JEQ, BPF_REG_8, 1, 1),
+                       BPF_LDX_MEM(BPF_B, BPF_REG_9, BPF_REG_1, 0),
+                       BPF_MOV64_IMM(BPF_REG_0, 0),
+                       BPF_EXIT_INSN(),
+                       BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 0),
+                       BPF_EXIT_INSN(),
+               },
+               .prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
+               .errstr_unpriv = "function calls to other bpf functions are allowed for root only",
+               .result_unpriv = REJECT,
+               .errstr = "!read_ok",
+               .result = REJECT,
+       },
  };
  
  static int probe_filter_length(const struct bpf_insn *fp)
index 9543a4c2f9bedec12fabf2f71164c0eea70db442,923570a9708ae730909920e321ee2880af0f8a8f..f8f3e90700c0ebc2437ffdd96398caee1b39fa4a
@@@ -4,15 -4,14 +4,16 @@@
  CFLAGS =  -Wall -Wl,--no-as-needed -O2 -g
  CFLAGS += -I../../../../usr/include/
  
 -TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh
 +TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \
 +            rtnetlink.sh xfrm_policy.sh
  TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh ip_defrag.sh
  TEST_PROGS += udpgso_bench.sh fib_rule_tests.sh msg_zerocopy.sh psock_snd.sh
 +TEST_PROGS += udpgro_bench.sh udpgro.sh test_vxlan_under_vrf.sh reuseport_addr_any.sh
+ TEST_PROGS += test_vxlan_fdb_changelink.sh
  TEST_PROGS_EXTENDED := in_netns.sh
  TEST_GEN_FILES =  socket
 -TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
 -TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd
 +TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy reuseport_addr_any
 +TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd txring_overwrite
  TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx ip_defrag
  TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
  TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls