Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2016 16:29:28 +0000 (11:29 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2016 18:27:16 +0000 (13:27 -0500)
All conflicts were simple overlapping changes except perhaps
for the Thunder driver.

That driver has a change_mtu method explicitly for sending
a message to the hardware.  If that fails it returns an
error.

Normally a driver doesn't need an ndo_change_mtu method becuase those
are usually just range changes, which are now handled generically.
But since this extra operation is needed in the Thunder driver, it has
to stay.

However, if the message send fails we have to restore the original
MTU before the change because the entire call chain expects that if
an error is thrown by ndo_change_mtu then the MTU did not change.
Therefore code is added to nicvf_change_mtu to remember the original
MTU, and to restore it upon nicvf_update_hw_max_frs() failue.

Signed-off-by: David S. Miller <davem@davemloft.net>
44 files changed:
1  2 
MAINTAINERS
drivers/infiniband/core/cma.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/net/ethernet/arc/emac_main.c
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/cavium/thunder/nicvf_main.c
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/marvell/sky2.c
drivers/net/ethernet/stmicro/stmmac/Kconfig
drivers/net/ethernet/stmicro/stmmac/descs.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/sun/sunbmac.c
drivers/net/ethernet/sun/sunqe.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/virtio_net.c
drivers/net/wireless/mac80211_hwsim.c
include/linux/bpf_verifier.h
include/net/net_namespace.h
kernel/bpf/verifier.c
net/batman-adv/hard-interface.c
net/batman-adv/tp_meter.c
net/core/net_namespace.c
net/ipv4/fib_frontend.c
net/ipv4/tcp_cong.c
net/ipv4/udp.c
net/ipv6/ip6_tunnel.c
net/ipv6/udp.c
net/l2tp/l2tp_eth.c
net/l2tp/l2tp_ip6.c
net/mac80211/sta_info.c
net/mac80211/tx.c
net/socket.c
net/sunrpc/svcsock.c
net/tipc/socket.c
net/unix/af_unix.c
net/wireless/core.h
net/wireless/util.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b192712c93b7bd6bf39b1dd5cf394fbaba8da62b,8a37012c9c89637560fc3ae7554718b0f96163e4..7c2c37388c1240c79712b37ad846d3a0ad6748bf
@@@ -1300,22 -1291,20 +1291,17 @@@ napi_del
  static int nicvf_change_mtu(struct net_device *netdev, int new_mtu)
  {
        struct nicvf *nic = netdev_priv(netdev);
 -
 -      if (new_mtu > NIC_HW_MAX_FRS)
 -              return -EINVAL;
 -
 -      if (new_mtu < NIC_HW_MIN_FRS)
 -              return -EINVAL;
++      int orig_mtu = netdev->mtu;
  
-       if (nicvf_update_hw_max_frs(nic, new_mtu))
-               return -EINVAL;
        netdev->mtu = new_mtu;
-       nic->mtu = new_mtu;
+       if (!netif_running(netdev))
+               return 0;
 -      if (nicvf_update_hw_max_frs(nic, new_mtu))
++      if (nicvf_update_hw_max_frs(nic, new_mtu)) {
++              netdev->mtu = orig_mtu;
+               return -EINVAL;
++      }
  
        return 0;
  }
Simple merge
index bec72d3103a173cf62050a1b278aed14de103b94,a601f8d43b75d8a97cc007ebaad4eed9ebd66ae3..a340fc8bd0debf305ff2cb2d6b72b1925ec8b86e
@@@ -205,14 -211,18 +212,18 @@@ static void dwmac4_rd_enable_tx_timesta
  
  static int dwmac4_wrback_get_tx_timestamp_status(struct dma_desc *p)
  {
-       return (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS)
-               >> TDES3_TIMESTAMP_STATUS_SHIFT;
+       /* Context type from W/B descriptor must be zero */
 -      if (p->des3 & TDES3_CONTEXT_TYPE)
++      if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE)
+               return -EINVAL;
+       /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */
 -      if (p->des3 & TDES3_TIMESTAMP_STATUS)
++      if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS)
+               return 0;
+       return 1;
  }
  
- /*  NOTE: For RX CTX bit has to be checked before
-  *  HAVE a specific function for TX and another one for RX
-  */
- static u64 dwmac4_wrback_get_timestamp(void *desc, u32 ats)
+ static inline u64 dwmac4_get_timestamp(void *desc, u32 ats)
  {
        struct dma_desc *p = (struct dma_desc *)desc;
        u64 ns;
        return ns;
  }
  
- static int dwmac4_context_get_rx_timestamp_status(void *desc, u32 ats)
+ static int dwmac4_rx_check_timestamp(void *desc)
+ {
+       struct dma_desc *p = (struct dma_desc *)desc;
+       u32 own, ctxt;
+       int ret = 1;
+       own = p->des3 & RDES3_OWN;
+       ctxt = ((p->des3 & RDES3_CONTEXT_DESCRIPTOR)
+               >> RDES3_CONTEXT_DESCRIPTOR_SHIFT);
+       if (likely(!own && ctxt)) {
+               if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff))
+                       /* Corrupted value */
+                       ret = -EINVAL;
+               else
+                       /* A valid Timestamp is ready to be read */
+                       ret = 0;
+       }
+       /* Timestamp not ready */
+       return ret;
+ }
+ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, u32 ats)
  {
        struct dma_desc *p = (struct dma_desc *)desc;
 -              if (likely(p->des1 & RDES1_TIMESTAMP_AVAILABLE)) {
+       int ret = -EINVAL;
+       /* Get the status from normal w/b descriptor */
+       if (likely(p->des3 & TDES3_RS1V)) {
++              if (likely(le32_to_cpu(p->des1) & RDES1_TIMESTAMP_AVAILABLE)) {
+                       int i = 0;
+                       /* Check if timestamp is OK from context descriptor */
+                       do {
+                               ret = dwmac4_rx_check_timestamp(desc);
+                               if (ret < 0)
+                                       goto exit;
+                               i++;
  
-       return (le32_to_cpu(p->des1) & RDES1_TIMESTAMP_AVAILABLE)
-               >> RDES1_TIMESTAMP_AVAILABLE_SHIFT;
+                       } while ((ret == 1) || (i < 10));
+                       if (i == 10)
+                               ret = -EBUSY;
+               }
+       }
+ exit:
+       return ret;
  }
  
  static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
index fbd1cd79233d8c00b8837de6c194d502d588c9e5,1f9ec02fa7f856ecf461cc4c5bfa51e7cc79902e..29557d27e99111d9951c4fc9ee128a6e3e866ab3
@@@ -2635,11 -2628,8 +2638,9 @@@ static int stmmac_rx(struct stmmac_pri
                                                 DMA_FROM_DEVICE);
                        }
  
-                       stmmac_get_rx_hwtstamp(priv, entry, skb);
                        if (netif_msg_pktdata(priv)) {
 -                              pr_debug("frame received (%dbytes)", frame_len);
 +                              netdev_dbg(priv->dev, "frame received (%dbytes)",
 +                                         frame_len);
                                print_pkt(skb->data, frame_len);
                        }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index ac5b393ee6b276084d06796004ad15c78839fc3c,6aaf425cebc39a9dbb3619d7ad28987ca54a01c7..7453c12815317575c96f271dedd7e76b2c7f2f10
@@@ -22,8 -22,8 +22,9 @@@ struct bpf_reg_state 
         * Used to determine if any memory access using this register will
         * result in a bad access.
         */
-       u64 min_value, max_value;
+       s64 min_value;
+       u64 max_value;
 +      u32 id;
        union {
                /* valid when type == CONST_IMM | PTR_TO_STACK | UNKNOWN_VALUE */
                s64 imm;
Simple merge
index 89f787ca47ef98e412ec740507601f63b6a86741,6a936159c6e06d629c325978623a32359ec095f4..8740c5fa02fcf0a7a4d853c8f73b6826a9b03cf5
@@@ -229,13 -212,12 +229,13 @@@ static void print_verifier_state(struc
                else if (t == CONST_PTR_TO_MAP || t == PTR_TO_MAP_VALUE ||
                         t == PTR_TO_MAP_VALUE_OR_NULL ||
                         t == PTR_TO_MAP_VALUE_ADJ)
 -                      verbose("(ks=%d,vs=%d)",
 +                      verbose("(ks=%d,vs=%d,id=%u)",
                                reg->map_ptr->key_size,
 -                              reg->map_ptr->value_size);
 +                              reg->map_ptr->value_size,
 +                              reg->id);
                if (reg->min_value != BPF_REGISTER_MIN_RANGE)
-                       verbose(",min_value=%llu",
-                               (unsigned long long)reg->min_value);
+                       verbose(",min_value=%lld",
+                               (long long)reg->min_value);
                if (reg->max_value != BPF_REGISTER_MAX_RANGE)
                        verbose(",max_value=%llu",
                                (unsigned long long)reg->max_value);
@@@ -1498,7 -1477,9 +1499,8 @@@ static void adjust_reg_min_max_vals(str
                                    struct bpf_insn *insn)
  {
        struct bpf_reg_state *regs = env->cur_state.regs, *dst_reg;
-       u64 min_val = BPF_REGISTER_MIN_RANGE, max_val = BPF_REGISTER_MAX_RANGE;
+       s64 min_val = BPF_REGISTER_MIN_RANGE;
+       u64 max_val = BPF_REGISTER_MAX_RANGE;
 -      bool min_set = false, max_set = false;
        u8 opcode = BPF_OP(insn->code);
  
        dst_reg = &regs[insn->dst_reg];
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/udp.c
Simple merge
Simple merge
diff --cc net/ipv6/udp.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/socket.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge