Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time
From: Steven Rostedt @ 2018-03-26 15:02 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: davem, daniel, torvalds, peterz, netdev, kernel-team, linux-api,
	Mathieu Desnoyers
In-Reply-To: <20180324023038.938665-7-ast@fb.com>

On Fri, 23 Mar 2018 19:30:34 -0700
Alexei Starovoitov <ast@fb.com> wrote:

> From: Alexei Starovoitov <ast@kernel.org>
> 
> add fancy macro to compute number of arguments passed into tracepoint
> at compile time and store it as part of 'struct tracepoint'.
> The number is necessary to check safety of bpf program access that
> is coming in subsequent patch.
> 
> for_each_tracepoint_range() api has no users inside the kernel.
> Make it more useful with ability to stop for_each() loop depending
> via callback return value.
> In such form it's used in subsequent patch.

I believe this is used by LTTng.

-- Steve

> 
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> ---
>  include/linux/tracepoint-defs.h |  1 +
>  include/linux/tracepoint.h      | 28 +++++++++++++++++++---------
>  include/trace/define_trace.h    | 14 +++++++-------
>  kernel/tracepoint.c             | 27 ++++++++++++++++-----------
>  4 files changed, 43 insertions(+), 27 deletions(-)
> 
> diff --git a/include/linux/tracepoint-defs.h b/include/linux/tracepoint-defs.h
> index 64ed7064f1fa..39a283c61c51 100644
> --- a/include/linux/tracepoint-defs.h
> +++ b/include/linux/tracepoint-defs.h
> @@ -33,6 +33,7 @@ struct tracepoint {
>  	int (*regfunc)(void);
>  	void (*unregfunc)(void);
>  	struct tracepoint_func __rcu *funcs;
> +	u32 num_args;
>  };
>  
>  #endif
> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index c94f466d57ef..2194e7c31484 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -40,9 +40,19 @@ tracepoint_probe_register_prio(struct tracepoint *tp, void *probe, void *data,
>  			       int prio);
>  extern int
>  tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data);
> -extern void
> -for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
> -		void *priv);
> +
> +#ifdef CONFIG_TRACEPOINTS
> +void *
> +for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void *priv),
> +			   void *priv);
> +#else
> +static inline void *
> +for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void *priv),
> +			   void *priv)
> +{
> +	return NULL;
> +}
> +#endif
>  
>  #ifdef CONFIG_MODULES
>  struct tp_module {
> @@ -230,18 +240,18 @@ extern void syscall_unregfunc(void);
>   * structures, so we create an array of pointers that will be used for iteration
>   * on the tracepoints.
>   */
> -#define DEFINE_TRACE_FN(name, reg, unreg)				 \
> +#define DEFINE_TRACE_FN(name, reg, unreg, num_args)			 \
>  	static const char __tpstrtab_##name[]				 \
>  	__attribute__((section("__tracepoints_strings"))) = #name;	 \
>  	struct tracepoint __tracepoint_##name				 \
>  	__attribute__((section("__tracepoints"))) =			 \
> -		{ __tpstrtab_##name, STATIC_KEY_INIT_FALSE, reg, unreg, NULL };\
> +		{ __tpstrtab_##name, STATIC_KEY_INIT_FALSE, reg, unreg, NULL, num_args };\
>  	static struct tracepoint * const __tracepoint_ptr_##name __used	 \
>  	__attribute__((section("__tracepoints_ptrs"))) =		 \
>  		&__tracepoint_##name;
>  
> -#define DEFINE_TRACE(name)						\
> -	DEFINE_TRACE_FN(name, NULL, NULL);
> +#define DEFINE_TRACE(name, num_args)					\
> +	DEFINE_TRACE_FN(name, NULL, NULL, num_args);
>  
>  #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)				\
>  	EXPORT_SYMBOL_GPL(__tracepoint_##name)
> @@ -275,8 +285,8 @@ extern void syscall_unregfunc(void);
>  		return false;						\
>  	}
>  
> -#define DEFINE_TRACE_FN(name, reg, unreg)
> -#define DEFINE_TRACE(name)
> +#define DEFINE_TRACE_FN(name, reg, unreg, num_args)
> +#define DEFINE_TRACE(name, num_args)
>  #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
>  #define EXPORT_TRACEPOINT_SYMBOL(name)
>  
> diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
> index d9e3d4aa3f6e..96b22ace9ae7 100644
> --- a/include/trace/define_trace.h
> +++ b/include/trace/define_trace.h
> @@ -25,7 +25,7 @@
>  
>  #undef TRACE_EVENT
>  #define TRACE_EVENT(name, proto, args, tstruct, assign, print)	\
> -	DEFINE_TRACE(name)
> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>  
>  #undef TRACE_EVENT_CONDITION
>  #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
> @@ -39,24 +39,24 @@
>  #undef TRACE_EVENT_FN
>  #define TRACE_EVENT_FN(name, proto, args, tstruct,		\
>  		assign, print, reg, unreg)			\
> -	DEFINE_TRACE_FN(name, reg, unreg)
> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>  
>  #undef TRACE_EVENT_FN_COND
>  #define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct,		\
>  		assign, print, reg, unreg)			\
> -	DEFINE_TRACE_FN(name, reg, unreg)
> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>  
>  #undef DEFINE_EVENT
>  #define DEFINE_EVENT(template, name, proto, args) \
> -	DEFINE_TRACE(name)
> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>  
>  #undef DEFINE_EVENT_FN
>  #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \
> -	DEFINE_TRACE_FN(name, reg, unreg)
> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>  
>  #undef DEFINE_EVENT_PRINT
>  #define DEFINE_EVENT_PRINT(template, name, proto, args, print)	\
> -	DEFINE_TRACE(name)
> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>  
>  #undef DEFINE_EVENT_CONDITION
>  #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
> @@ -64,7 +64,7 @@
>  
>  #undef DECLARE_TRACE
>  #define DECLARE_TRACE(name, proto, args)	\
> -	DEFINE_TRACE(name)
> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>  
>  #undef TRACE_INCLUDE
>  #undef __TRACE_INCLUDE
> diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
> index 671b13457387..3f2dc5738c2b 100644
> --- a/kernel/tracepoint.c
> +++ b/kernel/tracepoint.c
> @@ -502,17 +502,22 @@ static __init int init_tracepoints(void)
>  __initcall(init_tracepoints);
>  #endif /* CONFIG_MODULES */
>  
> -static void for_each_tracepoint_range(struct tracepoint * const *begin,
> -		struct tracepoint * const *end,
> -		void (*fct)(struct tracepoint *tp, void *priv),
> -		void *priv)
> +static void *for_each_tracepoint_range(struct tracepoint * const *begin,
> +				       struct tracepoint * const *end,
> +				       void *(*fct)(struct tracepoint *tp, void *priv),
> +				       void *priv)
>  {
>  	struct tracepoint * const *iter;
> +	void *ret;
>  
>  	if (!begin)
> -		return;
> -	for (iter = begin; iter < end; iter++)
> -		fct(*iter, priv);
> +		return NULL;
> +	for (iter = begin; iter < end; iter++) {
> +		ret = fct(*iter, priv);
> +		if (ret)
> +			return ret;
> +	}
> +	return NULL;
>  }
>  
>  /**
> @@ -520,11 +525,11 @@ static void for_each_tracepoint_range(struct tracepoint * const *begin,
>   * @fct: callback
>   * @priv: private data
>   */
> -void for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
> -		void *priv)
> +void *for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void *priv),
> +				 void *priv)
>  {
> -	for_each_tracepoint_range(__start___tracepoints_ptrs,
> -		__stop___tracepoints_ptrs, fct, priv);
> +	return for_each_tracepoint_range(__start___tracepoints_ptrs,
> +					 __stop___tracepoints_ptrs, fct, priv);
>  }
>  EXPORT_SYMBOL_GPL(for_each_kernel_tracepoint);
>  

^ permalink raw reply

* Re: [PATCH] json_print: fix print_uint with helper type extensions
From: David Ahern @ 2018-03-26 15:03 UTC (permalink / raw)
  To: Kevin Darbyshire-Bryant, Stephen Hemminger; +Cc: netdev@vger.kernel.org
In-Reply-To: <1BC918EA-5B3E-41D7-B033-AC659B615829@darbyshire-bryant.me.uk>

