Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorDavid S. Miller <davem@davemloft.net>
Wed, 17 Apr 2019 18:26:25 +0000 (11:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Apr 2019 18:26:25 +0000 (11:26 -0700)
Conflict resolution of af_smc.c from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
40 files changed:
1  2 
.clang-format
MAINTAINERS
Makefile
drivers/net/bonding/bond_main.c
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/qlogic/qed/qed.h
drivers/net/ethernet/qlogic/qed/qed_dev.c
drivers/net/team/team.c
drivers/net/wireless/mac80211_hwsim.c
include/linux/netdevice.h
include/net/sock.h
include/net/tls.h
net/bridge/br_input.c
net/bridge/br_multicast.c
net/bridge/br_netlink.c
net/core/dev.c
net/core/filter.c
net/core/net-sysfs.c
net/core/rtnetlink.c
net/core/skbuff.c
net/ipv4/fou.c
net/ipv4/route.c
net/ipv4/tcp_input.c
net/ipv6/route.c
net/ipv6/udp.c
net/sctp/socket.c
net/smc/af_smc.c
net/smc/smc_pnet.c
net/strparser/strparser.c
net/tipc/link.c
net/tls/tls_main.c
net/tls/tls_sw.c
net/wireless/nl80211.c
tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
tools/testing/selftests/net/fib_tests.sh

diff --cc .clang-format
index 3a4c8220df2f721b960f6c2b313b39c032b1c030,f3923a1f98583bef70d7beeac5954da858079a3c..2ffd69afc1a8280654a8763e044e27e08be7a69f
@@@ -366,15 -387,16 +387,16 @@@ ForEachMacros
    - 'rhl_for_each_entry_rcu'
    - 'rhl_for_each_rcu'
    - 'rht_for_each'
 -  - 'rht_for_each_continue'
 +  - 'rht_for_each_from'
    - 'rht_for_each_entry'
 -  - 'rht_for_each_entry_continue'
 +  - 'rht_for_each_entry_from'
    - 'rht_for_each_entry_rcu'
 -  - 'rht_for_each_entry_rcu_continue'
 +  - 'rht_for_each_entry_rcu_from'
    - 'rht_for_each_entry_safe'
    - 'rht_for_each_rcu'
 -  - 'rht_for_each_rcu_continue'
 +  - 'rht_for_each_rcu_from'
    - '__rq_for_each_bio'
+   - 'rq_for_each_bvec'
    - 'rq_for_each_segment'
    - 'scsi_for_each_prot_sg'
    - 'scsi_for_each_sg'
diff --cc MAINTAINERS
Simple merge
diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 86dc46f6a68f3051b362933595d89886842b2eea,ba303ee99b9b59762e724072d0f66907f46235b2..014af7efef251871fdbf2fbca2a60714b1a3bc6f
@@@ -196,68 -197,12 +196,65 @@@ static void __br_handle_local_finish(st
  /* note: already called with rcu_read_lock */
  static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
  {
-       struct net_bridge_port *p = br_port_get_rcu(skb->dev);
        __br_handle_local_finish(skb);
  
-       BR_INPUT_SKB_CB(skb)->brdev = p->br->dev;
-       br_pass_frame_up(skb);
-       return 0;
+       /* return 1 to signal the okfn() was called so it's ok to use the skb */
+       return 1;
  }
  
 +static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)
 +{
 +#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE
 +      struct nf_hook_entries *e = NULL;
 +      struct nf_hook_state state;
 +      unsigned int verdict, i;
 +      struct net *net;
 +      int ret;
 +
 +      net = dev_net(skb->dev);
 +#ifdef HAVE_JUMP_LABEL
 +      if (!static_key_false(&nf_hooks_needed[NFPROTO_BRIDGE][NF_BR_PRE_ROUTING]))
 +              goto frame_finish;
 +#endif
 +
 +      e = rcu_dereference(net->nf.hooks_bridge[NF_BR_PRE_ROUTING]);
 +      if (!e)
 +              goto frame_finish;
 +
 +      nf_hook_state_init(&state, NF_BR_PRE_ROUTING,
 +                         NFPROTO_BRIDGE, skb->dev, NULL, NULL,
 +                         net, br_handle_frame_finish);
 +
 +      for (i = 0; i < e->num_hook_entries; i++) {
 +              verdict = nf_hook_entry_hookfn(&e->hooks[i], skb, &state);
 +              switch (verdict & NF_VERDICT_MASK) {
 +              case NF_ACCEPT:
 +                      if (BR_INPUT_SKB_CB(skb)->br_netfilter_broute) {
 +                              *pskb = skb;
 +                              return RX_HANDLER_PASS;
 +                      }
 +                      break;
 +              case NF_DROP:
 +                      kfree_skb(skb);
 +                      return RX_HANDLER_CONSUMED;
 +              case NF_QUEUE:
 +                      ret = nf_queue(skb, &state, e, i, verdict);
 +                      if (ret == 1)
 +                              continue;
 +                      return RX_HANDLER_CONSUMED;
 +              default: /* STOLEN */
 +                      return RX_HANDLER_CONSUMED;
 +              }
 +      }
 +frame_finish:
 +      net = dev_net(skb->dev);
 +      br_handle_frame_finish(net, NULL, skb);
 +#else
 +      br_handle_frame_finish(dev_net(skb->dev), NULL, skb);
 +#endif
 +      return RX_HANDLER_CONSUMED;
 +}
 +
  /*
   * Return NULL if skb is handled
   * note: already called with rcu_read_lock
Simple merge
Simple merge
diff --cc net/core/dev.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/fou.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv6/udp.c
Simple merge
Simple merge
index e066899de72d08151109c27d732859e5ff25c1b8,6f869ef49b3226806ab7f7973821870d77618004..086d9913975ddeabcbfa1a80bd51501ee8d304f0
@@@ -447,10 -457,9 +455,10 @@@ static void smc_switch_to_fallback(stru
  /* fall back during connect */
  static int smc_connect_fallback(struct smc_sock *smc, int reason_code)
  {
-       smc->use_fallback = true;
+       smc_switch_to_fallback(smc);
        smc->fallback_rsn = reason_code;
        smc_copy_sock_settings_to_clc(smc);
 +      smc->connect_nonblock = 0;
        if (smc->sk.sk_state == SMC_INIT)
                smc->sk.sk_state = SMC_ACTIVE;
        return 0;
@@@ -780,10 -783,16 +788,14 @@@ static void smc_connect_work(struct wor
                smc->sk.sk_err = -rc;
  
  out:
-       if (smc->sk.sk_err)
-               smc->sk.sk_state_change(&smc->sk);
-       else
-               smc->sk.sk_write_space(&smc->sk);
+       if (!sock_flag(&smc->sk, SOCK_DEAD)) {
+               if (smc->sk.sk_err) {
+                       smc->sk.sk_state_change(&smc->sk);
+               } else { /* allow polling before and after fallback decision */
+                       smc->clcsock->sk->sk_write_space(smc->clcsock->sk);
+                       smc->sk.sk_write_space(&smc->sk);
+               }
+       }
 -      kfree(smc->connect_info);
 -      smc->connect_info = NULL;
        release_sock(&smc->sk);
  }
  
@@@ -1215,11 -1244,19 +1232,14 @@@ static void smc_listen_work(struct work
        struct socket *newclcsock = new_smc->clcsock;
        struct smc_clc_msg_accept_confirm cclc;
        struct smc_clc_msg_proposal *pclc;
 -      struct smc_ib_device *ibdev;
 +      struct smc_init_info ini = {0};
        bool ism_supported = false;
 -      struct smcd_dev *ismdev;
        u8 buf[SMC_CLC_MAX_LEN];
 -      int local_contact = 0;
 -      unsigned short vlan;
 -      int reason_code = 0;
        int rc = 0;
 -      u8 ibport;
  
+       if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN)
+               return smc_listen_out_err(new_smc);
        if (new_smc->use_fallback) {
                smc_listen_out_connected(new_smc);
                return;
Simple merge
Simple merge
diff --cc net/tipc/link.c
Simple merge
Simple merge
Simple merge
index 33408ba1d7eede0b02cf0e707f28203d4c2681fc,47e30a58566c2817696655212a8da4c5fc00f00e..e7ee18ab6cb7143d2ff826644ffb9c980d25e6bd
@@@ -13612,9 -13647,11 +13612,10 @@@ static const struct genl_ops nl80211_op
        {
                .cmd = NL80211_CMD_ASSOCIATE,
                .doit = nl80211_associate,
 -              .policy = nl80211_policy,
                .flags = GENL_UNS_ADMIN_PERM,
                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_DEAUTHENTICATE,
        {
                .cmd = NL80211_CMD_CONNECT,
                .doit = nl80211_connect,
 -              .policy = nl80211_policy,
                .flags = GENL_UNS_ADMIN_PERM,
                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,
                .doit = nl80211_update_connect_params,
 -              .policy = nl80211_policy,
                .flags = GENL_ADMIN_PERM,
                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_DISCONNECT,
        {
                .cmd = NL80211_CMD_SET_PMKSA,
                .doit = nl80211_setdel_pmksa,
 -              .policy = nl80211_policy,
                .flags = GENL_UNS_ADMIN_PERM,
                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_DEL_PMKSA,
                .cmd = NL80211_CMD_VENDOR,
                .doit = nl80211_vendor_cmd,
                .dumpit = nl80211_vendor_cmd_dump,
 -              .policy = nl80211_policy,
                .flags = GENL_UNS_ADMIN_PERM,
                .internal_flags = NL80211_FLAG_NEED_WIPHY |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_SET_QOS_MAP,
        {
                .cmd = NL80211_CMD_SET_PMK,
                .doit = nl80211_set_pmk,
 -              .policy = nl80211_policy,
                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
-                                 NL80211_FLAG_NEED_RTNL,
+                                 NL80211_FLAG_NEED_RTNL |
+                                 NL80211_FLAG_CLEAR_SKB,
        },
        {
                .cmd = NL80211_CMD_DEL_PMK,