linux-next: manual merge of the net-next tree with the net tree

2018-07-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/act_tunnel_key.c

between commit:

  38230a3e0e09 ("net/sched: act_tunnel_key: fix NULL dereference when 'goto 
chain' is used")

from the net tree and commit:

  036bb44327f5 ("net: sched: change type of reference and bind counters")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/act_tunnel_key.c
index 9bc6c2ae98a5,3ec585d58762..
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@@ -252,9 -477,8 +477,9 @@@ static int tunnel_key_dump(struct sk_bu
struct tcf_tunnel_key_params *params;
struct tc_tunnel_key opt = {
.index= t->tcf_index,
-   .refcnt   = t->tcf_refcnt - ref,
-   .bindcnt  = t->tcf_bindcnt - bind,
+   .refcnt   = refcount_read(>tcf_refcnt) - ref,
+   .bindcnt  = atomic_read(>tcf_bindcnt) - bind,
 +  .action   = t->tcf_action,
};
struct tcf_t tm;
  


pgpR8iChnbq7f.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-07-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/act_csum.c

between commit:

  11a245e2f7bf ("net/sched: act_csum: fix NULL dereference when 'goto chain' is 
used")

from the net tree and commit:

  036bb44327f5 ("net: sched: change type of reference and bind counters")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/act_csum.c
index 6e7124e57918,bd232d3bd022..
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@@ -597,9 -603,8 +603,9 @@@ static int tcf_csum_dump(struct sk_buf
struct tcf_csum_params *params;
struct tc_csum opt = {
.index   = p->tcf_index,
-   .refcnt  = p->tcf_refcnt - ref,
-   .bindcnt = p->tcf_bindcnt - bind,
+   .refcnt  = refcount_read(>tcf_refcnt) - ref,
+   .bindcnt = atomic_read(>tcf_bindcnt) - bind,
 +  .action  = p->tcf_action,
};
struct tcf_t t;
  


pgpdy6F0CUySt.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-07-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/aquantia/atlantic/aq_hw.h

between commit:

  94b3b542303f ("net: aquantia: vlan unicast address list correct handling")

from the net tree and commit:

  c1af5427954b ("net: aquantia: Ethtool based ring size configuration")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/aquantia/atlantic/aq_hw.h
index 2c6ebd91a9f2,1a51152029c3..
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
@@@ -98,8 -100,9 +100,11 @@@ struct aq_stats_s 
  #define AQ_HW_MEDIA_TYPE_TP1U
  #define AQ_HW_MEDIA_TYPE_FIBRE 2U
  
 +#define AQ_HW_MULTICAST_ADDRESS_MAX 32U
 +
+ #define AQ_HW_TXD_MULTIPLE 8U
+ #define AQ_HW_RXD_MULTIPLE 8U
+ 
  struct aq_hw_s {
atomic_t flags;
u8 rbl_enabled:1;


pgp81fjIIx91I.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-05-24 Thread Mark Brown
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv4/fib_frontend.c

between commit:

  2eabd764cb5512f1338 ("net: ipv4: add missing RTA_TABLE to rtm_ipv4_policy")

from the net tree and commit:

  404eb77ea766260c45c ("ipv4: support sport, dport and ip_proto in 
RTM_GETROUTE")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc net/ipv4/fib_frontend.c
index e66172aaf241,897ae92dff0f..
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@@ -649,7 -649,9 +649,10 @@@ const struct nla_policy rtm_ipv4_policy
[RTA_ENCAP] = { .type = NLA_NESTED },
[RTA_UID]   = { .type = NLA_U32 },
[RTA_MARK]  = { .type = NLA_U32 },
 +  [RTA_TABLE] = { .type = NLA_U32 },
+   [RTA_IP_PROTO]  = { .type = NLA_U8 },
+   [RTA_SPORT] = { .type = NLA_U16 },
+   [RTA_DPORT] = { .type = NLA_U16 },
  };
  
  static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,


signature.asc
Description: PGP signature


linux-next: manual merge of the net-next tree with the net tree

2018-05-09 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/realtek/r8169.c

between commit:

  3148dedfe79e ("r8169: fix powering up RTL8168h")

from the net tree and commit:

  4f447d296982 ("r8169: drop member pll_power_ops from struct rtl8169_private")

from the net-next tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/realtek/r8169.c
index c7aac1fc99e8,6d99b141a7aa..
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@@ -4980,72 -4767,13 +4767,16 @@@ static void rtl_pll_power_down(struct r
  
  static void rtl_pll_power_up(struct rtl8169_private *tp)
  {
-   rtl_generic_op(tp, tp->pll_power_ops.up);
- 
-   /* give MAC/PHY some time to resume */
-   msleep(20);
- }
- 
- static void rtl_init_pll_power_ops(struct rtl8169_private *tp)
- {
-   struct pll_power_ops *ops = >pll_power_ops;
- 
switch (tp->mac_version) {
-   case RTL_GIGA_MAC_VER_07:
-   case RTL_GIGA_MAC_VER_08:
-   case RTL_GIGA_MAC_VER_09:
-   case RTL_GIGA_MAC_VER_10:
-   case RTL_GIGA_MAC_VER_16:
-   case RTL_GIGA_MAC_VER_29:
-   case RTL_GIGA_MAC_VER_30:
-   case RTL_GIGA_MAC_VER_37:
-   case RTL_GIGA_MAC_VER_39:
-   case RTL_GIGA_MAC_VER_43:
-   case RTL_GIGA_MAC_VER_47:
-   case RTL_GIGA_MAC_VER_48:
-   ops->down   = r810x_pll_power_down;
-   ops->up = r810x_pll_power_up;
-   break;
- 
-   case RTL_GIGA_MAC_VER_11:
-   case RTL_GIGA_MAC_VER_12:
-   case RTL_GIGA_MAC_VER_17:
-   case RTL_GIGA_MAC_VER_18:
-   case RTL_GIGA_MAC_VER_19:
-   case RTL_GIGA_MAC_VER_20:
-   case RTL_GIGA_MAC_VER_21:
-   case RTL_GIGA_MAC_VER_22:
-   case RTL_GIGA_MAC_VER_23:
-   case RTL_GIGA_MAC_VER_24:
-   case RTL_GIGA_MAC_VER_25:
-   case RTL_GIGA_MAC_VER_26:
-   case RTL_GIGA_MAC_VER_27:
-   case RTL_GIGA_MAC_VER_28:
-   case RTL_GIGA_MAC_VER_31:
-   case RTL_GIGA_MAC_VER_32:
-   case RTL_GIGA_MAC_VER_33:
-   case RTL_GIGA_MAC_VER_34:
-   case RTL_GIGA_MAC_VER_35:
-   case RTL_GIGA_MAC_VER_36:
-   case RTL_GIGA_MAC_VER_38:
-   case RTL_GIGA_MAC_VER_40:
-   case RTL_GIGA_MAC_VER_41:
-   case RTL_GIGA_MAC_VER_42:
-   case RTL_GIGA_MAC_VER_44:
-   case RTL_GIGA_MAC_VER_45:
-   case RTL_GIGA_MAC_VER_46:
-   case RTL_GIGA_MAC_VER_49:
-   case RTL_GIGA_MAC_VER_50:
-   case RTL_GIGA_MAC_VER_51:
-   ops->down   = r8168_pll_power_down;
-   ops->up = r8168_pll_power_up;
+   case RTL_GIGA_MAC_VER_01 ... RTL_GIGA_MAC_VER_06:
+   case RTL_GIGA_MAC_VER_13 ... RTL_GIGA_MAC_VER_15:
break;
- 
default:
-   ops->down   = NULL;
-   ops->up = NULL;
-   break;
+   r8168_pll_power_up(tp);
}
++
++  /* give MAC/PHY some time to resume */
++  msleep(20);
  }
  
  static void rtl_init_rxcfg(struct rtl8169_private *tp)


pgpgntRAHlhxp.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the net-next tree with the net tree

2018-05-09 Thread Stephen Rothwell
Hi Anders,

On Wed, 9 May 2018 10:24:49 +0200 Anders Roxell  
wrote:
>
> On 9 May 2018 at 06:19, Stephen Rothwell  wrote:
> >
> >   TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh 
> > rtnetlink.sh
> > - TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh
> > + TEST_PROGS += fib_tests.sh fib-onlink-tests.sh in_netns.sh pmtu.sh 
> > udpgso.sh  
> 
> in_netns.sh shouldn't be in the above list, its already in the
> TEST_PROGS_EXTENDED below.

Thanks for that, I have fixed up my merge resolution for tomorrow.

-- 
Cheers,
Stephen Rothwell


pgp_5MyqFFpLy.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the net-next tree with the net tree

2018-05-09 Thread Anders Roxell
On 9 May 2018 at 06:19, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   tools/testing/selftests/net/Makefile
>
> between commit:
>
>   1751eb42ddb5 ("selftests: net: use TEST_PROGS_EXTENDED")
>
> from the net tree and commits:
>
>   a7b15ab887e5 ("Merge 
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc tools/testing/selftests/net/Makefile
> index 3ff81a478dbe,73af45773938..
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@@ -5,10 -5,13 +5,13 @@@ CFLAGS =  -Wall -Wl,--no-as-needed -O2
>   CFLAGS += -I../../../../usr/include/
>
>   TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh 
> rtnetlink.sh
> - TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh
> + TEST_PROGS += fib_tests.sh fib-onlink-tests.sh in_netns.sh pmtu.sh udpgso.sh

in_netns.sh shouldn't be in the above list, its already in the
TEST_PROGS_EXTENDED below.

Cheers,
Anders

> + TEST_PROGS += udpgso_bench.sh
>  -TEST_GEN_PROGS_EXTENDED := in_netns.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
> + TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx
>   TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
>   TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict
>


linux-next: manual merge of the net-next tree with the net tree

2018-05-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  tools/testing/selftests/net/Makefile

between commit:

  1751eb42ddb5 ("selftests: net: use TEST_PROGS_EXTENDED")

from the net tree and commits:

  a7b15ab887e5 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/net/Makefile
index 3ff81a478dbe,73af45773938..
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@@ -5,10 -5,13 +5,13 @@@ CFLAGS =  -Wall -Wl,--no-as-needed -O2 
  CFLAGS += -I../../../../usr/include/
  
  TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh 
rtnetlink.sh
- TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh
+ TEST_PROGS += fib_tests.sh fib-onlink-tests.sh in_netns.sh pmtu.sh udpgso.sh
+ TEST_PROGS += udpgso_bench.sh
 -TEST_GEN_PROGS_EXTENDED := in_netns.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
+ TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx
  TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
  TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict
  


pgpyr9vZprMQp.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-05-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/tls/tls_main.c

between commit:

  98f0a39529e5 ("tls: fix use after free in tls_sk_proto_close")

from the net tree and commit:

  f66de3ee2c16 ("net/tls: Split conf to rx + tx")

from the net-next tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/tls/tls_main.c
index 20cd93be6236,4b57ddd72f34..
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@@ -254,8 -252,12 +254,9 @@@ static void tls_sk_proto_close(struct s
lock_sock(sk);
sk_proto_close = ctx->sk_proto_close;
  
-   if (ctx->conf == TLS_BASE || ctx->conf == TLS_HW_RECORD) {
 -  if (ctx->tx_conf == TLS_HW_RECORD && ctx->rx_conf == TLS_HW_RECORD)
 -  goto skip_tx_cleanup;
 -
 -  if (ctx->tx_conf == TLS_BASE && ctx->rx_conf == TLS_BASE) {
 -  kfree(ctx);
 -  ctx = NULL;
++  if ((ctx->tx_conf == TLS_BASE && ctx->rx_conf == TLS_BASE) ||
++  (ctx->tx_conf == TLS_HW_RECORD && ctx->rx_conf == TLS_HW_RECORD)) {
 +  free_ctx = true;
goto skip_tx_cleanup;
}
  


pgptX6BkbTkGf.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-05-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/syscall.c

between commit:

  9ef09e35e521 ("bpf: fix possible spectre-v1 in find_and_alloc_map()")

from the net tree and commit:

  a26ca7c982cb ("bpf: btf: Add pretty print support to the basic arraymap")

from the net-next tree.

I fixed it up (I removed the conflicting addition of an include of
linux/btf.h in the latter commit as it had already been included
earlier in the file by a previous commit) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


pgpE08pKqWM8n.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-05-01 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  include/net/ip6_route.h

between commit:

  edd7ceb78296 ("ipv6: Allow non-gateway ECMP for IPv6")

from the net tree and commit:

  93c2fb253d17 ("net/ipv6: Rename fib6_info struct elements")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/net/ip6_route.h
index abceb5864d99,8df4ff798b04..
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@@ -66,9 -66,10 +66,9 @@@ static inline bool rt6_need_strict(cons
(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | 
IPV6_ADDR_LOOPBACK);
  }
  
- static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt)
+ static inline bool rt6_qualify_for_ecmp(const struct fib6_info *f6i)
  {
-   return (rt->rt6i_flags & (RTF_ADDRCONF | RTF_DYNAMIC)) == 0;
 -  return (f6i->fib6_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
 - RTF_GATEWAY;
++  return (f6i->fib6_flags & (RTF_ADDRCONF | RTF_DYNAMIC)) == 0;
  }
  
  void ip6_route_input(struct sk_buff *skb);


pgpPAxFaint4a.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-04-29 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  tools/testing/selftests/net/Makefile

between commit:

  9faedd643fd9 ("selftests: net: add in_netns.sh TEST_GEN_PROGS_EXTENDED")

from the net tree and commit:

  a160725780e3 ("selftests: udp gso")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/net/Makefile
index daf5effec3f0,df9102ec7b7a..
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@@ -5,12 -5,14 +5,15 @@@ CFLAGS =  -Wall -Wl,--no-as-needed -O2 
  CFLAGS += -I../../../../usr/include/
  
  TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh 
rtnetlink.sh
- TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh
 -TEST_PROGS += fib_tests.sh fib-onlink-tests.sh in_netns.sh pmtu.sh udpgso.sh
++TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh
+ TEST_PROGS += udpgso_bench.sh
 +TEST_GEN_PROGS_EXTENDED := in_netns.sh
  TEST_GEN_FILES =  socket
  TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
+ TEST_GEN_FILES += tcp_mmap
  TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
  TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict
+ TEST_GEN_PROGS += udpgso udpgso_bench_tx udpgso_bench_rx
  
  include ../lib.mk
  


pgpPVaCdeufsq.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-03-14 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv4/xfrm4_policy.c

between commit:

  d52e5a7e7ca4 ("ipv4: lock mtu in fnhe when received PMTU < 
net.ipv4.route.min_pmtu")

from the net tree and commit:

  68e813aa4307 ("net/ipv4: Remove fib table id from rtable")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/xfrm4_policy.c
index fbebda67ac1b,0c752dc3f93b..
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@@ -100,10 -100,7 +100,9 @@@ static int xfrm4_fill_dst(struct xfrm_d
xdst->u.rt.rt_gateway = rt->rt_gateway;
xdst->u.rt.rt_uses_gateway = rt->rt_uses_gateway;
xdst->u.rt.rt_pmtu = rt->rt_pmtu;
 +  xdst->u.rt.rt_mtu_locked = rt->rt_mtu_locked;
-   xdst->u.rt.rt_table_id = rt->rt_table_id;
INIT_LIST_HEAD(>u.rt.rt_uncached);
 +  rt_add_uncached_list(>u.rt);
  
return 0;
  }


pgpuOLrqvfiB_.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the net-next tree with the net tree

2018-03-13 Thread Petr Machata
Stephen Rothwell  writes:

> Today's linux-next merge of the net-next tree got conflicts in:
>
>   drivers/net/ethernet/mellanox/mlxsw/spectrum.h
>   drivers/net/ethernet/mellanox/mlxsw/spectrum.c
>
> between commit:
>
>   663f1b26f9c1 ("mlxsw: spectrum: Prevent duplicate mirrors")
>
> from the net tree and commit:
>
>   a629ef210d89 ("mlxsw: spectrum: Move SPAN code to separate module")
>
> from the net-next tree.
>
> I fixed it up

Looks good.

Thanks,
Petr


linux-next: manual merge of the net-next tree with the net tree

2018-03-12 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  drivers/net/ethernet/mellanox/mlxsw/spectrum.h
  drivers/net/ethernet/mellanox/mlxsw/spectrum.c

between commit:

  663f1b26f9c1 ("mlxsw: spectrum: Prevent duplicate mirrors")

from the net tree and commit:

  a629ef210d89 ("mlxsw: spectrum: Move SPAN code to separate module")

from the net-next tree.

I fixed it up (the code changed in the former was moved in the latter -
I applied the below merge fix patch) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

From: Stephen Rothwell 
Date: Tue, 13 Mar 2018 11:25:13 +1100
Subject: [PATCH] mlxsw: merge fix for move of SPAN code

Signed-off-by: Stephen Rothwell 
---
 .../net/ethernet/mellanox/mlxsw/spectrum_span.c| 28 ++
 .../net/ethernet/mellanox/mlxsw/spectrum_span.h|  3 +++
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c 
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
index ae22a3daffbf..4d6ed207b4af 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
@@ -600,13 +600,17 @@ int mlxsw_sp_span_port_mtu_update(struct mlxsw_sp_port 
*port, u16 mtu)
 }
 
 static struct mlxsw_sp_span_inspected_port *
-mlxsw_sp_span_entry_bound_port_find(struct mlxsw_sp_port *port,
-   struct mlxsw_sp_span_entry *span_entry)
+mlxsw_sp_span_entry_bound_port_find(struct mlxsw_sp_span_entry *span_entry,
+   enum mlxsw_sp_span_type type,
+   struct mlxsw_sp_port *port,
+   bool bind)
 {
struct mlxsw_sp_span_inspected_port *p;
 
list_for_each_entry(p, _entry->bound_ports_list, list)
-   if (port->local_port == p->local_port)
+   if (type == p->type &&
+   port->local_port == p->local_port &&
+   bind == p->bound)
return p;
return NULL;
 }
@@ -636,8 +640,22 @@ mlxsw_sp_span_inspected_port_add(struct mlxsw_sp_port 
*port,
struct mlxsw_sp_span_inspected_port *inspected_port;
struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp;
char sbib_pl[MLXSW_REG_SBIB_LEN];
+   int i;
int err;
 
+   /* A given (source port, direction) can only be bound to one analyzer,
+* so if a binding is requested, check for conflicts.
+*/
+   if (bind)
+   for (i = 0; i < mlxsw_sp->span.entries_count; i++) {
+   struct mlxsw_sp_span_entry *curr =
+   _sp->span.entries[i];
+
+   if (mlxsw_sp_span_entry_bound_port_find(curr, type,
+   port, bind))
+   return -EEXIST;
+   }
+
/* if it is an egress SPAN, bind a shared buffer to it */
if (type == MLXSW_SP_SPAN_EGRESS) {
u32 buffsize = mlxsw_sp_span_mtu_to_buffsize(mlxsw_sp,
@@ -665,6 +683,7 @@ mlxsw_sp_span_inspected_port_add(struct mlxsw_sp_port *port,
}
inspected_port->local_port = port->local_port;
inspected_port->type = type;
+   inspected_port->bound = bind;
list_add_tail(_port->list, _entry->bound_ports_list);
 
return 0;
@@ -691,7 +710,8 @@ mlxsw_sp_span_inspected_port_del(struct mlxsw_sp_port *port,
struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp;
char sbib_pl[MLXSW_REG_SBIB_LEN];
 
-   inspected_port = mlxsw_sp_span_entry_bound_port_find(port, span_entry);
+   inspected_port = mlxsw_sp_span_entry_bound_port_find(span_entry, type,
+port, bind);
if (!inspected_port)
return;
 
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h 
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
index 948aceb512c5..4b87ec20e658 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
@@ -51,6 +51,9 @@ struct mlxsw_sp_span_inspected_port {
struct list_head list;
enum mlxsw_sp_span_type type;
u8 local_port;
+
+   /* Whether this is a directly bound mirror (port-to-port) or an ACL. */
+   bool bound;
 };
 
 struct mlxsw_sp_span_parms {
-- 
2.16.1

-- 
Cheers,
Stephen Rothwell


pgp_4kle5XNC5.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-03-12 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/phy.c

between commit:

  a2c054a896b8 ("net: phy: Tell caller result of phy_change()")

from the net tree and commit:

  4fff2d33c707 ("net: phy: remove phy_error from phy_disable_interrupts")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/phy/phy.c
index 9aabfa1a455a,c2d9027be863..
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@@ -617,77 -617,6 +617,68 @@@ static void phy_error(struct phy_devic
phy_trigger_machine(phydev, false);
  }
  
 +/**
 + * phy_disable_interrupts - Disable the PHY interrupts from the PHY side
 + * @phydev: target phy_device struct
 + */
 +static int phy_disable_interrupts(struct phy_device *phydev)
 +{
 +  int err;
 +
 +  /* Disable PHY interrupts */
 +  err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
 +  if (err)
-   goto phy_err;
++  return err;
 +
 +  /* Clear the interrupt */
-   err = phy_clear_interrupt(phydev);
-   if (err)
-   goto phy_err;
- 
-   return 0;
- 
- phy_err:
-   phy_error(phydev);
- 
-   return err;
++  return phy_clear_interrupt(phydev);
 +}
 +
 +/**
 + * phy_change - Called by the phy_interrupt to handle PHY changes
 + * @phydev: phy_device struct that interrupted
 + */
 +static irqreturn_t phy_change(struct phy_device *phydev)
 +{
 +  if (phy_interrupt_is_valid(phydev)) {
 +  if (phydev->drv->did_interrupt &&
 +  !phydev->drv->did_interrupt(phydev))
 +  return IRQ_NONE;
 +
 +  if (phydev->state == PHY_HALTED)
 +  if (phy_disable_interrupts(phydev))
 +  goto phy_err;
 +  }
 +
 +  mutex_lock(>lock);
 +  if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state))
 +  phydev->state = PHY_CHANGELINK;
 +  mutex_unlock(>lock);
 +
 +  /* reschedule state queue work to run as soon as possible */
 +  phy_trigger_machine(phydev, true);
 +
 +  if (phy_interrupt_is_valid(phydev) && phy_clear_interrupt(phydev))
 +  goto phy_err;
 +  return IRQ_HANDLED;
 +
 +phy_err:
 +  phy_error(phydev);
 +  return IRQ_NONE;
 +}
 +
 +/**
 + * phy_change_work - Scheduled by the phy_mac_interrupt to handle PHY changes
 + * @work: work_struct that describes the work to be done
 + */
 +void phy_change_work(struct work_struct *work)
 +{
 +  struct phy_device *phydev =
 +  container_of(work, struct phy_device, phy_queue);
 +
 +  phy_change(phydev);
 +}
 +
  /**
   * phy_interrupt - PHY interrupt handler
   * @irq: interrupt line


pgpczla4TfrtD.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-03-04 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv6/netfilter/nft_fib_ipv6.c

between commit:

  47b7e7f82802 ("netfilter: don't set F_IFACE on ipv6 fib lookups")

from the net tree and commit:

  b75cc8f90f07 ("net/ipv6: Pass skb to route lookup")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv6/netfilter/nft_fib_ipv6.c
index 62fc84d7bdff,3230b3d7b11b..
--- a/net/ipv6/netfilter/nft_fib_ipv6.c
+++ b/net/ipv6/netfilter/nft_fib_ipv6.c
@@@ -180,7 -180,9 +180,8 @@@ void nft_fib6_eval(const struct nft_exp
}
  
*dest = 0;
-   rt = (void *)ip6_route_lookup(nft_net(pkt), , lookup_flags);
 - again:
+   rt = (void *)ip6_route_lookup(nft_net(pkt), , pkt->skb,
+ lookup_flags);
if (rt->dst.error)
goto put_rt_err;
  


pgp6Wknc9MaBN.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-03-01 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/smc/smc_core.c

between commit:

  2be922f31606 ("net/smc: use link_id of server in confirm link reply")

from the net tree and commit:

  52bedf37bafe ("net/smc: process add/delete link messages")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.



-- 
Cheers,
Stephen Rothwell


pgpT6w9uNnMau.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-02-28 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mellanox/mlxsw/spectrum.c

between commit:

  77d270967c5f ("mlxsw: spectrum: Fix handling of resource_size_param")

from the net tree and commit:

  4f4bbf7c4e3d ("devlink: Perform cleanup of resource_set cb")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index c7e941aecc2a,7c6204f701ae..
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@@ -4204,21 -3816,13 +3822,12 @@@ static struct devlink_resource_ops mlxs
.occ_get = mlxsw_sp_resource_kvd_linear_occ_get,
  };
  
- static struct devlink_resource_ops mlxsw_sp_resource_kvd_hash_single_ops = {
-   .size_validate = mlxsw_sp_resource_kvd_hash_single_size_validate,
- };
- 
- static struct devlink_resource_ops mlxsw_sp_resource_kvd_hash_double_ops = {
-   .size_validate = mlxsw_sp_resource_kvd_hash_double_size_validate,
- };
 -static struct devlink_resource_size_params mlxsw_sp_kvd_size_params;
 -static struct devlink_resource_size_params mlxsw_sp_linear_size_params;
 -static struct devlink_resource_size_params mlxsw_sp_hash_single_size_params;
 -static struct devlink_resource_size_params mlxsw_sp_hash_double_size_params;
--
  static void
 -mlxsw_sp_resource_size_params_prepare(struct mlxsw_core *mlxsw_core)
 +mlxsw_sp_resource_size_params_prepare(struct mlxsw_core *mlxsw_core,
 +struct devlink_resource_size_params 
*kvd_size_params,
 +struct devlink_resource_size_params 
*linear_size_params,
 +struct devlink_resource_size_params 
*hash_double_size_params,
 +struct devlink_resource_size_params 
*hash_single_size_params)
  {
u32 single_size_min = MLXSW_CORE_RES_GET(mlxsw_core,
 KVD_SINGLE_MIN_SIZE);
@@@ -4274,8 -3876,8 +3883,8 @@@ static int mlxsw_sp_resources_register(
true, kvd_size,
MLXSW_SP_RESOURCE_KVD,
DEVLINK_RESOURCE_ID_PARENT_TOP,
 -  _sp_kvd_size_params,
 +  _size_params,
-   _sp_resource_kvd_ops);
+   NULL);
if (err)
return err;
  
@@@ -4298,8 -3904,8 +3911,8 @@@
false, double_size,
MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,
MLXSW_SP_RESOURCE_KVD,
 -  _sp_hash_double_size_params,
 +  _double_size_params,
-   _sp_resource_kvd_hash_double_ops);
+   NULL);
if (err)
return err;
  
@@@ -4308,8 -3914,8 +3921,8 @@@
false, single_size,
MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,
MLXSW_SP_RESOURCE_KVD,
 -  _sp_hash_single_size_params,
 +  _single_size_params,
-   _sp_resource_kvd_hash_single_ops);
+   NULL);
if (err)
return err;
  


pgp3MNTlOvmlo.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the net-next tree with the net tree

2018-02-28 Thread Petr Machata
Stephen Rothwell  writes:

> Today's linux-next merge of the net-next tree got a conflict in:
>
>   net/ipv4/ip_tunnel.c
>
> between commit:
>
>   4e994776e7bd ("ip_tunnel: Do not use mark in skb by default")
>
> from the net tree and commit:
>
>   b0066da52ea5 ("ip_tunnel: Rename & publish init_tunnel_flow")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary.

Looks good, thanks!

Petr


linux-next: manual merge of the net-next tree with the net tree

2018-02-27 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv4/ip_tunnel.c

between commit:

  4e994776e7bd ("ip_tunnel: Do not use mark in skb by default")

from the net tree and commit:

  b0066da52ea5 ("ip_tunnel: Rename & publish init_tunnel_flow")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/ip_tunnel.c
index 6d21068f9b55,b2117d89bc83..
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@@ -710,9 -694,16 +694,9 @@@ void ip_tunnel_xmit(struct sk_buff *skb
}
}
  
-   init_tunnel_flow(, protocol, dst, tnl_params->saddr,
-tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
-tunnel->fwmark);
 -  if (tunnel->fwmark) {
 -  ip_tunnel_init_flow(, protocol, dst, tnl_params->saddr,
 -  tunnel->parms.o_key, RT_TOS(tos),
 -  tunnel->parms.link, tunnel->fwmark);
 -  }
 -  else {
 -  ip_tunnel_init_flow(, protocol, dst, tnl_params->saddr,
 -  tunnel->parms.o_key, RT_TOS(tos),
 -  tunnel->parms.link, skb->mark);
 -  }
++  ip_tunnel_init_flow(, protocol, dst, tnl_params->saddr,
++  tunnel->parms.o_key, RT_TOS(tos),
++  tunnel->parms.link, tunnel->fwmark);
  
if (ip_tunnel_encap(skb, tunnel, , ) < 0)
goto tx_error;


pgpa7w5mFwJx7.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the net tree

2018-01-18 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/verifier.c

between commit:

  6f16101e6a8b ("bpf: mark dst unknown on inconsistent {s, u}bounds 
adjustments")

from the net tree and commit:

  f4d7e40a5b71 ("bpf: introduce function calls (verification)")

from the net-next tree.

I fixed it up (I just used the former version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.



-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2018-01-17 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/tun.c

between commit:

  4df0bfc79904 ("tun: fix a memory leak for tfile->tx_array")

from the net tree and commits:

  8bf5c4ee1889 ("tun: setup xdp_rxq_info")
  5990a30510ed ("tun/tap: use ptr_ring instead of skb_array")
  fc72d1d54dd9 ("tuntap: XDP transmission")

from the net-next tree.

I have no idea how to clean this up, so I effectively reverted the net
tree commit.

I fixed it up (see above) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2018-01-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  net/sched/sch_ingress.c
  net/sched/sch_api.c
  include/net/sch_generic.h

between commit:

  81d947e2b8dd ("net, sched: fix panic when updating miniq {b,q}stats")

from the net tree and commits:

  54160ef6ec64 ("net: sched: sch_api: rearrange init handling")
  8d1a77f974ca ("net: sch: api: add extack support in tcf_block_get")
  d0bd684dddab ("net: sch: api: add extack support in qdisc_alloc")

from the net-next tree.

I fixed it up (I think, see below) and can carry the fix as necessary.
This is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/net/sch_generic.h
index becf86aa4ac6,ac029d5d88e4..
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@@ -444,10 -471,11 +471,12 @@@ void qdisc_destroy(struct Qdisc *qdisc)
  void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
   unsigned int len);
  struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
- const struct Qdisc_ops *ops);
+ const struct Qdisc_ops *ops,
+ struct netlink_ext_ack *extack);
 +void qdisc_free(struct Qdisc *qdisc);
  struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
-   const struct Qdisc_ops *ops, u32 parentid);
+   const struct Qdisc_ops *ops, u32 parentid,
+   struct netlink_ext_ack *extack);
  void __qdisc_calculate_pkt_len(struct sk_buff *skb,
   const struct qdisc_size_table *stab);
  int skb_do_redirect(struct sk_buff *);
diff --cc net/sched/sch_api.c
index 52529b7f8d96,0038a1c44ee9..
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@@ -1062,43 -1088,64 +1088,53 @@@ static struct Qdisc *qdisc_create(struc
netdev_info(dev, "Caught tx_queue_len zero misconfig\n");
}
  
-   if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS])) == 0) {
-   if (tca[TCA_STAB]) {
-   stab = qdisc_get_stab(tca[TCA_STAB]);
-   if (IS_ERR(stab)) {
-   err = PTR_ERR(stab);
-   goto err_out4;
-   }
-   rcu_assign_pointer(sch->stab, stab);
-   }
-   if (tca[TCA_RATE]) {
-   seqcount_t *running;
- 
-   err = -EOPNOTSUPP;
-   if (sch->flags & TCQ_F_MQROOT)
-   goto err_out4;
- 
-   if ((sch->parent != TC_H_ROOT) &&
-   !(sch->flags & TCQ_F_INGRESS) &&
-   (!p || !(p->flags & TCQ_F_MQROOT)))
-   running = qdisc_root_sleeping_running(sch);
-   else
-   running = >running;
- 
-   err = gen_new_estimator(>bstats,
-   sch->cpu_bstats,
-   >rate_est,
-   NULL,
-   running,
-   tca[TCA_RATE]);
-   if (err)
-   goto err_out4;
+   if (ops->init) {
+   err = ops->init(sch, tca[TCA_OPTIONS], extack);
+   if (err != 0)
+   goto err_out5;
+   }
+ 
 -  if (qdisc_is_percpu_stats(sch)) {
 -  sch->cpu_bstats =
 -  netdev_alloc_pcpu_stats(struct gnet_stats_basic_cpu);
 -  if (!sch->cpu_bstats)
 -  goto err_out4;
 -
 -  sch->cpu_qstats = alloc_percpu(struct gnet_stats_queue);
 -  if (!sch->cpu_qstats)
 -  goto err_out4;
 -  }
 -
+   if (tca[TCA_STAB]) {
+   stab = qdisc_get_stab(tca[TCA_STAB], extack);
+   if (IS_ERR(stab)) {
+   err = PTR_ERR(stab);
+   goto err_out4;
}
+   rcu_assign_pointer(sch->stab, stab);
+   }
+   if (tca[TCA_RATE]) {
+   seqcount_t *running;
  
-   qdisc_hash_add(sch, false);
+   err = -EOPNOTSUPP;
+   if (sch->flags & TCQ_F_MQROOT) {
+   NL_SET_ERR_MSG(extack, "Cannot attach rate estimator to 
a multi-queue root qdisc");
+   goto err_out4;
+   }
  
-   return sch;
+   if (sch->parent != TC_H_ROOT &&
+   

linux-next: manual merge of the net-next tree with the net tree

2018-01-15 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv6/ip6_output.c

between commit:

  749439bfac6e ("ipv6: fix udpv6 sendmsg crash caused by too small MTU")

from the net tree and commit:

  0f6c480f23f4 ("xfrm: Move dst->path into struct xfrm_dst")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv6/ip6_output.c
index 4f7d8de56611,18547a44bdaf..
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@@ -1206,18 -1215,16 +1215,18 @@@ static int ip6_setup_cork(struct sock *
v6_cork->tclass = ipc6->tclass;
if (rt->dst.flags & DST_XFRM_TUNNEL)
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
 -rt->dst.dev->mtu : dst_mtu(>dst);
 +READ_ONCE(rt->dst.dev->mtu) : dst_mtu(>dst);
else
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
- READ_ONCE(rt->dst.dev->mtu) : dst_mtu(rt->dst.path);
 -rt->dst.dev->mtu : dst_mtu(xfrm_dst_path(>dst));
++READ_ONCE(rt->dst.dev->mtu) : 
dst_mtu(xfrm_dst_path(>dst));
if (np->frag_size < mtu) {
if (np->frag_size)
mtu = np->frag_size;
}
 +  if (mtu < IPV6_MIN_MTU)
 +  return -EINVAL;
cork->base.fragsize = mtu;
-   if (dst_allfrag(rt->dst.path))
+   if (dst_allfrag(xfrm_dst_path(>dst)))
cork->base.flags |= IPCORK_ALLFRAG;
cork->base.length = 0;
  


linux-next: manual merge of the net-next tree with the net tree

2018-01-15 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/openvswitch/flow_netlink.c

between commit:

  95a332088ecb ("Revert "openvswitch: Add erspan tunnel support."")

from the net tree and commit:

  1d7e2ed22f8d ("net: erspan: refactor existing erspan code")

from the net-next tree.

I fixed it up (I removed the bits of code rmeoved by the former that
were updated in the latter) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.



-- 
Cheers,
Stephen Rothwell


Re: linux-next: manual merge of the net-next tree with the net tree

2018-01-14 Thread Eran Ben Elisha
On Mon, Jan 15, 2018 at 1:52 AM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   include/linux/mlx5/mlx5_ifc.h
>
> between commit:
>
>   8978cc921fc7 ("{net,ib}/mlx5: Don't disable local loopback multicast 
> traffic when needed")
>
> from the net tree and commit:
>
>   40817cdbb695 ("net/mlx5: Add hairpin definitions to the FW API")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

sure, https://patchwork.ozlabs.org/patch/859425/

>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc include/linux/mlx5/mlx5_ifc.h
> index 1391a82da98e,78e36fc2609e..
> --- a/include/linux/mlx5/mlx5_ifc.h
> +++ b/include/linux/mlx5/mlx5_ifc.h
> @@@ -1027,9 -1035,10 +1035,10 @@@ struct mlx5_ifc_cmd_hca_cap_bits
> u8 log_max_wq_sz[0x5];
>
> u8 nic_vport_change_event[0x1];
>  -  u8 disable_local_lb[0x1];
>  -  u8 reserved_at_3e2[0x1];
>  +  u8 disable_local_lb_uc[0x1];
>  +  u8 disable_local_lb_mc[0x1];
> -   u8 reserved_at_3e3[0x8];
> +   u8 log_min_hairpin_wq_data_sz[0x5];
> +   u8 reserved_at_3e8[0x3];

Conflict fix looks good as proposed.

thanks for the fix,
Eran.

> u8 log_max_vlan_list[0x5];
> u8 reserved_at_3f0[0x3];
> u8 log_max_current_mc_list[0x5];


linux-next: manual merge of the net-next tree with the net tree

2018-01-14 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  include/linux/mlx5/mlx5_ifc.h

between commit:

  8978cc921fc7 ("{net,ib}/mlx5: Don't disable local loopback multicast traffic 
when needed")

from the net tree and commit:

  40817cdbb695 ("net/mlx5: Add hairpin definitions to the FW API")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/mlx5/mlx5_ifc.h
index 1391a82da98e,78e36fc2609e..
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@@ -1027,9 -1035,10 +1035,10 @@@ struct mlx5_ifc_cmd_hca_cap_bits 
u8 log_max_wq_sz[0x5];
  
u8 nic_vport_change_event[0x1];
 -  u8 disable_local_lb[0x1];
 -  u8 reserved_at_3e2[0x1];
 +  u8 disable_local_lb_uc[0x1];
 +  u8 disable_local_lb_mc[0x1];
-   u8 reserved_at_3e3[0x8];
+   u8 log_min_hairpin_wq_data_sz[0x5];
+   u8 reserved_at_3e8[0x3];
u8 log_max_vlan_list[0x5];
u8 reserved_at_3f0[0x3];
u8 log_max_current_mc_list[0x5];


linux-next: manual merge of the net-next tree with the net tree

2017-12-21 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/verifier.c

between commit:

  0c17d1d2c619 ("bpf: fix incorrect tracking of register size truncation")

from the net tree and commits:

  f4d7e40a5b71 ("bpf: introduce function calls (verification)")
  1ea47e01ad6e ("bpf: add support for bpf_call to interpreter")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/bpf/verifier.c
index 04b24876cd23,48b2901cf483..
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@@ -1072,29 -1425,54 +1430,77 @@@ static int check_ptr_alignment(struct b
   strict);
  }
  
 +/* truncate register to smaller size (in bytes)
 + * must be called with size < BPF_REG_SIZE
 + */
 +static void coerce_reg_to_size(struct bpf_reg_state *reg, int size)
 +{
 +  u64 mask;
 +
 +  /* clear high bits in bit representation */
 +  reg->var_off = tnum_cast(reg->var_off, size);
 +
 +  /* fix arithmetic bounds */
 +  mask = ((u64)1 << (size * 8)) - 1;
 +  if ((reg->umin_value & ~mask) == (reg->umax_value & ~mask)) {
 +  reg->umin_value &= mask;
 +  reg->umax_value &= mask;
 +  } else {
 +  reg->umin_value = 0;
 +  reg->umax_value = mask;
 +  }
 +  reg->smin_value = reg->umin_value;
 +  reg->smax_value = reg->umax_value;
 +}
 +
+ static int update_stack_depth(struct bpf_verifier_env *env,
+ const struct bpf_func_state *func,
+ int off)
+ {
+   u16 stack = env->subprog_stack_depth[func->subprogno], total = 0;
+   struct bpf_verifier_state *cur = env->cur_state;
+   int i;
+ 
+   if (stack >= -off)
+   return 0;
+ 
+   /* update known max for given subprogram */
+   env->subprog_stack_depth[func->subprogno] = -off;
+ 
+   /* compute the total for current call chain */
+   for (i = 0; i <= cur->curframe; i++) {
+   u32 depth = env->subprog_stack_depth[cur->frame[i]->subprogno];
+ 
+   /* round up to 32-bytes, since this is granularity
+* of interpreter stack sizes
+*/
+   depth = round_up(depth, 32);
+   total += depth;
+   }
+ 
+   if (total > MAX_BPF_STACK) {
+   verbose(env, "combined stack size of %d calls is %d. Too 
large\n",
+   cur->curframe, total);
+   return -EACCES;
+   }
+   return 0;
+ }
+ 
+ static int get_callee_stack_depth(struct bpf_verifier_env *env,
+ const struct bpf_insn *insn, int idx)
+ {
+   int start = idx + insn->imm + 1, subprog;
+ 
+   subprog = find_subprog(env, start);
+   if (subprog < 0) {
+   WARN_ONCE(1, "verifier bug. No program starts at insn %d\n",
+ start);
+   return -EFAULT;
+   }
+   subprog++;
+   return env->subprog_stack_depth[subprog];
+ }
+ 
  /* check whether memory at (regno + off) is accessible for t = (read | write)
   * if t==write, value_regno is a register which value is stored into memory
   * if t==read, value_regno is a register which will receive the value from 
memory
@@@ -1302,15 -1678,14 +1704,15 @@@ static int check_stack_boundary(struct 
}
  
/* Only allow fixed-offset stack reads */
-   if (!tnum_is_const(regs[regno].var_off)) {
+   if (!tnum_is_const(reg->var_off)) {
char tn_buf[48];
  
-   tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off);
+   tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off);
verbose(env, "invalid variable stack read R%d var_off=%s\n",
regno, tn_buf);
 +  return -EACCES;
}
-   off = regs[regno].off + regs[regno].var_off.value;
+   off = reg->off + reg->var_off.value;
if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 ||
access_size < 0 || (access_size == 0 && !zero_size_allowed)) {
verbose(env, "invalid stack type R%d off=%d access_size=%d\n",
@@@ -2294,9 -2758,12 +2828,11 @@@ static int adjust_scalar_min_max_vals(s
  static int adjust_reg_min_max_vals(struct bpf_verifier_env *env,
   struct bpf_insn *insn)
  {
-   struct bpf_reg_state *regs = cur_regs(env), *dst_reg, *src_reg;
+   struct bpf_verifier_state *vstate = env->cur_state;
+   struct bpf_func_state *state = vstate->frame[vstate->curframe];
+   struct bpf_reg_state *regs = 

linux-next: manual merge of the net-next tree with the net tree

2017-12-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/netronome/nfp/bpf/main.c

between commit:

  d3f89b98e391 ("nfp: bpf: keep track of the offloaded program")

from the net tree and commit:

  bd0b2e7fe611 ("net: xdp: make the stack take care of the tear down")

from the net-next tree.

I fixed it up (the latter seems to be a fix for the same problem as the
former, so I just reverted the former by hand) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2017-12-18 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/marvell.c

between commit:

  c505873eaece ("net: phy: marvell: Limit 88m1101 autoneg errata to 88E1145 as 
well.")

from the net tree and commit:

  80274abafc60 ("net: phy: remove generic settings for callbacks config_aneg 
and read_status from drivers")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/phy/marvell.c
index 82104edca393,2fc026dc170a..
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@@ -2085,8 -2070,7 +2082,7 @@@ static struct phy_driver marvell_driver
.flags = PHY_HAS_INTERRUPT,
.probe = marvell_probe,
.config_init = _config_init,
 -  .config_aneg = _config_aneg,
 +  .config_aneg = _config_aneg,
-   .read_status = _read_status,
.ack_interrupt = _ack_interrupt,
.config_intr = _config_intr,
.resume = _resume,


linux-next: manual merge of the net-next tree with the net tree

2017-12-11 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/meson-gxl.c

between commit:

  f1e2400a80ff ("net: phy: meson-gxl: detect LPA corruption")

from the net tree and commit:

  80274abafc60 ("net: phy: remove generic settings for callbacks config_aneg 
and read_status from drivers")

from the net-next tree.

I fixed it up (I just used the former) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/phy/meson-gxl.c
index 77dd4be5,401e3234be58..
--- a/drivers/net/phy/meson-gxl.c
+++ b/drivers/net/phy/meson-gxl.c
@@@ -130,9 -58,7 +130,8 @@@ static struct phy_driver meson_gxl_phy[
.features   = PHY_BASIC_FEATURES,
.flags  = PHY_IS_INTERNAL,
.config_init= meson_gxl_config_init,
-   .config_aneg= genphy_config_aneg,
.aneg_done  = genphy_aneg_done,
 +  .read_status= meson_gxl_read_status,
.suspend= genphy_suspend,
.resume = genphy_resume,
},


Re: linux-next: manual merge of the net-next tree with the net tree

2017-10-31 Thread Cong Wang
On Tue, Oct 31, 2017 at 5:58 PM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   net/sched/cls_api.c
>
> between commit:
>
>   822e86d997e4 ("net_sched: remove tcf_block_put_deferred()")
>
> from the net tree and commit:
>
>   8c4083b30e56 ("net: sched: add block bind/unbind notif. and extended 
> block_get/put")
>
> from the net-next tree.

Seems good.

Thanks!


linux-next: manual merge of the net-next tree with the net tree

2017-10-31 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/cls_api.c

between commit:

  822e86d997e4 ("net_sched: remove tcf_block_put_deferred()")

from the net tree and commit:

  8c4083b30e56 ("net: sched: add block bind/unbind notif. and extended 
block_get/put")

from the net-next tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/cls_api.c
index b2d310745487,d9d54b367d23..
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@@ -289,22 -331,47 +331,26 @@@ static void tcf_block_put_final(struct 
  }
  
  /* XXX: Standalone actions are not allowed to jump to any chain, and bound
 - * actions should be all removed after flushing. However, filters are 
destroyed
 - * in RCU callbacks, we have to hold the chains first, otherwise we would
 - * always race with RCU callbacks on this list without proper locking.
 + * actions should be all removed after flushing. However, filters are now
 + * destroyed in tc filter workqueue with RTNL lock, they can not race here.
   */
- void tcf_block_put(struct tcf_block *block)
 -static void tcf_block_put_deferred(struct work_struct *work)
 -{
 -  struct tcf_block *block = container_of(work, struct tcf_block, work);
 -  struct tcf_chain *chain;
 -
 -  rtnl_lock();
 -  /* Hold a refcnt for all chains, except 0, in case they are gone. */
 -  list_for_each_entry(chain, >chain_list, list)
 -  if (chain->index)
 -  tcf_chain_hold(chain);
 -
 -  /* No race on the list, because no chain could be destroyed. */
 -  list_for_each_entry(chain, >chain_list, list)
 -  tcf_chain_flush(chain);
 -
 -  INIT_WORK(>work, tcf_block_put_final);
 -  /* Wait for RCU callbacks to release the reference count and make
 -   * sure their works have been queued before this.
 -   */
 -  rcu_barrier();
 -  tcf_queue_work(>work);
 -  rtnl_unlock();
 -}
 -
+ void tcf_block_put_ext(struct tcf_block *block,
+  struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q,
+  struct tcf_block_ext_info *ei)
  {
 +  struct tcf_chain *chain, *tmp;
 +
if (!block)
return;
  
+   tcf_block_offload_unbind(block, q, ei);
+ 
 -  INIT_WORK(>work, tcf_block_put_deferred);
 -  /* Wait for existing RCU callbacks to cool down, make sure their works
 -   * have been queued before this. We can not flush pending works here
 -   * because we are holding the RTNL lock.
 +  list_for_each_entry_safe(chain, tmp, >chain_list, list)
 +  tcf_chain_flush(chain);
 +
 +  INIT_WORK(>work, tcf_block_put_final);
 +  /* Wait for RCU callbacks to release the reference count and make
 +   * sure their works have been queued before this.
 */
rcu_barrier();
tcf_queue_work(>work);


Re: linux-next: manual merge of the net-next tree with the net tree

2017-10-19 Thread Daniel Borkmann

On 10/19/2017 03:05 PM, Mark Brown wrote:

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

   tools/testing/selftests/bpf/test_verifier.c

between commit:

   28e33f9d78eef ("bpf: disallow arithmetic operations on context pointer")

from the net tree and commit:

   22c8852624fc9 ("bpf: improve selftests and add tests for meta pointer")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This


LGTM, thanks.


linux-next: manual merge of the net-next tree with the net tree

2017-10-19 Thread Mark Brown
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  tools/testing/selftests/bpf/test_verifier.c

between commit:

  28e33f9d78eef ("bpf: disallow arithmetic operations on context pointer")

from the net tree and commit:

  22c8852624fc9 ("bpf: improve selftests and add tests for meta pointer")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc tools/testing/selftests/bpf/test_verifier.c
index 3c7d3a45a3c5,cc91d0159f43..
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@@ -6645,20 -6645,325 +6645,339 @@@ static struct bpf_test tests[] = 
.errstr = "BPF_END uses reserved fields",
.result = REJECT,
},
 +  {
 +  "arithmetic ops make PTR_TO_CTX unusable",
 +  .insns = {
 +  BPF_ALU64_IMM(BPF_ADD, BPF_REG_1,
 +offsetof(struct __sk_buff, data) -
 +offsetof(struct __sk_buff, mark)),
 +  BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
 +  offsetof(struct __sk_buff, mark)),
 +  BPF_EXIT_INSN(),
 +  },
 +  .errstr = "dereference of modified ctx ptr R1 off=68+8, 
ctx+const is allowed, ctx+const+const is not",
 +  .result = REJECT,
 +  .prog_type = BPF_PROG_TYPE_SCHED_CLS,
 +  },
+   {
+   "meta access, test1",
+   .insns = {
+   BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+   offsetof(struct xdp_md, data_meta)),
+   BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+   offsetof(struct xdp_md, data)),
+   BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 1),
+   BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_2, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .result = ACCEPT,
+   .prog_type = BPF_PROG_TYPE_XDP,
+   },
+   {
+   "meta access, test2",
+   .insns = {
+   BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+   offsetof(struct xdp_md, data_meta)),
+   BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+   offsetof(struct xdp_md, data)),
+   BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
+   BPF_ALU64_IMM(BPF_SUB, BPF_REG_0, 8),
+   BPF_MOV64_REG(BPF_REG_4, BPF_REG_2),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, 8),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_4, BPF_REG_3, 1),
+   BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .result = REJECT,
+   .errstr = "invalid access to packet, off=-8",
+   .prog_type = BPF_PROG_TYPE_XDP,
+   },
+   {
+   "meta access, test3",
+   .insns = {
+   BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+   offsetof(struct xdp_md, data_meta)),
+   BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+   offsetof(struct xdp_md, data_end)),
+   BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 1),
+   BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_2, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .result = REJECT,
+   .errstr = "invalid access to packet",
+   .prog_type = BPF_PROG_TYPE_XDP,
+   },
+   {
+   "meta access, test4",
+   .insns = {
+   BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+   offsetof(struct xdp_md, data_meta)),
+   BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
+   offsetof(struct xdp_md, data_end)),
+   BPF_LDX_MEM(BPF_W, BPF_REG_4, BPF_REG_1,
+   offsetof(struct xdp_md, data)),
+  

Re: linux-next: manual merge of the net-next tree with the net tree

2017-10-17 Thread Mark Brown
On Tue, Oct 17, 2017 at 02:30:29PM +0300, Sergei Shtylyov wrote:

> > diff --cc drivers/net/dsa/mv88e6060.c
> > index f123ed57630d,6173be889d95..
> > --- a/drivers/net/dsa/mv88e6060.c
> > +++ b/drivers/net/dsa/mv88e6060.c

>Your mail ends here.

Yes, that's the resulting diff.


signature.asc
Description: PGP signature


Re: linux-next: manual merge of the net-next tree with the net tree

2017-10-17 Thread Sergei Shtylyov

Hello!

On 10/16/2017 12:36 PM, Mark Brown wrote:


Today's linux-next merge of the net-next tree got a conflict in:

   drivers/net/dsa/mv88e6060.c

between commit:

   3efc93c2bc243 ("net: dsa: mv88e6060: fix switch MAC address")

from the net tree and commit:

   56c3ff9bf23e1 ("net: dsa: mv88e6060: setup random mac address")

from the net-next tree.

I fixed it up (see below, the relevant code was deleted in net-next) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

diff --cc drivers/net/dsa/mv88e6060.c
index f123ed57630d,6173be889d95..
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c


   Your mail ends here.

MBR, Sergei


linux-next: manual merge of the net-next tree with the net tree

2017-10-16 Thread Mark Brown
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/dsa/mv88e6060.c

between commit:

  3efc93c2bc243 ("net: dsa: mv88e6060: fix switch MAC address")

from the net tree and commit:

  56c3ff9bf23e1 ("net: dsa: mv88e6060: setup random mac address")

from the net-next tree.

I fixed it up (see below, the relevant code was deleted in net-next) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

diff --cc drivers/net/dsa/mv88e6060.c
index f123ed57630d,6173be889d95..
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c


signature.asc
Description: PGP signature


linux-next: manual merge of the net-next tree with the net tree

2017-08-28 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/marvell/mvpp2.c

between commit:

  4c2286826451 ("net: mvpp2: fix the mac address used when using PPv2.2")

from the net tree and commits:

  09f8397553a2 ("net: mvpp2: introduce per-port nrxqs/ntxqs variables")
  213f428f5056 ("net: mvpp2: add support for TX interrupts and RX queue 
distribution modes")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/marvell/mvpp2.c
index 4d598ca8503a,fea9ae5b70ba..
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@@ -6504,7 -7248,9 +7248,9 @@@ static int mvpp2_port_probe(struct plat
struct resource *res;
const char *dt_mac_addr;
const char *mac_from;
 -  char hw_mac_addr[ETH_ALEN];
 +  char hw_mac_addr[ETH_ALEN] = {0};
+   unsigned int ntxqs, nrxqs;
+   bool has_tx_irqs;
u32 id;
int features;
int phy_mode;


Re: linux-next: manual merge of the net-next tree with the net tree

2017-08-22 Thread Ido Schimmel
On Wed, Aug 23, 2017 at 11:31:05AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   net/ipv6/ip6_fib.c
> 
> between commit:
> 
>   c5cff8561d2d ("ipv6: add rcu grace period before freeing fib6_node")
> 
> from the net tree and commit:
> 
>   a460aa83963b ("ipv6: fib: Add helpers to hold / drop a reference on 
> rt6_info")
> 
> from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Looks good to me.

Thanks!


linux-next: manual merge of the net-next tree with the net tree

2017-08-22 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv6/ip6_fib.c

between commit:

  c5cff8561d2d ("ipv6: add rcu grace period before freeing fib6_node")

from the net tree and commit:

  a460aa83963b ("ipv6: fib: Add helpers to hold / drop a reference on rt6_info")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv6/ip6_fib.c
index a5ebf86f6be8,549aacc3cb2c..
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@@ -160,12 -154,7 +161,12 @@@ static void node_free_rcu(struct rcu_he
kmem_cache_free(fib6_node_kmem, fn);
  }
  
 +static void node_free(struct fib6_node *fn)
 +{
 +  call_rcu(>rcu, node_free_rcu);
 +}
 +
- static void rt6_free_pcpu(struct rt6_info *non_pcpu_rt)
+ void rt6_free_pcpu(struct rt6_info *non_pcpu_rt)
  {
int cpu;
  


Re: linux-next: manual merge of the net-next tree with the net tree

2017-08-06 Thread Stephen Rothwell
Hi Neal,

On Sun, 6 Aug 2017 22:21:43 -0400 Neal Cardwell  wrote:
>
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging.  You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.  
> 
> Sorry about that. Will try to follow that procedure in the future.

The above is a generic statement I add to all these emails.  It is
aimed more at the maintainers if the trees involved, no the developers
of patches.  I don't think you need to do anything different in these
cases with the "net" and "net-next" tree.  Dave Miller will fix up any
conflicts when he next merges the net tree into the net-next tree.

-- 
Cheers,
Stephen Rothwell


Re: linux-next: manual merge of the net-next tree with the net tree

2017-08-06 Thread Neal Cardwell
On Sun, Aug 6, 2017 at 10:01 PM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   net/ipv4/tcp_output.c
>
> between commit:
>
>   a2815817ffa6 ("tcp: enable xmit timer fix by having TLP use time when RTO 
> should fire")
>
> from the net tree and commit:
>
>   bb4d991a28cc ("tcp: adjust tail loss probe timeout")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Sorry about that. Will try to follow that procedure in the future.

thanks,
neal


linux-next: manual merge of the net-next tree with the net tree

2017-08-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv4/tcp_output.c

between commit:

  a2815817ffa6 ("tcp: enable xmit timer fix by having TLP use time when RTO 
should fire")

from the net tree and commit:

  bb4d991a28cc ("tcp: adjust tail loss probe timeout")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/tcp_output.c
index 276406a83a37,d49bff51bdb7..
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@@ -2377,9 -2375,13 +2375,8 @@@ bool tcp_schedule_loss_probe(struct soc
  {
struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
-   u32 rtt = usecs_to_jiffies(tp->srtt_us >> 3);
 -  u32 timeout, tlp_time_stamp, rto_time_stamp;
 +  u32 timeout, rto_delta_us;
  
 -  /* No consecutive loss probes. */
 -  if (WARN_ON(icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)) {
 -  tcp_rearm_rto(sk);
 -  return false;
 -  }
/* Don't do any loss probe on a Fast Open connection before 3WHS
 * finishes.
 */
@@@ -2402,16 -2408,24 +2399,20 @@@
 * for delayed ack when there's one outstanding packet. If no RTT
 * sample is available then probe after TCP_TIMEOUT_INIT.
 */
-   timeout = rtt << 1 ? : TCP_TIMEOUT_INIT;
-   if (tp->packets_out == 1)
-   timeout = max_t(u32, timeout,
-   (rtt + (rtt >> 1) + TCP_DELACK_MAX));
-   timeout = max_t(u32, timeout, msecs_to_jiffies(10));
+   if (tp->srtt_us) {
+   timeout = usecs_to_jiffies(tp->srtt_us >> 2);
+   if (tp->packets_out == 1)
+   timeout += TCP_RTO_MIN;
+   else
+   timeout += TCP_TIMEOUT_MIN;
+   } else {
+   timeout = TCP_TIMEOUT_INIT;
+   }
  
 -  /* If RTO is shorter, just schedule TLP in its place. */
 -  tlp_time_stamp = tcp_jiffies32 + timeout;
 -  rto_time_stamp = (u32)inet_csk(sk)->icsk_timeout;
 -  if ((s32)(tlp_time_stamp - rto_time_stamp) > 0) {
 -  s32 delta = rto_time_stamp - tcp_jiffies32;
 -  if (delta > 0)
 -  timeout = delta;
 -  }
 +  /* If the RTO formula yields an earlier time, then use that time. */
 +  rto_delta_us = tcp_rto_delta_us(sk);  /* How far in future is RTO? */
 +  if (rto_delta_us > 0)
 +  timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us));
  
inet_csk_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout,
  TCP_RTO_MAX);


Re: linux-next: manual merge of the net-next tree with the net tree

2017-08-02 Thread Stephen Hemminger
On Thu, 3 Aug 2017 12:01:37 +1000
Stephen Rothwell  wrote:

> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/net/hyperv/netvsc.c
> 
> between commit:
> 
>   4a0dee1ffe0e ("netvsc: Initialize 64-bit stats seqcount")
> 
> from the net tree and commit:
> 
>   35fbbccfb417 ("netvsc: save pointer to parent netvsc_device in channel 
> table")
> 
> from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 

Thanks, that looks right.


linux-next: manual merge of the net-next tree with the net tree

2017-08-02 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/hyperv/netvsc.c

between commit:

  4a0dee1ffe0e ("netvsc: Initialize 64-bit stats seqcount")

from the net tree and commit:

  35fbbccfb417 ("netvsc: save pointer to parent netvsc_device in channel table")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/hyperv/netvsc.c
index 96f90c75d1b7,9598220b3bcc..
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@@ -1302,8 -1269,7 +1269,9 @@@ struct netvsc_device *netvsc_device_add
struct netvsc_channel *nvchan = _device->chan_table[i];
  
nvchan->channel = device->channel;
+   nvchan->net_device = net_device;
 +  u64_stats_init(>tx_stats.syncp);
 +  u64_stats_init(>rx_stats.syncp);
}
  
/* Enable NAPI handler before init callbacks */


Re: linux-next: manual merge of the net-next tree with the net tree

2017-07-03 Thread Saeed Mahameed
On Mon, Jul 3, 2017 at 4:43 AM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got conflicts in:
>
>   drivers/net/ethernet/mellanox/mlx5/core/health.c
>   include/linux/mlx5/driver.h
>
> between commit:
>
>   2a0165a034ac ("net/mlx5: Cancel delayed recovery work when unloading the 
> driver")
>
> from the net tree and commit:
>
>   0179720d6be2 ("Introduce new function for entering bad-health state.")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/net/ethernet/mellanox/mlx5/core/health.c
> index 8a8b5f0e497c,0648a659b21d..
> --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> @@@ -193,8 -193,8 +194,8 @@@ static void health_care(struct work_str
> mlx5_core_warn(dev, "handling bad device here\n");
> mlx5_handle_bad_state(dev);
>
> -   spin_lock(>wq_lock);
> +   spin_lock_irqsave(>wq_lock, flags);
>  -  if (!test_bit(MLX5_DROP_NEW_HEALTH_WORK, >flags))
>  +  if (!test_bit(MLX5_DROP_NEW_RECOVERY_WORK, >flags))
> schedule_delayed_work(>recover_work, recover_delay);
> else
> dev_err(>pdev->dev,
> @@@ -334,11 -341,11 +343,12 @@@ void mlx5_stop_health_poll(struct mlx5_
>   void mlx5_drain_health_wq(struct mlx5_core_dev *dev)
>   {
> struct mlx5_core_health *health = >priv.health;
> +   unsigned long flags;
>
> -   spin_lock(>wq_lock);
> +   spin_lock_irqsave(>wq_lock, flags);
> set_bit(MLX5_DROP_NEW_HEALTH_WORK, >flags);
>  +  set_bit(MLX5_DROP_NEW_RECOVERY_WORK, >flags);
> -   spin_unlock(>wq_lock);
> +   spin_unlock_irqrestore(>wq_lock, flags);
> cancel_delayed_work_sync(>recover_work);
> cancel_work_sync(>work);
>   }
> diff --cc include/linux/mlx5/driver.h
> index ba260330ce5e,2ab4ae3e3a1a..
> --- a/include/linux/mlx5/driver.h
> +++ b/include/linux/mlx5/driver.h
> @@@ -925,7 -945,7 +945,8 @@@ int mlx5_health_init(struct mlx5_core_d
>   void mlx5_start_health_poll(struct mlx5_core_dev *dev);
>   void mlx5_stop_health_poll(struct mlx5_core_dev *dev);
>   void mlx5_drain_health_wq(struct mlx5_core_dev *dev);
>  +void mlx5_drain_health_recovery(struct mlx5_core_dev *dev);
> + void mlx5_trigger_health_work(struct mlx5_core_dev *dev);
>   int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size,
> struct mlx5_buf *buf, int node);
>   int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, struct mlx5_buf 
> *buf);

Hi Stephen,

The fix up looks good, I already notified Dave about this on net
submission and he approved.

Thanks,
Saeed.


linux-next: manual merge of the net-next tree with the net tree

2017-07-02 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  drivers/net/ethernet/mellanox/mlx5/core/health.c
  include/linux/mlx5/driver.h

between commit:

  2a0165a034ac ("net/mlx5: Cancel delayed recovery work when unloading the 
driver")

from the net tree and commit:

  0179720d6be2 ("Introduce new function for entering bad-health state.")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx5/core/health.c
index 8a8b5f0e497c,0648a659b21d..
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@@ -193,8 -193,8 +194,8 @@@ static void health_care(struct work_str
mlx5_core_warn(dev, "handling bad device here\n");
mlx5_handle_bad_state(dev);
  
-   spin_lock(>wq_lock);
+   spin_lock_irqsave(>wq_lock, flags);
 -  if (!test_bit(MLX5_DROP_NEW_HEALTH_WORK, >flags))
 +  if (!test_bit(MLX5_DROP_NEW_RECOVERY_WORK, >flags))
schedule_delayed_work(>recover_work, recover_delay);
else
dev_err(>pdev->dev,
@@@ -334,11 -341,11 +343,12 @@@ void mlx5_stop_health_poll(struct mlx5_
  void mlx5_drain_health_wq(struct mlx5_core_dev *dev)
  {
struct mlx5_core_health *health = >priv.health;
+   unsigned long flags;
  
-   spin_lock(>wq_lock);
+   spin_lock_irqsave(>wq_lock, flags);
set_bit(MLX5_DROP_NEW_HEALTH_WORK, >flags);
 +  set_bit(MLX5_DROP_NEW_RECOVERY_WORK, >flags);
-   spin_unlock(>wq_lock);
+   spin_unlock_irqrestore(>wq_lock, flags);
cancel_delayed_work_sync(>recover_work);
cancel_work_sync(>work);
  }
diff --cc include/linux/mlx5/driver.h
index ba260330ce5e,2ab4ae3e3a1a..
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@@ -925,7 -945,7 +945,8 @@@ int mlx5_health_init(struct mlx5_core_d
  void mlx5_start_health_poll(struct mlx5_core_dev *dev);
  void mlx5_stop_health_poll(struct mlx5_core_dev *dev);
  void mlx5_drain_health_wq(struct mlx5_core_dev *dev);
 +void mlx5_drain_health_recovery(struct mlx5_core_dev *dev);
+ void mlx5_trigger_health_work(struct mlx5_core_dev *dev);
  int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size,
struct mlx5_buf *buf, int node);
  int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, struct mlx5_buf *buf);


linux-next: manual merge of the net-next tree with the net tree

2017-06-22 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/macvlan.c

between commits:

  e26f43faa0d7 ("macvlan: Do not return error when setting the same mac 
address")
  18c8c54de9a6 ("macvlan: Let passthru macvlan correctly restore lower mac 
address")

from the net tree and commit:

  a88e2676a6cd ("macvlan: propagate the mac address change status for lowerdev")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/macvlan.c
index 72b801803aa4,8ca274c6df3d..
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@@ -743,15 -703,8 +743,14 @@@ static int macvlan_set_mac_address(stru
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
  
 -  if (vlan->mode == MACVLAN_MODE_PASSTHRU)
 +  /* If the addresses are the same, this is a no-op */
 +  if (ether_addr_equal(dev->dev_addr, addr->sa_data))
 +  return 0;
 +
 +  if (vlan->mode == MACVLAN_MODE_PASSTHRU) {
 +  macvlan_set_addr_change(vlan->port);
-   dev_set_mac_address(vlan->lowerdev, addr);
-   return 0;
+   return dev_set_mac_address(vlan->lowerdev, addr);
 +  }
  
return macvlan_sync_address(dev, addr->sa_data);
  }


linux-next: manual merge of the net-next tree with the net tree

2017-06-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/core/rtnetlink.c

between commit:

  db833d40ad32 ("rtnetlink: add IFLA_GROUP to ifla_policy")

from the net tree and commit:

  3d3ea5af5c0b ("rtnl: Add support for netdev event to link messages")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/core/rtnetlink.c
index 467a2f4510a7,3aa57848a895..
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@@ -1469,7 -1519,7 +1520,8 @@@ static const struct nla_policy ifla_pol
[IFLA_LINK_NETNSID] = { .type = NLA_S32 },
[IFLA_PROTO_DOWN]   = { .type = NLA_U8 },
[IFLA_XDP]  = { .type = NLA_NESTED },
 +  [IFLA_GROUP]= { .type = NLA_U32 },
+   [IFLA_EVENT]= { .type = NLA_U32 },
  };
  
  static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {


linux-next: manual merge of the net-next tree with the net tree

2017-06-13 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/batman-adv/routing.c

between commit:

  a1a745ef980a ("batman-adv: fix memory leak when dropping packet from other 
gateway")

from the net tree and commit:

  22f0502ed9f3 ("batman-adv: Print correct function names in dbg messages")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/batman-adv/routing.c
index ae9f4d37d34f,1338b9221613..
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@@ -985,9 -985,9 +985,9 @@@ int batadv_recv_unicast_packet(struct s
batadv_orig_node_put(orig_node_gw);
if (is_gw) {
batadv_dbg(BATADV_DBG_BLA, bat_priv,
-  "recv_unicast_packet(): Dropped 
unicast pkt received from another backbone gw %pM.\n",
-  orig_addr_gw);
+  "%s(): Dropped unicast pkt received 
from another backbone gw %pM.\n",
+  __func__, orig_addr_gw);
 -  return NET_RX_DROP;
 +  goto free_skb;
}
}
  


linux-next: manual merge of the net-next tree with the net tree

2017-06-13 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/qlogic/qed/qed_debug.c

between commit:

  ace17c369295 ("qed: fix dump of context data")

from the net tree and commit:

  7b6859fbdcc4 ("qed: Utilize FW 8.20.0.0")

from the net-next tree.

I fixed it up (the latter incorporated the former) and can carry the
fix as necessary. This is now fixed as far as linux-next is concerned,
but any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging.  You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2017-06-05 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/dsa/dsa2.c

between commit:

  b07ac9894644 ("net: dsa: Fix stale cpu_switch reference after unbind then 
bind")

from the net tree and commits:

  8b0d3ea55587 ("net: dsa: store CPU port pointer in the tree")
  937c7df85ce7 ("net: dsa: Pass dsa_port reference to ethtool setup/restore")

from the net-next tree.

I fixed it up (I think (maybe it should be "dst->cpu_dp.ds = NULL"?) -
see below) and can carry the fix as necessary. This is now fixed as far
as linux-next is concerned, but any non trivial conflicts should be
mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/dsa/dsa2.c
index 7796580e99ee,cd13bb54a30c..
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@@ -484,10 -474,8 +474,10 @@@ static void dsa_dst_unapply(struct dsa_
dsa_ds_unapply(dst, ds);
}
  
-   if (dst->cpu_switch) {
-   dsa_cpu_port_ethtool_restore(dst->cpu_switch);
-   dst->cpu_switch = NULL;
 -  if (dst->cpu_dp)
++  if (dst->cpu_dp) {
+   dsa_cpu_port_ethtool_restore(dst->cpu_dp);
++  dst->cpu_dp = NULL;
 +  }
  
pr_info("DSA: tree %d unapplied\n", dst->tree);
dst->applied = false;


linux-next: manual merge of the net-next tree with the net tree

2017-05-31 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/marvell.c

between commit:

  898805e0cdf7 ("net: phy: fix marvell phy status reading")

from the net tree and commit:

  e1dde8dc5b27 ("net: phy: marvell: Refactor some bigger functions")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/phy/marvell.c
index 57297ba23987,1a72bebc588a..
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@@ -1082,119 -1133,106 +1133,104 @@@ static int marvell_update_link(struct p
return 0;
  }
  
- /* marvell_read_status_page
-  *
-  * Description:
-  *   Check the link, then figure out the current state
-  *   by comparing what we advertise with what the link partner
-  *   advertises.  Start by checking the gigabit possibilities,
-  *   then move on to 10/100.
-  */
- static int marvell_read_status_page(struct phy_device *phydev, int page)
+ static int marvell_read_status_page_an(struct phy_device *phydev,
+  int fiber)
  {
-   int adv;
-   int err;
+   int status;
int lpa;
int lpagb;
-   int status = 0;
-   int fiber;
+   int adv;
  
-   /* Detect and update the link, but return if there
-* was an error */
-   if (page == MII_M_FIBER)
-   fiber = 1;
-   else
-   fiber = 0;
+   status = phy_read(phydev, MII_M1011_PHY_STATUS);
+   if (status < 0)
+   return status;
  
-   err = marvell_update_link(phydev, fiber);
-   if (err)
-   return err;
+   lpa = phy_read(phydev, MII_LPA);
+   if (lpa < 0)
+   return lpa;
  
-   if (AUTONEG_ENABLE == phydev->autoneg) {
-   status = phy_read(phydev, MII_M1011_PHY_STATUS);
-   if (status < 0)
-   return status;
+   lpagb = phy_read(phydev, MII_STAT1000);
+   if (lpagb < 0)
+   return lpagb;
  
-   lpa = phy_read(phydev, MII_LPA);
-   if (lpa < 0)
-   return lpa;
+   adv = phy_read(phydev, MII_ADVERTISE);
+   if (adv < 0)
+   return adv;
  
-   lpagb = phy_read(phydev, MII_STAT1000);
-   if (lpagb < 0)
-   return lpagb;
 -  lpa &= adv;
 -
+   if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
+   phydev->duplex = DUPLEX_FULL;
+   else
+   phydev->duplex = DUPLEX_HALF;
  
-   adv = phy_read(phydev, MII_ADVERTISE);
-   if (adv < 0)
-   return adv;
+   status = status & MII_M1011_PHY_STATUS_SPD_MASK;
+   phydev->pause = 0;
+   phydev->asym_pause = 0;
  
-   if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
-   phydev->duplex = DUPLEX_FULL;
-   else
-   phydev->duplex = DUPLEX_HALF;
+   switch (status) {
+   case MII_M1011_PHY_STATUS_1000:
+   phydev->speed = SPEED_1000;
+   break;
  
-   status = status & MII_M1011_PHY_STATUS_SPD_MASK;
-   phydev->pause = phydev->asym_pause = 0;
+   case MII_M1011_PHY_STATUS_100:
+   phydev->speed = SPEED_100;
+   break;
  
-   switch (status) {
-   case MII_M1011_PHY_STATUS_1000:
-   phydev->speed = SPEED_1000;
-   break;
+   default:
+   phydev->speed = SPEED_10;
+   break;
+   }
  
-   case MII_M1011_PHY_STATUS_100:
-   phydev->speed = SPEED_100;
-   break;
+   if (!fiber) {
+   phydev->lp_advertising =
+   mii_stat1000_to_ethtool_lpa_t(lpagb) |
+   mii_lpa_to_ethtool_lpa_t(lpa);
  
-   default:
-   phydev->speed = SPEED_10;
-   break;
+   if (phydev->duplex == DUPLEX_FULL) {
+   phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
+   phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0;
}
- 
-   if (!fiber) {
-   phydev->lp_advertising = 
mii_stat1000_to_ethtool_lpa_t(lpagb) |
-mii_lpa_to_ethtool_lpa_t(lpa);
- 
-   if (phydev->duplex == DUPLEX_FULL) {
-   phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
-   phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 
0;
- 

linux-next: manual merge of the net-next tree with the net tree

2017-05-24 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/marvell.c

between commit:

  f2899788353c ("net: phy: marvell: Limit errata to 88m1101")

from the net tree and commit:

  0c3439bc7773 ("net: phy: Marvell: checkpatch - Comments")

from the net-next tree.

I fixed it up (I just used the former version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


Re: linux-next: manual merge of the net-next tree with the net tree

2017-04-17 Thread Daniel Borkmann

On 04/18/2017 02:18 AM, Stephen Rothwell wrote:

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

   kernel/bpf/syscall.c

between commits:

   6b1bb01bcc5b ("bpf: fix cb access in socket filter programs on tail calls")
   c2002f983767 ("bpf: fix checking xdp_adjust_head on tail calls")

from the net tree and commit:

   e245c5c6a565 ("bpf: move fixup_bpf_calls() function")
   79741b3bdec0 ("bpf: refactor fixup_bpf_calls()")

from the net-next tree.

I fixed it up (the latter moved and changed teh code modified by the
former  - I added the following fix up patch) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

From: Stephen Rothwell 
Date: Tue, 18 Apr 2017 10:16:03 +1000
Subject: [PATCH] bpf: merge fix for move of fixup_bpf_calls()

Signed-off-by: Stephen Rothwell 
---
  kernel/bpf/verifier.c | 8 
  1 file changed, 8 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 62e1e447ded9..5939b4c81fe1 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -3349,6 +3349,14 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
if (insn->imm == BPF_FUNC_xdp_adjust_head)
prog->xdp_adjust_head = 1;
if (insn->imm == BPF_FUNC_tail_call) {
+   /* If we tail call into other programs, we
+* cannot make any assumptions since they
+* can be replaced dynamically during runtime
+* in the program array.
+*/
+   prog->cb_access = 1;
+   prog->xdp_adjust_head = 1;
+
/* mark bpf_tail_call as different opcode to avoid
 * conditional branch in the interpeter for every normal
 * call and to prevent accidental JITing by JIT compiler



Looks good, thanks.


linux-next: manual merge of the net-next tree with the net tree

2017-04-17 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/syscall.c

between commits:

  6b1bb01bcc5b ("bpf: fix cb access in socket filter programs on tail calls")
  c2002f983767 ("bpf: fix checking xdp_adjust_head on tail calls")

from the net tree and commit:

  e245c5c6a565 ("bpf: move fixup_bpf_calls() function")
  79741b3bdec0 ("bpf: refactor fixup_bpf_calls()")

from the net-next tree.

I fixed it up (the latter moved and changed teh code modified by the
former  - I added the following fix up patch) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

From: Stephen Rothwell 
Date: Tue, 18 Apr 2017 10:16:03 +1000
Subject: [PATCH] bpf: merge fix for move of fixup_bpf_calls()

Signed-off-by: Stephen Rothwell 
---
 kernel/bpf/verifier.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 62e1e447ded9..5939b4c81fe1 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -3349,6 +3349,14 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
if (insn->imm == BPF_FUNC_xdp_adjust_head)
prog->xdp_adjust_head = 1;
if (insn->imm == BPF_FUNC_tail_call) {
+   /* If we tail call into other programs, we
+* cannot make any assumptions since they
+* can be replaced dynamically during runtime
+* in the program array.
+*/
+   prog->cb_access = 1;
+   prog->xdp_adjust_head = 1;
+
/* mark bpf_tail_call as different opcode to avoid
 * conditional branch in the interpeter for every normal
 * call and to prevent accidental JITing by JIT compiler
-- 
2.11.0

-- 
Cheers,
Stephen Rothwell


Re: linux-next: manual merge of the net-next tree with the net tree

2017-04-07 Thread Cong Wang
On Thu, Apr 6, 2017 at 5:12 PM, Stephen Rothwell  wrote:
> diff --cc net/sched/sch_generic.c
> index 1a2f9e964330,3e64d23e098c..
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@@ -794,8 -794,8 +794,8 @@@ static void attach_default_qdiscs(struc
> }
> }
>   #ifdef CONFIG_NET_SCHED
>  -  if (dev->qdisc)
>  +  if (dev->qdisc != _qdisc)
> -   qdisc_hash_add(dev->qdisc);
> +   qdisc_hash_add(dev->qdisc, false);
>   #endif
>   }


Looks good to me.

Thanks.


linux-next: manual merge of the net-next tree with the net tree

2017-04-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/sch_generic.c

between commit:

  92f9170621a1 ("net_sched: check noop_qdisc before qdisc_hash_add()")

from the net tree and commit:

  49b499718fa1 ("net: sched: make default fifo qdiscs appear in the dump")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/sch_generic.c
index 1a2f9e964330,3e64d23e098c..
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@@ -794,8 -794,8 +794,8 @@@ static void attach_default_qdiscs(struc
}
}
  #ifdef CONFIG_NET_SCHED
 -  if (dev->qdisc)
 +  if (dev->qdisc != _qdisc)
-   qdisc_hash_add(dev->qdisc);
+   qdisc_hash_add(dev->qdisc, false);
  #endif
  }
  


Re: linux-next: manual merge of the net-next tree with the net tree

2017-04-04 Thread Simon Horman
On Tue, Apr 04, 2017 at 11:13:57AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   net/core/flow_dissector.c
> 
> between commit:
> 
>   ac6a3722fed6 ("flow dissector: correct size of storage for ARP")
> 
> from the net tree and commit:
> 
>   9bf881ffc5c0 ("flow_dissector: Move ARP dissection into a separate 
> function")
> 
> from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Thanks Stephen, the fix looks correct to me.


linux-next: manual merge of the net-next tree with the net tree

2017-04-03 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/core/flow_dissector.c

between commit:

  ac6a3722fed6 ("flow dissector: correct size of storage for ARP")

from the net tree and commit:

  9bf881ffc5c0 ("flow_dissector: Move ARP dissection into a separate function")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/core/flow_dissector.c
index d98d4998213d,5f3ae922fcd1..
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@@ -113,6 -113,216 +113,216 @@@ __be32 __skb_flow_get_ports(const struc
  }
  EXPORT_SYMBOL(__skb_flow_get_ports);
  
+ enum flow_dissect_ret {
+   FLOW_DISSECT_RET_OUT_GOOD,
+   FLOW_DISSECT_RET_OUT_BAD,
+   FLOW_DISSECT_RET_OUT_PROTO_AGAIN,
+ };
+ 
+ static enum flow_dissect_ret
+ __skb_flow_dissect_mpls(const struct sk_buff *skb,
+   struct flow_dissector *flow_dissector,
+   void *target_container, void *data, int nhoff, int hlen)
+ {
+   struct flow_dissector_key_keyid *key_keyid;
+   struct mpls_label *hdr, _hdr[2];
+ 
+   if (!dissector_uses_key(flow_dissector,
+   FLOW_DISSECTOR_KEY_MPLS_ENTROPY))
+   return FLOW_DISSECT_RET_OUT_GOOD;
+ 
+   hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data,
+  hlen, &_hdr);
+   if (!hdr)
+   return FLOW_DISSECT_RET_OUT_BAD;
+ 
+   if ((ntohl(hdr[0].entry) & MPLS_LS_LABEL_MASK) >>
+   MPLS_LS_LABEL_SHIFT == MPLS_LABEL_ENTROPY) {
+   key_keyid = skb_flow_dissector_target(flow_dissector,
+ 
FLOW_DISSECTOR_KEY_MPLS_ENTROPY,
+ target_container);
+   key_keyid->keyid = hdr[1].entry & htonl(MPLS_LS_LABEL_MASK);
+   }
+   return FLOW_DISSECT_RET_OUT_GOOD;
+ }
+ 
+ static enum flow_dissect_ret
+ __skb_flow_dissect_arp(const struct sk_buff *skb,
+  struct flow_dissector *flow_dissector,
+  void *target_container, void *data, int nhoff, int hlen)
+ {
+   struct flow_dissector_key_arp *key_arp;
+   struct {
+   unsigned char ar_sha[ETH_ALEN];
+   unsigned char ar_sip[4];
+   unsigned char ar_tha[ETH_ALEN];
+   unsigned char ar_tip[4];
+   } *arp_eth, _arp_eth;
+   const struct arphdr *arp;
 -  struct arphdr *_arp;
++  struct arphdr _arp;
+ 
+   if (!dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_ARP))
+   return FLOW_DISSECT_RET_OUT_GOOD;
+ 
+   arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data,
+  hlen, &_arp);
+   if (!arp)
+   return FLOW_DISSECT_RET_OUT_BAD;
+ 
+   if (arp->ar_hrd != htons(ARPHRD_ETHER) ||
+   arp->ar_pro != htons(ETH_P_IP) ||
+   arp->ar_hln != ETH_ALEN ||
+   arp->ar_pln != 4 ||
+   (arp->ar_op != htons(ARPOP_REPLY) &&
+arp->ar_op != htons(ARPOP_REQUEST)))
+   return FLOW_DISSECT_RET_OUT_BAD;
+ 
+   arp_eth = __skb_header_pointer(skb, nhoff + sizeof(_arp),
+  sizeof(_arp_eth), data,
+  hlen, &_arp_eth);
+   if (!arp_eth)
+   return FLOW_DISSECT_RET_OUT_BAD;
+ 
+   key_arp = skb_flow_dissector_target(flow_dissector,
+   FLOW_DISSECTOR_KEY_ARP,
+   target_container);
+ 
+   memcpy(_arp->sip, arp_eth->ar_sip, sizeof(key_arp->sip));
+   memcpy(_arp->tip, arp_eth->ar_tip, sizeof(key_arp->tip));
+ 
+   /* Only store the lower byte of the opcode;
+* this covers ARPOP_REPLY and ARPOP_REQUEST.
+*/
+   key_arp->op = ntohs(arp->ar_op) & 0xff;
+ 
+   ether_addr_copy(key_arp->sha, arp_eth->ar_sha);
+   ether_addr_copy(key_arp->tha, arp_eth->ar_tha);
+ 
+   return FLOW_DISSECT_RET_OUT_GOOD;
+ }
+ 
+ static enum flow_dissect_ret
+ __skb_flow_dissect_gre(const struct sk_buff *skb,
+  struct flow_dissector_key_control *key_control,
+  struct flow_dissector *flow_dissector,
+  void *target_container, void *data,
+  __be16 *p_proto, int *p_nhoff, int *p_hlen,
+  unsigned int flags)
+ {
+   struct flow_dissector_key_keyid *key_keyid;
+   struct gre_base_hdr *hdr, _hdr;
+   int offset = 0;
+   u16 gre_ver;
+ 
+   hdr = 

Re: linux-next: manual merge of the net-next tree with the net tree

2017-04-03 Thread Daniel Borkmann

On 04/03/2017 04:07 AM, Stephen Rothwell wrote:

Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

   tools/testing/selftests/bpf/Makefile
   tools/testing/selftests/bpf/test_verifier.c

between commit:

   02ea80b1850e ("bpf: add various verifier test cases for self-tests")

from the net tree and commits:

   6882804c916b ("selftests/bpf: add a test for overlapping packet range 
checks")
   fb30d4b71214 ("bpf: Add tests for map-in-map")

from the net-next tree.

I fixed it up (see below - though there are probably more fixups needed)
and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be
mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.


Looks fine, thanks Stephen!


linux-next: manual merge of the net-next tree with the net tree

2017-04-02 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  tools/testing/selftests/bpf/Makefile
  tools/testing/selftests/bpf/test_verifier.c

between commit:

  02ea80b1850e ("bpf: add various verifier test cases for self-tests")

from the net tree and commits:

  6882804c916b ("selftests/bpf: add a test for overlapping packet range checks")
  fb30d4b71214 ("bpf: Add tests for map-in-map")

from the net-next tree.

I fixed it up (see below - though there are probably more fixups needed)
and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be
mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/bpf/Makefile
index 9af09e8099c0,32fb7a294f0f..
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@@ -1,17 -1,12 +1,19 @@@
  LIBDIR := ../../../lib
  BPFDIR := $(LIBDIR)/bpf
 +APIDIR := ../../../include/uapi
 +GENDIR := ../../../../include/generated
 +GENHDR := $(GENDIR)/autoconf.h
  
 -CFLAGS += -Wall -O2 -I../../../include/uapi -I$(LIBDIR) -I../../../include
 +ifneq ($(wildcard $(GENHDR)),)
 +  GENFLAGS := -DHAVE_GENHDR
 +endif
 +
- CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS)
- LDLIBS += -lcap
++CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) -I../../../include 
$(GENFLAGS)
+ LDLIBS += -lcap -lelf
  
- TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map
+ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map 
test_progs
+ 
+ TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o
  
  TEST_PROGS := test_kmod.sh
  
diff --cc tools/testing/selftests/bpf/test_verifier.c
index c848e90b6421,f4f43c98cf7f..
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@@ -46,9 -38,8 +46,10 @@@
  
  #define MAX_INSNS 512
  #define MAX_FIXUPS8
+ #define MAX_NR_MAPS   4
  
 +#define F_NEEDS_EFFICIENT_UNALIGNED_ACCESS(1 << 0)
 +
  struct bpf_test {
const char *descr;
struct bpf_insn insns[MAX_INSNS];
@@@ -4719,8 -4454,76 +4721,77 @@@ static struct bpf_test tests[] = 
.errstr = "R0 min value is negative, either use unsigned index 
or do a if (index >=0) check.",
.result = REJECT,
.result_unpriv = REJECT,
 +  .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
-   }
+   },
+   {
+   "map in map access",
+   .insns = {
+   BPF_ST_MEM(0, BPF_REG_10, -4, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 5),
+   BPF_ST_MEM(0, BPF_REG_10, -4, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),
+   BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_MOV64_REG(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map_in_map = { 3 },
+   .result = ACCEPT,
+   },
+   {
+   "invalid inner map pointer",
+   .insns = {
+   BPF_ST_MEM(0, BPF_REG_10, -4, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 6),
+   BPF_ST_MEM(0, BPF_REG_10, -4, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),
+   BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, 8),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_MOV64_REG(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map_in_map = { 3 },
+   .errstr = "R1 type=inv expected=map_ptr",
+   .errstr_unpriv = "R1 pointer arithmetic prohibited",
+   

linux-next: manual merge of the net-next tree with the net tree

2017-03-22 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/broadcom/genet/bcmmii.c

between commit:

  31739eae738c ("net: bcmgenet: remove bcmgenet_internal_phy_setup()")

from the net tree and commit:

  421380856d9c ("net: bcmgenet: add support for the GENETv5 hardware")

from the net-next tree.

I fixed it up (I just removed the bcmgenet_internal_phy_setup() function)
and can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/broadcom/genet/bcmmii.c
index 2f9281936f0e,8df47c90cfc5..
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@@ -195,31 -195,49 +195,33 @@@ void bcmgenet_phy_power_set(struct net_
u32 reg = 0;
  
/* EXT_GPHY_CTRL is only valid for GENETv4 and onward */
-   if (!GENET_IS_V4(priv))
-   return;
- 
-   reg = bcmgenet_ext_readl(priv, EXT_GPHY_CTRL);
-   if (enable) {
-   reg &= ~EXT_CK25_DIS;
-   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
-   mdelay(1);
- 
-   reg &= ~(EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN);
-   reg |= EXT_GPHY_RESET;
+   if (GENET_IS_V4(priv)) {
+   reg = bcmgenet_ext_readl(priv, EXT_GPHY_CTRL);
+   if (enable) {
+   reg &= ~EXT_CK25_DIS;
+   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
+   mdelay(1);
+ 
+   reg &= ~(EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN);
+   reg |= EXT_GPHY_RESET;
+   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
+   mdelay(1);
+ 
+   reg &= ~EXT_GPHY_RESET;
+   } else {
+   reg |= EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN |
+  EXT_GPHY_RESET;
+   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
+   mdelay(1);
+   reg |= EXT_CK25_DIS;
+   }
bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
-   mdelay(1);
- 
-   reg &= ~EXT_GPHY_RESET;
+   udelay(60);
} else {
-   reg |= EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN | EXT_GPHY_RESET;
-   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
mdelay(1);
-   reg |= EXT_CK25_DIS;
}
-   bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL);
-   udelay(60);
  }
  
 -static void bcmgenet_internal_phy_setup(struct net_device *dev)
 -{
 -  struct bcmgenet_priv *priv = netdev_priv(dev);
 -  u32 reg;
 -
 -  /* Power up PHY */
 -  bcmgenet_phy_power_set(dev, true);
 -  if (!GENET_IS_V5(priv)) {
 -  /* enable APD */
 -  reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
 -  reg |= EXT_PWR_DN_EN_LD;
 -  bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT);
 -  }
 -  bcmgenet_mii_reset(dev);
 -}
 -
  static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv)
  {
u32 reg;


linux-next: manual merge of the net-next tree with the net tree

2017-03-19 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/hyperv/netvsc.c

between commit:

  e14b4db7a567 ("netvsc: fix race during initialization")

from the net tree and commits:

  0d6dd35784e7 ("netvsc: need napi scheduled during removal")
  6de38af611ca ("netvsc: avoid race with callback")

from the net-next tree.

I fixed it up (I just used the net-next version) and can carry the fix
as necessary. This is now fixed as far as linux-next is concerned, but
any non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

P.S. the Signed-off-bys do not match the Author email addresses.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2017-01-30 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/cadence/macb.h

between commit:

  dc97a89e726c ("net: macb: Fix 64 bit addressing support for GEM")

from the net tree and commit:

  c2594d804d5c ("macb: Common code to enable ptp support for MACB/GEM")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/cadence/macb.h
index fc8550a5d47f,94ddedd2d83e..
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@@ -385,9 -426,18 +426,20 @@@
  /* Bitfields in DCFG6. */
  #define GEM_PBUF_LSO_OFFSET   27
  #define GEM_PBUF_LSO_SIZE 1
 +#define GEM_DAW64_OFFSET  23
 +#define GEM_DAW64_SIZE1
  
+ /* Bitfields in TISUBN */
+ #define GEM_SUBNSINCR_OFFSET  0
+ #define GEM_SUBNSINCR_SIZE16
+ 
+ /* Bitfields in TI */
+ #define GEM_NSINCR_OFFSET 0
+ #define GEM_NSINCR_SIZE   8
+ 
+ /* Bitfields in ADJ */
+ #define GEM_ADDSUB_OFFSET 31
+ #define GEM_ADDSUB_SIZE   1
  /* Constants for CLK */
  #define MACB_CLK_DIV8 0
  #define MACB_CLK_DIV161
@@@ -885,9 -942,7 +952,11 @@@ struct macb 
  
u32 wol;
  
 +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
 +  enum macb_hw_dma_cap hw_dma_cap;
 +#endif
++
+   struct macb_ptp_info*ptp_info;  /* macb-ptp interface */
  };
  
  static inline bool macb_is_gem(struct macb *bp)


linux-next: manual merge of the net-next tree with the net tree

2017-01-30 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

between commit:

  3e621b19b0bb ("net/mlx5e: Support TC encapsulation offloads with upper 
devices")

from the net tree and commits:

  75c33da82736 ("net/mlx5e: TC ipv4 tunnel encap offload cosmetic changes")
  9a941117fb76 ("net/mlx5e: Maximize ip tunnel key usage on the TC offloading 
path")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index c5282b6aba8b,640f10f2e994..
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@@ -660,13 -684,10 +684,11 @@@ static int mlx5e_route_lookup_ipv4(stru
   struct net_device **out_dev,
   struct flowi4 *fl4,
   struct neighbour **out_n,
-  __be32 *saddr,
   int *out_ttl)
  {
 +  struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
struct rtable *rt;
struct neighbour *n = NULL;
-   int ttl;
  
  #if IS_ENABLED(CONFIG_INET)
int ret;
@@@ -678,21 -699,21 +700,19 @@@
  #else
return -EOPNOTSUPP;
  #endif
 -
 -  if (!switchdev_port_same_parent_id(priv->netdev, rt->dst.dev)) {
 -  pr_warn("%s: can't offload, devices not on same HW e-switch\n", 
__func__);
 -  ip_rt_put(rt);
 -  return -EOPNOTSUPP;
 -  }
 +  /* if the egress device isn't on the same HW e-switch, we use the 
uplink */
 +  if (!switchdev_port_same_parent_id(priv->netdev, rt->dst.dev))
 +  *out_dev = mlx5_eswitch_get_uplink_netdev(esw);
 +  else
 +  *out_dev = rt->dst.dev;
  
-   ttl = ip4_dst_hoplimit(>dst);
+   *out_ttl = ip4_dst_hoplimit(>dst);
n = dst_neigh_lookup(>dst, >daddr);
ip_rt_put(rt);
if (!n)
return -ENOMEM;
  
*out_n = n;
-   *saddr = fl4->saddr;
-   *out_ttl = ttl;
 -  *out_dev = rt->dst.dev;
  
return 0;
  }


linux-next: manual merge of the net-next tree with the net tree

2017-01-23 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/mpls/af_mpls.c

between commit:

  9f427a0e474a ("net: mpls: Fix multipath selection for LSR use case")

from the net tree and commit:

  27d691056bde ("mpls: Packet stats")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/mpls/af_mpls.c
index 5b77377e5a15,4dc81963af8f..
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@@ -98,10 -94,35 +94,35 @@@ bool mpls_pkt_too_big(const struct sk_b
  }
  EXPORT_SYMBOL_GPL(mpls_pkt_too_big);
  
+ void mpls_stats_inc_outucastpkts(struct net_device *dev,
+const struct sk_buff *skb)
+ {
+   struct mpls_dev *mdev;
+ 
+   if (skb->protocol == htons(ETH_P_MPLS_UC)) {
+   mdev = mpls_dev_get(dev);
+   if (mdev)
+   MPLS_INC_STATS_LEN(mdev, skb->len,
+  tx_packets,
+  tx_bytes);
+   } else if (skb->protocol == htons(ETH_P_IP)) {
+   IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUT, skb->len);
+ #if IS_ENABLED(CONFIG_IPV6)
+   } else if (skb->protocol == htons(ETH_P_IPV6)) {
+   struct inet6_dev *in6dev = __in6_dev_get(dev);
+ 
+   if (in6dev)
+   IP6_UPD_PO_STATS(dev_net(dev), in6dev,
+IPSTATS_MIB_OUT, skb->len);
+ #endif
+   }
+ }
+ EXPORT_SYMBOL_GPL(mpls_stats_inc_outucastpkts);
+ 
 -static u32 mpls_multipath_hash(struct mpls_route *rt,
 - struct sk_buff *skb, bool bos)
 +static u32 mpls_multipath_hash(struct mpls_route *rt, struct sk_buff *skb)
  {
struct mpls_entry_decoded dec;
 +  unsigned int mpls_hdr_len = 0;
struct mpls_shim_hdr *hdr;
bool eli_seen = false;
int label_index;
@@@ -280,27 -308,24 +310,24 @@@ static int mpls_forward(struct sk_buff 
hdr = mpls_hdr(skb);
dec = mpls_entry_decode(hdr);
  
 -  /* Pop the label */
 -  skb_pull(skb, sizeof(*hdr));
 -  skb_reset_network_header(skb);
 -
 -  skb_orphan(skb);
 -
rt = mpls_route_input_rcu(net, dec.label);
-   if (!rt)
+   if (!rt) {
+   MPLS_INC_STATS(mdev, rx_noroute);
goto drop;
+   }
  
 -  nh = mpls_select_multipath(rt, skb, dec.bos);
 +  nh = mpls_select_multipath(rt, skb);
if (!nh)
-   goto drop;
- 
-   /* Find the output device */
-   out_dev = rcu_dereference(nh->nh_dev);
-   if (!mpls_output_possible(out_dev))
-   goto drop;
+   goto err;
  
 +  /* Pop the label */
 +  skb_pull(skb, sizeof(*hdr));
 +  skb_reset_network_header(skb);
 +
 +  skb_orphan(skb);
 +
if (skb_warn_if_lro(skb))
-   goto drop;
+   goto err;
  
skb_forward_csum(skb);
  


Re: linux-next: manual merge of the net-next tree with the net tree

2016-12-01 Thread Jiri Pirko
Thu, Dec 01, 2016 at 02:41:59AM CET, s...@canb.auug.org.au wrote:
>Hi all,
>
>Today's linux-next merge of the net-next tree got a conflict in:
>
>  net/sched/cls_flower.c
>
>between commit:
>
>  725cbb62e7ad ("sched: cls_flower: remove from hashtable only in case skip sw 
> flag is not set")
>
>from the net tree and commit:
>
>  13fa876ebd03 ("net/sched: cls_flower: merge filter delete/destroy common 
> code")
>
>from the net-next tree.
>
>I fixed it up (see below) and can carry the fix as necessary. This
>is now fixed as far as linux-next is concerned, but any non trivial
>conflicts should be mentioned to your upstream maintainer when your tree
>is submitted for merging.  You may also want to consider cooperating
>with the maintainer of the conflicting tree to minimise any particularly
>complex conflicts.

Looks fine to me. Thanks.

>
>-- 
>Cheers,
>Stephen Rothwell
>
>diff --cc net/sched/cls_flower.c
>index 904442421db3,e8dd09af0d0c..
>--- a/net/sched/cls_flower.c
>+++ b/net/sched/cls_flower.c
>@@@ -273,24 -272,14 +276,32 @@@ static void fl_hw_update_stats(struct t
>   dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, );
>  }
>  
> +static void fl_destroy_sleepable(struct work_struct *work)
> +{
> + struct cls_fl_head *head = container_of(work, struct cls_fl_head,
> + work);
> + if (head->mask_assigned)
> + rhashtable_destroy(>ht);
> + kfree(head);
> + module_put(THIS_MODULE);
> +}
> +
> +static void fl_destroy_rcu(struct rcu_head *rcu)
> +{
> + struct cls_fl_head *head = container_of(rcu, struct cls_fl_head, rcu);
> +
> + INIT_WORK(>work, fl_destroy_sleepable);
> + schedule_work(>work);
> +}
> +
>+ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
>+ {
>+  list_del_rcu(>list);
>+  fl_hw_destroy_filter(tp, (unsigned long)f);
>+  tcf_unbind_filter(tp, >res);
>+  call_rcu(>rcu, fl_destroy_filter);
>+ }
>+ 
>  static bool fl_destroy(struct tcf_proto *tp, bool force)
>  {
>   struct cls_fl_head *head = rtnl_dereference(tp->root);
>@@@ -299,14 -288,12 +310,11 @@@
>   if (!force && !list_empty(>filters))
>   return false;
>  
>-  list_for_each_entry_safe(f, next, >filters, list) {
>-  fl_hw_destroy_filter(tp, (unsigned long)f);
>-  list_del_rcu(>list);
>-  call_rcu(>rcu, fl_destroy_filter);
>-  }
>+  list_for_each_entry_safe(f, next, >filters, list)
>+  __fl_delete(tp, f);
> - RCU_INIT_POINTER(tp->root, NULL);
> - if (head->mask_assigned)
> - rhashtable_destroy(>ht);
> - kfree_rcu(head, rcu);
> +
> + __module_get(THIS_MODULE);
> + call_rcu(>rcu, fl_destroy_rcu);
>   return true;
>  }
>  
>@@@ -761,13 -782,9 +804,10 @@@ static int fl_delete(struct tcf_proto *
>   struct cls_fl_head *head = rtnl_dereference(tp->root);
>   struct cls_fl_filter *f = (struct cls_fl_filter *) arg;
>  
> - rhashtable_remove_fast(>ht, >ht_node,
> -head->ht_params);
> + if (!tc_skip_sw(f->flags))
> + rhashtable_remove_fast(>ht, >ht_node,
> +head->ht_params);
>-  list_del_rcu(>list);
>-  fl_hw_destroy_filter(tp, (unsigned long)f);
>-  tcf_unbind_filter(tp, >res);
>-  call_rcu(>rcu, fl_destroy_filter);
>+  __fl_delete(tp, f);
>   return 0;
>  }
>  


linux-next: manual merge of the net-next tree with the net tree

2016-11-30 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/cls_flower.c

between commit:

  725cbb62e7ad ("sched: cls_flower: remove from hashtable only in case skip sw 
flag is not set")

from the net tree and commit:

  13fa876ebd03 ("net/sched: cls_flower: merge filter delete/destroy common 
code")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/cls_flower.c
index 904442421db3,e8dd09af0d0c..
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@@ -273,24 -272,14 +276,32 @@@ static void fl_hw_update_stats(struct t
dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, );
  }
  
 +static void fl_destroy_sleepable(struct work_struct *work)
 +{
 +  struct cls_fl_head *head = container_of(work, struct cls_fl_head,
 +  work);
 +  if (head->mask_assigned)
 +  rhashtable_destroy(>ht);
 +  kfree(head);
 +  module_put(THIS_MODULE);
 +}
 +
 +static void fl_destroy_rcu(struct rcu_head *rcu)
 +{
 +  struct cls_fl_head *head = container_of(rcu, struct cls_fl_head, rcu);
 +
 +  INIT_WORK(>work, fl_destroy_sleepable);
 +  schedule_work(>work);
 +}
 +
+ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
+ {
+   list_del_rcu(>list);
+   fl_hw_destroy_filter(tp, (unsigned long)f);
+   tcf_unbind_filter(tp, >res);
+   call_rcu(>rcu, fl_destroy_filter);
+ }
+ 
  static bool fl_destroy(struct tcf_proto *tp, bool force)
  {
struct cls_fl_head *head = rtnl_dereference(tp->root);
@@@ -299,14 -288,12 +310,11 @@@
if (!force && !list_empty(>filters))
return false;
  
-   list_for_each_entry_safe(f, next, >filters, list) {
-   fl_hw_destroy_filter(tp, (unsigned long)f);
-   list_del_rcu(>list);
-   call_rcu(>rcu, fl_destroy_filter);
-   }
+   list_for_each_entry_safe(f, next, >filters, list)
+   __fl_delete(tp, f);
 -  RCU_INIT_POINTER(tp->root, NULL);
 -  if (head->mask_assigned)
 -  rhashtable_destroy(>ht);
 -  kfree_rcu(head, rcu);
 +
 +  __module_get(THIS_MODULE);
 +  call_rcu(>rcu, fl_destroy_rcu);
return true;
  }
  
@@@ -761,13 -782,9 +804,10 @@@ static int fl_delete(struct tcf_proto *
struct cls_fl_head *head = rtnl_dereference(tp->root);
struct cls_fl_filter *f = (struct cls_fl_filter *) arg;
  
 -  rhashtable_remove_fast(>ht, >ht_node,
 - head->ht_params);
 +  if (!tc_skip_sw(f->flags))
 +  rhashtable_remove_fast(>ht, >ht_node,
 + head->ht_params);
-   list_del_rcu(>list);
-   fl_hw_destroy_filter(tp, (unsigned long)f);
-   tcf_unbind_filter(tp, >res);
-   call_rcu(>rcu, fl_destroy_filter);
+   __fl_delete(tp, f);
return 0;
  }
  


linux-next: manual merge of the net-next tree with the net tree

2016-11-30 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/cadence/macb.c

between commit:

  a0b44eea372b ("net: macb: fix the RX queue reset in macb_rx()")

from the net tree and commit:

  b410d13e10db ("net: macb: Use variables with defaults for tx/rx ring sizes 
instead of hardcoded values")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/cadence/macb.c
index ec09fcece711,0e489bb82456..
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@@ -974,8 -990,7 +990,8 @@@ static inline void macb_init_rx_ring(st
bp->rx_ring[i].ctrl = 0;
addr += bp->rx_buffer_size;
}
-   bp->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);
+   bp->rx_ring[bp->rx_ring_size - 1].addr |= MACB_BIT(RX_WRAP);
 +  bp->rx_tail = 0;
  }
  
  static int macb_rx(struct macb *bp, int budget)
@@@ -1617,7 -1735,9 +1737,7 @@@ static void macb_init_rings(struct mac
}
bp->queues[0].tx_head = 0;
bp->queues[0].tx_tail = 0;
-   bp->queues[0].tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
+   bp->queues[0].tx_ring[bp->tx_ring_size - 1].ctrl |= MACB_BIT(TX_WRAP);
 -
 -  bp->rx_tail = 0;
  }
  
  static void macb_reset_hw(struct macb *bp)


Re: linux-next: manual merge of the net-next tree with the net tree

2016-11-29 Thread Borislav Petkov
On Tue, Nov 29, 2016 at 11:22:32AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/net/ethernet/amd/xgbe/xgbe-main.c
> 
> between commit:
> 
>   91eefaabf102 ("amd-xgbe: Fix unused suspend handlers build warning")
> 
> from the net tree and commit:
> 
>   bd8255d8ba35 ("amd-xgbe: Prepare for supporting PCI devices")
> 
> from the net-next tree.
> 
> I fixed it up (the latter removed the code modified by the former)

... except that +#ifdef CONFIG_PM is present in the new
drivers/net/ethernet/amd/xgbe/xgbe-platform.c now.

So actually the proper fix is, IMO, to convert:

+#ifdef CONFIG_PM
+static int xgbe_platform_suspend(struct device *dev)

to

+#ifdef CONFIG_PM_SLEEP
+static int xgbe_platform_suspend(struct device *dev)

so that it doesn't fire again.

David, would you prefer a patch against linux-next?

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 


Re: linux-next: manual merge of the net-next tree with the net tree

2016-11-28 Thread Daniel Borkmann

On 11/29/2016 01:31 AM, Stephen Rothwell wrote:

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

   net/sched/cls_flower.c

between commit:

   d936377414fa ("net, sched: respect rcu grace period on cls destruction")

from the net tree and commit:

   13fa876ebd03 ("net/sched: cls_flower: merge filter delete/destroy common 
code")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.


Looks good to me, thanks!


linux-next: manual merge of the net-next tree with the net tree

2016-11-28 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/cls_flower.c

between commit:

  d936377414fa ("net, sched: respect rcu grace period on cls destruction")

from the net tree and commit:

  13fa876ebd03 ("net/sched: cls_flower: merge filter delete/destroy common 
code")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/cls_flower.c
index b296f3991ab2,e8dd09af0d0c..
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@@ -273,24 -272,14 +276,32 @@@ static void fl_hw_update_stats(struct t
dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, );
  }
  
 +static void fl_destroy_sleepable(struct work_struct *work)
 +{
 +  struct cls_fl_head *head = container_of(work, struct cls_fl_head,
 +  work);
 +  if (head->mask_assigned)
 +  rhashtable_destroy(>ht);
 +  kfree(head);
 +  module_put(THIS_MODULE);
 +}
 +
 +static void fl_destroy_rcu(struct rcu_head *rcu)
 +{
 +  struct cls_fl_head *head = container_of(rcu, struct cls_fl_head, rcu);
 +
 +  INIT_WORK(>work, fl_destroy_sleepable);
 +  schedule_work(>work);
 +}
 +
+ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
+ {
+   list_del_rcu(>list);
+   fl_hw_destroy_filter(tp, (unsigned long)f);
+   tcf_unbind_filter(tp, >res);
+   call_rcu(>rcu, fl_destroy_filter);
+ }
+ 
  static bool fl_destroy(struct tcf_proto *tp, bool force)
  {
struct cls_fl_head *head = rtnl_dereference(tp->root);
@@@ -299,14 -288,12 +310,11 @@@
if (!force && !list_empty(>filters))
return false;
  
-   list_for_each_entry_safe(f, next, >filters, list) {
-   fl_hw_destroy_filter(tp, (unsigned long)f);
-   list_del_rcu(>list);
-   call_rcu(>rcu, fl_destroy_filter);
-   }
+   list_for_each_entry_safe(f, next, >filters, list)
+   __fl_delete(tp, f);
 -  RCU_INIT_POINTER(tp->root, NULL);
 -  if (head->mask_assigned)
 -  rhashtable_destroy(>ht);
 -  kfree_rcu(head, rcu);
 +
 +  __module_get(THIS_MODULE);
 +  call_rcu(>rcu, fl_destroy_rcu);
return true;
  }
  


linux-next: manual merge of the net-next tree with the net tree

2016-11-28 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mellanox/mlx4/en_netdev.c

between commit:

  b4353708f5a1 ("Revert "net/mlx4_en: Avoid unregister_netdev at shutdown 
flow"")

from the net tree and commit:

  67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index fb8bb027b69c,ea76b28b728b..
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@@ -2155,6 -2209,9 +2202,7 @@@ void mlx4_en_destroy_netdev(struct net_
  {
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
 -  bool shutdown = mdev->dev->persist->interface_state &
 -  MLX4_INTERFACE_STATE_SHUTDOWN;
+   int t;
  
en_dbg(DRV, priv, "Destroying netdev on port:%d\n", priv->port);
  
@@@ -2188,10 -2248,13 +2236,12 @@@
mlx4_en_free_resources(priv);
mutex_unlock(>state_lock);
  
-   kfree(priv->tx_ring);
-   kfree(priv->tx_cq);
+   for (t = 0; t < MLX4_EN_NUM_TX_TYPES; t++) {
+   kfree(priv->tx_ring[t]);
+   kfree(priv->tx_cq[t]);
+   }
  
 -  if (!shutdown)
 -  free_netdev(dev);
 +  free_netdev(dev);
  }
  
  static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)


linux-next: manual merge of the net-next tree with the net tree

2016-11-28 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/amd/xgbe/xgbe-main.c

between commit:

  91eefaabf102 ("amd-xgbe: Fix unused suspend handlers build warning")

from the net tree and commit:

  bd8255d8ba35 ("amd-xgbe: Prepare for supporting PCI devices")

from the net-next tree.

I fixed it up (the latter removed the code modified by the former)
and can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2016-11-21 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

between commit:

  ba1ffd74df74 ("stmmac: fix PTP support for GMAC4")

from the net tree and commit:

  38ddc59d65b6 ("net: stmmac: replace all pr_xxx by their netdev_xxx 
counterpart")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1f9ec02fa7f8,fbd1cd79233d..
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@@ -2484,7 -2493,7 +2493,7 @@@ static int stmmac_rx(struct stmmac_pri
if (netif_msg_rx_status(priv)) {
void *rx_head;
  
-   pr_info(">> %s: descriptor ring:\n", __func__);
 -  netdev_dbg(priv->dev, "%s: descriptor ring:\n", __func__);
++  netdev_info(priv->dev, ">> %s: descriptor ring:\n", 
__func__);
if (priv->extend_desc)
rx_head = (void *)priv->dma_erx;
else
@@@ -2571,11 -2577,11 +2580,11 @@@
frame_len -= ETH_FCS_LEN;
  
if (netif_msg_rx_status(priv)) {
-   pr_info("\tdesc: %p [entry %d] buff=0x%x\n",
-   p, entry, des);
 -  netdev_dbg(priv->dev, "\tdesc: %p [entry %d] 
buff=0x%x\n",
 - p, entry, des);
++  netdev_info(priv->dev, "\tdesc: %p [entry %d] 
buff=0x%x\n",
++  p, entry, des);
if (frame_len > ETH_FRAME_LEN)
-   pr_debug("\tframe size %d, COE: %d\n",
-frame_len, status);
+   netdev_dbg(priv->dev, "frame size %d, 
COE: %d\n",
+  frame_len, status);
}
  
/* The zero-copy is always used for all the sizes
@@@ -2628,8 -2635,11 +2638,9 @@@
 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);
}
  


linux-next: manual merge of the net-next tree with the net tree

2016-11-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/verifier.c

between commit:

  f23cc643f9ba ("bpf: fix range arithmetic for bpf map access")

from the net tree and commit:

  de464375daf0 ("bpf: Remove unused but set variables")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/bpf/verifier.c
index 6a936159c6e0,89f787ca47ef..
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@@ -212,12 -229,13 +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);
@@@ -1477,9 -1498,7 +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 = [insn->dst_reg];


linux-next: manual merge of the net-next tree with the net tree

2016-11-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  include/linux/bpf_verifier.h

between commit:

  f23cc643f9ba ("bpf: fix range arithmetic for bpf map access")

from the net tree and commit:

  57a09bf0a416 ("bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/bpf_verifier.h
index 6aaf425cebc3,ac5b393ee6b2..
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@@ -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;


linux-next: manual merge of the net-next tree with the net tree

2016-11-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c

between commit:

  ba1ffd74df74 ("stmmac: fix PTP support for GMAC4")

from the net tree and commit:

  f8be0d78be6e ("net: ethernet: stmmac: change dma descriptors to __le32")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index a601f8d43b75,bec72d3103a1..
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@@ -211,18 -205,14 +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;
@@@ -234,54 -224,12 +235,54 @@@
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)
++  own = le32_to_cpu(p->des3) & RDES3_OWN;
++  ctxt = ((le32_to_cpu(p->des3) & RDES3_CONTEXT_DESCRIPTOR)
 +  >> RDES3_CONTEXT_DESCRIPTOR_SHIFT);
 +
 +  if (likely(!own && ctxt)) {
 +  if ((p->des0 == 0x) && (p->des1 == 0x))
 +  /* 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;
 +  int ret = -EINVAL;
 +
 +  /* Get the status from normal w/b descriptor */
-   if (likely(p->des3 & TDES3_RS1V)) {
-   if (likely(p->des1 & RDES1_TIMESTAMP_AVAILABLE)) {
++  if (likely(le32_to_cpu(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,


linux-next: manual merge of the net-next tree with the net tree

2016-11-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/cavium/thunder/nicvf_main.c

between commit:

  712c31853440 ("net: thunderx: Program LMAC credits based on MTU")

from the net tree and commit:

  109cc16526c6 ("ethernet/cavium: use core min/max MTU checking")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 8a37012c9c89,b192712c93b7..
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@@ -1292,19 -1312,10 +1292,13 @@@ static int nicvf_change_mtu(struct net_
  {
struct nicvf *nic = netdev_priv(netdev);
  
-   if (new_mtu > NIC_HW_MAX_FRS)
-   return -EINVAL;
- 
-   if (new_mtu < NIC_HW_MIN_FRS)
-   return -EINVAL;
- 
 +  netdev->mtu = new_mtu;
 +
 +  if (!netif_running(netdev))
 +  return 0;
 +
if (nicvf_update_hw_max_frs(nic, new_mtu))
return -EINVAL;
 -  netdev->mtu = new_mtu;
 -  nic->mtu = new_mtu;
  
return 0;
  }


Re: linux-next: manual merge of the net-next tree with the net tree

2016-11-13 Thread Or Gerlitz
On Thu, Nov 10, 2016 at 1:50 AM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>
> between commit:
>   ee39fbc4447d ("net/mlx5: E-Switch, Set the actions for offloaded rules 
> properly")
> from the net tree and commit:
>   66958ed906b8 ("net/mlx5: Support encap id when setting new steering entry")
> from the net-next tree.

> I fixed it up (see below) and can carry the fix as necessary.

Thanks Stephen, the fix is correct. Dave will hit the conflict the
next time he rebases
net-next on net and will solve it there. Hence the conflict will not
show up in linux-next
once you re-peek net-next.

Or.

> diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> index d239f5d0ea36,50fe8e8861bb..
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> @@@ -57,14 -58,14 +58,15 @@@ mlx5_eswitch_add_offloaded_rule(struct
> if (esw->mode != SRIOV_OFFLOADS)
> return ERR_PTR(-EOPNOTSUPP);
>
>  -  flow_act.action = attr->action;
>  +  /* per flow vlan pop/push is emulated, don't set that into the 
> firmware */
> -   action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | 
> MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
> ++  flow_act.action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH 
> | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
>
> -   if (action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
> -   dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
> -   dest.vport_num = attr->out_rep->vport;
> -   action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
> -   } else if (action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
> +   if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
> +   dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
> +   dest[i].vport_num = attr->out_rep->vport;
> +   i++;
> +   }
> +   if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
> counter = mlx5_fc_create(esw->dev, true);
> if (IS_ERR(counter))
> return ERR_CAST(counter);


linux-next: manual merge of the net-next tree with the net tree

2016-11-09 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

between commit:

  ee39fbc4447d ("net/mlx5: E-Switch, Set the actions for offloaded rules 
properly")

from the net tree and commit:

  66958ed906b8 ("net/mlx5: Support encap id when setting new steering entry")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index d239f5d0ea36,50fe8e8861bb..
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@@ -57,14 -58,14 +58,15 @@@ mlx5_eswitch_add_offloaded_rule(struct 
if (esw->mode != SRIOV_OFFLOADS)
return ERR_PTR(-EOPNOTSUPP);
  
 -  flow_act.action = attr->action;
 +  /* per flow vlan pop/push is emulated, don't set that into the firmware 
*/
-   action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | 
MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
++  flow_act.action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | 
MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
  
-   if (action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
-   dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
-   dest.vport_num = attr->out_rep->vport;
-   action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
-   } else if (action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
+   if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
+   dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
+   dest[i].vport_num = attr->out_rep->vport;
+   i++;
+   }
+   if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
counter = mlx5_fc_create(esw->dev, true);
if (IS_ERR(counter))
return ERR_CAST(counter);


Re: linux-next: manual merge of the net-next tree with the net tree

2016-11-07 Thread Cong Wang
On Mon, Nov 7, 2016 at 5:25 PM, Stephen Rothwell  wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   net/netlink/genetlink.c
>
> between commit:
>
>   00ffc1ba02d8 ("genetlink: fix a memory leak on error path")
>
> from the net tree and commit:
>
>   2ae0f17df1cd ("genetlink: use idr to track families")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Looks good to me.

Thanks!


linux-next: manual merge of the net-next tree with the net tree

2016-11-07 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/netlink/genetlink.c

between commit:

  00ffc1ba02d8 ("genetlink: fix a memory leak on error path")

from the net tree and commit:

  2ae0f17df1cd ("genetlink: use idr to track families")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/netlink/genetlink.c
index 49c28e8ef01b,bbd3bff885a1..
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@@ -402,11 -360,17 +360,17 @@@ int genl_register_family(struct genl_fa
} else
family->attrbuf = NULL;
  
+   family->id = idr_alloc(_fam_idr, family,
+  start, end + 1, GFP_KERNEL);
+   if (family->id < 0) {
+   err = family->id;
 -  goto errout_locked;
++  goto errout_free;
+   }
+ 
err = genl_validate_assign_mc_groups(family);
if (err)
-   goto errout_free;
+   goto errout_remove;
  
-   list_add_tail(>family_list, genl_family_chain(family->id));
genl_unlock_all();
  
/* send all events */
@@@ -417,14 -381,13 +381,15 @@@
  
return 0;
  
+ errout_remove:
+   idr_remove(_fam_idr, family->id);
 +errout_free:
 +  kfree(family->attrbuf);
  errout_locked:
genl_unlock_all();
- errout:
return err;
  }
- EXPORT_SYMBOL(__genl_register_family);
+ EXPORT_SYMBOL(genl_register_family);
  
  /**
   * genl_unregister_family - unregister generic netlink family


linux-next: manual merge of the net-next tree with the net tree

2016-10-23 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  include/net/udp.h

between commit:

  286c72deabaa ("udp: must lock the socket in udp_disconnect()")

from the net tree and commit:

  f970bd9e3a06 ("udp: implement memory accounting helpers")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/net/udp.h
index 4948790d393d,18f1e6b91927..
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@@ -258,7 -261,7 +261,8 @@@ void udp_flush_pending_frames(struct so
  void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
  int udp_rcv(struct sk_buff *skb);
  int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
+ int udp_init_sock(struct sock *sk);
 +int __udp_disconnect(struct sock *sk, int flags);
  int udp_disconnect(struct sock *sk, int flags);
  unsigned int udp_poll(struct file *file, struct socket *sock, poll_table 
*wait);
  struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,


linux-next: manual merge of the net-next tree with the net tree

2016-10-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/ibm/ibmvnic.c

between commit:

  87737f8810db ("ibmvnic: Update MTU after device initialization")

from the net tree and commit:

  d894be57ca92 ("ethernet: use net core MTU range checking in more drivers")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/ibm/ibmvnic.c
index 213162df1a9b,657206be7ba9..
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@@ -3654,7 -3644,8 +3644,9 @@@ static void handle_crq_init_rsp(struct 
goto task_failed;
  
netdev->real_num_tx_queues = adapter->req_tx_queues;
 +  netdev->mtu = adapter->req_mtu;
+   netdev->min_mtu = adapter->min_mtu;
+   netdev->max_mtu = adapter->max_mtu;
  
if (adapter->failover) {
adapter->failover = false;


Re: linux-next: manual merge of the net-next tree with the net tree

2016-10-20 Thread Ido Schimmel
On Thu, Oct 20, 2016 at 11:01:42AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got conflicts in:
> 
>   include/linux/netdevice.h
>   net/core/dev.c
> 
> between commit:
> 
>   e4961b076885 ("net: core: Correctly iterate over lower adjacency list")
> 
> from the net tree and commit:
> 
>   1a3f060c1a47 ("net: Introduce new api for walking upper and lower devices")
>   f1170fd462c6 ("net: Remove all_adj_list and its references")
> 
> from the net-next tree.
> 
> I fixed it up (I just used the net-next tree version) and can carry the
> fix as necessary.

Yes, net-next is correct. Thanks Stephen!


linux-next: manual merge of the net-next tree with the net tree

2016-10-19 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  include/linux/netdevice.h
  net/core/dev.c

between commit:

  e4961b076885 ("net: core: Correctly iterate over lower adjacency list")

from the net tree and commit:

  1a3f060c1a47 ("net: Introduce new api for walking upper and lower devices")
  f1170fd462c6 ("net: Remove all_adj_list and its references")

from the net-next tree.

I fixed it up (I just used the net-next tree version) and can carry the
fix as necessary. This is now fixed as far as linux-next is concerned,
but any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging.  You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2016-09-11 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/phy/Kconfig

between commit:

  c2f57fb97da5 ("drivers: net: phy: mdio-xgene: Add hardware dependency")

from the net tree and commit:

  d75b4a22b255 ("net: phy: Sort Makefile and Kconfig")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

These "sort the Kconfig/Makefile" patches are much better done just
before or after -rc1 so that the conflicting changes are already merged
and new development can be based on top of them.
-- 
Cheers,
Stephen Rothwell

138c337cf0c2436790877f87e91154b3c3294346
diff --cc drivers/net/phy/Kconfig
index b4863e4e522b,87b566f54cc1..2651c8d8de2f
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@@ -15,88 -15,156 +15,157 @@@ if PHYLI
  config SWPHY
bool
  
- comment "MII PHY device drivers"
- 
- config AQUANTIA_PHY
- tristate "Drivers for the Aquantia PHYs"
- ---help---
-   Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
+ comment "MDIO bus device drivers"
  
- config AT803X_PHY
-   tristate "Drivers for Atheros AT803X PHYs"
-   ---help---
- Currently supports the AT8030 and AT8035 model
+ config MDIO_BCM_IPROC
+   tristate "Broadcom iProc MDIO bus controller"
+   depends on ARCH_BCM_IPROC || COMPILE_TEST
+   depends on HAS_IOMEM && OF_MDIO
+   help
+ This module provides a driver for the MDIO busses found in the
+ Broadcom iProc SoC's.
  
- config AMD_PHY
-   tristate "Drivers for the AMD PHYs"
-   ---help---
- Currently supports the am79c874
+ config MDIO_BCM_UNIMAC
+   tristate "Broadcom UniMAC MDIO bus controller"
+   depends on HAS_IOMEM
+   help
+ This module provides a driver for the Broadcom UniMAC MDIO busses.
+ This hardware can be found in the Broadcom GENET Ethernet MAC
+ controllers as well as some Broadcom Ethernet switches such as the
+ Starfighter 2 switches.
  
- config MARVELL_PHY
-   tristate "Drivers for Marvell PHYs"
-   ---help---
- Currently has a driver for the 88E1011S
-   
- config DAVICOM_PHY
-   tristate "Drivers for Davicom PHYs"
-   ---help---
- Currently supports dm9161e and dm9131
+ config MDIO_BITBANG
+   tristate "Bitbanged MDIO buses"
+   help
+ This module implements the MDIO bus protocol in software,
+ for use by low level drivers that export the ability to
+ drive the relevant pins.
  
- config QSEMI_PHY
-   tristate "Drivers for Quality Semiconductor PHYs"
-   ---help---
- Currently supports the qs6612
+ If in doubt, say N.
  
- config LXT_PHY
-   tristate "Drivers for the Intel LXT PHYs"
-   ---help---
- Currently supports the lxt970, lxt971
+ config MDIO_BUS_MUX
+   tristate
+   depends on OF_MDIO
+   help
+ This module provides a driver framework for MDIO bus
+ multiplexers which connect one of several child MDIO busses
+ to a parent bus.  Switching between child busses is done by
+ device specific drivers.
  
- config CICADA_PHY
-   tristate "Drivers for the Cicada PHYs"
-   ---help---
- Currently supports the cis8204
+ config MDIO_BUS_MUX_BCM_IPROC
+   tristate "Broadcom iProc based MDIO bus multiplexers"
+   depends on OF && OF_MDIO && (ARCH_BCM_IPROC || COMPILE_TEST)
+   select MDIO_BUS_MUX
+   default ARCH_BCM_IPROC
+   help
+ This module provides a driver for MDIO bus multiplexers found in
+ iProc based Broadcom SoCs. This multiplexer connects one of several
+ child MDIO bus to a parent bus. Buses could be internal as well as
+ external and selection logic lies inside the same multiplexer.
  
- config VITESSE_PHY
- tristate "Drivers for the Vitesse PHYs"
- ---help---
-   Currently supports the vsc8244
+ config MDIO_BUS_MUX_GPIO
+   tristate "GPIO controlled MDIO bus multiplexers"
+   depends on OF_GPIO && OF_MDIO
+   select MDIO_BUS_MUX
+   help
+ This module provides a driver for MDIO bus multiplexers that
+ are controlled via GPIO lines.  The multiplexer connects one of
+ several child MDIO busses to a parent bus.  Child bus
+ selection is under the control of GPIO lines.
  
- config TERANETICS_PHY
- tristate "Drivers for the Teranetics PHYs"
- ---help---
-   Currently supports the Teranetics TN2020
+ config MDIO_BUS_MUX_MMIOREG
+   tristate "MMIO device-controlled MDIO bus multiplexers"
+   depends on OF_MDIO && 

linux-next: manual merge of the net-next tree with the net tree

2016-09-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/qlogic/qed/qed_dcbx.c

between commit:

  561ed23331df ("qed: fix kzalloc-simple.cocci warnings")

from the net tree and commit:

  2591c280c375 ("qed: Remove OOM messages")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 3656d2fd673d,be7b3dc7c9a7..
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@@ -1189,11 -1172,9 +1186,9 @@@ int qed_dcbx_get_config_params(struct q
return 0;
}
  
 -  dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL);
 +  dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
-   if (!dcbx_info) {
-   DP_ERR(p_hwfn, "Failed to allocate struct qed_dcbx_info\n");
+   if (!dcbx_info)
return -ENOMEM;
-   }
  
rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB);
if (rc) {
@@@ -1226,11 -1207,9 +1221,9 @@@ static struct qed_dcbx_get *qed_dcbnl_g
  {
struct qed_dcbx_get *dcbx_info;
  
 -  dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL);
 +  dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
-   if (!dcbx_info) {
-   DP_ERR(hwfn->cdev, "Failed to allocate memory for dcbx_info\n");
+   if (!dcbx_info)
return NULL;
-   }
  
if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
kfree(dcbx_info);


linux-next: manual merge of the net-next tree with the net tree

2016-09-04 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mediatek/mtk_eth_soc.c

between commits:

  d3bd1ce4db8e ("net: ethernet: mediatek: remove redundant free_irq for 
devm_request_irq allocated irq")
  7c6b0d76fa02 ("net: ethernet: mediatek: fix logic unbalance between probe and 
remove")

from the net tree and commits:

  45d339309f49 ("net: mediatek: remove unnecessary platform_set_drvdata()")
  bacfd110e059 ("net: ethernet: mediatek: modify to use the PDMA instead of the 
QDMA for Ethernet RX")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mediatek/mtk_eth_soc.c
index d9199151a83e,2dadfa961898..
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@@ -334,9 -338,12 +334,10 @@@ static void mtk_mdio_cleanup(struct mtk
return;
  
mdiobus_unregister(eth->mii_bus);
 -  of_node_put(eth->mii_bus->dev.of_node);
 -  mdiobus_free(eth->mii_bus);
  }
  
- static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
+ static inline void mtk_irq_disable(struct mtk_eth *eth,
+  unsigned reg, u32 mask)
  {
unsigned long flags;
u32 val;
@@@ -1501,7 -1513,11 +1508,8 @@@ static void mtk_uninit(struct net_devic
struct mtk_eth *eth = mac->hw;
  
phy_disconnect(mac->phy_dev);
-   mtk_irq_disable(eth, ~0);
 -  mtk_mdio_cleanup(eth);
+   mtk_irq_disable(eth, MTK_QDMA_INT_MASK, ~0);
+   mtk_irq_disable(eth, MTK_PDMA_INT_MASK, ~0);
 -  free_irq(eth->irq[1], dev);
 -  free_irq(eth->irq[2], dev);
  }
  
  static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@@ -1913,8 -1920,6 +1921,7 @@@ static int mtk_remove(struct platform_d
netif_napi_del(>tx_napi);
netif_napi_del(>rx_napi);
mtk_cleanup(eth);
 +  mtk_mdio_cleanup(eth);
-   platform_set_drvdata(pdev, NULL);
  
return 0;
  }


linux-next: manual merge of the net-next tree with the net tree

2016-08-21 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

between commit:

  e0d8b2908696 ("cxgb4: Fixes resource allocation for ULD's in kdump kernel")

from the net tree and commit:

  94cdb8bb993a ("cxgb4: Add support for dynamic allocation of resources for 
ULD")

from the net-next tree.

I fixed it up (I just used the version form the net-next tree) and can
carry the fix as necessary. This is now fixed as far as linux-next is
concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2016-08-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/dsa/mv88e6xxx/chip.c

between commit:

  601bbae0bc10 ("dsa: mv88e6xxx: hide unused functions")

from the net tree and commit:

  9c93829c014f ("net: dsa: mv88e6xxx: use the new PHY API")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/dsa/mv88e6xxx/chip.c
index d1d9d3cf9139,a230fcba5b64..
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@@ -3187,48 -3250,13 +3250,20 @@@ static int mv88e6xxx_set_addr(struct ds
return err;
  }
  
- #ifdef CONFIG_NET_DSA_HWMON
- static int mv88e6xxx_mdio_page_read(struct dsa_switch *ds, int port, int page,
-   int reg)
- {
-   struct mv88e6xxx_chip *chip = ds_to_priv(ds);
-   int ret;
- 
-   mutex_lock(>reg_lock);
-   ret = _mv88e6xxx_mdio_page_read(chip, port, page, reg);
-   mutex_unlock(>reg_lock);
- 
-   return ret;
- }
- 
- static int mv88e6xxx_mdio_page_write(struct dsa_switch *ds, int port, int 
page,
-int reg, int val)
- {
-   struct mv88e6xxx_chip *chip = ds_to_priv(ds);
-   int ret;
- 
-   mutex_lock(>reg_lock);
-   ret = _mv88e6xxx_mdio_page_write(chip, port, page, reg, val);
-   mutex_unlock(>reg_lock);
- 
-   return ret;
- }
- #endif
- 
 +static int mv88e6xxx_port_to_mdio_addr(struct mv88e6xxx_chip *chip, int port)
 +{
 +  if (port >= 0 && port < chip->info->num_ports)
 +  return port;
 +  return -EINVAL;
 +}
 +
- static int mv88e6xxx_mdio_read(struct mii_bus *bus, int port, int regnum)
+ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
  {
struct mv88e6xxx_chip *chip = bus->priv;
-   int addr = mv88e6xxx_port_to_mdio_addr(chip, port);
-   int ret;
+   u16 val;
+   int err;
  
-   if (addr < 0)
+   if (phy >= chip->info->num_ports)
return 0x;
  
mutex_lock(>reg_lock);


Re: linux-next: manual merge of the net-next tree with the net tree

2016-08-15 Thread Daniel Borkmann

On 08/15/2016 02:35 AM, Stephen Rothwell wrote:

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

   kernel/bpf/verifier.c

between commit:

   747ea55e4f78 ("bpf: fix bpf_skb_in_cgroup helper naming")

from the net tree and commit:

   60d20f9195b2 ("bpf: Add bpf_current_task_under_cgroup helper")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary.


Looks good to me, thanks!


linux-next: manual merge of the net-next tree with the net tree

2016-08-14 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  kernel/bpf/verifier.c

between commit:

  747ea55e4f78 ("bpf: fix bpf_skb_in_cgroup helper naming")

from the net tree and commit:

  60d20f9195b2 ("bpf: Add bpf_current_task_under_cgroup helper")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/bpf/verifier.c
index daea765d72e6,0cc46f1df358..
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@@ -1053,7 -1078,8 +1078,8 @@@ static int check_map_func_compatibility
goto error;
break;
case BPF_MAP_TYPE_CGROUP_ARRAY:
-   if (func_id != BPF_FUNC_skb_under_cgroup)
 -  if (func_id != BPF_FUNC_skb_in_cgroup &&
++  if (func_id != BPF_FUNC_skb_under_cgroup &&
+   func_id != BPF_FUNC_current_task_under_cgroup)
goto error;
break;
default:
@@@ -1075,7 -1101,8 +1101,8 @@@
if (map->map_type != BPF_MAP_TYPE_STACK_TRACE)
goto error;
break;
+   case BPF_FUNC_current_task_under_cgroup:
 -  case BPF_FUNC_skb_in_cgroup:
 +  case BPF_FUNC_skb_under_cgroup:
if (map->map_type != BPF_MAP_TYPE_CGROUP_ARRAY)
goto error;
break;


linux-next: manual merge of the net-next tree with the net tree

2016-07-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

between commit:

  ec25bc04ed8e ("net/mlx4_en: Add resilience in low memory systems")

from the net tree and commit:

  9ecc2d86171a ("net/mlx4_en: add xdp forwarding and data write support")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 44cf16d01f42,f32e272c83dd..
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@@ -1730,28 -1722,32 +1729,35 @@@ static int mlx4_en_set_channels(struct 
!channel->tx_count || !channel->rx_count)
return -EINVAL;
  
+   if (channel->tx_count * MLX4_EN_NUM_UP <= priv->xdp_ring_num) {
+   en_err(priv, "Minimum %d tx channels required with XDP on\n",
+  priv->xdp_ring_num / MLX4_EN_NUM_UP + 1);
+   return -EINVAL;
+   }
+ 
 +  tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
 +  if (!tmp)
 +  return -ENOMEM;
 +
mutex_lock(>state_lock);
 +  memcpy(_prof, priv->prof, sizeof(struct mlx4_en_port_profile));
 +  new_prof.num_tx_rings_p_up = channel->tx_count;
 +  new_prof.tx_ring_num = channel->tx_count * MLX4_EN_NUM_UP;
 +  new_prof.rx_ring_num = channel->rx_count;
 +
 +  err = mlx4_en_try_alloc_resources(priv, tmp, _prof);
 +  if (err)
 +  goto out;
 +
if (priv->port_up) {
port_up = 1;
mlx4_en_stop_port(dev, 1);
}
  
 -  mlx4_en_free_resources(priv);
 -
 -  priv->num_tx_rings_p_up = channel->tx_count;
 -  priv->tx_ring_num = channel->tx_count * MLX4_EN_NUM_UP;
 -  priv->rx_ring_num = channel->rx_count;
 -
 -  err = mlx4_en_alloc_resources(priv);
 -  if (err) {
 -  en_err(priv, "Failed reallocating port resources\n");
 -  goto out;
 -  }
 +  mlx4_en_safe_replace_resources(priv, tmp);
  
-   netif_set_real_num_tx_queues(dev, priv->tx_ring_num);
+   netif_set_real_num_tx_queues(dev, priv->tx_ring_num -
+   priv->xdp_ring_num);
netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
  
if (dev->num_tc)


linux-next: manual merge of the net-next tree with the net tree

2016-07-19 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sctp/input.c

between commit:

  c74bfbdba0e8 ("sctp: load transport header after sk_filter")

from the net tree and commit:

  3acb50c18d8d ("sctp: delay as much as possible skb_linearize")

from the net-next tree.

I fixed it up (I just used the net-next version) and can carry the fix
as necessary. This is now fixed as far as linux-next is concerned, but
any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging.  You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the net-next tree with the net tree

2016-07-19 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/sch_htb.c

between commit:

  338ed9b4de57 ("net_sched: sch_htb: export class backlog in dumps")

from the net tree and commit:

  0564bf0afae4 ("net/sched/sch_htb: clamp xstats tokens to fit into 32-bit int")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/sch_htb.c
index 052f84d6cc23,91982d9784b3..
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@@ -1136,18 -1113,22 +1113,24 @@@ static in
  htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump 
*d)
  {
struct htb_class *cl = (struct htb_class *)arg;
+   struct gnet_stats_queue qs = {
+   .drops = cl->drops,
+   };
__u32 qlen = 0;
  
-   if (!cl->level && cl->un.leaf.q)
+   if (!cl->level && cl->un.leaf.q) {
qlen = cl->un.leaf.q->q.qlen;
+   qs.backlog = cl->un.leaf.q->qstats.backlog;
+   }
 -  cl->xstats.tokens = PSCHED_NS2TICKS(cl->tokens);
 -  cl->xstats.ctokens = PSCHED_NS2TICKS(cl->ctokens);
 +  cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens),
 +  INT_MIN, INT_MAX);
 +  cl->xstats.ctokens = clamp_t(s64, PSCHED_NS2TICKS(cl->ctokens),
 +   INT_MIN, INT_MAX);
  
-   if (gnet_stats_copy_basic(d, NULL, >bstats) < 0 ||
+   if (gnet_stats_copy_basic(qdisc_root_sleeping_running(sch),
+ d, NULL, >bstats) < 0 ||
gnet_stats_copy_rate_est(d, NULL, >rate_est) < 0 ||
-   gnet_stats_copy_queue(d, NULL, >qstats, qlen) < 0)
+   gnet_stats_copy_queue(d, NULL, , qlen) < 0)
return -1;
  
return gnet_stats_copy_app(d, >xstats, sizeof(cl->xstats));


  1   2   >