On 3/18/18 2:40 AM, Kevin Darbyshire-Bryant wrote:
> 
> 
>> On 16 Mar 2018, at 20:34, Stephen Hemminger <stephen@networkplumber.org> wrote:
>>>
>>> print_uint64(PRINT_ANY, "refcnt", "refcnt %" PRIu64 " ", t->tcm_info)
>>>
>>> Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
>>
>> I am fine with this. But since there is no code using it yet, it should
>> go net-next branch.
>>
>> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> Existing code is tripping up over the hidden uint - > uint64_t promotion in print_uint in iproute2 v4.15, that’s how I fell over the issue.  Should I split the patch?  One fixing the uint->uint64_t and the other offering the explicit type length options.
> 
> Obviously I now realise that the email header should have iproute2 in it.  Learning, slowly :-)
> 

Kevin: I guess you need to split the patch. Extract the bug fix piece
and send for iproute2; enhancements go to iproute2-next.

^ permalink raw reply

* Re: [PATCH v5 bpf-next 00/10] bpf, tracing: introduce bpf raw tracepoints
From: Steven Rostedt @ 2018-03-26 15:04 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Alexei Starovoitov, davem, torvalds, peterz, netdev, kernel-team,
	linux-api
In-Reply-To: <c8be6d52-3f86-0402-9fdc-cc98f8e3e940@iogearbox.net>

On Mon, 26 Mar 2018 10:28:03 +0200
Daniel Borkmann <daniel@iogearbox.net> wrote:

> > tracepoint    base  kprobe+bpf tracepoint+bpf raw_tracepoint+bpf
> > task_rename   1.1M   769K        947K            1.0M
> > urandom_read  789K   697K        750K            755K  
> 
> Applied to bpf-next, thanks Alexei!

Please wait till you have the proper acks. Some of this affects
tracing.

-- Steve

^ permalink raw reply

* [PATCH net] net: fix possible out-of-bound read in skb_network_protocol()
From: Eric Dumazet @ 2018-03-26 15:08 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Pravin B Shelar

skb mac header is not necessarily set at the time skb_network_protocol()
is called. Use skb->data instead.

BUG: KASAN: slab-out-of-bounds in skb_network_protocol+0x46b/0x4b0 net/core/dev.c:2739
Read of size 2 at addr ffff8801b3097a0b by task syz-executor5/14242

CPU: 1 PID: 14242 Comm: syz-executor5 Not tainted 4.16.0-rc6+ #280
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report.c:443
 skb_network_protocol+0x46b/0x4b0 net/core/dev.c:2739
 harmonize_features net/core/dev.c:2924 [inline]
 netif_skb_features+0x509/0x9b0 net/core/dev.c:3011
 validate_xmit_skb+0x81/0xb00 net/core/dev.c:3084
 validate_xmit_skb_list+0xbf/0x120 net/core/dev.c:3142
 packet_direct_xmit+0x117/0x790 net/packet/af_packet.c:256
 packet_snd net/packet/af_packet.c:2944 [inline]
 packet_sendmsg+0x3aed/0x60b0 net/packet/af_packet.c:2969
 sock_sendmsg_nosec net/socket.c:629 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:639
 ___sys_sendmsg+0x767/0x8b0 net/socket.c:2047
 __sys_sendmsg+0xe5/0x210 net/socket.c:2081

Fixes: 19acc327258a ("gso: Handle Trans-Ether-Bridging protocol in skb_network_protocol()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin B Shelar <pshelar@ovn.org>
Reported-by: Reported-by: syzbot <syzkaller@googlegroups.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 12be205357146f0dcd55cc6e6f71dfb65fdeb33b..ef0cc6ea5f8da5b87c751d9eebfc0943fbe36a06 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2735,7 +2735,7 @@ __be16 skb_network_protocol(struct sk_buff *skb, int *depth)
 		if (unlikely(!pskb_may_pull(skb, sizeof(struct ethhdr))))
 			return 0;
 
-		eth = (struct ethhdr *)skb_mac_header(skb);
+		eth = (struct ethhdr *)skb->data;
 		type = eth->h_proto;
 	}
 
-- 
2.17.0.rc0.231.g781580f067-goog

^ permalink raw reply related

* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: Leon Romanovsky @ 2018-03-26 15:08 UTC (permalink / raw)
  To: Steve Wise; +Cc: David Ahern, stephen, netdev, linux-rdma
In-Reply-To: <783e600a-9296-8ea0-003e-59e48fd5234b@opengridcomputing.com>

[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]

On Mon, Mar 26, 2018 at 09:55:46AM -0500, Steve Wise wrote:
>
>
> On 3/26/2018 9:44 AM, David Ahern wrote:
> > On 3/26/18 8:30 AM, Steve Wise wrote:
> >>
> >> On 3/26/2018 9:17 AM, David Ahern wrote:
> >>> On 2/27/18 9:07 AM, Steve Wise wrote:
> >>>> diff --git a/rdma/rdma.h b/rdma/rdma.h
> >>>> index 5809f70..e55205b 100644
> >>>> --- a/rdma/rdma.h
> >>>> +++ b/rdma/rdma.h
> >>>> @@ -18,10 +18,12 @@
> >>>>  #include <libmnl/libmnl.h>
> >>>>  #include <rdma/rdma_netlink.h>
> >>>>  #include <time.h>
> >>>> +#include <net/if_arp.h>
> >>>>
> >>>>  #include "list.h"
> >>>>  #include "utils.h"
> >>>>  #include "json_writer.h"
> >>>> +#include <rdma/rdma_cma.h>
> >>>>
> >>> did you forget to add rdma_cma.h? I don't see that file in my repo.
> >> It is provided by the rdma-core package, upon which rdma tool now
> >> depends for the rdma_port_space enum.
> >>
> > You need to add a check for the package, and only build rdma if that
> > package is installed. See check_mnl in configure for an example.
>
> Ok, that makes sense.

IMHO, better solution will be to copy those files to iproute2.

Thanks

>
> Steve.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH iproute2-next 2/2] rdma: Print net device name and index for RDMA device
From: Leon Romanovsky @ 2018-03-26 15:09 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, RDMA mailing list, Stephen Hemminger
In-Reply-To: <7b6f0370-4749-5327-5701-6567587d2044@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

On Mon, Mar 26, 2018 at 08:06:52AM -0600, David Ahern wrote:
> On 3/26/18 2:28 AM, Leon Romanovsky wrote:
> > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
> > index 9446a721..45474f13 100644
> > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > @@ -388,6 +388,10 @@ enum rdma_nldev_attr {
> >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> >
> > +	/* Netdev information for relevant protocols, like RoCE and iWARP */
> > +	RDMA_NLDEV_ATTR_NDEV_INDEX,		/* u32 */
> > +	RDMA_NLDEV_ATTR_NDEV_NAME,		/* string */
> > +
> >  	RDMA_NLDEV_ATTR_MAX
> >  };
> >  #endif /* _RDMA_NETLINK_H */
>
> Why wasn't the above included in patch 1 as part of the header file update?
>
>

Kernel part is not accepted yet, this is why I separated them.

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH net 1/3] bonding: fix the err path for dev hwaddr sync in bond_enslave
From: Andy Gospodarek @ 2018-03-26 15:16 UTC (permalink / raw)
  To: Xin Long
  Cc: network dev, davem, Jiri Pirko, Wang Chen, Veaceslav Falico,
	Nikolay Aleksandrov
In-Reply-To: <8fd918da5a08f64dd69a45bcda3849bbd8114267.1521997984.git.lucien.xin@gmail.com>

On Mon, Mar 26, 2018 at 01:16:45AM +0800, Xin Long wrote:
> vlan_vids_add_by_dev is called right after dev hwaddr sync, so on
> the err path it should unsync dev hwaddr. Otherwise, the slave
> dev's hwaddr will never be unsync when this err happens.
> 
> Fixes: 1ff412ad7714 ("bonding: change the bond's vlan syncing functions with the standard ones")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Andy Gospodarek <andy@greyhouse.net>

