* Re: [PATCH net 1/3] bonding: fix the err path for dev hwaddr sync in bond_enslave
From: Nikolay Aleksandrov @ 2018-03-26 14:06 UTC (permalink / raw)
To: Xin Long, network dev
Cc: davem, Jiri Pirko, Wang Chen, Veaceslav Falico,
Nikolay Aleksandrov
In-Reply-To: <8fd918da5a08f64dd69a45bcda3849bbd8114267.1521997984.git.lucien.xin@gmail.com>
On 25/03/18 20:16, 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>
> ---
> drivers/net/bonding/bond_main.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
Seems I've missed the err path back then.
Thanks,
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ 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 14:06 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/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?
^ permalink raw reply
* Re: [PATCH 4/4] drivers/net: Use octal not symbolic permissions
From: Wei Liu @ 2018-03-26 14:07 UTC (permalink / raw)
To: Joe Perches
Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, Dmitry Tarnyagin,
Wolfgang Grandegger, Marc Kleine-Budde, Nicolas Ferre,
Alexandre Belloni, Jean-Paul Roubelat, K. Y. Srinivasan,
Haiyang Zhang, Stephen Hemminger, Alexander Aring, Stefan Schmidt,
Andrew Lunn, Florian Fainelli, Paul Mackerras, Michal Ostrowski,
Oliver Neukum
In-Reply-To: <8f24a711e6b8ec7b41356c378140fb54d510205c.1521845248.git.joe@perches.com>
On Fri, Mar 23, 2018 at 03:54:39PM -0700, Joe Perches wrote:
> Prefer the direct use of octal for permissions.
>
> Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace
> and some typing.
>
> Miscellanea:
>
> o Whitespace neatening around these conversions.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/xen-netback/xenbus.c | 4 +-
> drivers/net/xen-netfront.c | 6 +--
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
^ 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 14:09 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: <7c1a98ab-3bc3-d99a-9ad0-456911b5b54c@gmail.com>
On Fri, 23 Mar 2018 06:28:13 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On 03/23/2018 05:18 AM, Jesper Dangaard Brouer wrote:
>
> > +
> > + /* Note, below struct compat code was primarily needed when
> > + * page_pool code lived under MM-tree control, given mmots and
> > + * net-next trees progress in very different rates.
> > + *
> > + * Allow kernel devel trees and driver to progress at different rates
> > + */
> > + param_copy_sz = PAGE_POOL_PARAMS_SIZE;
> > + memset(&pool->p, 0, param_copy_sz);
> > + if (params->size < param_copy_sz) {
> > + /* Older module calling newer kernel, handled by only
> > + * copying supplied size, and keep remaining params zero
> > + */
> > + param_copy_sz = params->size;
> > + } else if (params->size > param_copy_sz) {
> > + /* Newer module calling older kernel. Need to validate
> > + * no new features were requested.
> > + */
> > + unsigned char *addr = (unsigned char *)params + param_copy_sz;
> > + unsigned char *end = (unsigned char *)params + params->size;
> > +
> > + for (; addr < end; addr++) {
> > + if (*addr != 0)
> > + return -E2BIG;
> > + }
> > + }
>
> I do not see the need for this part.
Okay, then I'll just drop it.
I'm considering changing page_pool_create() to just take everything
as parameters.
--
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 net 0/3] bonding: a bunch of fixes for dev hwaddr sync in bond_enslave
From: Nikolay Aleksandrov @ 2018-03-26 14:16 UTC (permalink / raw)
To: Xin Long, network dev
Cc: davem, Jiri Pirko, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek
In-Reply-To: <cover.1521997984.git.lucien.xin@gmail.com>
On 25/03/18 20:16, Xin Long wrote:
> This patchset is mainly to fix a crash when adding vlan as slave of
> bond which is also the parent link in patch 2/3, and also fix some
> err process problems in bond_enslave in patch 1/3 and 3/3.
>
> Xin Long (3):
> bonding: fix the err path for dev hwaddr sync in bond_enslave
> bonding: move dev_mc_sync after master_upper_dev_link in bond_enslave
> bonding: process the err returned by dev_set_allmulti properly in
> bond_enslave
>
> drivers/net/bonding/bond_main.c | 73 +++++++++++++++++++++--------------------
> 1 file changed, 37 insertions(+), 36 deletions(-)
>
I have no objections to the patches but you've missed to add the bonding maintainers
to the CC list (added now and removed the bouncing emails).
Thanks,
Nik
^ permalink raw reply
* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: David Ahern @ 2018-03-26 14:17 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:
> 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.
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: merge event notification routines
From: David Miller @ 2018-03-26 14:19 UTC (permalink / raw)
To: mrv; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1521756025-19663-1-git-send-email-mrv@mojatatu.com>
From: Roman Mashak <mrv@mojatatu.com>
Date: Thu, 22 Mar 2018 18:00:25 -0400
> Collapse tca_get_notify(), tca_add_notify() and tca_del_notify() in a
> single function since they repeat the same code pattern.
>
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
This really doesn't improve the situation.
Instead of a couple clearly coded helpers, you now have one which is
bombed with conditionals that change it's behavior based upon the
event that gets passed in.
This is much less intuitive than how the code is now.
I'm not applying this, sorry.
^ permalink raw reply
* Re: [PATCH net-next] XDP router for veth
From: David Miller @ 2018-03-26 14:21 UTC (permalink / raw)
To: mislam4
Cc: ebiederm, xemul, netdev, shemminger, edumazet, dsahern, roopa,
tom, alexei.starovoitov, f.fainelli, brouer
In-Reply-To: <CAFgPn1DJ-8DDkydvvBeYtrZeNs3fMA+PuaUJNbPu9vhPUporBg@mail.gmail.com>
From: "Md. Islam" <mislam4@kent.edu>
Date: Fri, 23 Mar 2018 02:43:16 -0400
> +#ifdef CONFIG_XDP_ROUTER
> + //if IP forwarding is enabled on the receiver, create xdp_buff
> + //from skb and call xdp_router_forward()
Never use C++ comments, only use C style.
> + if(is_forwarding_enabled(rcv)){
There must be a space between 'if' and the openning parenthesis. You need
to also have a space before the openning curly braces.
In fact this entire patch is full of coding style issues, please run your
changes through checkpatch.pl before resubmitting.
^ permalink raw reply
* Re: [PATCH iproute2-next] rdma: Move RDMA UAPI header file to be under RDMA responsibility
From: Steve Wise @ 2018-03-26 14:23 UTC (permalink / raw)
To: Leon Romanovsky
Cc: David Ahern, Leon Romanovsky, netdev, RDMA mailing list,
Stephen Hemminger
In-Reply-To: <c1cd4d27-dce6-84d0-344d-86ff7223add8@gmail.com>
On 3/26/2018 9:03 AM, David Ahern wrote:
> On 3/25/18 12:38 AM, Leon Romanovsky wrote:
>> From: Leon Romanovsky <leonro@mellanox.com>
>>
>> In iproute2 package, the updates of UAPIs files are performed
>> after the needed feature lands in kernel's net-next tree.
>>
>> Such development flow created delays to the rdma tool developers,
>> who uses rdma-next tree as a basis for their work.
>>
>> Move RDMA UAPI file to be under rdma/ folder, so whole responsibility
>> of syncing this file will be on them.
>>
>> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>> ---
>> rdma/Makefile | 1 +
>> {include => rdma/include}/uapi/rdma/rdma_netlink.h | 0
>> 2 files changed, 1 insertion(+)
>> rename {include => rdma/include}/uapi/rdma/rdma_netlink.h (100%)
> applied to iproute2-next
>
Hey Leon, so how do I change rdma/include/uapi/rdma_netlink.h now for my
series [1]? Do I just make the changes? Or is there some other process?
[1] https://www.spinics.net/lists/linux-rdma/msg61419.html
Steve.
^ permalink raw reply
* [PATCH net-next] net: aquantia: Make function hw_atl_utils_mpi_set_speed() static
From: Wei Yongjun @ 2018-03-26 14:32 UTC (permalink / raw)
To: Igor Russkikh, Pavel Belous; +Cc: Wei Yongjun, netdev, kernel-janitors
Fixes the following sparse warning:
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:508:5: warning:
symbol 'hw_atl_utils_mpi_set_speed' was not declared. Should it be static?
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index d3b847e..84d7f4d 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -505,7 +505,7 @@ void hw_atl_utils_mpi_read_stats(struct aq_hw_s *self,
err_exit:;
}
-int hw_atl_utils_mpi_set_speed(struct aq_hw_s *self, u32 speed)
+static int hw_atl_utils_mpi_set_speed(struct aq_hw_s *self, u32 speed)
{
u32 val = aq_hw_read_reg(self, HW_ATL_MPI_CONTROL_ADR);
^ permalink raw reply related
* [PATCH net-next] tipc: fix error handling in tipc_udp_enable()
From: Wei Yongjun @ 2018-03-26 14:32 UTC (permalink / raw)
To: Jon Maloy, Ying Xue; +Cc: Wei Yongjun, netdev, tipc-discussion, kernel-janitors
Release alloced resource before return from the error handling
case in tipc_udp_enable(), otherwise will cause memory leak.
Fixes: 52dfae5c85a4 ("tipc: obtain node identity from interface by default")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
net/tipc/udp_media.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index 2c13b18..e7d91f5 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -687,7 +687,8 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
}
if (!tipc_own_id(net)) {
pr_warn("Failed to set node id, please configure manually\n");
- return -EINVAL;
+ err = -EINVAL;
+ goto err;
}
b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
^ permalink raw reply related
* [PATCH net-next] tipc: tipc_node_create() can be static
From: Wei Yongjun @ 2018-03-26 14:33 UTC (permalink / raw)
To: Jon Maloy, Ying Xue; +Cc: Wei Yongjun, netdev, tipc-discussion, kernel-janitors
Fixes the following sparse warning:
net/tipc/node.c:336:18: warning:
symbol 'tipc_node_create' was not declared. Should it be static?
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
net/tipc/node.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 4a95c8c..4fb4327 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -333,8 +333,8 @@ static void tipc_node_write_unlock(struct tipc_node *n)
}
}
-struct tipc_node *tipc_node_create(struct net *net, u32 addr,
- u8 *peer_id, u16 capabilities)
+static struct tipc_node *tipc_node_create(struct net *net, u32 addr,
+ u8 *peer_id, u16 capabilities)
{
struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_node *n, *temp_node;
^ permalink raw reply related
* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: Steve Wise @ 2018-03-26 14:30 UTC (permalink / raw)
To: David Ahern; +Cc: leon, stephen, netdev, linux-rdma
In-Reply-To: <f6dd4255-69b2-bb90-de92-bb633f7248ef@gmail.com>
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.
Steve.
^ permalink raw reply
* Re: [PATCH RFC net-next 7/7] netdevsim: Add simple FIB resource controller via devlink
From: Jiri Pirko @ 2018-03-26 14:33 UTC (permalink / raw)
To: David Ahern
Cc: netdev, davem, roopa, shm, jiri, idosch, jakub.kicinski,
David Ahern
In-Reply-To: <f095d817-4c78-43ec-802b-51f014c35367@cumulusnetworks.com>
Sun, Mar 25, 2018 at 04:24:11PM CEST, dsa@cumulusnetworks.com wrote:
>On 3/24/18 10:02 AM, Jiri Pirko wrote:
>>>>>>>>
>>>>>>>> Wait a second. What do you mean by "per-network namespace"? Devlink
>>>>>>>> instance is always associated with one physical device. Like an ASIC.
>>>>>>>>
>>>>>>>>
>>>>>>>>> has a net entry, the simplest design is to put it into the namespace of
>>>>>>>>> the controller. Without it, controlling resource sizes in namespace
>>>>>>>>> 'foobar' has to be done from init_net, which is just wrong.
>>>>>>>
>>>>>>> you need to look at how netdevsim creates a device per netdevice.
>>>>>>
>>>>>> That means one devlink instance for each netdevsim device, doesn't it?
>>>>>>
>>>>>
>>>>> yes.
>>>>
>>>> Still not sure how to handle namespaces in devlink. Originally, I
>>>> thought it would be okay to leave all devlink instances in init_ns.
>>>> Because what happens if you move netdev to another namespace? Should the
>>>> devlink move as well? What if you have multiple ports, each in different
>>>> namespace. Can user move devlink instance to another namespace? Etc.
>>>>
>>>
>>> The devlink instance is associated with a 'struct device' and those do
>>> not change namespaces AFAIK.
>>
>> Yeah. But you put devlink instance into namespace according to struct
>> net_device. That is mismatch.
>>
>
>New netdevsim netdevice creates a new 'struct device' which creates a
>new devlink instance. The namespace the netdev is created in is then
>passed to the devlink instance. Yes, the netdev could change namespaces,
>but that is something we can easily prevent if it has a devlink instance.
>
>But really, we are way down a tangent with respect to the intent of this
>patch set. I am fine with limiting the example resource controller to
I know. That is just something that I spotted :)
^ permalink raw reply
* [PATCH v2] net-usb: add qmi_wwan if on lte modem wistron neweb d18q1
From: Giuseppe Lippolis @ 2018-03-26 14:34 UTC (permalink / raw)
To: netdev; +Cc: Giuseppe Lippolis
This modem is embedded on dlink dwr-921 router.
The oem configuration states:
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1435 ProdID=0918 Rev= 2.32
S: Manufacturer=Android
S: Product=Android
S: SerialNumber=0123456789ABCDEF
C:* #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E: Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
Tested on openwrt distribution
Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
---
drivers/net/usb/qmi_wwan.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 5894e3c..b1f9b0a 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1100,6 +1100,9 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x0846, 0x68a2, 8)},
{QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
{QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
+ {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */
+ {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */
+ {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */
{QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */
{QMI_FIXED_INTF(0x16d8, 0x6007, 0)}, /* CMOTech CHE-628S */
{QMI_FIXED_INTF(0x16d8, 0x6008, 0)}, /* CMOTech CMU-301 */
--
2.7.4
^ permalink raw reply related
* Re: [PATCH net] team: move dev_mc_sync after master_upper_dev_link in team_port_add
From: Jiri Pirko @ 2018-03-26 14:38 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, davem
In-Reply-To: <e2412cb1b4863791705ee606755c0a8c82973b20.1521998706.git.lucien.xin@gmail.com>
Sun, Mar 25, 2018 at 07:25:06PM CEST, lucien.xin@gmail.com wrote:
>The same fix as in 'bonding: move dev_mc_sync after master_upper_dev_link
>in bond_enslave' is needed for team driver.
>
>The panic can be reproduced easily:
>
> ip link add team1 type team
> ip link set team1 up
> ip link add link team1 vlan1 type vlan id 80
> ip link set vlan1 master team1
>
>Fixes: cb41c997d444 ("team: team should sync the port's uc/mc addrs when add a port")
>Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* [PATCH net v2] udp6: set dst cache for a connected sk before udp_v6_send_skb
From: Alexey Kodanev @ 2018-03-26 14:48 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller, Alexey Kodanev
After commit 33c162a980fe ("ipv6: datagram: Update dst cache of a
connected datagram sk during pmtu update"), when the error occurs on
sending datagram in udpv6_sendmsg() due to ICMPV6_PKT_TOOBIG type,
error handler can trigger the following path and call ip6_dst_store():
udpv6_err()
ip6_sk_update_pmtu()
ip6_datagram_dst_update()
ip6_dst_lookup_flow(), can create a RTF_CACHE clone
...
ip6_dst_store()
It can happen before a connected UDP socket invokes ip6_dst_store()
in the end of udpv6_sendmsg(), on destination release, as a result,
the last one changes dst to the old one, preventing getting updated
dst cache on the next udpv6_sendmsg() call.
This patch moves ip6_dst_store() in udpv6_sendmsg(), so that it is
invoked after ip6_sk_dst_lookup_flow() and before udp_v6_send_skb().
Also, increase refcnt for dst, when passing it to ip6_dst_store()
because after that the dst cache can be released by other calls
to ip6_dst_store() with the same socket.
Fixes: 33c162a980fe ("ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
v2: * remove 'release_dst:' label
* move ip6_dst_store() below MSG_CONFIRM check as
suggested by Eric and add dst_clone()
* add 'Fixes' commit.
net/ipv6/udp.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 52e3ea0..4508e5a 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1303,6 +1303,16 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
goto do_confirm;
back_from_confirm:
+ if (connected)
+ ip6_dst_store(sk, dst_clone(dst),
+ ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
+ &sk->sk_v6_daddr : NULL,
+#ifdef CONFIG_IPV6_SUBTREES
+ ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
+ &np->saddr :
+#endif
+ NULL);
+
/* Lockless fast path for the non-corking case */
if (!corkreq) {
struct sk_buff *skb;
@@ -1314,7 +1324,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
err = PTR_ERR(skb);
if (!IS_ERR_OR_NULL(skb))
err = udp_v6_send_skb(skb, &fl6);
- goto release_dst;
+ goto out;
}
lock_sock(sk);
@@ -1348,23 +1358,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
err = np->recverr ? net_xmit_errno(err) : 0;
release_sock(sk);
-release_dst:
- if (dst) {
- if (connected) {
- ip6_dst_store(sk, dst,
- ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
- &sk->sk_v6_daddr : NULL,
-#ifdef CONFIG_IPV6_SUBTREES
- ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
- &np->saddr :
-#endif
- NULL);
- } else {
- dst_release(dst);
- }
- dst = NULL;
- }
-
out:
dst_release(dst);
fl6_sock_release(flowlabel);
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: David Ahern @ 2018-03-26 14:44 UTC (permalink / raw)
To: Steve Wise; +Cc: leon, stephen, netdev, linux-rdma
In-Reply-To: <0443b8e0-17ff-1e62-51ba-ba1fa0e0d529@opengridcomputing.com>
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.
^ permalink raw reply
* RE: [PATCH net-next] tipc: fix error handling in tipc_udp_enable()
From: Jon Maloy @ 2018-03-26 14:44 UTC (permalink / raw)
To: Wei Yongjun, Ying Xue
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
kernel-janitors@vger.kernel.org
In-Reply-To: <1522074764-22678-1-git-send-email-weiyongjun1@huawei.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Thank you, Wei.
> -----Original Message-----
> From: Wei Yongjun [mailto:weiyongjun1@huawei.com]
> Sent: Monday, March 26, 2018 10:33
> To: Jon Maloy <jon.maloy@ericsson.com>; Ying Xue
> <ying.xue@windriver.com>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; netdev@vger.kernel.org;
> tipc-discussion@lists.sourceforge.net; kernel-janitors@vger.kernel.org
> Subject: [PATCH net-next] tipc: fix error handling in tipc_udp_enable()
>
> Release alloced resource before return from the error handling case in
> tipc_udp_enable(), otherwise will cause memory leak.
>
> Fixes: 52dfae5c85a4 ("tipc: obtain node identity from interface by default")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> net/tipc/udp_media.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index
> 2c13b18..e7d91f5 100644
> --- a/net/tipc/udp_media.c
> +++ b/net/tipc/udp_media.c
> @@ -687,7 +687,8 @@ static int tipc_udp_enable(struct net *net, struct
> tipc_bearer *b,
> }
> if (!tipc_own_id(net)) {
> pr_warn("Failed to set node id, please configure
> manually\n");
> - return -EINVAL;
> + err = -EINVAL;
> + goto err;
> }
>
> b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
^ permalink raw reply
* RE: [PATCH net-next] tipc: tipc_node_create() can be static
From: Jon Maloy @ 2018-03-26 14:45 UTC (permalink / raw)
To: Wei Yongjun, Ying Xue
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
kernel-janitors@vger.kernel.org
In-Reply-To: <1522074793-22753-1-git-send-email-weiyongjun1@huawei.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Thanks
///jon
> -----Original Message-----
> From: Wei Yongjun [mailto:weiyongjun1@huawei.com]
> Sent: Monday, March 26, 2018 10:33
> To: Jon Maloy <jon.maloy@ericsson.com>; Ying Xue
> <ying.xue@windriver.com>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; netdev@vger.kernel.org;
> tipc-discussion@lists.sourceforge.net; kernel-janitors@vger.kernel.org
> Subject: [PATCH net-next] tipc: tipc_node_create() can be static
>
> Fixes the following sparse warning:
>
> net/tipc/node.c:336:18: warning:
> symbol 'tipc_node_create' was not declared. Should it be static?
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> net/tipc/node.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/tipc/node.c b/net/tipc/node.c index 4a95c8c..4fb4327 100644
> --- a/net/tipc/node.c
> +++ b/net/tipc/node.c
> @@ -333,8 +333,8 @@ static void tipc_node_write_unlock(struct tipc_node
> *n)
> }
> }
>
> -struct tipc_node *tipc_node_create(struct net *net, u32 addr,
> - u8 *peer_id, u16 capabilities)
> +static struct tipc_node *tipc_node_create(struct net *net, u32 addr,
> + u8 *peer_id, u16 capabilities)
> {
> struct tipc_net *tn = net_generic(net, tipc_net_id);
> struct tipc_node *n, *temp_node;
^ permalink raw reply
* [PATCH net-next 1/1] tc-testing: Correct compound statements for namespace execution
From: Lucas Bates @ 2018-03-26 14:46 UTC (permalink / raw)
To: davem; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri, Lucas Bates
If tdc is executing test cases inside a namespace, only the
first command in a compound statement will be executed inside
the namespace by tdc. As a result, the subsequent commands
are not executed inside the namespace and the test will fail.
Example:
for i in {x..y}; do args="foo"; done && tc actions add $args
The namespace execution feature will prepend 'ip netns exec'
to the command:
ip netns exec tcut for i in {x..y}; do args="foo"; done && \
tc actions add $args
So the actual tc command is not parsed by the shell as being
part of the namespace execution.
Enclosing these compound statements inside a bash invocation
with proper escape characters resolves the problem by creating
a subshell inside the namespace.
Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
---
tools/testing/selftests/tc-testing/tc-tests/actions/gact.json | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/gact.json b/tools/testing/selftests/tc-testing/tc-tests/actions/gact.json
index ae96d03..68c9102 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/gact.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/gact.json
@@ -481,7 +481,7 @@
255
]
],
- "cmdUnderTest": "for i in `seq 1 32`; do cmd=\"action pass index $i \"; args=\"$args$cmd\"; done && $TC actions add $args",
+ "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action pass index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
"expExitCode": "0",
"verifyCmd": "$TC actions list action gact",
"matchPattern": "^[ \t]+index [0-9]+ ref",
@@ -505,7 +505,7 @@
255
]
],
- "cmdUnderTest": "for i in `seq 1 32`; do cmd=\"action continue index $i cookie aabbccddeeff112233445566778800a1 \"; args=\"$args$cmd\"; done && $TC actions add $args",
+ "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action continue index \\$i cookie aabbccddeeff112233445566778800a1 \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
"expExitCode": "0",
"verifyCmd": "$TC actions list action gact",
"matchPattern": "^[ \t]+index [0-9]+ ref",
@@ -528,13 +528,13 @@
1,
255
],
- "for i in `seq 1 32`; do cmd=\"action continue index $i \"; args=\"$args$cmd\"; done && $TC actions add $args"
+ "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action continue index \\$i \\\"; args=\\\"\\$args\\$cmd\\\"; done && $TC actions add \\$args\""
],
- "cmdUnderTest": "for i in `seq 1 32`; do cmd=\"action gact index $i \"; args=\"$args$cmd\"; done && $TC actions del $args",
+ "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action gact index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
"expExitCode": "0",
"verifyCmd": "$TC actions list action gact",
"matchPattern": "^[ \t]+index [0-9]+ ref",
"matchCount": "0",
"teardown": []
}
-]
\ No newline at end of file
+]
^ permalink raw reply related
* Re: [PATCH net v2] udp6: set dst cache for a connected sk before udp_v6_send_skb
From: Eric Dumazet @ 2018-03-26 14:48 UTC (permalink / raw)
To: Alexey Kodanev, netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller
In-Reply-To: <1522075727-19860-1-git-send-email-alexey.kodanev@oracle.com>
On 03/26/2018 07:48 AM, Alexey Kodanev wrote:
> After commit 33c162a980fe ("ipv6: datagram: Update dst cache of a
> connected datagram sk during pmtu update"), when the error occurs on
> sending datagram in udpv6_sendmsg() due to ICMPV6_PKT_TOOBIG type,
> error handler can trigger the following path and call ip6_dst_store():
>
> udpv6_err()
> ip6_sk_update_pmtu()
> ip6_datagram_dst_update()
> ip6_dst_lookup_flow(), can create a RTF_CACHE clone
> ...
> ip6_dst_store()
>
> It can happen before a connected UDP socket invokes ip6_dst_store()
> in the end of udpv6_sendmsg(), on destination release, as a result,
> the last one changes dst to the old one, preventing getting updated
> dst cache on the next udpv6_sendmsg() call.
>
> This patch moves ip6_dst_store() in udpv6_sendmsg(), so that it is
> invoked after ip6_sk_dst_lookup_flow() and before udp_v6_send_skb().
>
> Also, increase refcnt for dst, when passing it to ip6_dst_store()
> because after that the dst cache can be released by other calls
> to ip6_dst_store() with the same socket.
>
> Fixes: 33c162a980fe ("ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update")
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Thanks Alexey.
^ permalink raw reply
* Re: [PATCH 4/4] selftests/bpf: fix compiling errors
From: Alexei Starovoitov @ 2018-03-26 14:55 UTC (permalink / raw)
To: changbin.du; +Cc: shuah, linux-kselftest, linux-kernel, Daniel Borkmann, netdev
In-Reply-To: <1522056208-4004-5-git-send-email-changbin.du@intel.com>
On Mon, Mar 26, 2018 at 05:23:28PM +0800, changbin.du@intel.com wrote:
> From: Changbin Du <changbin.du@intel.com>
>
> This patch fixed below errors of missing head files.
>
> tools/testing/selftests$ make
> ...
> clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \
> -O2 -target bpf -emit-llvm -c test_pkt_access.c -o - | \
> llc -march=bpf -mcpu=generic -filetype=obj -o /home/changbin/work/linux/tools/testing/selftests/bpf//test_pkt_access.o
> In file included from test_pkt_access.c:9:
> In file included from ../../../include/uapi/linux/bpf.h:11:
> In file included from ./include/uapi/linux/types.h:5:
> /usr/include/asm-generic/int-ll64.h:11:10: fatal error: 'asm/bitsperlong.h' file not found
> #include <asm/bitsperlong.h>
> ^
> 1 error generated.
> clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \
> -O2 -target bpf -emit-llvm -c test_xdp.c -o - | \
> llc -march=bpf -mcpu=generic -filetype=obj -o /home/changbin/work/linux/tools/testing/selftests/bpf//test_xdp.o
> In file included from test_xdp.c:9:
> In file included from ../../../include/uapi/linux/bpf.h:11:
> In file included from ./include/uapi/linux/types.h:5:
> /usr/include/asm-generic/int-ll64.h:11:10: fatal error: 'asm/bitsperlong.h' file not found
> #include <asm/bitsperlong.h>
> ^
> 1 error generated.
> clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \
> -O2 -target bpf -emit-llvm -c test_l4lb.c -o - | \
> llc -march=bpf -mcpu=generic -filetype=obj -o /home/changbin/work/linux/tools/testing/selftests/bpf//test_l4lb.o
> In file included from test_l4lb.c:10:
> In file included from /usr/include/linux/pkt_cls.h:4:
> In file included from ./include/uapi/linux/types.h:5:
> /usr/include/asm-generic/int-ll64.h:11:10: fatal error: 'asm/bitsperlong.h' file not found
> #include <asm/bitsperlong.h>
> ^
> 1 error generated.
> clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \
> -O2 -target bpf -emit-llvm -c test_tcp_estats.c -o - | \
> llc -march=bpf -mcpu=generic -filetype=obj -o /home/changbin/work/linux/tools/testing/selftests/bpf//test_tcp_estats.o
> In file included from test_tcp_estats.c:35:
> In file included from ../../../include/uapi/linux/bpf.h:11:
> In file included from ./include/uapi/linux/types.h:5:
> /usr/include/asm-generic/int-ll64.h:11:10: fatal error: 'asm/bitsperlong.h' file not found
> #include <asm/bitsperlong.h>
> ...
>
> Signed-off-by: Changbin Du <changbin.du@intel.com>
> ---
> tools/testing/selftests/bpf/Makefile | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 5c43c18..dc0fdc8 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -10,7 +10,8 @@ ifneq ($(wildcard $(GENHDR)),)
> GENFLAGS := -DHAVE_GENHDR
> endif
>
> -CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
> +CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) \
> + -I../../../include -I../../../../usr/include
> LDLIBS += -lcap -lelf -lrt -lpthread
>
> # Order correspond to 'make run_tests' order
> @@ -62,7 +63,7 @@ else
> CPU ?= generic
> endif
>
> -CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \
> +CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi -I../../../../usr/include \
> -Wno-compare-distinct-pointer-types
Nack.
I suspect that will break the build for everyone else who's doing it in the directory
itself instead of the outer one.
^ permalink raw reply
* Re: [PATCH v2 iproute2-next 3/6] rdma: Add CM_ID resource tracking information
From: Steve Wise @ 2018-03-26 14:55 UTC (permalink / raw)
To: David Ahern; +Cc: leon, stephen, netdev, linux-rdma
In-Reply-To: <8d788e10-c170-9b94-09f0-98515fdd5bac@gmail.com>
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.
Steve.
^ permalink raw reply
* 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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox