Netdev List
 help / color / mirror / Atom feed
* [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

* 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


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