> ---
>  drivers/net/bonding/bond_main.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index c669554..0c299de 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1565,7 +1565,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  	if (res) {
>  		netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n",
>  			   slave_dev->name);
> -		goto err_close;
> +		goto err_hwaddr_unsync;
>  	}
>  
>  	prev_slave = bond_last_slave(bond);
> @@ -1755,9 +1755,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  	netdev_rx_handler_unregister(slave_dev);
>  
>  err_detach:
> -	if (!bond_uses_primary(bond))
> -		bond_hw_addr_flush(bond_dev, slave_dev);
> -
>  	vlan_vids_del_by_dev(slave_dev, bond_dev);
>  	if (rcu_access_pointer(bond->primary_slave) == new_slave)
>  		RCU_INIT_POINTER(bond->primary_slave, NULL);
> @@ -1771,6 +1768,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  	synchronize_rcu();
>  	slave_disable_netpoll(new_slave);
>  
> +err_hwaddr_unsync:
> +	if (!bond_uses_primary(bond))
> +		bond_hw_addr_flush(bond_dev, slave_dev);
> +
>  err_close:
>  	slave_dev->priv_flags &= ~IFF_BONDING;
>  	dev_close(slave_dev);

^ permalink raw reply

* Re: [PATCH iproute2-next 2/2] rdma: Print net device name and index for RDMA device
From: Steve Wise @ 2018-03-26 15:17 UTC (permalink / raw)
  To: Leon Romanovsky, David Ahern
  Cc: Leon Romanovsky, netdev, RDMA mailing list, Stephen Hemminger
In-Reply-To: <20180326082829.21214-3-leon@kernel.org>



On 3/26/2018 3:28 AM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> The RDMA devices are operated in RoCE and iWARP modes have net device
> underneath. Present their names in regular output and their net index
> in detailed mode.
>
> [root@nps ~]# rdma link show mlx5_3/1
> 4/1: mlx5_3/1: state ACTIVE physical_state LINK_UP netdev ens7
> [root@nps ~]# rdma link show mlx5_3/1 -d
> 4/1: mlx5_3/1: state ACTIVE physical_state LINK_UP netdev ens7 netdev_index 7
>     caps: <CM, IP_BASED_GIDS>
>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  rdma/include/uapi/rdma/rdma_netlink.h |  4 ++++
>  rdma/link.c                           | 21 +++++++++++++++++++++
>  rdma/utils.c                          |  2 ++
>  3 files changed, 27 insertions(+)
>
> diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
> index 9446a721..45474f13 100644
> --- a/rdma/include/uapi/rdma/rdma_netlink.h
> +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> @@ -388,6 +388,10 @@ enum rdma_nldev_attr {
>  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
>  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
>
> +	/* Netdev information for relevant protocols, like RoCE and iWARP */
> +	RDMA_NLDEV_ATTR_NDEV_INDEX,		/* u32 */
> +	RDMA_NLDEV_ATTR_NDEV_NAME,		/* string */
> +
>  	RDMA_NLDEV_ATTR_MAX
>  };
>  #endif /* _RDMA_NETLINK_H */
> diff --git a/rdma/link.c b/rdma/link.c
> index 66bcd50e..7e914c87 100644
> --- a/rdma/link.c
> +++ b/rdma/link.c
> @@ -205,6 +205,26 @@ static void link_print_phys_state(struct rd *rd, struct nlattr **tb)
>  		pr_out("physical_state %s ", phys_state_to_str(phys_state));
>  }
>
> +static void link_print_netdev(struct rd *rd, struct nlattr **tb)
> +{
> +	const char *netdev_name;
> +	uint32_t idx;
> +
> +	if (!tb[RDMA_NLDEV_ATTR_NDEV_NAME] || !tb[RDMA_NLDEV_ATTR_NDEV_INDEX])
> +		return;
> +
> +	netdev_name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_NDEV_NAME]);
> +	idx = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_NDEV_INDEX]);
> +	if (rd->json_output) {
> +		jsonw_string_field(rd->jw, "netdev", netdev_name);
> +		jsonw_uint_field(rd->jw, "netdev_index", idx);
> +	} else {
> +		pr_out("netdev %s ", netdev_name);
> +		if (rd->show_details)
> +			pr_out("netdev_index %u ", idx);
> +	}
> +}
> +

Why is the netdev_index under 'show_details'?

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

>  static int link_parse_cb(const struct nlmsghdr *nlh, void *data)
>  {
>  	struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
> @@ -241,6 +261,7 @@ static int link_parse_cb(const struct nlmsghdr *nlh, void *data)
>  	link_print_lmc(rd, tb);
>  	link_print_state(rd, tb);
>  	link_print_phys_state(rd, tb);
> +	link_print_netdev(rd, tb);
>  	if (rd->show_details)
>  		link_print_caps(rd, tb);
>
> diff --git a/rdma/utils.c b/rdma/utils.c
> index f9460162..4fed80ab 100644
> --- a/rdma/utils.c
> +++ b/rdma/utils.c
> @@ -375,6 +375,8 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
>  	[RDMA_NLDEV_ATTR_RES_STATE]		= MNL_TYPE_U8,
>  	[RDMA_NLDEV_ATTR_RES_PID]		= MNL_TYPE_U32,
>  	[RDMA_NLDEV_ATTR_RES_KERN_NAME]	= MNL_TYPE_NUL_STRING,
> +	[RDMA_NLDEV_ATTR_NDEV_INDEX]		= MNL_TYPE_U32,
> +	[RDMA_NLDEV_ATTR_NDEV_NAME]		= MNL_TYPE_NUL_STRING,
>  };
>
>  int rd_attr_cb(const struct nlattr *attr, void *data)
> --
> 2.14.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [bpf-next V5 PATCH 11/15] page_pool: refurbish version of page_pool code
From: Jesper Dangaard Brouer @ 2018-03-26 15:19 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: netdev, BjörnTöpel, magnus.karlsson, eugenia,
	Jason Wang, John Fastabend, Eran Ben Elisha, Saeed Mahameed, galp,
	Daniel Borkmann, Alexei Starovoitov, Tariq Toukan, brouer
In-Reply-To: <796ac33b-26cc-107b-debe-17b5cfceab97@gmail.com>

On Fri, 23 Mar 2018 07:55:37 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> rcu grace period before freeing huge quantitites of pages is
> problematic and could be used by syzbot to OOM the host.

Okay. Adjusted code to empty ring "right-way" when driver calls
destroy, and then only RCU delay/free the page_pool pointer and also
free/empty ring for pages of any in-flight producers.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply

* Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time
From: Mathieu Desnoyers @ 2018-03-26 15:14 UTC (permalink / raw)
  To: rostedt
  Cc: Alexei Starovoitov, David S. Miller, Daniel Borkmann,
	Linus Torvalds, Peter Zijlstra, netdev, kernel-team, linux-api
In-Reply-To: <20180326110204.042801dd@gandalf.local.home>

----- On Mar 26, 2018, at 11:02 AM, rostedt rostedt@goodmis.org wrote:

> On Fri, 23 Mar 2018 19:30:34 -0700
> Alexei Starovoitov <ast@fb.com> wrote:
> 
>> From: Alexei Starovoitov <ast@kernel.org>
>> 
>> add fancy macro to compute number of arguments passed into tracepoint
>> at compile time and store it as part of 'struct tracepoint'.
>> The number is necessary to check safety of bpf program access that
>> is coming in subsequent patch.
>> 
>> for_each_tracepoint_range() api has no users inside the kernel.
>> Make it more useful with ability to stop for_each() loop depending
>> via callback return value.
>> In such form it's used in subsequent patch.
> 
> I believe this is used by LTTng.

Indeed, and by SystemTAP as well.

What justifies the need to stop mid-iteration ? A less intrusive alternative
would be to use the "priv" data pointer to keep state telling further calls
to return immediately. Does performance of iteration over tracepoints really
matter here so much that stopping iteration immediately is worth it ?

Thanks,

Mathieu

