* Re: [bpf-next,v4] samples: bpf: add max_pckt_size option at xdp_adjust_tail
From: Yonghong Song @ 2019-09-16 16:07 UTC (permalink / raw)
To: Daniel T. Lee, Daniel Borkmann, Alexei Starovoitov
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
In-Reply-To: <20190915124733.31134-1-danieltimlee@gmail.com>
On 9/15/19 1:47 PM, Daniel T. Lee wrote:
> Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> to 600. To make this size flexible, a new map 'pcktsz' is added.
>
> By updating new packet size to this map from the userland,
> xdp_adjust_tail_kern.o will use this value as a new max_pckt_size.
>
> If no '-P <MAX_PCKT_SIZE>' option is used, the size of maximum packet
> will be 600 as a default.
>
> Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
>
> ---
> Changes in v4:
> - make pckt_size no less than ICMP_TOOBIG_SIZE
> - Fix code style
> Changes in v2:
> - Change the helper to fetch map from 'bpf_map__next' to
> 'bpf_object__find_map_fd_by_name'.
>
> samples/bpf/xdp_adjust_tail_kern.c | 23 +++++++++++++++++++----
> samples/bpf/xdp_adjust_tail_user.c | 28 ++++++++++++++++++++++------
> 2 files changed, 41 insertions(+), 10 deletions(-)
LGTM except a minor comments below.
Acked-by: Yonghong Song <yhs@fb.com>
bpf-next is closed. Please resubmit the patch once it is opened
in around 2 weeks.
>
> diff --git a/samples/bpf/xdp_adjust_tail_kern.c b/samples/bpf/xdp_adjust_tail_kern.c
> index 411fdb21f8bc..8869bbb160d2 100644
> --- a/samples/bpf/xdp_adjust_tail_kern.c
> +++ b/samples/bpf/xdp_adjust_tail_kern.c
> @@ -25,6 +25,13 @@
> #define ICMP_TOOBIG_SIZE 98
> #define ICMP_TOOBIG_PAYLOAD_SIZE 92
>
> +struct bpf_map_def SEC("maps") pcktsz = {
> + .type = BPF_MAP_TYPE_ARRAY,
> + .key_size = sizeof(__u32),
> + .value_size = sizeof(__u32),
> + .max_entries = 1,
> +};
> +
> struct bpf_map_def SEC("maps") icmpcnt = {
> .type = BPF_MAP_TYPE_ARRAY,
> .key_size = sizeof(__u32),
> @@ -64,7 +71,8 @@ static __always_inline void ipv4_csum(void *data_start, int data_size,
> *csum = csum_fold_helper(*csum);
> }
>
> -static __always_inline int send_icmp4_too_big(struct xdp_md *xdp)
> +static __always_inline int send_icmp4_too_big(struct xdp_md *xdp,
> + __u32 max_pckt_size)
> {
> int headroom = (int)sizeof(struct iphdr) + (int)sizeof(struct icmphdr);
>
> @@ -92,7 +100,7 @@ static __always_inline int send_icmp4_too_big(struct xdp_md *xdp)
> orig_iph = data + off;
> icmp_hdr->type = ICMP_DEST_UNREACH;
> icmp_hdr->code = ICMP_FRAG_NEEDED;
> - icmp_hdr->un.frag.mtu = htons(MAX_PCKT_SIZE-sizeof(struct ethhdr));
> + icmp_hdr->un.frag.mtu = htons(max_pckt_size - sizeof(struct ethhdr));
> icmp_hdr->checksum = 0;
> ipv4_csum(icmp_hdr, ICMP_TOOBIG_PAYLOAD_SIZE, &csum);
> icmp_hdr->checksum = csum;
> @@ -118,14 +126,21 @@ static __always_inline int handle_ipv4(struct xdp_md *xdp)
> {
> void *data_end = (void *)(long)xdp->data_end;
> void *data = (void *)(long)xdp->data;
> + __u32 max_pckt_size = MAX_PCKT_SIZE;
> int pckt_size = data_end - data;
> + __u32 *pckt_sz;
> + __u32 key = 0;
> int offset;
>
> - if (pckt_size > MAX_PCKT_SIZE) {
> + pckt_sz = bpf_map_lookup_elem(&pcktsz, &key);
> + if (pckt_sz && *pckt_sz)
> + max_pckt_size = *pckt_sz;
> +
> + if (pckt_size > max(max_pckt_size, ICMP_TOOBIG_SIZE)) {
> offset = pckt_size - ICMP_TOOBIG_SIZE;
> if (bpf_xdp_adjust_tail(xdp, 0 - offset))
> return XDP_PASS;
> - return send_icmp4_too_big(xdp);
> + return send_icmp4_too_big(xdp, max_pckt_size);
> }
> return XDP_PASS;
> }
> diff --git a/samples/bpf/xdp_adjust_tail_user.c b/samples/bpf/xdp_adjust_tail_user.c
> index a3596b617c4c..99e965c68054 100644
> --- a/samples/bpf/xdp_adjust_tail_user.c
> +++ b/samples/bpf/xdp_adjust_tail_user.c
> @@ -23,6 +23,7 @@
> #include "libbpf.h"
>
> #define STATS_INTERVAL_S 2U
> +#define MAX_PCKT_SIZE 600
>
> static int ifindex = -1;
> static __u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
> @@ -72,6 +73,7 @@ static void usage(const char *cmd)
> printf("Usage: %s [...]\n", cmd);
> printf(" -i <ifname|ifindex> Interface\n");
> printf(" -T <stop-after-X-seconds> Default: 0 (forever)\n");
> + printf(" -P <MAX_PCKT_SIZE> Default: %u\n", MAX_PCKT_SIZE);
> printf(" -S use skb-mode\n");
> printf(" -N enforce native mode\n");
> printf(" -F force loading prog\n");
> @@ -85,13 +87,14 @@ int main(int argc, char **argv)
> .prog_type = BPF_PROG_TYPE_XDP,
> };
> unsigned char opt_flags[256] = {};
> - const char *optstr = "i:T:SNFh";
> + const char *optstr = "i:T:P:SNFh";
> struct bpf_prog_info info = {};
> __u32 info_len = sizeof(info);
> + __u32 max_pckt_size = 0;
> + __u32 key = 0;
> unsigned int kill_after_s = 0;
> int i, prog_fd, map_fd, opt;
> struct bpf_object *obj;
> - struct bpf_map *map;
> char filename[256];
> int err;
>
> @@ -110,6 +113,9 @@ int main(int argc, char **argv)
> case 'T':
> kill_after_s = atoi(optarg);
> break;
> + case 'P':
> + max_pckt_size = atoi(optarg);
> + break;
> case 'S':
> xdp_flags |= XDP_FLAGS_SKB_MODE;
> break;
> @@ -150,12 +156,22 @@ int main(int argc, char **argv)
> if (bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd))
> return 1;
>
> - map = bpf_map__next(NULL, obj);
> - if (!map) {
> - printf("finding a map in obj file failed\n");
> + /* update pcktsz map */
> + if (max_pckt_size) {
> + map_fd = bpf_object__find_map_fd_by_name(obj, "pcktsz");
> + if (map_fd < 0) {
> + printf("finding a pcktsz map in obj file failed\n");
> + return 1;
> + }
> + bpf_map_update_elem(map_fd, &key, &max_pckt_size, BPF_ANY);
> + }
> +
> + /* fetch icmpcnt map */
> + map_fd = bpf_object__find_map_fd_by_name(obj, "icmpcnt");
> + if (map_fd < 0) {
> + printf("finding a icmpcnt map in obj file failed\n");
> return 1;
> }
> - map_fd = bpf_map__fd(map);
>
> if (!prog_fd) {
> printf("load_bpf_file: %s\n", strerror(errno));
Could you move the 'if (!prog_fd) ...' right after 'bpf_prog_load_xattr'
for readability reason?
Could you also change the condition 'if (!prog_fd)' to 'if (prog_fd <
0)'? You need to mention this fix in your commit message as well.
^ permalink raw reply
* Re: [PATCH] selftests/net: replace AF_MAX with INT_MAX in socket.c
From: shuah @ 2019-09-16 16:09 UTC (permalink / raw)
To: Marcelo Henrique Cerri, David S. Miller
Cc: netdev, linux-kselftest, linux-kernel, shuah
In-Reply-To: <20190916150337.18049-1-marcelo.cerri@canonical.com>
On 9/16/19 9:03 AM, Marcelo Henrique Cerri wrote:
> Use INT_MAX instead of AF_MAX, since libc might have a smaller value
> of AF_MAX than the kernel, what causes the test to fail.
>
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
> tools/testing/selftests/net/socket.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/socket.c b/tools/testing/selftests/net/socket.c
> index afca1ead677f..10e75ba90124 100644
> --- a/tools/testing/selftests/net/socket.c
> +++ b/tools/testing/selftests/net/socket.c
> @@ -6,6 +6,7 @@
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> +#include <limits.h>
>
> struct socket_testcase {
> int domain;
> @@ -24,7 +25,10 @@ struct socket_testcase {
> };
>
> static struct socket_testcase tests[] = {
> - { AF_MAX, 0, 0, -EAFNOSUPPORT, 0 },
> + /* libc might have a smaller value of AF_MAX than the kernel
> + * actually supports, so use INT_MAX instead.
> + */
> + { INT_MAX, 0, 0, -EAFNOSUPPORT, 0 },
> { AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 1 },
> { AF_INET, SOCK_DGRAM, IPPROTO_TCP, -EPROTONOSUPPORT, 1 },
> { AF_INET, SOCK_DGRAM, IPPROTO_UDP, 0, 1 },
>
What failure are you seeing? It sounds arbitrary to use INT_MAX
instead of AF_MAX. I think it is important to understand the
failure first.
Please note that AF_MAX is widely used in the kernel.
thanks,
-- Shuah
^ permalink raw reply
* Re: BUG: unable to handle kernel NULL pointer dereference in rds_bind
From: Cong Wang @ 2019-09-16 16:49 UTC (permalink / raw)
To: syzbot
Cc: Arvid Brodin, David Miller, LKML, linux-rdma,
Linux Kernel Network Developers, rds-devel, Santosh Shilimkar,
syzkaller-bugs
In-Reply-To: <000000000000bd36db0592ab9652@google.com>
On Mon, Sep 16, 2019 at 6:29 AM syzbot
<syzbot+fae39afd2101a17ec624@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: f4b752a6 mlx4: fix spelling mistake "veify" -> "verify"
> git tree: net
> console output: https://syzkaller.appspot.com/x/log.txt?x=16cbebe6600000
> kernel config: https://syzkaller.appspot.com/x/.config?x=b89bb446a3faaba4
> dashboard link: https://syzkaller.appspot.com/bug?extid=fae39afd2101a17ec624
> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10753bc1600000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=111dfc11600000
>
> The bug was bisected to:
>
> commit b9a1e627405d68d475a3c1f35e685ccfb5bbe668
> Author: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Thu Jul 4 00:21:13 2019 +0000
>
> hsr: implement dellink to clean up resources
The crash has nothing to do with this commit. It is probably caused
by the lack of ->laddr_check in rds_loop_transport.
^ permalink raw reply
* Re: [bpf-next,v4] samples: bpf: add max_pckt_size option at xdp_adjust_tail
From: Daniel T. Lee @ 2019-09-16 16:55 UTC (permalink / raw)
To: Yonghong Song
Cc: Daniel Borkmann, Alexei Starovoitov, netdev@vger.kernel.org,
bpf@vger.kernel.org
In-Reply-To: <d6b935ae-64a7-a375-9825-72eaebafd8a4@fb.com>
On Tue, Sep 17, 2019 at 1:07 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 9/15/19 1:47 PM, Daniel T. Lee wrote:
> > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> > to 600. To make this size flexible, a new map 'pcktsz' is added.
> >
> > By updating new packet size to this map from the userland,
> > xdp_adjust_tail_kern.o will use this value as a new max_pckt_size.
> >
> > If no '-P <MAX_PCKT_SIZE>' option is used, the size of maximum packet
> > will be 600 as a default.
> >
> > Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
> >
> > ---
> > Changes in v4:
> > - make pckt_size no less than ICMP_TOOBIG_SIZE
> > - Fix code style
> > Changes in v2:
> > - Change the helper to fetch map from 'bpf_map__next' to
> > 'bpf_object__find_map_fd_by_name'.
> >
> > samples/bpf/xdp_adjust_tail_kern.c | 23 +++++++++++++++++++----
> > samples/bpf/xdp_adjust_tail_user.c | 28 ++++++++++++++++++++++------
> > 2 files changed, 41 insertions(+), 10 deletions(-)
>
> LGTM except a minor comments below.
> Acked-by: Yonghong Song <yhs@fb.com>
>
> bpf-next is closed. Please resubmit the patch once it is opened
> in around 2 weeks.
>
> >
> > diff --git a/samples/bpf/xdp_adjust_tail_kern.c b/samples/bpf/xdp_adjust_tail_kern.c
> > index 411fdb21f8bc..8869bbb160d2 100644
> > --- a/samples/bpf/xdp_adjust_tail_kern.c
> > +++ b/samples/bpf/xdp_adjust_tail_kern.c
> > @@ -25,6 +25,13 @@
> > #define ICMP_TOOBIG_SIZE 98
> > #define ICMP_TOOBIG_PAYLOAD_SIZE 92
> >
> > +struct bpf_map_def SEC("maps") pcktsz = {
> > + .type = BPF_MAP_TYPE_ARRAY,
> > + .key_size = sizeof(__u32),
> > + .value_size = sizeof(__u32),
> > + .max_entries = 1,
> > +};
> > +
> > struct bpf_map_def SEC("maps") icmpcnt = {
> > .type = BPF_MAP_TYPE_ARRAY,
> > .key_size = sizeof(__u32),
> > @@ -64,7 +71,8 @@ static __always_inline void ipv4_csum(void *data_start, int data_size,
> > *csum = csum_fold_helper(*csum);
> > }
> >
> > -static __always_inline int send_icmp4_too_big(struct xdp_md *xdp)
> > +static __always_inline int send_icmp4_too_big(struct xdp_md *xdp,
> > + __u32 max_pckt_size)
> > {
> > int headroom = (int)sizeof(struct iphdr) + (int)sizeof(struct icmphdr);
> >
> > @@ -92,7 +100,7 @@ static __always_inline int send_icmp4_too_big(struct xdp_md *xdp)
> > orig_iph = data + off;
> > icmp_hdr->type = ICMP_DEST_UNREACH;
> > icmp_hdr->code = ICMP_FRAG_NEEDED;
> > - icmp_hdr->un.frag.mtu = htons(MAX_PCKT_SIZE-sizeof(struct ethhdr));
> > + icmp_hdr->un.frag.mtu = htons(max_pckt_size - sizeof(struct ethhdr));
> > icmp_hdr->checksum = 0;
> > ipv4_csum(icmp_hdr, ICMP_TOOBIG_PAYLOAD_SIZE, &csum);
> > icmp_hdr->checksum = csum;
> > @@ -118,14 +126,21 @@ static __always_inline int handle_ipv4(struct xdp_md *xdp)
> > {
> > void *data_end = (void *)(long)xdp->data_end;
> > void *data = (void *)(long)xdp->data;
> > + __u32 max_pckt_size = MAX_PCKT_SIZE;
> > int pckt_size = data_end - data;
> > + __u32 *pckt_sz;
> > + __u32 key = 0;
> > int offset;
> >
> > - if (pckt_size > MAX_PCKT_SIZE) {
> > + pckt_sz = bpf_map_lookup_elem(&pcktsz, &key);
> > + if (pckt_sz && *pckt_sz)
> > + max_pckt_size = *pckt_sz;
> > +
> > + if (pckt_size > max(max_pckt_size, ICMP_TOOBIG_SIZE)) {
> > offset = pckt_size - ICMP_TOOBIG_SIZE;
> > if (bpf_xdp_adjust_tail(xdp, 0 - offset))
> > return XDP_PASS;
> > - return send_icmp4_too_big(xdp);
> > + return send_icmp4_too_big(xdp, max_pckt_size);
> > }
> > return XDP_PASS;
> > }
> > diff --git a/samples/bpf/xdp_adjust_tail_user.c b/samples/bpf/xdp_adjust_tail_user.c
> > index a3596b617c4c..99e965c68054 100644
> > --- a/samples/bpf/xdp_adjust_tail_user.c
> > +++ b/samples/bpf/xdp_adjust_tail_user.c
> > @@ -23,6 +23,7 @@
> > #include "libbpf.h"
> >
> > #define STATS_INTERVAL_S 2U
> > +#define MAX_PCKT_SIZE 600
> >
> > static int ifindex = -1;
> > static __u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
> > @@ -72,6 +73,7 @@ static void usage(const char *cmd)
> > printf("Usage: %s [...]\n", cmd);
> > printf(" -i <ifname|ifindex> Interface\n");
> > printf(" -T <stop-after-X-seconds> Default: 0 (forever)\n");
> > + printf(" -P <MAX_PCKT_SIZE> Default: %u\n", MAX_PCKT_SIZE);
> > printf(" -S use skb-mode\n");
> > printf(" -N enforce native mode\n");
> > printf(" -F force loading prog\n");
> > @@ -85,13 +87,14 @@ int main(int argc, char **argv)
> > .prog_type = BPF_PROG_TYPE_XDP,
> > };
> > unsigned char opt_flags[256] = {};
> > - const char *optstr = "i:T:SNFh";
> > + const char *optstr = "i:T:P:SNFh";
> > struct bpf_prog_info info = {};
> > __u32 info_len = sizeof(info);
> > + __u32 max_pckt_size = 0;
> > + __u32 key = 0;
> > unsigned int kill_after_s = 0;
> > int i, prog_fd, map_fd, opt;
> > struct bpf_object *obj;
> > - struct bpf_map *map;
> > char filename[256];
> > int err;
> >
> > @@ -110,6 +113,9 @@ int main(int argc, char **argv)
> > case 'T':
> > kill_after_s = atoi(optarg);
> > break;
> > + case 'P':
> > + max_pckt_size = atoi(optarg);
> > + break;
> > case 'S':
> > xdp_flags |= XDP_FLAGS_SKB_MODE;
> > break;
> > @@ -150,12 +156,22 @@ int main(int argc, char **argv)
> > if (bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd))
> > return 1;
> >
> > - map = bpf_map__next(NULL, obj);
> > - if (!map) {
> > - printf("finding a map in obj file failed\n");
> > + /* update pcktsz map */
> > + if (max_pckt_size) {
> > + map_fd = bpf_object__find_map_fd_by_name(obj, "pcktsz");
> > + if (map_fd < 0) {
> > + printf("finding a pcktsz map in obj file failed\n");
> > + return 1;
> > + }
> > + bpf_map_update_elem(map_fd, &key, &max_pckt_size, BPF_ANY);
> > + }
> > +
> > + /* fetch icmpcnt map */
> > + map_fd = bpf_object__find_map_fd_by_name(obj, "icmpcnt");
> > + if (map_fd < 0) {
> > + printf("finding a icmpcnt map in obj file failed\n");
> > return 1;
> > }
> > - map_fd = bpf_map__fd(map);
> >
> > if (!prog_fd) {
> > printf("load_bpf_file: %s\n", strerror(errno));
>
> Could you move the 'if (!prog_fd) ...' right after 'bpf_prog_load_xattr'
> for readability reason?
>
> Could you also change the condition 'if (!prog_fd)' to 'if (prog_fd <
> 0)'? You need to mention this fix in your commit message as well.
Thanks for the review!
I'll resubmit the patch with this changes included when bpf-next opens.
And also the commit message as well.
Thanks,
Daniel
^ permalink raw reply
* Re: [PATCH iproute2] link_xfrm: don't forcce to set phydev
From: Matt Ellison @ 2019-09-16 17:29 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: stephen, netdev, dsahern, julien.floret
In-Reply-To: <20190916153627.19458-1-nicolas.dichtel@6wind.com>
Acked-by: Matt Ellison <matt@arroyo.io>
--
Please be advised that this email may contain confidential information.
If you are not the intended recipient, please notify us by email by
replying to the sender and delete this message. The sender disclaims that
the content of this email constitutes an offer to enter into, or the
acceptance of, any agreement; provided that the foregoing does not
invalidate the binding effect of any digital or other electronic
reproduction of a manual signature that is included in any attachment.
<https://twitter.com/arroyo_networks>
<https://www.linkedin.com/company/arroyo-networks>
<https://www.github.com/ArroyoNetworks>
^ permalink raw reply
* Re: [PATCH] dt-bindings: net: Correct the documentation of KSZ9021 skew values
From: James Byrne @ 2019-09-16 17:40 UTC (permalink / raw)
To: David Miller
Cc: robh+dt@kernel.org, mark.rutland@arm.com, netdev@vger.kernel.org,
devicetree@vger.kernel.org
In-Reply-To: <20190916.161455.1015414751228915954.davem@davemloft.net>
On 16/09/2019 15:14, David Miller wrote:
> From: James Byrne <james.byrne@origamienergy.com>
> Date: Fri, 13 Sep 2019 16:46:35 +0000
>
>> The documentation of skew values for the KSZ9021 PHY was misleading
>> because the driver implementation followed the erroneous information
>> given in the original KSZ9021 datasheet before it was corrected in
>> revision 1.2 (Feb 2014). It is probably too late to correct the driver
>> now because of the many existing device trees, so instead this just
>> corrects the documentation to explain that what you actually get is not
>> what you might think when looking at the device tree.
>>
>> Signed-off-by: James Byrne <james.byrne@origamienergy.com>
>
> What tree should this go into?
I believe this should go into the 'net' tree, but please let me know if
I have submitted this patch incorrectly in some way.
James
^ permalink raw reply
* Re: [PATCH v5 1/2] tcp: Add TCP_INFO counter for packets received out-of-order
From: Thomas Higdon @ 2019-09-16 17:42 UTC (permalink / raw)
To: Neal Cardwell
Cc: netdev@vger.kernel.org, Jonathan Lemon, Dave Jones, Eric Dumazet,
Dave Taht, Yuchung Cheng, Soheil Hassas Yeganeh
In-Reply-To: <CADVnQynfwJ8HWstz-HAa7AMOGRhDC7nqKwMCKpe2Fvm7kUQgkA@mail.gmail.com>
On Sat, Sep 14, 2019 at 11:43:25AM -0400, Neal Cardwell wrote:
> On Fri, Sep 13, 2019 at 7:23 PM Thomas Higdon <tph@fb.com> wrote:
> >
> > For receive-heavy cases on the server-side, we want to track the
> > connection quality for individual client IPs. This counter, similar to
> > the existing system-wide TCPOFOQueue counter in /proc/net/netstat,
> > tracks out-of-order packet reception. By providing this counter in
> > TCP_INFO, it will allow understanding to what degree receive-heavy
> > sockets are experiencing out-of-order delivery and packet drops
> > indicating congestion.
> >
> > Please note that this is similar to the counter in NetBSD TCP_INFO, and
> > has the same name.
> >
> > Also note that we avoid increasing the size of the tcp_sock struct by
> > taking advantage of a hole.
> >
> > Signed-off-by: Thomas Higdon <tph@fb.com>
> > ---
> > changes since v4:
> > - optimize placement of rcv_ooopack to avoid increasing tcp_sock struct
> > size
>
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
>
> Thanks, Thomas, for adding this!
>
> After this is merged, would you mind sending a patch to add support to
> the "ss" command line tool to print these 2 new fields?
>
> My favorite recent example of such a patch to ss is Eric's change:
> https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/misc/ss.c?id=5eead6270a19f00464052d4084f32182cfe027ff
Yes, and thank you for the help in getting this into a good state!
From looking at that "ss" patch, it seems like we would need to wait
until iproute2-next's include/uapi/linux/tcp.h has received a merge from
kernel net-next before we'd be able to apply a patch for "ss" that uses
the new fields.
In the meantime, as you've asked, I will go ahead and send a patch for
iproute2-next's "ss" with the assumption that these tcpinfo changes have
already been merged.
^ permalink raw reply
* Re: BUG: unable to handle kernel NULL pointer dereference in rds_bind
From: santosh.shilimkar @ 2019-09-16 17:57 UTC (permalink / raw)
To: Cong Wang, syzbot
Cc: Arvid Brodin, David Miller, LKML, linux-rdma,
Linux Kernel Network Developers, rds-devel, syzkaller-bugs
In-Reply-To: <CAM_iQpXdTNVywYm6+vmAKMsBRcC6ySOX9Rcg70xhgdjJgbDJkw@mail.gmail.com>
On 9/16/19 9:49 AM, Cong Wang wrote:
> On Mon, Sep 16, 2019 at 6:29 AM syzbot
> <syzbot+fae39afd2101a17ec624@syzkaller.appspotmail.com> wrote:
>>
>> Hello,
>>
>> syzbot found the following crash on:
>>
>> HEAD commit: f4b752a6 mlx4: fix spelling mistake "veify" -> "verify"
>> git tree: net
>> console output: https://syzkaller.appspot.com/x/log.txt?x=16cbebe6600000
>> kernel config: https://syzkaller.appspot.com/x/.config?x=b89bb446a3faaba4
>> dashboard link: https://syzkaller.appspot.com/bug?extid=fae39afd2101a17ec624
>> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10753bc1600000
>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=111dfc11600000
>>
>> The bug was bisected to:
>>
>> commit b9a1e627405d68d475a3c1f35e685ccfb5bbe668
>> Author: Cong Wang <xiyou.wangcong@gmail.com>
>> Date: Thu Jul 4 00:21:13 2019 +0000
>>
>> hsr: implement dellink to clean up resources
>
>
> The crash has nothing to do with this commit. It is probably caused
> by the lack of ->laddr_check in rds_loop_transport.
>
Will have a look.
regards,
Santosh
^ permalink raw reply
* Re: net: phy: micrel KSZ9031 ifdown ifup issue
From: Paul Thomas @ 2019-09-16 19:07 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Florian Fainelli, Heiner Kallweit, David S. Miller, netdev
In-Reply-To: <20190916151316.GA8144@lunn.ch>
On Mon, Sep 16, 2019 at 11:13 AM Andrew Lunn <andrew@lunn.ch> wrote:
>
> > When it is in the good state I see that reg 0x01 is 0x796d where bit
> > 1.2 reports 'Link is up' and bit 1.5 reports 'Auto-negotiation process
> > complete'. However, once I get to the bad state (it may take several
> > tries of ifdown, ifup to get there) then reg 0x01 is 0x7649 reporting
> > 'Link is down' and 'Auto-negotiation process not completed'. This can
> > be fixed by resetting the phy './phytool write eth0/3/0 0x9140'
> >
> > So, I guess that means the driver is doing what it is supposed to?
> > Could we add quirk or something to reset the phy again from the driver
> > if auto-negotiation doesn't complete with x seconds?
>
> Hi Paul
>
> Adding a timeout would make sense. But please try to hide all this
> inside the PHY driver. Since it is being polled, the read_status()
> should be called once per second, so you should be able to handle all
> this inside that driver callback.
Thanks Andrew,
It looks like there are more issues than just the auto-negotiation.
Even when the negotiated link comes back I never see any more rx
packets from the macb driver. I'll look into this more.
thanks,
Paul
^ permalink raw reply
* Re: [PATCH] net/ncsi: Disable global multicast filter
From: Vijay Khemka @ 2019-09-16 19:20 UTC (permalink / raw)
To: Samuel Mendoza-Jonas, David S. Miller, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: openbmc @ lists . ozlabs . org, joel@jms.id.au,
linux-aspeed@lists.ozlabs.org, Sai Dasari, Christian Svensson
In-Reply-To: <eb370d3280327b512828adc62b64656e65b22745.camel@mendozajonas.com>
On 9/15/19, 7:39 PM, "Samuel Mendoza-Jonas" <sam@mendozajonas.com> wrote:
On Thu, 2019-09-12 at 12:04 -0700, Vijay Khemka wrote:
> Disabling multicast filtering from NCSI if it is supported. As it
> should not filter any multicast packets. In current code, multicast
> filter is enabled and with an exception of optional field supported
> by device are disabled filtering.
>
> Mainly I see if goal is to disable filtering for IPV6 packets then
> let
> it disabled for every other types as well. As we are seeing issues
> with
> LLDP not working with this enabled filtering. And there are other
> issues
> with IPV6.
>
> By Disabling this multicast completely, it is working for both IPV6
> as
> well as LLDP.
>
> Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Hi Vijay,
There are definitely some current issues with multicast filtering and
IPv6 when behind NC-SI at the moment. It would be nice to make this
configurable instead of disabling the component wholesale but I don't
believe this actually *breaks* anyone's configuration. It would be nice
to see some Tested-By's from the OpenBMC people though.
I'll have a look at the multicast issues, CC'ing in Chris too who IIRC
was looking at similar issues for u-bmc in case he got further.
Sam,
The current multicast issues for IPV6 are vendor's issues. And if some is
not supporting IPV6 forwarding to management controller bit fields in
EGMF then we are filtering it and by disabling filtering it works for Mellanox
And Broadcom cards. I have tested it. That's why I have disabled it to start with
And it can be enabled from netlink utility if required.
Acked-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
> ---
> net/ncsi/internal.h | 7 +--
> net/ncsi/ncsi-manage.c | 98 +++++-----------------------------------
> --
> 2 files changed, 12 insertions(+), 93 deletions(-)
>
> diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h
> index 0b3f0673e1a2..ad3fd7f1da75 100644
> --- a/net/ncsi/internal.h
> +++ b/net/ncsi/internal.h
> @@ -264,9 +264,7 @@ enum {
> ncsi_dev_state_config_ev,
> ncsi_dev_state_config_sma,
> ncsi_dev_state_config_ebf,
> -#if IS_ENABLED(CONFIG_IPV6)
> - ncsi_dev_state_config_egmf,
> -#endif
> + ncsi_dev_state_config_dgmf,
> ncsi_dev_state_config_ecnt,
> ncsi_dev_state_config_ec,
> ncsi_dev_state_config_ae,
> @@ -295,9 +293,6 @@ struct ncsi_dev_priv {
> #define NCSI_DEV_RESET 8 /* Reset state of
> NC */
> unsigned int gma_flag; /* OEM GMA
> flag */
> spinlock_t lock; /* Protect the NCSI
> device */
> -#if IS_ENABLED(CONFIG_IPV6)
> - unsigned int inet6_addr_num; /* Number of IPv6
> addresses */
> -#endif
> unsigned int package_probe_id;/* Current ID during
> probe */
> unsigned int package_num; /* Number of
> packages */
> struct list_head packages; /* List of
> packages */
> diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
> index 755aab66dcab..bce8b443289d 100644
> --- a/net/ncsi/ncsi-manage.c
> +++ b/net/ncsi/ncsi-manage.c
> @@ -14,7 +14,6 @@
> #include <net/sock.h>
> #include <net/addrconf.h>
> #include <net/ipv6.h>
> -#include <net/if_inet6.h>
> #include <net/genetlink.h>
>
> #include "internal.h"
> @@ -978,9 +977,7 @@ static void ncsi_configure_channel(struct
> ncsi_dev_priv *ndp)
> case ncsi_dev_state_config_ev:
> case ncsi_dev_state_config_sma:
> case ncsi_dev_state_config_ebf:
> -#if IS_ENABLED(CONFIG_IPV6)
> - case ncsi_dev_state_config_egmf:
> -#endif
> + case ncsi_dev_state_config_dgmf:
> case ncsi_dev_state_config_ecnt:
> case ncsi_dev_state_config_ec:
> case ncsi_dev_state_config_ae:
> @@ -1033,23 +1030,23 @@ static void ncsi_configure_channel(struct
> ncsi_dev_priv *ndp)
> } else if (nd->state == ncsi_dev_state_config_ebf) {
> nca.type = NCSI_PKT_CMD_EBF;
> nca.dwords[0] = nc->caps[NCSI_CAP_BC].cap;
> - if (ncsi_channel_is_tx(ndp, nc))
> + /* if multicast global filtering is supported
> then
> + * disable it so that all multicast packet will
> be
> + * forwarded to management controller
> + */
> + if (nc->caps[NCSI_CAP_GENERIC].cap &
> + NCSI_CAP_GENERIC_MC)
> + nd->state = ncsi_dev_state_config_dgmf;
> + else if (ncsi_channel_is_tx(ndp, nc))
> nd->state = ncsi_dev_state_config_ecnt;
> else
> nd->state = ncsi_dev_state_config_ec;
> -#if IS_ENABLED(CONFIG_IPV6)
> - if (ndp->inet6_addr_num > 0 &&
> - (nc->caps[NCSI_CAP_GENERIC].cap &
> - NCSI_CAP_GENERIC_MC))
> - nd->state = ncsi_dev_state_config_egmf;
> - } else if (nd->state == ncsi_dev_state_config_egmf) {
> - nca.type = NCSI_PKT_CMD_EGMF;
> - nca.dwords[0] = nc->caps[NCSI_CAP_MC].cap;
> + } else if (nd->state == ncsi_dev_state_config_dgmf) {
> + nca.type = NCSI_PKT_CMD_DGMF;
> if (ncsi_channel_is_tx(ndp, nc))
> nd->state = ncsi_dev_state_config_ecnt;
> else
> nd->state = ncsi_dev_state_config_ec;
> -#endif /* CONFIG_IPV6 */
> } else if (nd->state == ncsi_dev_state_config_ecnt) {
> if (np->preferred_channel &&
> nc != np->preferred_channel)
> @@ -1483,70 +1480,6 @@ int ncsi_process_next_channel(struct
> ncsi_dev_priv *ndp)
> return -ENODEV;
> }
>
> -#if IS_ENABLED(CONFIG_IPV6)
> -static int ncsi_inet6addr_event(struct notifier_block *this,
> - unsigned long event, void *data)
> -{
> - struct inet6_ifaddr *ifa = data;
> - struct net_device *dev = ifa->idev->dev;
> - struct ncsi_dev *nd = ncsi_find_dev(dev);
> - struct ncsi_dev_priv *ndp = nd ? TO_NCSI_DEV_PRIV(nd) : NULL;
> - struct ncsi_package *np;
> - struct ncsi_channel *nc;
> - struct ncsi_cmd_arg nca;
> - bool action;
> - int ret;
> -
> - if (!ndp || (ipv6_addr_type(&ifa->addr) &
> - (IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK)))
> - return NOTIFY_OK;
> -
> - switch (event) {
> - case NETDEV_UP:
> - action = (++ndp->inet6_addr_num) == 1;
> - nca.type = NCSI_PKT_CMD_EGMF;
> - break;
> - case NETDEV_DOWN:
> - action = (--ndp->inet6_addr_num == 0);
> - nca.type = NCSI_PKT_CMD_DGMF;
> - break;
> - default:
> - return NOTIFY_OK;
> - }
> -
> - /* We might not have active channel or packages. The IPv6
> - * required multicast will be enabled when active channel
> - * or packages are chosen.
> - */
> - np = ndp->active_package;
> - nc = ndp->active_channel;
> - if (!action || !np || !nc)
> - return NOTIFY_OK;
> -
> - /* We needn't enable or disable it if the function isn't
> supported */
> - if (!(nc->caps[NCSI_CAP_GENERIC].cap & NCSI_CAP_GENERIC_MC))
> - return NOTIFY_OK;
> -
> - nca.ndp = ndp;
> - nca.req_flags = 0;
> - nca.package = np->id;
> - nca.channel = nc->id;
> - nca.dwords[0] = nc->caps[NCSI_CAP_MC].cap;
> - ret = ncsi_xmit_cmd(&nca);
> - if (ret) {
> - netdev_warn(dev, "Fail to %s global multicast filter
> (%d)\n",
> - (event == NETDEV_UP) ? "enable" :
> "disable", ret);
> - return NOTIFY_DONE;
> - }
> -
> - return NOTIFY_OK;
> -}
> -
> -static struct notifier_block ncsi_inet6addr_notifier = {
> - .notifier_call = ncsi_inet6addr_event,
> -};
> -#endif /* CONFIG_IPV6 */
> -
> static int ncsi_kick_channels(struct ncsi_dev_priv *ndp)
> {
> struct ncsi_dev *nd = &ndp->ndev;
> @@ -1725,11 +1658,6 @@ struct ncsi_dev *ncsi_register_dev(struct
> net_device *dev,
> }
>
> spin_lock_irqsave(&ncsi_dev_lock, flags);
> -#if IS_ENABLED(CONFIG_IPV6)
> - ndp->inet6_addr_num = 0;
> - if (list_empty(&ncsi_dev_list))
> - register_inet6addr_notifier(&ncsi_inet6addr_notifier);
> -#endif
> list_add_tail_rcu(&ndp->node, &ncsi_dev_list);
> spin_unlock_irqrestore(&ncsi_dev_lock, flags);
>
> @@ -1896,10 +1824,6 @@ void ncsi_unregister_dev(struct ncsi_dev *nd)
>
> spin_lock_irqsave(&ncsi_dev_lock, flags);
> list_del_rcu(&ndp->node);
> -#if IS_ENABLED(CONFIG_IPV6)
> - if (list_empty(&ncsi_dev_list))
> - unregister_inet6addr_notifier(&ncsi_inet6addr_notifier)
> ;
> -#endif
> spin_unlock_irqrestore(&ncsi_dev_lock, flags);
>
> ncsi_unregister_netlink(nd->dev);
^ permalink raw reply
* Re: [PATCH v4 net-next 0/6] tc-taprio offload for SJA1105 DSA
From: David Miller @ 2019-09-16 19:36 UTC (permalink / raw)
To: olteanv
Cc: f.fainelli, vivien.didelot, andrew, vinicius.gomes, vedang.patel,
richardcochran, weifeng.voon, jiri, m-karicheri2, jose.abreu,
ilias.apalodimas, jhs, xiyou.wangcong, kurt.kanzenbach,
joergen.andreasen, netdev
In-Reply-To: <20190915020003.27926-1-olteanv@gmail.com>
From: Vladimir Oltean <olteanv@gmail.com>
Date: Sun, 15 Sep 2019 04:59:57 +0300
> This is the third attempt to submit the tc-taprio offload model for
> inclusion in the networking tree. The sja1105 switch driver will provide
> the first implementation of the offload. Only the bare minimum is added:
>
> - The offload model and a DSA pass-through
> - The hardware implementation
> - The interaction with the netdev queues in the tagger code
> - Documentation
>
> What has been removed from previous attempts is support for
> PTP-as-clocksource in sja1105, as well as configuring the traffic class
> for management traffic. These will be added as soon as the offload
> model is settled.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/2] drop_monitor: Better sanitize notified packets
From: David Miller @ 2019-09-16 19:40 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, nhorman, jakub.kicinski, mlxsw, idosch
In-Reply-To: <20190915064636.6884-1-idosch@idosch.org>
From: Ido Schimmel <idosch@idosch.org>
Date: Sun, 15 Sep 2019 09:46:34 +0300
> From: Ido Schimmel <idosch@mellanox.com>
>
> When working in 'packet' mode, drop monitor generates a notification
> with a potentially truncated payload of the dropped packet. The payload
> is copied from the MAC header, but I forgot to check that the MAC header
> was set, so do it now.
>
> Patch #1 sets the offsets to the various protocol layers in netdevsim,
> so that it will continue to work after the MAC header check is added to
> drop monitor in patch #2.
Series applied.
^ permalink raw reply
* Re: [PATCH V1 net] net: ena: don't wake up tx queue when down
From: David Miller @ 2019-09-16 19:40 UTC (permalink / raw)
To: sameehj
Cc: netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea, gtzalik,
netanel, alisaidi, benh, akiyano
In-Reply-To: <20190915142944.7572-1-sameehj@amazon.com>
From: <sameehj@amazon.com>
Date: Sun, 15 Sep 2019 17:29:44 +0300
> From: Sameeh Jubran <sameehj@amazon.com>
>
> There is a race condition that can occur when calling ena_down().
> The ena_clean_tx_irq() - which is a part of the napi handler -
> function might wake up the tx queue when the queue is supposed
> to be down (during recovery or changing the size of the queues
> for example) This causes the ena_start_xmit() function to trigger
> and possibly try to access the destroyed queues.
>
> The race is illustrated below:
>
> Flow A: Flow B(napi handler)
> ena_down()
> netif_carrier_off()
> netif_tx_disable()
> ena_clean_tx_irq()
> netif_tx_wake_queue()
> ena_napi_disable_all()
> ena_destroy_all_io_queues()
>
> After these flows the tx queue is active and ena_start_xmit() accesses
> the destroyed queue which leads to a kernel panic.
>
> fixes: 1738cd3ed342 (net: ena: Add a driver for Amazon Elastic Network Adapters (ENA))
>
> Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Applied.
^ permalink raw reply
* Re: [PATCH V1 net-next 2/5] net: ena: multiple queue creation related cleanups
From: David Miller @ 2019-09-16 19:44 UTC (permalink / raw)
To: sameehj
Cc: netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea, gtzalik,
netanel, alisaidi, benh, akiyano
In-Reply-To: <20190915152722.8240-3-sameehj@amazon.com>
From: <sameehj@amazon.com>
Date: Sun, 15 Sep 2019 18:27:19 +0300
> @@ -1885,6 +1885,13 @@ static int ena_up(struct ena_adapter *adapter)
> if (rc)
> goto err_req_irq;
>
> + netif_info(adapter, ifup, adapter->netdev, "creating %d io queues. rx queue size: %d tx queue size. %d LLQ is %s\n",
> + adapter->num_io_queues,
> + adapter->requested_rx_ring_size,
> + adapter->requested_tx_ring_size,
> + (adapter->ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) ?
> + "ENABLED" : "DISABLED");
Please don't clog up the kernel log with stuff like this.
Maybe netif_debug() at best, but I'd rather you remove this entirely. It's so
easy to make a device go up and down repeatedly multiple times in one second.
^ permalink raw reply
* Re: [PATCH net-next] s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-09-16 19:45 UTC (permalink / raw)
To: jwi; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun, elfring
In-Reply-To: <20190915172105.42024-1-jwi@linux.ibm.com>
From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Sun, 15 Sep 2019 19:21:05 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1] xen-netfront: do not assume sk_buff_head list is empty in error handling
From: David Miller @ 2019-09-16 19:47 UTC (permalink / raw)
To: dongli.zhang
Cc: xen-devel, netdev, boris.ostrovsky, jgross, sstabellini,
linux-kernel
In-Reply-To: <1568605619-22219-1-git-send-email-dongli.zhang@oracle.com>
From: Dongli Zhang <dongli.zhang@oracle.com>
Date: Mon, 16 Sep 2019 11:46:59 +0800
> When skb_shinfo(skb) is not able to cache extra fragment (that is,
> skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS), xennet_fill_frags() assumes
> the sk_buff_head list is already empty. As a result, cons is increased only
> by 1 and returns to error handling path in xennet_poll().
>
> However, if the sk_buff_head list is not empty, queue->rx.rsp_cons may be
> set incorrectly. That is, queue->rx.rsp_cons would point to the rx ring
> buffer entries whose queue->rx_skbs[i] and queue->grant_rx_ref[i] are
> already cleared to NULL. This leads to NULL pointer access in the next
> iteration to process rx ring buffer entries.
>
> Below is how xennet_poll() does error handling. All remaining entries in
> tmpq are accounted to queue->rx.rsp_cons without assuming how many
> outstanding skbs are remained in the list.
>
> 985 static int xennet_poll(struct napi_struct *napi, int budget)
> ... ...
> 1032 if (unlikely(xennet_set_skb_gso(skb, gso))) {
> 1033 __skb_queue_head(&tmpq, skb);
> 1034 queue->rx.rsp_cons += skb_queue_len(&tmpq);
> 1035 goto err;
> 1036 }
>
> It is better to always have the error handling in the same way.
>
> Fixes: ad4f15dc2c70 ("xen/netfront: don't bug in case of too many frags")
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH v4 net-next 0/6] tc-taprio offload for SJA1105 DSA
From: Vladimir Oltean @ 2019-09-16 19:52 UTC (permalink / raw)
To: David Miller
Cc: Florian Fainelli, Vivien Didelot, Andrew Lunn,
Vinicius Costa Gomes, Patel, Vedang, Richard Cochran,
Voon, Weifeng, jiri, m-karicheri2, jose.abreu, Ilias Apalodimas,
Jamal Hadi Salim, Cong Wang, Kurt Kanzenbach, Joergen Andreasen,
netdev
In-Reply-To: <20190916.213627.1150593408219168339.davem@davemloft.net>
On Mon, 16 Sep 2019 at 22:36, David Miller <davem@davemloft.net> wrote:
>
> From: Vladimir Oltean <olteanv@gmail.com>
> Date: Sun, 15 Sep 2019 04:59:57 +0300
>
> > This is the third attempt to submit the tc-taprio offload model for
> > inclusion in the networking tree. The sja1105 switch driver will provide
> > the first implementation of the offload. Only the bare minimum is added:
> >
> > - The offload model and a DSA pass-through
> > - The hardware implementation
> > - The interaction with the netdev queues in the tagger code
> > - Documentation
> >
> > What has been removed from previous attempts is support for
> > PTP-as-clocksource in sja1105, as well as configuring the traffic class
> > for management traffic. These will be added as soon as the offload
> > model is settled.
>
> Series applied, thanks.
Thanks a lot, that's what I call cutting it close!
-Vladimir
^ permalink raw reply
* Re: [PATCH v5 0/2] ethtool: implement Energy Detect Powerdown support via phy-tunable
From: David Miller @ 2019-09-16 20:03 UTC (permalink / raw)
To: alexandru.ardelean
Cc: netdev, devicetree, linux-kernel, robh+dt, mark.rutland,
f.fainelli, hkallweit1, andrew, mkubecek
In-Reply-To: <20190916073526.24711-1-alexandru.ardelean@analog.com>
From: Alexandru Ardelean <alexandru.ardelean@analog.com>
Date: Mon, 16 Sep 2019 10:35:24 +0300
> This changeset proposes a new control for PHY tunable to control Energy
> Detect Power Down.
>
> The `phy_tunable_id` has been named `ETHTOOL_PHY_EDPD` since it looks like
> this feature is common across other PHYs (like EEE), and defining
> `ETHTOOL_PHY_ENERGY_DETECT_POWER_DOWN` seems too long.
>
> The way EDPD works, is that the RX block is put to a lower power mode,
> except for link-pulse detection circuits. The TX block is also put to low
> power mode, but the PHY wakes-up periodically to send link pulses, to avoid
> lock-ups in case the other side is also in EDPD mode.
>
> Currently, there are 2 PHY drivers that look like they could use this new
> PHY tunable feature: the `adin` && `micrel` PHYs.
>
> This series updates only the `adin` PHY driver to support this new feature,
> as this chip has been tested. A change for `micrel` can be proposed after a
> discussion of the PHY-tunable API is resolved.
Series applied.
^ permalink raw reply
* Re: [PATCH V2 net-next 00/11] net: ena: implement adaptive interrupt moderation using dim
From: David Miller @ 2019-09-16 20:06 UTC (permalink / raw)
To: akiyano
Cc: netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea, gtzalik,
netanel, alisaidi, benh, sameehj, ndagan
In-Reply-To: <1568633496-4143-1-git-send-email-akiyano@amazon.com>
From: <akiyano@amazon.com>
Date: Mon, 16 Sep 2019 14:31:25 +0300
> From: Arthur Kiyanovski <akiyano@amazon.com>
>
> In this patchset we replace our adaptive interrupt moderation
> implementation with the dim library implementation.
> The dim library showed great improvement in throughput, latency
> and CPU usage in different scenarios on ARM CPUs.
> This patchset also includes a few bug fixes to the parts of the
> old implementation of adaptive interrupt moderation that were left.
>
> Changes from V1 patchset:
> Removed stray empty lines from patches 01/11, 09/11.
Series applied.
^ permalink raw reply
* Re: [PATCH net-next v3 0/3] mlxsw: spectrum_buffers: Add the ability to query the CPU port's shared buffer
From: David Miller @ 2019-09-16 20:08 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, shalomt, mlxsw, idosch
In-Reply-To: <20190916150422.28947-1-idosch@idosch.org>
From: Ido Schimmel <idosch@idosch.org>
Date: Mon, 16 Sep 2019 18:04:19 +0300
> From: Ido Schimmel <idosch@mellanox.com>
>
> Shalom says:
>
> While debugging packet loss towards the CPU, it is useful to be able to
> query the CPU port's shared buffer quotas and occupancy.
>
> Patch #1 prevents changing the CPU port's threshold and binding.
>
> Patch #2 registers the CPU port with devlink.
>
> Patch #3 adds the ability to query the CPU port's shared buffer quotas and
> occupancy.
...
Series applied.
^ permalink raw reply
* Re: [PATCH v3 bpf-next 01/14] samples: bpf: makefile: fix HDR_PROBE "echo"
From: Andrii Nakryiko @ 2019-09-16 20:13 UTC (permalink / raw)
To: Ivan Khoronzhuk
Cc: Alexei Starovoitov, Daniel Borkmann, Yonghong Song,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
john fastabend, open list, Networking, bpf, clang-built-linux,
sergei.shtylyov
In-Reply-To: <20190916105433.11404-2-ivan.khoronzhuk@linaro.org>
On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk
<ivan.khoronzhuk@linaro.org> wrote:
>
> echo should be replaced with echo -e to handle '\n' correctly, but
> instead, replace it with printf as some systems can't handle echo -e.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
> samples/bpf/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 1d9be26b4edd..f50ca852c2a8 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -201,7 +201,7 @@ endif
>
> # Don't evaluate probes and warnings if we need to run make recursively
> ifneq ($(src),)
> -HDR_PROBE := $(shell echo "\#include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \
> +HDR_PROBE := $(shell printf "\#include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \
printf change is fine, but I'm confused about \# at the beginning of
the string. Not sure what was the intent, but it seems like it should
work with just #include at the beginning.
> $(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \
> echo okay)
>
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v3 bpf-next 02/14] samples: bpf: makefile: fix cookie_uid_helper_example obj build
From: Andrii Nakryiko @ 2019-09-16 20:18 UTC (permalink / raw)
To: Ivan Khoronzhuk
Cc: Alexei Starovoitov, Daniel Borkmann, Yonghong Song,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
john fastabend, open list, Networking, bpf, clang-built-linux,
sergei.shtylyov
In-Reply-To: <20190916105433.11404-3-ivan.khoronzhuk@linaro.org>
On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk
<ivan.khoronzhuk@linaro.org> wrote:
>
> Don't list userspace "cookie_uid_helper_example" object in list for
> bpf objects.
>
> 'always' target is used for listing bpf programs, but
> 'cookie_uid_helper_example.o' is a user space ELF file, and covered
> by rule `per_socket_stats_example`, so shouldn't be in 'always'.
> Let us remove `always += cookie_uid_helper_example.o`, which avoids
> breaking cross compilation due to mismatched includes.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
Acked-by: Andrii Nakryiko <andriin@fb.com>
> samples/bpf/Makefile | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index f50ca852c2a8..43dee90dffa4 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -145,7 +145,6 @@ always += sampleip_kern.o
> always += lwt_len_hist_kern.o
> always += xdp_tx_iptunnel_kern.o
> always += test_map_in_map_kern.o
> -always += cookie_uid_helper_example.o
> always += tcp_synrto_kern.o
> always += tcp_rwnd_kern.o
> always += tcp_bufs_kern.o
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v3 bpf-next 03/14] samples: bpf: makefile: use --target from cross-compile
From: Andrii Nakryiko @ 2019-09-16 20:25 UTC (permalink / raw)
To: Ivan Khoronzhuk
Cc: Alexei Starovoitov, Daniel Borkmann, Yonghong Song,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
john fastabend, open list, Networking, bpf, clang-built-linux,
sergei.shtylyov
In-Reply-To: <20190916105433.11404-4-ivan.khoronzhuk@linaro.org>
On Mon, Sep 16, 2019 at 4:01 AM Ivan Khoronzhuk
<ivan.khoronzhuk@linaro.org> wrote:
>
> For cross compiling the target triple can be inherited from
> cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
> So copy-paste this decision from kernel Makefile.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
Acked-by: Andrii Nakryiko <andriin@fb.com>
> samples/bpf/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 43dee90dffa4..b59e77e2250e 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -195,7 +195,7 @@ BTF_PAHOLE ?= pahole
> # Detect that we're cross compiling and use the cross compiler
> ifdef CROSS_COMPILE
> HOSTCC = $(CROSS_COMPILE)gcc
> -CLANG_ARCH_ARGS = -target $(ARCH)
> +CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%))
> endif
>
> # Don't evaluate probes and warnings if we need to run make recursively
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v3 bpf-next 04/14] samples: bpf: use own EXTRA_CFLAGS for clang commands
From: Andrii Nakryiko @ 2019-09-16 20:35 UTC (permalink / raw)
To: Ivan Khoronzhuk
Cc: Alexei Starovoitov, Daniel Borkmann, Yonghong Song,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
john fastabend, open list, Networking, bpf, clang-built-linux,
sergei.shtylyov
In-Reply-To: <20190916105433.11404-5-ivan.khoronzhuk@linaro.org>
On Mon, Sep 16, 2019 at 4:01 AM Ivan Khoronzhuk
<ivan.khoronzhuk@linaro.org> wrote:
>
> It can overlap with CFLAGS used for libraries built with gcc if
> not now then in next patches. Correct it here for simplicity.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
With GCC BPF front-end recently added, we should probably generalize
this to something like BPF_EXTRA_CFLAGS or something like that,
eventually. But for now:
Acked-by: Andrii Nakryiko <andriin@fb.com>
> samples/bpf/Makefile | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index b59e77e2250e..8ecc5d0c2d5b 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -218,10 +218,10 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
> /bin/rm -f ./llvm_btf_verify.o)
>
> ifneq ($(BTF_LLVM_PROBE),)
> - EXTRA_CFLAGS += -g
> + CLANG_EXTRA_CFLAGS += -g
> else
> ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),)
> - EXTRA_CFLAGS += -g
> + CLANG_EXTRA_CFLAGS += -g
> LLC_FLAGS += -mattr=dwarfris
> DWARF2BTF = y
> endif
> @@ -280,8 +280,8 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h
> # useless for BPF samples.
> $(obj)/%.o: $(src)/%.c
> @echo " CLANG-bpf " $@
> - $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
> - -I$(srctree)/tools/testing/selftests/bpf/ \
> + $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(CLANG_EXTRA_CFLAGS) \
> + -I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \
> -D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
> -D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
> -Wno-gnu-variable-sized-type-not-at-end \
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v3 bpf-next 05/14] samples: bpf: makefile: use __LINUX_ARM_ARCH__ selector for arm
From: Andrii Nakryiko @ 2019-09-16 20:44 UTC (permalink / raw)
To: Ivan Khoronzhuk
Cc: Alexei Starovoitov, Daniel Borkmann, Yonghong Song,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
john fastabend, open list, Networking, bpf, clang-built-linux,
sergei.shtylyov
In-Reply-To: <20190916105433.11404-6-ivan.khoronzhuk@linaro.org>
On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk
<ivan.khoronzhuk@linaro.org> wrote:
>
> For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction
> set selector and is absolutely required while parsing some parts of
> headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's
> retrieve it from and add to programs cflags. In another case errors
> like "SMP is not supported" for armv7 and bunch of other errors are
> issued resulting to incorrect final object.
> ---
> samples/bpf/Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 8ecc5d0c2d5b..d3c8db3df560 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -185,6 +185,16 @@ HOSTLDLIBS_map_perf_test += -lrt
> HOSTLDLIBS_test_overhead += -lrt
> HOSTLDLIBS_xdpsock += -pthread
>
> +ifeq ($(ARCH), arm)
> +# Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
> +# headers when arm instruction set identification is requested.
> +ARM_ARCH_SELECTOR = $(shell echo "$(KBUILD_CFLAGS) " | \
> + sed 's/[[:blank:]]/\n/g' | sed '/^-D__LINUX_ARM_ARCH__/!d')
Does the following work exactly like that without shelling out (and
being arguably simpler)?
ARM_ARCH_SELECTOR = $(filter -D__LINUX_ARM_ARCH__%, $(KBUILD_CFLAGS))
> +
> +CLANG_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR)
> +KBUILD_HOSTCFLAGS := $(ARM_ARCH_SELECTOR)
Isn't this clearing out previous value of KBUILD_HOSTCFLAGS? Is that
intentional, or it was supposed to be += here?
> +endif
> +
> # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline:
> # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
> LLC ?= llc
> --
> 2.17.1
>
^ 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