[PATCH net-next] rtnelink: Move link dump consistency check out of the loop

2017-08-09 Thread Jakub Sitnicki
he check for net->dev_base_seq change (since the last time we were called) out of the loop. This way we avoid giving a wrong impression that there are concurrent updates to the link list going on while we're iterating over them. Signed-off-by: Jakub Sitnicki --- net/core/rtnetlink.c | 6 ++ 1 fi

Re: [PATCH net] xfrm: Clear sk_dst_cache when applying per-socket policy.

2017-08-16 Thread Jakub Sitnicki
00bc0ef5880d ("ipv6: Skip XFRM lookup if dst_entry in socket cache is > valid") > Tested: https://android-review.googlesource.com/418659 > Signed-off-by: Jonathan Basseri > --- Thank you for the fix. Acked-by: Jakub Sitnicki

Re: [PATCH net] xfrm: Clear sk_dst_cache when applying per-socket policy.

2017-08-16 Thread Jakub Sitnicki
On Wed, 16 Aug 2017 03:43:54 -0700 Eric Dumazet wrote: > On Wed, 2017-08-16 at 11:03 +0200, Jakub Sitnicki wrote: > > On Tue, 15 Aug 2017 15:25:10 -0700 > > Jonathan Basseri wrote: > > > > > If an IPv6 socket has a valid dst cache, then xfrm_lookup_route will g

[PATCH net-next] ipv6: Add sysctl for per namespace flow label reflection

2017-08-23 Thread Jakub Sitnicki
ned-off-by: Jakub Sitnicki --- Documentation/networking/ip-sysctl.txt | 9 + include/net/netns/ipv6.h | 1 + net/ipv6/af_inet6.c| 1 + net/ipv6/sysctl_net_ipv6.c | 8 4 files changed, 19 insertions(+) diff --git a/Documentation/net

[PATCH net-next v3 1/4] net: Extend struct flowi6 with multipath hash

2017-08-23 Thread Jakub Sitnicki
the offending IPv6 datagram that triggered the error, rather than the flow of the ICMP error itself. Signed-off-by: Jakub Sitnicki --- include/net/flow.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/flow.h b/include/net/flow.h index f3dc61b..eb60cee3 100644 --- a/include/net

[PATCH net-next v3 2/4] ipv6: Compute multipath hash for ICMP errors from offending packet

2017-08-23 Thread Jakub Sitnicki
ath_hash -> rt6_multipath_hash Signed-off-by: Jakub Sitnicki --- include/net/ip6_route.h | 1 + net/ipv6/icmp.c | 1 + net/ipv6/route.c| 50 + 3 files changed, 52 insertions(+) diff --git a/include/net/ip6_route.h b/include/net/

[PATCH net-next v3 0/4] Route ICMPv6 errors with the flow when ECMP in use

2017-08-23 Thread Jakub Sitnicki
com/jsitnicki/tools/tree/master/net/tests/ecmp/pmtud [4] https://github.com/jsitnicki/tools/tree/master/net/tests/ecmp/load-balance Jakub Sitnicki (4): net: Extend struct flowi6 with multipath hash ipv6: Compute multipath hash for ICMP errors from offending packet ipv6: Fold rt6_info_ha

[PATCH net-next v3 3/4] ipv6: Fold rt6_info_hash_nhsfn() into its only caller

2017-08-23 Thread Jakub Sitnicki
Commit 644d0e656958 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes sense to keep it around. Also remove the accompanying comment that has become outdated. Signed-off-by: Jakub Sitnicki --- net/ipv6/ro

[PATCH net-next v3 4/4] ipv6: Use multipath hash from flow info if available

2017-08-23 Thread Jakub Sitnicki
the usual case when we aren't dealing with an ICMP error, so that there is one central place where multipath hash is computed. Signed-off-by: Jakub Sitnicki --- net/ipv6/route.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c

[PATCH net-next] ipv6: Avoid going through ->sk_net to access the netns

2017-07-31 Thread Jakub Sitnicki
There is no need to go through sk->sk_net to access the net namespace and its sysctl variables because we allocate the sock and initialize sk_net just a few lines earlier in the same routine. Signed-off-by: Jakub Sitnicki --- net/ipv6/af_inet6.c | 2 +- 1 file changed, 1 insertion(+)

Re: [PATCH net] geneve: Fix function matching VNI and tunnel ID on big-endian

2017-10-19 Thread Jakub Sitnicki
from the three MSBs. Fix it by using > the same check implemented on LE, which maps VNI from the three > LSBs of tunnel ID. > > Fixes: 2e0b26e10352 ("geneve: Optimize geneve device lookup.") > Signed-off-by: Stefano Brivio Thanks, Stefano. Reviewed-by: Jakub Sitnicki

[PATCH net] ipv6: Count in extension headers in skb->network_header

2016-04-05 Thread Jakub Sitnicki
r+0x2b/0x100 [] neigh_resolve_output+0x210/0x310 [] ip6_finish_output2+0x4a7/0x7c0 [] ip6_output+0x16a/0x280 [] ip6_local_out+0xb1/0xf0 [] ip6_send_skb+0x45/0xd0 [] udp_v6_send_skb+0x246/0x5d0 [] udpv6_sendmsg+0xa6e/0x1090 [...] Reported-by: Ji Jianwen Signed-off-by: Jakub Sitnicki Acked-by: Hannes F