> 
> -- Steve
> 
>> 
>> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>> ---
>>  include/linux/tracepoint-defs.h |  1 +
>>  include/linux/tracepoint.h      | 28 +++++++++++++++++++---------
>>  include/trace/define_trace.h    | 14 +++++++-------
>>  kernel/tracepoint.c             | 27 ++++++++++++++++-----------
>>  4 files changed, 43 insertions(+), 27 deletions(-)
>> 
>> diff --git a/include/linux/tracepoint-defs.h b/include/linux/tracepoint-defs.h
>> index 64ed7064f1fa..39a283c61c51 100644
>> --- a/include/linux/tracepoint-defs.h
>> +++ b/include/linux/tracepoint-defs.h
>> @@ -33,6 +33,7 @@ struct tracepoint {
>>  	int (*regfunc)(void);
>>  	void (*unregfunc)(void);
>>  	struct tracepoint_func __rcu *funcs;
>> +	u32 num_args;
>>  };
>>  
>>  #endif
>> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
>> index c94f466d57ef..2194e7c31484 100644
>> --- a/include/linux/tracepoint.h
>> +++ b/include/linux/tracepoint.h
>> @@ -40,9 +40,19 @@ tracepoint_probe_register_prio(struct tracepoint *tp, void
>> *probe, void *data,
>>  			       int prio);
>>  extern int
>>  tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data);
>> -extern void
>> -for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
>> -		void *priv);
>> +
>> +#ifdef CONFIG_TRACEPOINTS
>> +void *
>> +for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void *priv),
>> +			   void *priv);
>> +#else
>> +static inline void *
>> +for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void *priv),
>> +			   void *priv)
>> +{
>> +	return NULL;
>> +}
>> +#endif
>>  
>>  #ifdef CONFIG_MODULES
>>  struct tp_module {
>> @@ -230,18 +240,18 @@ extern void syscall_unregfunc(void);
>>   * structures, so we create an array of pointers that will be used for iteration
>>   * on the tracepoints.
>>   */
>> -#define DEFINE_TRACE_FN(name, reg, unreg)				 \
>> +#define DEFINE_TRACE_FN(name, reg, unreg, num_args)			 \
>>  	static const char __tpstrtab_##name[]				 \
>>  	__attribute__((section("__tracepoints_strings"))) = #name;	 \
>>  	struct tracepoint __tracepoint_##name				 \
>>  	__attribute__((section("__tracepoints"))) =			 \
>> -		{ __tpstrtab_##name, STATIC_KEY_INIT_FALSE, reg, unreg, NULL };\
>> +		{ __tpstrtab_##name, STATIC_KEY_INIT_FALSE, reg, unreg, NULL, num_args };\
>>  	static struct tracepoint * const __tracepoint_ptr_##name __used	 \
>>  	__attribute__((section("__tracepoints_ptrs"))) =		 \
>>  		&__tracepoint_##name;
>>  
>> -#define DEFINE_TRACE(name)						\
>> -	DEFINE_TRACE_FN(name, NULL, NULL);
>> +#define DEFINE_TRACE(name, num_args)					\
>> +	DEFINE_TRACE_FN(name, NULL, NULL, num_args);
>>  
>>  #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)				\
>>  	EXPORT_SYMBOL_GPL(__tracepoint_##name)
>> @@ -275,8 +285,8 @@ extern void syscall_unregfunc(void);
>>  		return false;						\
>>  	}
>>  
>> -#define DEFINE_TRACE_FN(name, reg, unreg)
>> -#define DEFINE_TRACE(name)
>> +#define DEFINE_TRACE_FN(name, reg, unreg, num_args)
>> +#define DEFINE_TRACE(name, num_args)
>>  #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
>>  #define EXPORT_TRACEPOINT_SYMBOL(name)
>>  
>> diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
>> index d9e3d4aa3f6e..96b22ace9ae7 100644
>> --- a/include/trace/define_trace.h
>> +++ b/include/trace/define_trace.h
>> @@ -25,7 +25,7 @@
>>  
>>  #undef TRACE_EVENT
>>  #define TRACE_EVENT(name, proto, args, tstruct, assign, print)	\
>> -	DEFINE_TRACE(name)
>> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>>  
>>  #undef TRACE_EVENT_CONDITION
>>  #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
>> @@ -39,24 +39,24 @@
>>  #undef TRACE_EVENT_FN
>>  #define TRACE_EVENT_FN(name, proto, args, tstruct,		\
>>  		assign, print, reg, unreg)			\
>> -	DEFINE_TRACE_FN(name, reg, unreg)
>> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>>  
>>  #undef TRACE_EVENT_FN_COND
>>  #define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct,		\
>>  		assign, print, reg, unreg)			\
>> -	DEFINE_TRACE_FN(name, reg, unreg)
>> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>>  
>>  #undef DEFINE_EVENT
>>  #define DEFINE_EVENT(template, name, proto, args) \
>> -	DEFINE_TRACE(name)
>> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>>  
>>  #undef DEFINE_EVENT_FN
>>  #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \
>> -	DEFINE_TRACE_FN(name, reg, unreg)
>> +	DEFINE_TRACE_FN(name, reg, unreg, COUNT_ARGS(args))
>>  
>>  #undef DEFINE_EVENT_PRINT
>>  #define DEFINE_EVENT_PRINT(template, name, proto, args, print)	\
>> -	DEFINE_TRACE(name)
>> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>>  
>>  #undef DEFINE_EVENT_CONDITION
>>  #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
>> @@ -64,7 +64,7 @@
>>  
>>  #undef DECLARE_TRACE
>>  #define DECLARE_TRACE(name, proto, args)	\
>> -	DEFINE_TRACE(name)
>> +	DEFINE_TRACE(name, COUNT_ARGS(args))
>>  
>>  #undef TRACE_INCLUDE
>>  #undef __TRACE_INCLUDE
>> diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
>> index 671b13457387..3f2dc5738c2b 100644
>> --- a/kernel/tracepoint.c
>> +++ b/kernel/tracepoint.c
>> @@ -502,17 +502,22 @@ static __init int init_tracepoints(void)
>>  __initcall(init_tracepoints);
>>  #endif /* CONFIG_MODULES */
>>  
>> -static void for_each_tracepoint_range(struct tracepoint * const *begin,
>> -		struct tracepoint * const *end,
>> -		void (*fct)(struct tracepoint *tp, void *priv),
>> -		void *priv)
>> +static void *for_each_tracepoint_range(struct tracepoint * const *begin,
>> +				       struct tracepoint * const *end,
>> +				       void *(*fct)(struct tracepoint *tp, void *priv),
>> +				       void *priv)
>>  {
>>  	struct tracepoint * const *iter;
>> +	void *ret;
>>  
>>  	if (!begin)
>> -		return;
>> -	for (iter = begin; iter < end; iter++)
>> -		fct(*iter, priv);
>> +		return NULL;
>> +	for (iter = begin; iter < end; iter++) {
>> +		ret = fct(*iter, priv);
>> +		if (ret)
>> +			return ret;
>> +	}
>> +	return NULL;
>>  }
>>  
>>  /**
>> @@ -520,11 +525,11 @@ static void for_each_tracepoint_range(struct tracepoint *
>> const *begin,
>>   * @fct: callback
>>   * @priv: private data
>>   */
>> -void for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
>> -		void *priv)
>> +void *for_each_kernel_tracepoint(void *(*fct)(struct tracepoint *tp, void
>> *priv),
>> +				 void *priv)
>>  {
>> -	for_each_tracepoint_range(__start___tracepoints_ptrs,
>> -		__stop___tracepoints_ptrs, fct, priv);
>> +	return for_each_tracepoint_range(__start___tracepoints_ptrs,
>> +					 __stop___tracepoints_ptrs, fct, priv);
>>  }
>>  EXPORT_SYMBOL_GPL(for_each_kernel_tracepoint);

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply

* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: Steve Wise @ 2018-03-26 15:24 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: David Ahern, stephen, netdev, linux-rdma
In-Reply-To: <20180326150826.GH1877@mtr-leonro.local>



On 3/26/2018 10:08 AM, Leon Romanovsky wrote:
> On Mon, Mar 26, 2018 at 09:55:46AM -0500, Steve Wise wrote:
>>
>> On 3/26/2018 9:44 AM, David Ahern wrote:
>>> On 3/26/18 8:30 AM, Steve Wise wrote:
>>>> On 3/26/2018 9:17 AM, David Ahern wrote:
>>>>> On 2/27/18 9:07 AM, Steve Wise wrote:
>>>>>> diff --git a/rdma/rdma.h b/rdma/rdma.h
>>>>>> index 5809f70..e55205b 100644
>>>>>> --- a/rdma/rdma.h
>>>>>> +++ b/rdma/rdma.h
>>>>>> @@ -18,10 +18,12 @@
>>>>>>  #include <libmnl/libmnl.h>
>>>>>>  #include <rdma/rdma_netlink.h>
>>>>>>  #include <time.h>
>>>>>> +#include <net/if_arp.h>
>>>>>>
>>>>>>  #include "list.h"
>>>>>>  #include "utils.h"
>>>>>>  #include "json_writer.h"
>>>>>> +#include <rdma/rdma_cma.h>
>>>>>>
>>>>> did you forget to add rdma_cma.h? I don't see that file in my repo.
>>>> It is provided by the rdma-core package, upon which rdma tool now
>>>> depends for the rdma_port_space enum.
>>>>
>>> You need to add a check for the package, and only build rdma if that
>>> package is installed. See check_mnl in configure for an example.
>> Ok, that makes sense.
> IMHO, better solution will be to copy those files to iproute2.

Hey Leon,

Why is it better in your opinion?  My gut tells me adding rdma_cma.h to
iproute2 means more uabi type syncing.

^ permalink raw reply

* Re: [PATCH 0/2] net: ethernet: ave: add UniPhier PXs3 support
From: David Miller @ 2018-03-26 15:29 UTC (permalink / raw)
  To: hayashi.kunihiko
  Cc: netdev, robh+dt, andrew, f.fainelli, mark.rutland,
	linux-arm-kernel, linux-kernel, yamada.masahiro, masami.hiramatsu,
	jaswinder.singh
In-Reply-To: <1521808237-3623-1-git-send-email-hayashi.kunihiko@socionext.com>

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: Fri, 23 Mar 2018 21:30:35 +0900

> Add ethernet controller support on UniPhier PXs3 SoC.

Series applied to net-next, thank you.

^ permalink raw reply

* Re: [PATCH v2] fsl/fman: remove unnecessary set_dma_ops() call and HAS_DMA dependency
From: David Miller @ 2018-03-26 15:30 UTC (permalink / raw)
  To: madalin.bucur; +Cc: geert.uytterhoeven, netdev, linux-kernel
In-Reply-To: <20180323145225.9130-1-madalin.bucur@nxp.com>

From: Madalin Bucur <madalin.bucur@nxp.com>
Date: Fri, 23 Mar 2018 09:52:25 -0500

> The platform device is no longer used for DMA mapping so the
> (questionable) setting of the DMA ops done here is no longer
> needed. Removing it together with the HAS_DMA dependency that
> it required.
> 
> Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH v5 bpf-next 00/10] bpf, tracing: introduce bpf raw tracepoints
From: Daniel Borkmann @ 2018-03-26 15:32 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Alexei Starovoitov, davem, torvalds, peterz, netdev, kernel-team,
	linux-api
In-Reply-To: <20180326110435.4cdd7e7d@gandalf.local.home>

On 03/26/2018 05:04 PM, Steven Rostedt wrote:
> On Mon, 26 Mar 2018 10:28:03 +0200
> Daniel Borkmann <daniel@iogearbox.net> wrote:
> 
>>> tracepoint    base  kprobe+bpf tracepoint+bpf raw_tracepoint+bpf
>>> task_rename   1.1M   769K        947K            1.0M
>>> urandom_read  789K   697K        750K            755K  
>>
>> Applied to bpf-next, thanks Alexei!
> 
> Please wait till you have the proper acks. Some of this affects
> tracing.

Ok, I thought time up to v5 was long enough. Anyway, in case there are
objections I can still toss out the series from bpf-next tree worst case
should e.g. follow-up fixups not be appropriate.

Thanks,
Daniel

^ permalink raw reply

* Re: [PATCH net 1/2] net: dsa: mt7530: remove redundant MODULE_ALIAS entries
From: Andrew Lunn @ 2018-03-26 15:32 UTC (permalink / raw)
  To: sean.wang
  Cc: davem, f.fainelli, vivien.didelot, netdev, linux-kernel,
	linux-mediatek
In-Reply-To: <2497321afc9156f7954e813721f60a0a95c03bd2.1522057659.git.sean.wang@mediatek.com>

On Mon, Mar 26, 2018 at 06:07:09PM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> MODULE_ALIAS exports information to allow the module to be auto-loaded at
> boot for the drivers registered using legacy platform registration.
> 
> However, currently the driver is always used by DT-only platform,
> MODULE_ALIAS is redundant and should be removed properly.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

For this, and the second patch:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply

* Re: linux-next on x60: network manager often complains "network is disabled" after resume
From: Dan Williams @ 2018-03-26 15:33 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Woody Suwalski, Rafael J. Wysocki, kernel list,
	Linux-pm mailing list, Netdev list
In-Reply-To: <20180325061927.GA2148@amd>

On Sun, 2018-03-25 at 08:19 +0200, Pavel Machek wrote:
> > > > Ok, what does 'nmcli dev' and 'nmcli radio' show?
> > > 
> > > Broken state.
> > > 
> > > pavel@amd:~$ nmcli dev
> > > DEVICE  TYPE      STATE        CONNECTION
> > > eth1    ethernet  unavailable  --
> > > lo      loopback  unmanaged    --
> > > wlan0   wifi      unmanaged    --
> > 
> > If the state is "unmanaged" on resume, that would indicate a
> > problem
> > with sleep/wake and likely not a kernel network device issue.
> > 
> > We should probably move this discussion to the NM lists to debug
> > further.  Before you suspend, run "nmcli gen log level trace" to
> > turn
> > on full debug logging, then reproduce the issue, and send a pointer
> > to
> > those logs (scrubbed for anything you consider sensitive) to the NM
> > mailing list.
> 
> Hmm :-)
> 
> root@amd:/data/pavel# nmcli gen log level trace
> Error: Unknown log level 'trace'

What NM version?  'trace' is pretty old (since 1.0 from December 2014)
so unless you're using a really, really old version of Debian I'd
expect you'd have it.  Anyway, debug would do.

> root@amd:/data/pavel# nmcli gen log level help
> Error: Unknown log level 'help'

nmcli gen help

> root@amd:/data/pavel# nmcli gen log level
> Error: value for 'level' argument is required.
> root@amd:/data/pavel# nmcli gen log level debug

This should be OK.

> root@amd:/data/pavel# cat /var/log/sys/log