Re: [PATCH v2 2/2] sctp: delay calls to sk_data_ready() as much as possible

2016-04-07 Thread Jakub Sitnicki
On Wed, Apr 06, 2016 at 07:53 PM CEST, Marcelo Ricardo Leitner wrote: > Currently, the processing of multiple chunks in a single SCTP packet > leads to multiple calls to sk_data_ready, causing multiple wake up > signals which are costly and doesn't make it wake up any faster. > > With this patch

[PATCH net] ipv6: Skip XFRM lookup if dst_entry in socket cache is valid

2016-06-08 Thread Jakub Sitnicki
rings us on par with UDPv4. The fix also benefits connected PINGv6 sockets, another user of ip6_sk_dst_lookup_flow(), who also suffer messages being transformed twice. Joint work with Hannes Frederic Sowa. Reported-by: Jan Tluka Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa ---

Re: [PATCHv3 net-next 4/6] sctp: add the sctp_diag.c file

2016-04-14 Thread Jakub Sitnicki
Hi Xin, On Thu, Apr 14, 2016 at 09:35 AM CEST, Xin Long wrote: > This one will implement all the interface of inet_diag, inet_diag_handler. > which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info. > > It will work as a module, and register inet_diag_handler when loading. > > v2

Re: [PATCHv3 net-next] net: use jiffies_to_msecs to replace EXPIRES_IN_MS in inet/sctp_diag

2016-04-19 Thread Jakub Sitnicki
On Tue, Apr 19, 2016 at 09:10 AM CEST, Xin Long wrote: > EXPIRES_IN_MS macro comes from net/ipv4/inet_diag.c and dates > back to before jiffies_to_msecs() has been introduced. > > Now we can remove it and use jiffies_to_msecs(). > > Signed-off-by: Xin Long > --- Acked-by: Jakub Sitnicki

Re: [iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-22 Thread Jakub Sitnicki
Hi Phil, On Tue, Jun 21, 2016 at 06:18 PM CEST, Phil Sutter wrote: > This big patch was compiled by vimgrepping for memset calls and changing > to C99 initializer if applicable. One notable exception is the > initialization of union bpf_attr in tc/tc_bpf.c: changing it would break > for older gcc

Re: [iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-22 Thread Jakub Sitnicki
On Wed, Jun 22, 2016 at 11:29 AM CEST, Phil Sutter wrote: > On Wed, Jun 22, 2016 at 11:12:14AM +0200, Jakub Sitnicki wrote: >> On Tue, Jun 21, 2016 at 06:18 PM CEST, Phil Sutter wrote: >> > This big patch was compiled by vimgrepping for memset calls and changing >>

Re: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-22 Thread Jakub Sitnicki
On Tue, Jun 21, 2016 at 06:18 PM CEST, Phil Sutter wrote: > By combining the attribute extraction and check for existence, the > additional indentation level in the 'else' clause can be avoided. > > In addition to that, common actions for 'daddr' are combined since the > function returns if neithe

Re: [PATCH iproute2] Enable use of extra debugging information

2016-06-22 Thread Jakub Sitnicki
Hi David, On Wed, Jun 22, 2016 at 01:27 AM CEST, David Ahern wrote: > Add -g flag to builds if DEBUG parameter is set. Improves > debugging with gdb. > > Signed-off-by: David Ahern > --- > Makefile | 4 > 1 file changed, 4 insertions(+) > > diff --git a/Makefile b/Makefile > index 15c81ec

[iproute PATCH] iproute: Abort if nexthop cannot be parsed

2018-04-11 Thread Jakub Sitnicki
t; Cannot find device "fake1" ... Segmentation fault (core dumped) Don't ignore errors from the helper routine that parses the nexthop definition, and abort immediately if parsing fails. Signed-off-by: Jakub Sitnicki --- ip/iproute.c | 5 - 1 file changed, 4 insertions(+),

Re: [PATCH net] ipv6: fix uninit-value in ip6_multipath_l3_keys()

2018-04-30 Thread Jakub Sitnicki
= skb_header_pointer(skb, skb_transport_offset(skb), > +sizeof(_icmph), &_icmph); > + if (!icmph) > + goto out; > + > if (icmph->icmp6_type != ICMPV6_DEST_UNREACH && > icmph->icmp6_type != ICMPV6_PKT_TOOBIG && > icmph->icmp6_type != ICMPV6_TIME_EXCEED && Thank you for the fix. I was not being careful there. Acked-by: Jakub Sitnicki

[PATCH net] ipv6: Don't use ufo handling on later transformed packets

2016-10-26 Thread Jakub Sitnicki
s: e89e9cf539a2 ("[IPv4/IPv6]: UFO Scatter-gather approach") Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa --- net/ipv6/ip6_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 6001e78..59eb4ed 100

Re: [PATCH] rtl8xxxu: mark symbol static where possible

2016-10-26 Thread Jakub Sitnicki
On Wed, Oct 26, 2016 at 09:32 AM GMT, Baoyou Xie wrote: > We get 1 warning when building kernel with W=1: > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c:1557:6: warning: no > previous prototype for 'rtl8192eu_power_off' [-Wmissing-prototypes] > > In fact, this function is only used in th

Re: [PATCH net-next 4/5] ipv6: Compute multipath hash for sent ICMP errors from offending packet

2016-10-27 Thread Jakub Sitnicki
On Thu, Oct 27, 2016 at 03:24 PM GMT, David Miller wrote: > From: Jakub Sitnicki > Date: Mon, 24 Oct 2016 11:28:51 +0200 > >> diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h >> index 57086e9..6282e03 100644 >> --- a/include/linux/icmpv6.h >> +++ b/i

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-10-27 Thread Jakub Sitnicki
On Thu, Oct 27, 2016 at 03:25 PM GMT, David Miller wrote: > From: Jakub Sitnicki > Date: Mon, 24 Oct 2016 11:28:52 +0200 > >> +inner_iph = skb_header_pointer( >> +skb, skb_transport_offset(skb) + sizeof(*icmph), >> +sizeof(_inner_iph), &

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-10-28 Thread Jakub Sitnicki
On Thu, Oct 27, 2016 at 10:35 PM GMT, Tom Herbert wrote: > On Mon, Oct 24, 2016 at 2:28 AM, Jakub Sitnicki wrote: >> Same as for the transmit path, let's do our best to ensure that received >> ICMP errors that may be subject to forwarding will be routed the same >> path

[PATCH net-next v2 0/5] Route ICMPv6 errors with the flow when ECMP in use

2016-10-28 Thread Jakub Sitnicki
a function call, and align consecutive lines to the first argument, pointed out by David Miller; - expand the cover letter based on the feedback from David Miller and Hannes Sowa; Jakub Sitnicki (5): ipv6: Fold rt6_info_hash_nhsfn() into its only caller net: Extend struct flowi6 wit

[PATCH net-next v2 2/5] net: Extend struct flowi6 with multipath hash

2016-10-28 Thread Jakub Sitnicki
the offending IPv6 datagram that triggered the error, rather than the flow of the ICMP error itself. Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa --- include/net/flow.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/flow.h b/include/net/flow.h index 035aa77

[PATCH net-next v2 3/5] ipv6: Use multipath hash from flow info if available

2016-10-28 Thread Jakub Sitnicki
Allow our callers to influence the choice of ECMP link by honoring the hash passed together with the flow info. This will allow for special treatment of ICMP errors which we would like to route over the same link as the IP datagram that triggered the error. Signed-off-by: Jakub Sitnicki Acked-by

[PATCH net-next v2 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller

2016-10-28 Thread Jakub Sitnicki
Commit 644d0e656958 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes sense to keep it around. Also the accompanying documentation comment has become outdated, so just remove it altogether. Signed-off-by: Jakub Sitni

[PATCH net-next v2 4/5] ipv6: Compute multipath hash for sent ICMP errors from offending packet

2016-10-28 Thread Jakub Sitnicki
external function declaration in header file, pointed out by David Miller Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa --- include/linux/icmpv6.h | 2 ++ net/ipv6/icmp.c| 21 + 2 files changed, 23 insertions(+) diff --git a/include/linux/icmpv6

[PATCH net-next v2 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-10-28 Thread Jakub Sitnicki
e on the first line of a function call, and align consecutive lines to the first argument, pointed out by David Miller Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa --- net/ipv6/route.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/net/ipv6/route

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-10-30 Thread Jakub Sitnicki
On Fri, Oct 28, 2016 at 02:25 PM GMT, Tom Herbert wrote: > On Fri, Oct 28, 2016 at 1:32 AM, Jakub Sitnicki wrote: >> On Thu, Oct 27, 2016 at 10:35 PM GMT, Tom Herbert wrote: >>> On Mon, Oct 24, 2016 at 2:28 AM, Jakub Sitnicki wrote: >>>> Same as for the transmit pat

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-11-01 Thread Jakub Sitnicki
On Mon, Oct 31, 2016 at 07:15 PM GMT, David Miller wrote: > From: Jakub Sitnicki > Date: Sun, 30 Oct 2016 14:03:11 +0100 > >> 2) ensure the flow labels used in both directions are the same (either >>reflected by one side, or fixed, e.g. not used and set to 0), so that

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-11-01 Thread Jakub Sitnicki
On Mon, Oct 31, 2016 at 07:25 PM GMT, Tom Herbert wrote: > On Sun, Oct 30, 2016 at 6:03 AM, Jakub Sitnicki wrote: >> On Fri, Oct 28, 2016 at 02:25 PM GMT, Tom Herbert wrote: >>> >>> If this patch is being done to be compatible with IPv4 I guess that's >>>

Re: [PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-11-01 Thread Jakub Sitnicki
On Tue, Nov 01, 2016 at 03:35 PM GMT, David Miller wrote: > From: Jakub Sitnicki > Date: Tue, 01 Nov 2016 16:13:51 +0100 > >> On Mon, Oct 31, 2016 at 07:15 PM GMT, David Miller wrote: >>> From: Jakub Sitnicki >>> Date: Sun, 30 Oct 2016 14:03:11 +0100 >>&

Re: [PATCH v2 net-next 1/2] net: centralize net_device min/max MTU checking

2016-09-30 Thread Jakub Sitnicki
On Wed, Sep 28, 2016 at 10:20 PM GMT, Jarod Wilson wrote: > While looking into an MTU issue with sfc, I started noticing that almost > every NIC driver with an ndo_change_mtu function implemented almost > exactly the same range checks, and in many cases, that was the only > practical thing their nd

Re: [PATCH net v2] flow_dissector: Check skb for VLAN only if skb specified.

2016-10-18 Thread Jakub Sitnicki
proto = skb->protocol; > I was a bit confused that we check skb for VLAN tag again later in the same block but this time without a NULL check. However, this only happens when we get called from skb_flow_dissect() or skb_flow_dissect_flow_keys() variants, which take an skb and pass it to us. Feel free to add: Reviewed-by: Jakub Sitnicki

[PATCH net-next 5/5] ipv6: Compute multipath hash for forwarded ICMP errors from offending packet

2016-10-24 Thread Jakub Sitnicki
Same as for the transmit path, let's do our best to ensure that received ICMP errors that may be subject to forwarding will be routed the same path as flow that triggered the error, if it was going in the opposite direction. Signed-off-by: Jakub Sitnicki --- net/ipv6/route.c

[PATCH net-next 4/5] ipv6: Compute multipath hash for sent ICMP errors from offending packet

2016-10-24 Thread Jakub Sitnicki
label. Otherwise packets from flow in the opposite direction and ICMP errors will not be routed over the same ECMP link. Export the function for calculating the multipath hash so that we can use it also on receive side, when forwarding ICMP errors. Signed-off-by: Jakub Sitnicki --- include/linux

[PATCH net-next 2/5] net: Extend struct flowi6 with multipath hash

2016-10-24 Thread Jakub Sitnicki
the offending IPv6 datagram that triggered the error, rather than the flow of the ICMP error itself. Signed-off-by: Jakub Sitnicki --- include/net/flow.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/flow.h b/include/net/flow.h index 035aa77..73ee3aa 100644 --- a/include/net

[PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available

2016-10-24 Thread Jakub Sitnicki
Allow our callers to influence the choice of ECMP link by honoring the hash passed together with the flow info. This will allow for special treatment of ICMP errors which we would like to route over the same link as the IP datagram that triggered the error. Signed-off-by: Jakub Sitnicki --- net

[PATCH net-next 0/5] Route ICMPv6 errors with the flow when ECMP in use

2016-10-24 Thread Jakub Sitnicki
the client host, with flow label set, has been run from one of the server hosts. Full test is available at [1]. -Jakub [1] https://github.com/jsitnicki/tools/blob/master/net/tests/ecmp/test-ecmp-icmpv6-error-routing.sh Jakub Sitnicki (5): ipv6: Fold rt6_info_hash_nhsfn() into its only caller

[PATCH net-next 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller

2016-10-24 Thread Jakub Sitnicki
Commit 644d0e656958 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes sense to keep it around. Also the accompanying documentation comment has become outdated, so just remove it altogether. Signed-off-by: Jakub Sitni

[iproute PATCH] iproute: Remove useless check for nexthop keyword when setting RTA_OIF

2017-06-07 Thread Jakub Sitnicki
When modifying a route we set the RTA_OIF attribute only if a device was specified with "dev" or "oif" keyword. But for some unknown reason we earlier alternatively check also for the presence of "nexthop" keyword, even though it has no effect. So remove the pointles

Re: [PATCH] [PATCH net] net: Do not hold the reference for the same sk_rx_dst.

2017-03-16 Thread Jakub Sitnicki
On Thu, Mar 16, 2017 at 08:08 AM GMT, Kevin Xu wrote: > In some rare cases, inet_sk_rx_dst_set() may be called multiple times > on the same dst, causing reference count leakage. Eventually, it > prevents net_device to be destroyed. The bug then manifested as > > unregister_netdevice: waiting for lo

Re: [PATCH] [PATCH net] net: Do not hold the reference for the same sk_rx_dst.

2017-03-16 Thread Jakub Sitnicki
fferent bug. > > Kevin > >> On Mar 16, 2017, at 3:01 AM, Jakub Sitnicki wrote: >> >>> On Thu, Mar 16, 2017 at 08:08 AM GMT, Kevin Xu wrote: >>> In some rare cases, inet_sk_rx_dst_set() may be called multiple times >>> on the same dst, causing reference

[PATCH net] ip6_tunnel: Account for tunnel header in tunnel MTU

2017-01-13 Thread Jakub Sitnicki
accounted for in tunnel MTU. Fixes: b05229f44228 ("gre6: Cleanup GREv6 transmit path, call common GRE functions") Signed-off-by: Jakub Sitnicki --- net/ipv6/ip6_tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tu

[PATCH net-next] gre6: Clean up unused struct ipv6_tel_txoption definition

2017-01-20 Thread Jakub Sitnicki
Commit b05229f44228 ("gre6: Cleanup GREv6 transmit path, call common GRE functions") removed the ip6gre specific transmit function, but left the struct ipv6_tel_txoption definition. Clean it up. Signed-off-by: Jakub Sitnicki --- net/ipv6/ip6_gre.c | 5 - 1 file changed, 5 deletion

Re: [PATCH net-next v2] net: ipv4: add support for ECMP hash policy choice

2017-03-08 Thread Jakub Sitnicki
Hi Nikolay, On Tue, Mar 07, 2017 at 11:01 AM GMT, Nikolay Aleksandrov wrote: > This patch adds support for ECMP hash policy choice via a new sysctl > called fib_multipath_hash_policy and also adds support for L4 hashes. > The current values for fib_multipath_hash_policy are: > 0 - layer 3 (defaul

Re: [PATCH net-next v2] net: ipv4: add support for ECMP hash policy choice

2017-03-08 Thread Jakub Sitnicki
On Wed, Mar 08, 2017 at 12:43 PM GMT, Nikolay Aleksandrov wrote: > On 08/03/17 14:05, Jakub Sitnicki wrote: >> On Tue, Mar 07, 2017 at 11:01 AM GMT, Nikolay Aleksandrov wrote: >>> This patch adds support for ECMP hash policy choice via a new sysctl >>> called fib_mul

Re: [PATCH net-next v3] net: ipv4: add support for ECMP hash policy choice

2017-03-15 Thread Jakub Sitnicki
On Tue, Mar 14, 2017 at 03:36 PM GMT, Nikolay Aleksandrov wrote: > This patch adds support for ECMP hash policy choice via a new sysctl > called fib_multipath_hash_policy and also adds support for L4 hashes. > The current values for fib_multipath_hash_policy are: > 0 - layer 3 (default) > 1 - lay

[RFC net-next] ipv4: Don't promote secondaries when flushing addresses

2018-06-07 Thread Jakub Sitnicki
ce to signal that a removal operation is being done because of a flush. When the flag is set, don't bother with secondary address promotion as we expect that secondary addresses will be removed soon as well. Signed-off-by: Jakub Sitnicki --- A benchmark involving a flush of 40,000 addresses fr

Re: [RFC net-next] ipv4: Don't promote secondaries when flushing addresses

2018-06-07 Thread Jakub Sitnicki
On Thu, 7 Jun 2018 13:00:29 +0200 Michal Kubecek wrote: > On Thu, Jun 07, 2018 at 12:13:01PM +0200, Jakub Sitnicki wrote: > > Promoting secondary addresses on address removal makes flushing all > > addresses from a device with 1000's of them slow. This is because we >

[PATCH net-next] socket: Tighten no-error check in bind()

2018-10-04 Thread Jakub Sitnicki
move_addr_to_kernel() returns only negative values on error, or zero on success. Rewrite the error check to an idiomatic form to avoid confusing the reader. Signed-off-by: Jakub Sitnicki --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net

[PATCH net-next] selftests: net: Clean up an unused variable

2018-10-05 Thread Jakub Sitnicki
Address compiler warning: ip_defrag.c: In function 'send_udp_frags': ip_defrag.c:206:16: warning: unused variable 'udphdr' [-Wunused-variable] struct udphdr udphdr; ^~~~~~ Signed-off-by: Jakub Sitnicki --- tools/testing/selftests/net/ip_defrag.c | 1

Re: [PATCH bpf] selftests/bpf: fix v4_to_v6 in sk_lookup

2020-08-10 Thread Jakub Sitnicki
On Mon, Aug 10, 2020 at 06:14 PM CEST, Stanislav Fomichev wrote: > On Sat, Aug 8, 2020 at 11:46 AM Jakub Sitnicki wrote: >> >> On Sat, Aug 08, 2020 at 12:38 AM CEST, Stanislav Fomichev wrote: >> > I'm getting some garbage in bytes 8 and 9 when doing conver

BPF sk_lookup v5 - TCP SYN and UDP 0-len flood benchmarks

2020-08-18 Thread Jakub Sitnicki
I got around to re-running flood benchmarks. Mainly to confirm that introduction of static key had the desired effect - users not attaching BPF sk_lookup programs won't notice a performance hit in Linux v5.9. But also to check for any unexpected bottlenecks when BPF sk_lookup program is attached,

Re: BPF sk_lookup v5 - TCP SYN and UDP 0-len flood benchmarks

2020-08-20 Thread Jakub Sitnicki
On Tue, Aug 18, 2020 at 08:19 PM CEST, Alexei Starovoitov wrote: > On Tue, Aug 18, 2020 at 8:49 AM Jakub Sitnicki wrote: >> : rcu_read_lock(); >> : run_array = >> rcu_dereference(net->bpf.run_array[NETNS_BPF_

[PATCH] bpf: sk_lookup: Add user documentation

2020-08-21 Thread Jakub Sitnicki
Describe the purpose of BPF sk_lookup program, how it can be attached, when it gets invoked, and what information gets passed to it. Point the reader to examples and further documentation. Signed-off-by: Jakub Sitnicki --- Documentation/bpf/index.rst | 1 + Documentation/bpf

Re: BPF sk_lookup v5 - TCP SYN and UDP 0-len flood benchmarks

2020-08-21 Thread Jakub Sitnicki
On Fri, Aug 21, 2020 at 12:18 AM CEST, Alexei Starovoitov wrote: > On Thu, Aug 20, 2020 at 3:29 AM Jakub Sitnicki wrote: >> On Tue, Aug 18, 2020 at 08:19 PM CEST, Alexei Starovoitov wrote: [...] >> > Long term we should probably stop doing *_kern style of ctx passing &

Re: [Patch bpf-next] skmsg: pass psock pointer to ->psock_update_sk_prot()

2021-04-12 Thread Jakub Sitnicki
gt; without bothering sk_psock(). > > Reported-and-tested-by: syzbot+320a3bc8d80f478c3...@syzkaller.appspotmail.com > Fixes: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()") > Cc: John Fastabend > Cc: Eric Dumazet > Cc: Daniel Borkmann > Cc: Jaku

Re: [Patch bpf-next] sock_map: fix a potential use-after-free in sock_map_close()

2021-04-12 Thread Jakub Sitnicki
_psock_stop(). > > Reported-by: syzbot+7b6548ae483d6f4c6...@syzkaller.appspotmail.com > Fixes: 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()") > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Acked-by: Jakub Sitnicki

Re: [Patch bpf-next v3 2/5] skmsg: get rid of struct sk_psock_parser

2021-02-15 Thread Jakub Sitnicki
> Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Acked-by: Jakub Sitnicki

Re: [Patch bpf-next v3 3/5] bpf: compute data_end dynamically with JIT code

2021-02-15 Thread Jakub Sitnicki
d of ->data_end. This is similar to skb_shinfo(skb) computation > in bpf_convert_shinfo_access(). > > Suggested-by: Jakub Sitnicki > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Acked-by: Jakub Sitnicki

[RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-18 Thread Jakub Sitnicki
are the technical concerns and if we can address them. Just in time for the coming Netconf conference. Thanks, Jakub [1] https://netdevconf.org/0x13/session.html?panel-industry-perspectives [2] https://blog.cloudflare.com/how-we-built-spectrum/ [3] https://www.spinics.net/lists/netdev/msg370

[RFC bpf-next 5/7] libbpf: Add support for inet_lookup program type

2019-06-18 Thread Jakub Sitnicki
Make libbpf aware of the newly added program type. Reserve a section name for it. Signed-off-by: Jakub Sitnicki --- tools/lib/bpf/libbpf.c| 4 tools/lib/bpf/libbpf.h| 2 ++ tools/lib/bpf/libbpf.map | 2 ++ tools/lib/bpf/libbpf_probes.c | 1 + 4 files changed, 9

[RFC bpf-next 6/7] bpf: Test destination address remapping with inet_lookup

2019-06-18 Thread Jakub Sitnicki
Check if destination IP address and/or port remapping happens when an inet_lookup program is attached to the net namespace. Signed-off-by: Jakub Sitnicki --- tools/testing/selftests/bpf/.gitignore| 1 + tools/testing/selftests/bpf/Makefile | 6 +- .../selftests/bpf/progs

[RFC bpf-next 1/7] bpf: Introduce inet_lookup program type

2019-06-18 Thread Jakub Sitnicki
allowed to overwrite the local IP & port that are used for looking up a listening socket. The program is not called anywhere yet. We hook it up to ipv4 and ipv6 stacks in subsequent patches. Suggested-by: Marek Majkowski Signed-off-by: Jakub Sitnicki --- include/linux/bpf_types.h | 1 + inc

[RFC bpf-next 7/7] bpf: Add verifier tests for inet_lookup context access

2019-06-18 Thread Jakub Sitnicki
Exercise verifier access checks for bpf_inet_lookup context object fields. Signed-off-by: Jakub Sitnicki --- .../selftests/bpf/verifier/ctx_inet_lookup.c | 511 ++ 1 file changed, 511 insertions(+) create mode 100644 tools/testing/selftests/bpf/verifier/ctx_inet_lookup.c diff

[RFC bpf-next 2/7] ipv4: Run inet_lookup bpf program on socket lookup

2019-06-18 Thread Jakub Sitnicki
ffic destined to a set of addresses and ports without bindings sockets to all the addresses and ports we want to receive on. Suggested-by: Marek Majkowski Signed-off-by: Jakub Sitnicki --- include/net/inet_hashtables.h | 39 +++ net/ipv4/inet_hashtables.c

[RFC bpf-next 4/7] bpf: Sync linux/bpf.h to tools/

2019-06-18 Thread Jakub Sitnicki
Newly added program and context type is needed for tests in subsequent patches. Signed-off-by: Jakub Sitnicki --- tools/include/uapi/linux/bpf.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index

[RFC bpf-next 3/7] ipv6: Run inet_lookup bpf program on socket lookup

2019-06-18 Thread Jakub Sitnicki
r not-connected socket lookup for UDP. Suggested-by: Marek Majkowski Signed-off-by: Jakub Sitnicki --- include/net/inet6_hashtables.h | 39 ++ net/ipv6/inet6_hashtables.c| 11 ++ net/ipv6/udp.c | 6 -- 3 files changed, 50 insertions(

Re: [RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-19 Thread Jakub Sitnicki
Hey Florian, Thanks for taking a look at it. On Tue, Jun 18, 2019 at 03:52 PM CEST, Florian Westphal wrote: > Jakub Sitnicki wrote: >> - XDP programs using bpf_sk_lookup helpers, like load balancers, can't >>find the listening socket to check for SYN cookies with TPROXY

Re: [RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-25 Thread Jakub Sitnicki
[Reposting with correct format this time. Sorry.] On Fri, Jun 21, 2019 at 12:20 AM CEST, Joe Stringer wrote: > On Wed, Jun 19, 2019 at 2:14 AM Jakub Sitnicki wrote: >> >> Hey Florian, >> >> Thanks for taking a look at it. >> >> On Tue, Jun 18, 2019 a

Re: [RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-25 Thread Jakub Sitnicki
On Fri, Jun 21, 2019 at 06:50 PM CEST, Joe Stringer wrote: > On Fri, Jun 21, 2019 at 1:44 AM Jakub Sitnicki wrote: >> >> On Fri, Jun 21, 2019, 00:20 Joe Stringer wrote: >>> >>> On Wed, Jun 19, 2019 at 2:14 AM Jakub Sitnicki wrote: >>> > >>>

Re: [PATCH] samples: bpf: fix style in bpf_load

2019-05-22 Thread Jakub Sitnicki
On Wed, May 22, 2019 at 02:24 AM CEST, Daniel T. Lee wrote: > This commit fixes style problem in samples/bpf/bpf_load.c > > Styles that have been changed are: > - Magic string use of 'DEBUGFS' > - Useless zero initialization of a global variable > - Minor style fix with whitespace > > Signed-off

[bpf PATCH] bpf: sockmap, restore sk_write_space when psock gets dropped

2019-05-22 Thread Jakub Sitnicki
0068 == Restore the saved sk_write_space callback when psock is being dropped to fix the crash. Signed-off-by: Jakub Sitnicki --- include/linux/skmsg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/skmsg.h b/i

Re: [PATCH net] sk_msg: Keep reference on socket file while psock lives

2019-05-22 Thread Jakub Sitnicki
Hi John, On Tue, May 21, 2019 at 10:07 PM CEST, John Fastabend wrote: > Jakub Sitnicki wrote: >> Hi Daniel, >> >> On Tue, Feb 19, 2019 at 05:00 PM CET, Daniel Borkmann wrote: >> > On 02/11/2019 10:09 AM, Jakub Sitnicki wrote: >> >> Backlog work for

Re: [PATCH net] sk_msg: Keep reference on socket file while psock lives

2019-05-24 Thread Jakub Sitnicki
On Thu, May 23, 2019 at 05:58 PM CEST, John Fastabend wrote: > [...] > >> >> Thanks for taking a look at it. Setting MSG_DONTWAIT works great for >> me. No more crashes in sk_stream_wait_memory. I've tested it on top of >> current bpf-next (f49aa1de9836).

Re: [PATCH net] sk_msg: Keep reference on socket file while psock lives

2019-05-27 Thread Jakub Sitnicki
On Fri, May 24, 2019 at 05:51 PM CEST, John Fastabend wrote: > Jakub Sitnicki wrote: >> >> Now that those pesky crashes are gone, we plan to look into drops when >> doing echo with sockmap. Marek tried running echo-sockmap [1] with >> latest bpf-next (plus mentioned cr

Re: [PATCH bpf] bpf: fix sanitation rewrite in case of non-pointers

2019-03-05 Thread Jakub Sitnicki
On Fri, Mar 01, 2019 at 10:05 PM CET, Daniel Borkmann wrote: > Marek reported that he saw an issue with the below snippet in that > timing measurements where off when loaded as unpriv while results > were reasonable when loaded as privileged: > > [...] > uint64_t a = bpf_ktime_get_ns(); >

Re: [PATCH bpf] bpf: fix sanitation rewrite in case of non-pointers

2019-03-06 Thread Jakub Sitnicki
On Tue, Mar 05, 2019 at 03:30 PM CET, Daniel Borkmann wrote: > On 03/05/2019 03:12 PM, Jakub Sitnicki wrote: > [...] >> Could you please queue it for -stable which has d3bd7413e0ca ("bpf: fix >> sanitation of alu op with pointer / scalar type from different paths")? >

[PATCH bpf] bpf: Stop the psock parser before canceling its work

2019-03-07 Thread Jakub Sitnicki
read_parkme+0x80/0x80 [ 405.348108] ret_from_fork+0x35/0x40 [ 405.348566] ---[ end trace a4a3af4026a327d4 ]--- Stop psock's parser just before canceling its work. Fixes: 1d79895aef18 ("sk_msg: Always cancel strp work before freeing the psock") Reported-by: kernel test robot Sig

Re: [Patch bpf-next 02/19] skmsg: get rid of struct sk_psock_parser

2021-02-05 Thread Jakub Sitnicki
On Wed, Feb 03, 2021 at 05:16 AM CET, Cong Wang wrote: > From: Cong Wang > > struct sk_psock_parser is embedded in sk_psock, it is > unnecessary as skb verdict also uses ->saved_data_ready. > We can simply fold these fields into sk_psock. > > Cc: John Fastabend > Cc: D

Re: [Patch bpf-next 01/19] bpf: rename BPF_STREAM_PARSER to BPF_SOCK_MAP

2021-02-05 Thread Jakub Sitnicki
ARSER to BPF_SOCK_MAP, so > that sock_map.c hopefully would be protocol-independent. > > Also, improve its Kconfig description to avoid confusion. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --

Re: [Patch bpf-next 18/19] selftests/bpf: add test cases for unix and udp sockmap

2021-02-05 Thread Jakub Sitnicki
On Wed, Feb 03, 2021 at 05:16 AM CET, Cong Wang wrote: > From: Cong Wang > > Add two test cases to ensure redirection between two > AF_UNIX sockets or two UDP sockets work. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer

Re: [Patch bpf-next 03/19] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-05 Thread Jakub Sitnicki
before/after a brief use. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- > include/linux/skbuff.h | 4 > include/linux/skmsg.h | 45 ++ > include/net/

Re: [Patch bpf-next v4 1/5] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Jakub Sitnicki
ap code simply depend on CONFIG_BPF_SYSCALL. > And leave CONFIG_NET_SOCK_MSG untouched, as it is used by > non-sockmap cases. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Reviewed-by: Lorenz Bauer > Acked-by: John Fastabend > Signed-off-by: Cong Wang > --- Sorry for the delay. T

Re: [Patch bpf-next v4 1/5] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Jakub Sitnicki
On Fri, Feb 19, 2021 at 07:46 PM CET, Cong Wang wrote: > On Fri, Feb 19, 2021 at 10:25 AM Jakub Sitnicki wrote: >> >> On Tue, Feb 16, 2021 at 07:42 AM CET, Cong Wang wrote: >> > From: Cong Wang >> > >> > As suggested by John, clean up sockmap relat

Re: [Patch bpf-next v6 1/8] bpf: clean up sockmap related Kconfigs

2021-02-22 Thread Jakub Sitnicki
ap code simply depend on CONFIG_BPF_SYSCALL > and CONFIG_INET, the latter is still needed at this point because > of TCP/UDP proto update. And leave CONFIG_NET_SOCK_MSG untouched, > as it is used by non-sockmap cases. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Reviewed-by: Lorenz Bauer

Re: [Patch bpf-next v6 4/8] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-22 Thread Jakub Sitnicki
an be reused because skb dst is > no longer needed after ->sk_data_ready() so we can just drop it. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Acked-by: John Fastabend > Signed-off-by: Cong Wang > --- LGTM. I have some questions (below) tha

Re: [Patch bpf-next v6 5/8] sock_map: rename skb_parser and skb_verdict

2021-02-22 Thread Jakub Sitnicki
t; general use later. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Reviewed-by: Lorenz Bauer > Acked-by: John Fastabend > Signed-off-by: Cong Wang > --- skb_parser also appears in: tools/testing/selftests/bpf/test_sockmap.c:int txmsg_omit_skb_p

Re: [Patch bpf-next v6 6/8] sock_map: make sock_map_prog_update() static

2021-02-22 Thread Jakub Sitnicki
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote: > From: Cong Wang > > It is only used within sock_map.c so can become static. > > Suggested-by: Jakub Sitnicki > Cc: Daniel Borkmann > Cc: Lorenz Bauer > Cc: John Fastabend > Signed-off-by: Cong Wang > ---

Re: [Patch bpf-next v6 7/8] skmsg: make __sk_psock_purge_ingress_msg() static

2021-02-22 Thread Jakub Sitnicki
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote: > From: Cong Wang > > It is only used within skmsg.c so can become static. > > Cc: Jakub Sitnicki > Cc: Daniel Borkmann > Cc: Lorenz Bauer > Cc: John Fastabend > Signed-off-by: Cong Wang > --- Acked-by: Jakub Sitnicki

Re: [Patch bpf-next v6 8/8] skmsg: get rid of sk_psock_bpf_run()

2021-02-22 Thread Jakub Sitnicki
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote: > From: Cong Wang > > It is now nearly identical to bpf_prog_run_pin_on_cpu() and > it has an unused parameter 'psock', so we can just get rid > of it and call bpf_prog_run_pin_on_cpu() directly. > > Cc: Jakub

Re: [Patch bpf-next v6 0/8] sock_map: clean up and refactor code for BPF_SK_SKB_VERDICT

2021-02-22 Thread Jakub Sitnicki
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote: > From: Cong Wang > > This patchset is the first series of patches separated out from > the original large patchset, to make reviews easier. This patchset > does not add any new feature or change any functionality but merely > cleans up the ex

Re: [Patch bpf-next v6 4/8] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-23 Thread Jakub Sitnicki
On Mon, Feb 22, 2021 at 08:27 PM CET, Cong Wang wrote: > On Mon, Feb 22, 2021 at 4:20 AM Jakub Sitnicki wrote: >> >> On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote: >> > From: Cong Wang >> > >> > Currently TCP_SKB_CB() is hard-coded in skmsg cod

Re: [Patch bpf-next v6 4/8] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-23 Thread Jakub Sitnicki
On Tue, Feb 23, 2021 at 07:04 PM CET, Cong Wang wrote: > On Tue, Feb 23, 2021 at 9:53 AM Jakub Sitnicki wrote: >> Based on what I've seen around, mask for sanitizing tagged pointers is >> usually derived from the flag(s). For instance: >> >> #define SKB_DST_NOREF

  1   2   3   4   5   >