It routes it to whatever the syslog 'daemon' facility logs to (however
that's configured on your system).  Usually /var/log/messages or
/var/log/daemon.log or sometimes your distro configures it to
/var/log/NetworkManager.log.

Or if you're using a systemd-based distro, it would probably be in the
systemd journal so "journalctl -b -u NetworkManager"

> Where do I get the logs? I don't see much in the syslog...

> And.. It seems that it is "every other suspend". One resume results
> in
> broken network, one in working one, one in broken one...

Does your distro use pm-utils, upower, or systemd for suspend/resume
handling?

Dan

^ permalink raw reply

* [PATCH] ipv6: addrconf: Use normal debugging style
From: Joe Perches @ 2018-03-26 15:35 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI; +Cc: netdev, linux-kernel

Remove local ADBG macro and use netdev_dbg/pr_debug

Miscellanea:

o Remove unnecessary debug message after allocation failure as there
  already is a dump_stack() on the failure paths
o Leave the allocation failure message on snmp6_alloc_dev as there
  is one code path that does not do a dump_stack()

Signed-off-by: Joe Perches <joe@perches.com>
---

Remerged resend of http://patchwork.ozlabs.org/patch/826028/
back in October 2017

 net/ipv6/addrconf.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6fd4bbdc444f..0d104bd74934 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -94,15 +94,6 @@
 #include <linux/seq_file.h>
 #include <linux/export.h>
 
-/* Set to 3 to get tracing... */
-#define ACONF_DEBUG 2
-
-#if ACONF_DEBUG >= 3
-#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
-#else
-#define ADBG(fmt, ...) do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
-#endif
-
 #define	INFINITY_LIFE_TIME	0xFFFFFFFF
 
 #define IPV6_MAX_STRLEN \
@@ -409,9 +400,8 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	dev_hold(dev);
 
 	if (snmp6_alloc_dev(ndev) < 0) {
-		ADBG(KERN_WARNING
-			"%s: cannot allocate memory for statistics; dev=%s.\n",
-			__func__, dev->name);
+		netdev_dbg(dev, "%s: cannot allocate memory for statistics\n",
+			   __func__);
 		neigh_parms_release(&nd_tbl, ndev->nd_parms);
 		dev_put(dev);
 		kfree(ndev);
@@ -419,9 +409,8 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	}
 
 	if (snmp6_register_dev(ndev) < 0) {
-		ADBG(KERN_WARNING
-			"%s: cannot create /proc/net/dev_snmp6/%s\n",
-			__func__, dev->name);
+		netdev_dbg(dev, "%s: cannot create /proc/net/dev_snmp6/%s\n",
+			   __func__, dev->name);
 		goto err_release;
 	}
 
@@ -984,7 +973,7 @@ static int ipv6_add_addr_hash(struct net_device *dev, struct inet6_ifaddr *ifa)
 
 	/* Ignore adding duplicate addresses on an interface */
 	if (ipv6_chk_same_addr(dev_net(dev), &ifa->addr, dev, hash)) {
-		ADBG("ipv6_add_addr: already assigned\n");
+		netdev_dbg(dev, "ipv6_add_addr: already assigned\n");
 		err = -EEXIST;
 	} else {
 		hlist_add_head_rcu(&ifa->addr_lst, &inet6_addr_lst[hash]);
@@ -1044,7 +1033,6 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
 
 	ifa = kzalloc(sizeof(*ifa), gfp_flags);
 	if (!ifa) {
-		ADBG("ipv6_add_addr: malloc failed\n");
 		err = -ENOBUFS;
 		goto out;
 	}
@@ -2618,7 +2606,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 	pinfo = (struct prefix_info *) opt;
 
 	if (len < sizeof(struct prefix_info)) {
-		ADBG("addrconf: prefix option too short\n");
+		netdev_dbg(dev, "addrconf: prefix option too short\n");
 		return;
 	}
 
@@ -4446,8 +4434,8 @@ static void addrconf_verify_rtnl(void)
 	if (time_before(next_sched, jiffies + ADDRCONF_TIMER_FUZZ_MAX))
 		next_sched = jiffies + ADDRCONF_TIMER_FUZZ_MAX;
 
-	ADBG(KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
-	      now, next, next_sec, next_sched);
+	pr_debug("now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
+		 now, next, next_sec, next_sched);
 	mod_delayed_work(addrconf_wq, &addr_chk_work, next_sched - now);
 	rcu_read_unlock_bh();
 }
-- 
2.15.0

^ permalink raw reply related

* Re: [PATCH net-next v2 0/3] Drop NETDEV_UNREGISTER_FINAL
From: David Miller @ 2018-03-26 15:35 UTC (permalink / raw)
  To: ktkhai
  Cc: Michal.Kalderon, Ariel.Elior, dledford, jgg, benve, 1dgoodell,
	daniel, jakub.kicinski, ast, edumazet, linux, john.fastabend,
	brouer, dsahern, netdev
In-Reply-To: <152182320819.2767.12723786642825837986.stgit@localhost.localdomain>

From: Kirill Tkhai <ktkhai@virtuozzo.com>
Date: Fri, 23 Mar 2018 19:47:09 +0300

> This series drops unused NETDEV_UNREGISTER_FINAL
> after some preparations.
> 
> v2: New patch [2/3]. Use switch() in [1/3].
> 
> The first version was acked by Jason Gunthorpe,
> and [1/3] was acked by David Ahern.
> 
> Since there are differences to v1, I haven't added
> Acked-by tags of people. It would be nice, if you
> fill OK to tag v2 too.

Series applied, thank you!

^ permalink raw reply

* Re: [PATCH v5 2/2] net: ethernet: nixge: Add support for National Instruments XGE netdev
From: David Miller @ 2018-03-26 15:38 UTC (permalink / raw)
  To: mdf; +Cc: linux-kernel, devicetree, netdev, robh+dt, andrew, f.fainelli
In-Reply-To: <20180323204128.29783-2-mdf@kernel.org>

From: Moritz Fischer <mdf@kernel.org>
Date: Fri, 23 Mar 2018 13:41:28 -0700

> +static void nixge_hw_dma_bd_release(struct net_device *ndev)
> +{
> +	int i;
> +	struct nixge_priv *priv = netdev_priv(ndev);

Please order local variables from longest to shortest line (ie. reverse
christmas tree layout).

> +static int nixge_hw_dma_bd_init(struct net_device *ndev)
> +{
> +	u32 cr;
> +	int i;
> +	struct sk_buff *skb;
> +	struct nixge_priv *priv = netdev_priv(ndev);

Likewise.

> +static void __nixge_device_reset(struct nixge_priv *priv, off_t offset)
> +{
> +	u32 status;
> +	int err;
> +	/* Reset Axi DMA. This would reset NIXGE Ethernet core as well.
> +	 * The reset process of Axi DMA takes a while to complete as all
> +	 * pending commands/transfers will be flushed or completed during
> +	 * this reset process.
> +	 */

Please put an empty line between the local variable declarations
and this comment.

^ permalink raw reply

* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: David Ahern @ 2018-03-26 15:40 UTC (permalink / raw)
  To: Steve Wise; +Cc: leon, stephen, netdev, linux-rdma
In-Reply-To: <743dc7a5306f9b3368fcd4c143cdd822250444a6.1520020530.git.swise@opengridcomputing.com>

On 2/27/18 9:07 AM, Steve Wise wrote:
> Sample output:
> 
> # rdma resource
> 2: cxgb4_0: pd 5 cq 2 qp 2 cm_id 3 mr 7
> 3: mlx4_0: pd 7 cq 3 qp 3 cm_id 3 mr 7
> 
> # rdma resource show cm_id
> link cxgb4_0/- lqpn 0 qp-type RC state LISTEN ps TCP pid 30485 comm rping src-addr 0.0.0.0:7174
> link cxgb4_0/2 lqpn 1048 qp-type RC state CONNECT ps TCP pid 30503 comm rping src-addr 172.16.2.1:7174 dst-addr 172.16.2.1:38246
> link cxgb4_0/2 lqpn 1040 qp-type RC state CONNECT ps TCP pid 30498 comm rping src-addr 172.16.2.1:38246 dst-addr 172.16.2.1:7174
> link mlx4_0/- lqpn 0 qp-type RC state LISTEN ps TCP pid 30485 comm rping src-addr 0.0.0.0:7174
> link mlx4_0/1 lqpn 539 qp-type RC state CONNECT ps TCP pid 30494 comm rping src-addr 172.16.99.1:7174 dst-addr 172.16.99.1:43670
> link mlx4_0/1 lqpn 538 qp-type RC state CONNECT ps TCP pid 30492 comm rping src-addr 172.16.99.1:43670 dst-addr 172.16.99.1:7174
> 
> # rdma resource show cm_id dst-port 7174
> link cxgb4_0/2 lqpn 1040 qp-type RC state CONNECT ps TCP pid 30498 comm rping src-addr 172.16.2.1:38246 dst-addr 172.16.2.1:7174
> link mlx4_0/1 lqpn 538 qp-type RC state CONNECT ps TCP pid 30492 comm rping src-addr 172.16.99.1:43670 dst-addr 172.16.99.1:7174
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  rdma/rdma.h  |   2 +
>  rdma/res.c   | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  rdma/utils.c |   5 ++
>  3 files changed, 264 insertions(+), 1 deletion(-)
> 
> diff --git a/rdma/rdma.h b/rdma/rdma.h
> index 5809f70..e55205b 100644
> --- a/rdma/rdma.h
> +++ b/rdma/rdma.h
> @@ -18,10 +18,12 @@
>  #include <libmnl/libmnl.h>
>  #include <rdma/rdma_netlink.h>
>  #include <time.h>
> +#include <net/if_arp.h>
>  
>  #include "list.h"
>  #include "utils.h"
>  #include "json_writer.h"
> +#include <rdma/rdma_cma.h>
>  
>  #define pr_err(args...) fprintf(stderr, ##args)
>  #define pr_out(args...) fprintf(stdout, ##args)
> diff --git a/rdma/res.c b/rdma/res.c
> index 62f5c54..1ef4f20 100644
> --- a/rdma/res.c
> +++ b/rdma/res.c
> @@ -16,9 +16,11 @@ static int res_help(struct rd *rd)
>  {
>  	pr_out("Usage: %s resource\n", rd->filename);
>  	pr_out("          resource show [DEV]\n");
> -	pr_out("          resource show [qp]\n");
> +	pr_out("          resource show [qp|cm_id]\n");
>  	pr_out("          resource show qp link [DEV/PORT]\n");
>  	pr_out("          resource show qp link [DEV/PORT] [FILTER-NAME FILTER-VALUE]\n");
> +	pr_out("          resource show cm_id link [DEV/PORT]\n");
> +	pr_out("          resource show cm_id link [DEV/PORT] [FILTER-NAME FILTER-VALUE]\n");
>  	return 0;
>  }
>  
> @@ -433,6 +435,230 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
>  	return MNL_CB_OK;
>  }
>  
> +static void print_qp_type(struct rd *rd, uint32_t val)
> +{
> +	if (rd->json_output)
> +		jsonw_string_field(rd->jw, "qp-type",
> +				   qp_types_to_str(val));
> +	else
> +		pr_out("qp-type %s ", qp_types_to_str(val));
> +}
> +
> +static const char *cm_id_state_to_str(uint8_t idx)
> +{
> +	static const char * const cm_id_states_str[] = { "IDLE", "ADDR_QUERY",
> +						      "ADDR_RESOLVED", "ROUTE_QUERY", "ROUTE_RESOLVED",
> +						      "CONNECT", "DISCONNECT",
> +						      "ADDR_BOUND", "LISTEN", "DEVICE_REMOVAL", "DESTROYING" };
> +

In general lines should stay under 80 columns. There are a few
exceptions to the rule (e.g., print strings), but most of the long lines
you have in this patch need to conform.

> @@ -457,11 +683,41 @@ filters qp_valid_filters[MAX_NUMBER_OF_FILTERS] = {{ .name = "link",
>  
>  RES_FUNC(res_qp,	RDMA_NLDEV_CMD_RES_QP_GET, qp_valid_filters, false);
>  
> +static const struct
> +filters cm_id_valid_filters[MAX_NUMBER_OF_FILTERS] = {{ .name = "link",
> +						   .is_number = false },
> +						   { .name = "lqpn",
> +						   .is_number = true },
> +						   { .name = "qp-type",
> +						   .is_number = false },
> +						   { .name = "state",
> +						   .is_number = false },
> +						   { .name = "ps",
> +						   .is_number = false },
> +						   { .name = "dev-type",
> +						   .is_number = false },
> +						   { .name = "transport-type",
> +						   .is_number = false },
> +						   { .name = "pid",
> +						   .is_number = true },
> +						   { .name = "src-addr",
> +						   .is_number = false },
> +						   { .name = "src-port",
> +						   .is_number = true },
> +						   { .name = "dst-addr",
> +						   .is_number = false },
> +						   { .name = "dst-port",
> +						   .is_number = true }};
> +

The above would be more readable as
	static const
	struct filters cm_id_valid_filters[MAX_NUMBER_OF_FILTERS] = {
		{ .name = "link", .is_number = false },
		{ .name = "lqpn", .is_number = true },
...

Definitely do not split between struct and filters.

^ permalink raw reply

* Re: [PATCH iproute2-next 2/2] rdma: Print net device name and index for RDMA device
From: David Ahern @ 2018-03-26 15:44 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: netdev, RDMA mailing list, Stephen Hemminger
In-Reply-To: <20180326150933.GI1877@mtr-leonro.local>

On 3/26/18 9:09 AM, Leon Romanovsky wrote:
> On Mon, Mar 26, 2018 at 08:06:52AM -0600, David Ahern wrote:
>> On 3/26/18 2:28 AM, Leon Romanovsky wrote:
>>> diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
>>> index 9446a721..45474f13 100644
>>> --- a/rdma/include/uapi/rdma/rdma_netlink.h
>>> +++ b/rdma/include/uapi/rdma/rdma_netlink.h
>>> @@ -388,6 +388,10 @@ enum rdma_nldev_attr {
>>>  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
>>>  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
>>>
>>> +	/* Netdev information for relevant protocols, like RoCE and iWARP */
>>> +	RDMA_NLDEV_ATTR_NDEV_INDEX,		/* u32 */
>>> +	RDMA_NLDEV_ATTR_NDEV_NAME,		/* string */
>>> +
>>>  	RDMA_NLDEV_ATTR_MAX
>>>  };
>>>  #endif /* _RDMA_NETLINK_H */
>>
>> Why wasn't the above included in patch 1 as part of the header file update?
>>
>>
> 
> Kernel part is not accepted yet, this is why I separated them.
>
Please don't mix patches in a set like this. The entire set should be
consistent -- either all of them are in the kernel or all of them are
waiting to be committed.

^ permalink raw reply

* Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time
From: Alexei Starovoitov @ 2018-03-26 15:42 UTC (permalink / raw)
  To: Mathieu Desnoyers, rostedt
  Cc: David S. Miller, Daniel Borkmann, Linus Torvalds, Peter Zijlstra,
	netdev, kernel-team, linux-api
In-Reply-To: <1787605856.4574.1522077244597.JavaMail.zimbra@efficios.com>

On 3/26/18 8:14 AM, Mathieu Desnoyers wrote:
> ----- On Mar 26, 2018, at 11:02 AM, rostedt rostedt@goodmis.org wrote:
>
>> On Fri, 23 Mar 2018 19:30:34 -0700
>> Alexei Starovoitov <ast@fb.com> wrote:
>>
>>> From: Alexei Starovoitov <ast@kernel.org>
>>>
>>> add fancy macro to compute number of arguments passed into tracepoint
>>> at compile time and store it as part of 'struct tracepoint'.
>>> The number is necessary to check safety of bpf program access that
>>> is coming in subsequent patch.
>>>
>>> for_each_tracepoint_range() api has no users inside the kernel.
>>> Make it more useful with ability to stop for_each() loop depending
>>> via callback return value.
>>> In such form it's used in subsequent patch.
>>
>> I believe this is used by LTTng.
>
> Indeed, and by SystemTAP as well.
>
> What justifies the need to stop mid-iteration ? A less intrusive alternative
> would be to use the "priv" data pointer to keep state telling further calls
> to return immediately. Does performance of iteration over tracepoints really
> matter here so much that stopping iteration immediately is worth it ?

I'm sure both you and Steven are not serious when you object
to _in-tree_ change to for_each_kernel_tracepoint() that
affects _out-of_tree_ modules?

Just change your module to 'return NULL' instead of plain 'return'.

^ permalink raw reply

* Re: [PATCH net 2/3] bonding: move dev_mc_sync after master_upper_dev_link in bond_enslave
From: Andy Gospodarek @ 2018-03-26 15:46 UTC (permalink / raw)
  To: Xin Long
  Cc: network dev, davem, Jiri Pirko, Wang Chen, Veaceslav Falico,
	Nikolay Aleksandrov
In-Reply-To: <f988756adf856b3975e7941b9c7de593fed098e8.1521997984.git.lucien.xin@gmail.com>

On Mon, Mar 26, 2018 at 01:16:46AM +0800, Xin Long wrote:
> Beniamino found a crash when adding vlan as slave of bond which is also
> the parent link:
> 
>   ip link add bond1 type bond
>   ip link set bond1 up
>   ip link add link bond1 vlan1 type vlan id 80
>   ip link set vlan1 master bond1
> 
> The call trace is as below:
> 
>   [<ffffffffa850842a>] queued_spin_lock_slowpath+0xb/0xf
>   [<ffffffffa8515680>] _raw_spin_lock+0x20/0x30
>   [<ffffffffa83f6f07>] dev_mc_sync+0x37/0x80
>   [<ffffffffc08687dc>] vlan_dev_set_rx_mode+0x1c/0x30 [8021q]
>   [<ffffffffa83efd2a>] __dev_set_rx_mode+0x5a/0xa0
>   [<ffffffffa83f7138>] dev_mc_sync_multiple+0x78/0x80
>   [<ffffffffc084127c>] bond_enslave+0x67c/0x1190 [bonding]
>   [<ffffffffa8401909>] do_setlink+0x9c9/0xe50
>   [<ffffffffa8403bf2>] rtnl_newlink+0x522/0x880
>   [<ffffffffa8403ff7>] rtnetlink_rcv_msg+0xa7/0x260
>   [<ffffffffa8424ecb>] netlink_rcv_skb+0xab/0xc0
>   [<ffffffffa83fe498>] rtnetlink_rcv+0x28/0x30
>   [<ffffffffa8424850>] netlink_unicast+0x170/0x210
>   [<ffffffffa8424bf8>] netlink_sendmsg+0x308/0x420
>   [<ffffffffa83cc396>] sock_sendmsg+0xb6/0xf0
> 
> This is actually a dead lock caused by sync slave hwaddr from master when
> the master is the slave's 'slave'. This dead loop check is actually done
> by netdev_master_upper_dev_link. However, Commit 1f718f0f4f97 ("bonding:
> populate neighbour's private on enslave") moved it after dev_mc_sync.
> 
> This patch is to fix it by moving dev_mc_sync after master_upper_dev_link,
> so that this loop check would be earlier than dev_mc_sync. It also moves
> if (mode == BOND_MODE_8023AD) into if (!bond_uses_primary) clause as an
> improvement.

Nice optimization.  :-)

> 
> Note team driver also has this issue, I will fix it in another patch.
> 
> Fixes: 1f718f0f4f97 ("bonding: populate neighbour's private on enslave")
> Reported-by: Beniamino Galvani <bgalvani@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Andy Gospodarek <andy@greyhouse.net>

> ---
>  drivers/net/bonding/bond_main.c | 73 ++++++++++++++++++++---------------------
>  1 file changed, 35 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 0c299de..55e1985 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1528,44 +1528,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  			goto err_close;
>  	}
>  
> -	/* If the mode uses primary, then the following is handled by
> -	 * bond_change_active_slave().
> -	 */
> -	if (!bond_uses_primary(bond)) {
> -		/* set promiscuity level to new slave */
> -		if (bond_dev->flags & IFF_PROMISC) {
> -			res = dev_set_promiscuity(slave_dev, 1);
> -			if (res)
> -				goto err_close;
> -		}
> -
> -		/* set allmulti level to new slave */
> -		if (bond_dev->flags & IFF_ALLMULTI) {
> -			res = dev_set_allmulti(slave_dev, 1);
> -			if (res)
> -				goto err_close;
> -		}
> -
> -		netif_addr_lock_bh(bond_dev);
> -
> -		dev_mc_sync_multiple(slave_dev, bond_dev);
> -		dev_uc_sync_multiple(slave_dev, bond_dev);
> -
> -		netif_addr_unlock_bh(bond_dev);
> -	}
> -
> -	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> -		/* add lacpdu mc addr to mc list */
> -		u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
> -
> -		dev_mc_add(slave_dev, lacpdu_multicast);
> -	}
> -
>  	res = vlan_vids_add_by_dev(slave_dev, bond_dev);
>  	if (res) {
>  		netdev_err(bond_dev, "Couldn't add bond vlan ids to %s\n",
>  			   slave_dev->name);
> -		goto err_hwaddr_unsync;
> +		goto err_close;
>  	}
>  
>  	prev_slave = bond_last_slave(bond);
> @@ -1725,6 +1692,37 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  		goto err_upper_unlink;
>  	}
>  
> +	/* If the mode uses primary, then the following is handled by
> +	 * bond_change_active_slave().
> +	 */
> +	if (!bond_uses_primary(bond)) {
> +		/* set promiscuity level to new slave */
> +		if (bond_dev->flags & IFF_PROMISC) {
> +			res = dev_set_promiscuity(slave_dev, 1);
> +			if (res)
> +				goto err_sysfs_del;
> +		}
> +
> +		/* set allmulti level to new slave */
> +		if (bond_dev->flags & IFF_ALLMULTI) {
> +			res = dev_set_allmulti(slave_dev, 1);
> +			if (res)
> +				goto err_sysfs_del;
> +		}
> +
> +		netif_addr_lock_bh(bond_dev);
> +		dev_mc_sync_multiple(slave_dev, bond_dev);
> +		dev_uc_sync_multiple(slave_dev, bond_dev);
> +		netif_addr_unlock_bh(bond_dev);
> +
> +		if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> +			/* add lacpdu mc addr to mc list */
> +			u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
> +
> +			dev_mc_add(slave_dev, lacpdu_multicast);
> +		}
> +	}
> +
>  	bond->slave_cnt++;
>  	bond_compute_features(bond);
>  	bond_set_carrier(bond);
> @@ -1748,6 +1746,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  	return 0;
>  
>  /* Undo stages on error */
> +err_sysfs_del:
> +	bond_sysfs_slave_del(new_slave);
> +
>  err_upper_unlink:
>  	bond_upper_dev_unlink(bond, new_slave);
>  
> @@ -1768,10 +1769,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  	synchronize_rcu();
>  	slave_disable_netpoll(new_slave);
>  
> -err_hwaddr_unsync:
> -	if (!bond_uses_primary(bond))
> -		bond_hw_addr_flush(bond_dev, slave_dev);
> -
>  err_close:
>  	slave_dev->priv_flags &= ~IFF_BONDING;
>  	dev_close(slave_dev);

^ permalink raw reply

* Re: [PATCH v5 bpf-next 00/10] bpf, tracing: introduce bpf raw tracepoints
From: Steven Rostedt @ 2018-03-26 15:47 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Alexei Starovoitov, davem, torvalds, peterz, netdev, kernel-team,
	linux-api
In-Reply-To: <ba96cda5-c4d6-4d66-0128-b7053d25fcd8@iogearbox.net>

On Mon, 26 Mar 2018 17:32:02 +0200
Daniel Borkmann <daniel@iogearbox.net> wrote:

> On 03/26/2018 05:04 PM, Steven Rostedt wrote:
> > On Mon, 26 Mar 2018 10:28:03 +0200
> > Daniel Borkmann <daniel@iogearbox.net> wrote:
> >   
> >>> tracepoint    base  kprobe+bpf tracepoint+bpf raw_tracepoint+bpf
> >>> task_rename   1.1M   769K        947K            1.0M
> >>> urandom_read  789K   697K        750K            755K    
> >>
> >> Applied to bpf-next, thanks Alexei!  
> > 
> > Please wait till you have the proper acks. Some of this affects
> > tracing.  
> 
> Ok, I thought time up to v5 was long enough. Anyway, in case there are
> objections I can still toss out the series from bpf-next tree worst case
> should e.g. follow-up fixups not be appropriate.

Yeah, I've been traveling a bit which slowed down my review process
(trying to catch up). My main concern is with patch 6, as there are
external users of those functions. Although, we generally don't cater
to out of tree code, we play nice with LTTng, and I don't want to break
it.

I also should probably pull in the patches and run them through my
tests to make sure they don't have any other side effects.

-- Steve

^ permalink raw reply

* Re: [PATCH v2] of_net: Implement of_get_nvmem_mac_address helper
From: Andrew Lunn @ 2018-03-26 15:50 UTC (permalink / raw)
  To: Mike Looijmans
  Cc: netdev, linux-kernel, devicetree, f.fainelli, robh+dt,
	frowand.list
In-Reply-To: <1522046489-19652-1-git-send-email-mike.looijmans@topic.nl>

On Mon, Mar 26, 2018 at 08:41:29AM +0200, Mike Looijmans wrote:
> It's common practice to store MAC addresses for network interfaces into
> nvmem devices. However the code to actually do this in the kernel lacks,
> so this patch adds of_get_nvmem_mac_address() for drivers to obtain the
> address from an nvmem cell provider.
> 
> This is particulary useful on devices where the ethernet interface cannot
> be configured by the bootloader, for example because it's in an FPGA.
> 
> Tested by adapting the cadence macb driver to call this instead of
> of_get_mac_address().

Hi Mike

I can understand you not wanting to modify all the call sites for
of_get_mac_address().

However, the name of_get_nvmem_mac_address() suggests it gets the MAC
address from NVMEM. I think people are going to be surprised when they
find it first tries for a MAC address directly in device tree. I would
drop the call to of_get_mac_address(), and have the MAC driver call
both.

You could also maybe take a look at fwnode_get_mac_address(). It
should work for both OF and ACPI. It fits better because is passes a
char * for the address. You could make that do both, and call it from
the macb driver. dev_fwnode() probably does what you want.

    Andrew

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox