Re: [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-18 Thread Tom Herbert
On Thu, Aug 16, 2018 at 9:44 AM, Petar Penkov wrote: > From: Petar Penkov > > This eBPF program extracts basic/control/ip address/ports keys from > incoming packets. It supports recursive parsing for IP > encapsulation, MPLS, GUE, and VLAN, along with IPv4/IPv6 and extension > headers. This

Re: KCM - recvmsg() mangles packets?

2018-08-09 Thread Tom Herbert
On Sun, Aug 5, 2018 at 4:39 PM, Dominique Martinet wrote: > Dominique Martinet wrote on Sun, Aug 05, 2018: >> It's getting late but I'll try adding a pskb_pull in there tomorrow, it >> would be better to make the bpf program start with an offset but I don't >> think that'll be easy to change... >

Re: KCM - recvmsg() mangles packets?

2018-08-03 Thread Tom Herbert
On Fri, Aug 3, 2018 at 4:20 PM, Dominique Martinet wrote: > Tom Herbert wrote on Fri, Aug 03, 2018: >> struct my_proto { >>struct _hdr { >>uint32_t len; >> } hdr; >> char data[32]; >> } __attribute__((packed)); >> >> // us

Re: KCM - recvmsg() mangles packets?

2018-08-03 Thread Tom Herbert
struct my_proto { struct _hdr { uint32_t len; } hdr; char data[32]; } __attribute__((packed)); // use htons to use LE header size, since load_half does a first convertion // from network byte order const char *bpf_prog_string = " \ ssize_t bpf_prog1(struct __sk_buff *skb) \ { \

[PATCH net-next 1/4] ila: Fix use of rhashtable walk in ila_xlat.c

2018-06-27 Thread Tom Herbert
Perform better EAGAIN handling, handle case where ila_dump_info fails and we missed objects in the dump, and add a skip index to skip over ila entires in a list on a rhashtable node that have already been visited (by a previous call to ila_nl_dump). Signed-off-by: Tom Herbert --- net/ipv6/ila

[PATCH net-next 4/4] ila: Flush netlink command to clear xlat table

2018-06-27 Thread Tom Herbert
Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Signed-off-by: Tom Herbert --- include/uapi/linux/ila.h | 1 + net/ipv6/ila/ila.h | 1 + net/ipv6/ila/ila_main.c | 6 + net/ipv6/ila/ila_xlat.c | 62 ++-- 4 files

[PATCH net-next 3/4] ila: Create main ila source file

2018-06-27 Thread Tom Herbert
Create a main ila file that contains the module initialization functions as well as netlink definitions. Previously these were defined in ila_xlat and ila_common. This approach allows better extensibility. Signed-off-by: Tom Herbert --- net/ipv6/ila/Makefile | 2 +- net/ipv6/ila/ila.h

[PATCH net-next 2/4] ila: Call library function alloc_bucket_locks

2018-06-27 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. Signed-off-by: Tom Herbert --- net/ipv6/ila/ila_xlat.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6

[PATCH net-next 0/4] ila: Cleanup

2018-06-27 Thread Tom Herbert
to ila_nl_dump. - Call alloc_bucket_spinlocks to create bucket locks. - Split out module initialization and netlink definitions into separate files. - Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Tom Herbert (4): ila: Fix use of rhashtable walk in ila_xlat.c ila: Call library

Re: [net-next PATCH v4 7/7] Documentation: Add explanation for XPS using Rx-queue(s) map

2018-06-26 Thread Tom Herbert
On Mon, Jun 25, 2018 at 11:04 AM, Amritha Nambiar wrote: > Signed-off-by: Amritha Nambiar Acked-by: Tom Herbert > --- > Documentation/ABI/testing/sysfs-class-net-queues | 11 > Documentation/networking/scaling.txt | 57 > ++ > 2

Re: [net-next PATCH v4 2/7] net: Use static_key for XPS maps

2018-06-26 Thread Tom Herbert
ap. > Acked-by: Tom Herbert > Signed-off-by: Amritha Nambiar > --- > net/core/dev.c | 26 -- > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 2552556..df2a78d 100644 > --- a/net/core/de

Re: [net-next PATCH v4 1/7] net: Refactor XPS for CPUs and Rx queues

2018-06-26 Thread Tom Herbert
t_xps_queue(struct net_device *dev, const > struct cpumask *mask, > kfree(new_dev_maps); > return -ENOMEM; > } > + > +int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask, > + u16 index) > +{ > + return __netif_set_xps_queue(dev, cpumask_bits(mask), index, false); > +} > EXPORT_SYMBOL(netif_set_xps_queue); > > #endif > @@ -3384,7 +3451,7 @@ static inline int get_xps_queue(struct net_device *dev, > struct sk_buff *skb) > int queue_index = -1; > > rcu_read_lock(); > - dev_maps = rcu_dereference(dev->xps_maps); > + dev_maps = rcu_dereference(dev->xps_cpus_map); > if (dev_maps) { > unsigned int tci = skb->sender_cpu - 1; > > @@ -3393,7 +3460,7 @@ static inline int get_xps_queue(struct net_device *dev, > struct sk_buff *skb) > tci += netdev_get_prio_tc_map(dev, skb->priority); > } > > - map = rcu_dereference(dev_maps->cpu_map[tci]); > + map = rcu_dereference(dev_maps->attr_map[tci]); > if (map) { > if (map->len == 1) > queue_index = map->queues[0]; > diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c > index bb7e80f..b39987c 100644 > --- a/net/core/net-sysfs.c > +++ b/net/core/net-sysfs.c > @@ -1227,13 +1227,13 @@ static ssize_t xps_cpus_show(struct netdev_queue > *queue, > return -ENOMEM; > > rcu_read_lock(); > - dev_maps = rcu_dereference(dev->xps_maps); > + dev_maps = rcu_dereference(dev->xps_cpus_map); > if (dev_maps) { > for_each_possible_cpu(cpu) { > int i, tci = cpu * num_tc + tc; > struct xps_map *map; > > - map = rcu_dereference(dev_maps->cpu_map[tci]); > + map = rcu_dereference(dev_maps->attr_map[tci]); > if (!map) > continue; > > Acked-by: Tom Herbert

Re: [RFC PATCH v2 net-next 00/12] Handle multiple received packets at each stage

2018-06-26 Thread Tom Herbert
On Tue, Jun 26, 2018 at 11:15 AM, Edward Cree wrote: > > This patch series adds the capability for the network stack to receive a > list of packets and process them as a unit, rather than handling each > packet singly in sequence. This is done by factoring out the existing > datapath code at

Re: 答复: ANNOUNCE: Enhanced IP v1.4

2018-06-04 Thread Tom Herbert
On Mon, Jun 4, 2018 at 6:02 AM, Eric Dumazet wrote: > > > On 06/03/2018 10:58 PM, PKU.孙斌 wrote: >> On Sun, Jun 03, 2018 at 03:41:08PM -0700, Eric Dumazet wrote: >>> >>> >>> On 06/03/2018 01:37 PM, Tom Herbert wrote: >>> >>>> This i

Re: ANNOUNCE: Enhanced IP v1.4

2018-06-03 Thread Tom Herbert
On Sat, Jun 2, 2018 at 9:17 AM, Sam Patton wrote: > Hello Willy, netdev, > > Thank you for your reply and advice. I couldn't agree more with you > about containers and the exciting prospects there, > > as well as the ADSL scenario you mention. > > As far as application examples, check out this

Re: [net-next PATCH v2 2/4] net: Enable Tx queue selection based on Rx queues

2018-05-22 Thread Tom Herbert
On Mon, May 21, 2018 at 8:12 AM, Willem de Bruijn <willemdebruijn.ker...@gmail.com> wrote: > On Mon, May 21, 2018 at 10:51 AM, Tom Herbert <t...@herbertland.com> wrote: >> On Sat, May 19, 2018 at 1:27 PM, Willem de Bruijn >> <willemdebruijn.ker...@gmail.com> wrote:

Re: [net-next PATCH v2 2/4] net: Enable Tx queue selection based on Rx queues

2018-05-21 Thread Tom Herbert
On Sat, May 19, 2018 at 1:27 PM, Willem de Bruijn <willemdebruijn.ker...@gmail.com> wrote: > On Sat, May 19, 2018 at 4:13 PM, Willem de Bruijn > <willemdebruijn.ker...@gmail.com> wrote: >> On Fri, May 18, 2018 at 12:03 AM, Tom Herbert <t...@herbertland.com> wrote: &g

Re: [PATCH net-next] sctp: add support for SCTP_REUSE_PORT sockopt

2018-05-20 Thread Tom Herbert
On Sun, May 20, 2018 at 6:54 PM, Marcelo Ricardo Leitner wrote: > On Sun, May 20, 2018 at 08:50:59PM -0400, Neil Horman wrote: >> On Sat, May 19, 2018 at 03:44:40PM +0800, Xin Long wrote: >> > This feature is actually already supported by sk->sk_reuse which can be >> >

Re: [PATCH net-next] sctp: add support for SCTP_REUSE_PORT sockopt

2018-05-20 Thread Tom Herbert
On Sat, May 19, 2018 at 12:44 AM, Xin Long wrote: > This feature is actually already supported by sk->sk_reuse which can be > set by SO_REUSEADDR. But it's not working exactly as RFC6458 demands in > section 8.1.27, like: > > - This option only supports one-to-one style

Re: [net-next PATCH v2 0/4] Symmetric queue selection using XPS for Rx queues

2018-05-17 Thread Tom Herbert
On Tue, May 15, 2018 at 6:26 PM, Amritha Nambiar wrote: > This patch series implements support for Tx queue selection based on > Rx queue(s) map. This is done by configuring Rx queue(s) map per Tx-queue > using sysfs attribute. If the user configuration for Rx queues

Re: [net-next PATCH v2 1/4] net: Refactor XPS for CPUs and Rx queues

2018-05-17 Thread Tom Herbert
On Tue, May 15, 2018 at 6:26 PM, Amritha Nambiar wrote: > Refactor XPS code to support Tx queue selection based on > CPU map or Rx queue map. > > Signed-off-by: Amritha Nambiar > --- > include/linux/cpumask.h | 11 ++ >

Re: [net-next PATCH v2 2/4] net: Enable Tx queue selection based on Rx queues

2018-05-17 Thread Tom Herbert
On Tue, May 15, 2018 at 6:26 PM, Amritha Nambiar wrote: > This patch adds support to pick Tx queue based on the Rx queue map > configuration set by the admin through the sysfs attribute > for each Tx queue. If the user configuration for receive > queue map does not

Re: [net-next PATCH 1/3] net: Refactor XPS for CPUs and Rx queues

2018-05-14 Thread Tom Herbert
On Wed, May 9, 2018 at 1:54 PM, Nambiar, Amritha <amritha.namb...@intel.com> wrote: > On 5/9/2018 1:31 PM, Tom Herbert wrote: >> On Thu, Apr 19, 2018 at 6:04 PM, Amritha Nambiar >> <amritha.namb...@intel.com> wrote: >>> Refactor XPS code to support Tx queue

Re: [net-next PATCH 1/3] net: Refactor XPS for CPUs and Rx queues

2018-05-09 Thread Tom Herbert
On Thu, Apr 19, 2018 at 6:04 PM, Amritha Nambiar wrote: > Refactor XPS code to support Tx queue selection based on > CPU map or Rx queue map. > > Signed-off-by: Amritha Nambiar > --- > include/linux/netdevice.h | 82 +- >

Re: [net-next PATCH 0/3] Symmetric queue selection using XPS for Rx queues

2018-05-08 Thread Tom Herbert
On Thu, Apr 19, 2018 at 7:41 PM, Eric Dumazet wrote: > On Thu, Apr 19, 2018 at 6:07 PM Amritha Nambiar > wrote: > >> This patch series implements support for Tx queue selection based on >> Rx queue map. This is done by configuring Rx queue map per

Re: [PATCH 7/8] rhashtable: add rhashtable_walk_prev()

2018-05-05 Thread Tom Herbert
On Sat, May 5, 2018 at 2:43 AM, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> rhashtable_walk_prev() returns the object returned by >> the previous rhashtable_walk_next(), providing it is still in the >> table (or was during this

Re: Creating FOU tunnels to the same destination IP but different port

2018-04-13 Thread Tom Herbert
On Fri, Apr 13, 2018 at 9:57 AM, Kostas Peletidis wrote: > Hello, > > I am having trouble with a particular case of setting up a fou tunnel > and I would really appreciate your help. > > I have a remote multihomed host behind a NAT box and I want to create > a fou tunnel for

Re: [PATCH net] strparser: Fix sign of err codes

2018-03-26 Thread Tom Herbert
On Mon, Mar 26, 2018 at 12:31 PM, Dave Watson wrote: > strp_parser_err is called with a negative code everywhere, which then > calls abort_parser with a negative code. strp_msg_timeout calls > abort_parser directly with a positive code. Negate ETIMEDOUT > to match

[PATCH v2 net] kcm: lock lower socket in kcm_attach

2018-03-13 Thread Tom Herbert
Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/kcm/kcmsock.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index f297d53a11aa..34355fd19f27 100644 --- a/net/kcm/kcmsock.c +++ b/net/kcm/kcmso

Re: [PATCH net] kcm: lock lower socket in kcm_attach

2018-03-12 Thread Tom Herbert
On Mon, Mar 12, 2018 at 2:09 PM, Eric Biggers <ebigge...@gmail.com> wrote: > On Mon, Mar 12, 2018 at 02:04:12PM -0700, Tom Herbert wrote: >> Need to lock lower socket in order to provide mutual exclusion >> with kcm_unattach. >> >> Fixes: ab7ac4eb9832e32a

[PATCH net] kcm: lock lower socket in kcm_attach

2018-03-12 Thread Tom Herbert
Need to lock lower socket in order to provide mutual exclusion with kcm_unattach. Fixes: ab7ac4eb9832e32a09f4e804 ("kcm: Kernel Connection Multiplexor module") Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/kcm/kcmsock.c | 33 +++-- 1

Re: KASAN: use-after-free Read in get_work_pool

2018-03-11 Thread Tom Herbert
On Sun, Mar 11, 2018 at 2:34 PM, Eric Biggers wrote: > On Wed, Feb 14, 2018 at 02:45:05PM +0100, 'Dmitry Vyukov' via syzkaller-bugs > wrote: >> On Wed, Dec 6, 2017 at 1:50 PM, Dmitry Vyukov wrote: >> > On Fri, Oct 27, 2017 at 11:18 PM, Cong Wang

Re: BUG: free active (active state 0) object type: work_struct hint: strp_work

2018-02-14 Thread Tom Herbert
On Tue, Feb 13, 2018 at 12:15 PM, Dmitry Vyukov <dvyu...@google.com> wrote: > > On Thu, Jan 4, 2018 at 8:36 PM, Tom Herbert <t...@quantonium.net> wrote: > > On Thu, Jan 4, 2018 at 4:10 AM, syzbot > > <syzbot+3c6c745b0d2f341bb...@syzkaller.appspotmail.com> wrote:

[PATCH net-next] kcm: Call strp_stop before strp_done in kcm_attach

2018-02-14 Thread Tom Herbert
: e5571240236c5652f ("kcm: Check if sk_user_data already set in kcm_attach" Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/kcm/kcmsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index f297d53a11aa..435594648dac 100644 --- a/net/kcm/kcm

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-02-07 Thread Tom Herbert
On Wed, Jan 31, 2018 at 5:53 AM, Björn Töpel wrote: > From: Björn Töpel > > This RFC introduces a new address family called AF_XDP that is > optimized for high performance packet processing and zero-copy > semantics. Throughput improvements can be up

[PATCH v2 net-next 0/2] kcm: fix two syzcaller issues

2018-01-24 Thread Tom Herbert
check for not PF_KCM in kcm_attach (suggested by Guillaume Nault) Tom Herbert (2): kcm: Only allow TCP sockets to be attached to a KCM mux kcm: Check if sk_user_data already set in kcm_attach net/kcm/kcmsock.c | 25 + 1 file changed, 21 insertions(+), 4 deletions

[PATCH v2 net-next 1/2] kcm: Only allow TCP sockets to be attached to a KCM mux

2018-01-24 Thread Tom Herbert
TCP sockets for IPv4 and IPv6 that are not listeners or in closed stated are allowed to be attached to a KCM mux. Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot+8865eaff7f9acd593...@syzkaller.appspotmail.com Signed-off-by: Tom Herbert <t...@q

[PATCH v2 net-next 2/2] kcm: Check if sk_user_data already set in kcm_attach

2018-01-24 Thread Tom Herbert
under the lock. Followup work is needed to unify all the use cases of sk_user_data to use the same locking. Reported-by: syzbot+114b15f2be420a888...@syzkaller.appspotmail.com Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Signed-off-by: Tom Herbert <t...@quantonium.

[PATCH net-next 2/2] kcm: Check if sk_user_data already set in kcm_attach

2018-01-23 Thread Tom Herbert
under the lock. Followup work is needed to unify all the use cases of sk_user_data to use the same locking. Reported-by: syzbot+114b15f2be420a888...@syzkaller.appspotmail.com Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Signed-off-by: Tom Herbert <t...@quantonium.

[PATCH net-next 1/2] kcm: Only allow TCP sockets to be attached to a KCM mux

2018-01-23 Thread Tom Herbert
TCP sockets for IPv4 and IPv6 that are not listeners or in closed stated are allowed to be attached to a KCM mux. Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot+8865eaff7f9acd593...@syzkaller.appspotmail.com Signed-off-by: Tom Herbert <t...@q

[PATCH net-next 0/2] kcm: fix two syzcaller issues

2018-01-23 Thread Tom Herbert
In this patch set: - Don't allow attaching non-TCP or listener sockets to a KCM mux. - In kcm_attach Check if sk_user_data is already set. This is under lock to avoid race conditions. More work is need to make all of the users of sk_user_data to use the same locking. Tom Herbert (2): kcm

Re: [PATCH net-next] kcm: do not attach sockets if sk_user_data is already used

2018-01-18 Thread Tom Herbert
On Thu, Jan 18, 2018 at 10:08 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Thu, 2018-01-18 at 09:46 -0800, Tom Herbert wrote: >> >> Then that's increasing the udp_sock structure size for a narrow use >> case which will get push back. I think it's going to be

Re: [PATCH net-next] kcm: do not attach sockets if sk_user_data is already used

2018-01-18 Thread Tom Herbert
gt; >>> Date: Wed, 17 Jan 2018 11:13:33 + >>> >>> > On 16 January 2018 at 19:00, David Miller <da...@davemloft.net> wrote: >>> >> From: Tom Herbert <t...@herbertland.com> >>> >> Date: Tue, 16 Jan 2018 09:36:41 -0800 >

Re: [PATCH net-next] kcm: do not attach sockets if sk_user_data is already used

2018-01-18 Thread Tom Herbert
On Wed, Jan 17, 2018 at 11:25 AM, David Miller <da...@davemloft.net> wrote: > From: James Chapman <jchap...@katalix.com> > Date: Wed, 17 Jan 2018 11:13:33 + > >> On 16 January 2018 at 19:00, David Miller <da...@davemloft.net> wrote: >>> From: Tom He

Re: KASAN: use-after-free Read in psock_write_space

2018-01-16 Thread Tom Herbert
On Tue, Jan 16, 2018 at 12:40 PM, syzbot wrote: > syzkaller has found reproducer for the following crash on > a8750ddca918032d6349adbf9a4b6555e7db20da > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler: gcc

Re: [PATCH net-next] kcm: do not attach sockets if sk_user_data is already used

2018-01-16 Thread Tom Herbert
On Sun, Jan 14, 2018 at 3:32 AM, James Chapman wrote: > SIOCKCMATTACH writes a connected socket's sk_user_data for its own > use. Prevent it doing so if the socket's sk_user_data is already set > since some sockets (e.g. encapsulated sockets) use sk_user_data > internally. >

Re: BUG: free active (active state 0) object type: work_struct hint: strp_work

2018-01-04 Thread Tom Herbert
On Thu, Jan 4, 2018 at 4:10 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 6bb8824732f69de0f233ae6b1a8158e149627b38 > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1

[PATCH net 2/2] strparser: Call sock_owned_by_user_nocheck

2017-12-28 Thread Tom Herbert
com> Reported-and-tested-by: <syzbot+c91c53af67f9ebe599a337d2e70950366153b...@syzkaller.appspotmail.com> Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net

[PATCH net 0/2] strparser: Fix lockdep issue

2017-12-28 Thread Tom Herbert
glegroups.com> Reported-and-tested-by: <syzbot+c91c53af67f9ebe599a337d2e70950366153b...@syzkaller.appspotmail.com> Tom Herbert (2): sock: Add sock_owned_by_user_nocheck strparser: Call sock_owned_by_user_nocheck include/net/sock.h| 5 + net/strparser/strparser.c | 2 +- 2 files

[PATCH net 1/2] sock: Add sock_owned_by_user_nocheck

2017-12-28 Thread Tom Herbert
This allows checking socket lock ownership with producing lockdep warnings. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/sock.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index 9155da422692..7a7b14e9628a

Re: WARNING in strp_data_ready

2017-12-28 Thread Tom Herbert
On Thu, Dec 28, 2017 at 12:59 AM, Ozgur <oz...@goosey.org> wrote: > > > 28.12.2017, 04:19, "Tom Herbert" <t...@herbertland.com>: >> On Wed, Dec 27, 2017 at 12:20 PM, Ozgur <oz...@goosey.org> wrote: >>> 27.12.2017, 23:14, "Dmitry Vyukov&quo

Re: WARNING in strp_data_ready

2017-12-27 Thread Tom Herbert
t; <dvyu...@google.com>: >>>> On Wed, Dec 27, 2017 at 8:09 PM, Tom Herbert <t...@herbertland.com> wrote: >>>>> Did you try the patch I posted? >>>> >>>> Hi Tom, >>> >>> Hello Dmitry, >>> >>>> N

[PATCH RFC 0/2] kcm: Fix lockdep issue

2017-12-27 Thread Tom Herbert
When sock_owned_by_user returns true in strparser. Fix is to add and call sock_owned_by_user_nocheck since the check for owned by user is not an error condition in this case. Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages") Reported-by: syzbot <syzkal...@googlegro

[PATCH RFC 1/2] sock: Add sock_owned_by_user_nocheck

2017-12-27 Thread Tom Herbert
This allows checking socket lock ownership with producing lockdep warnings. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/sock.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index 6c1db823f8b9..66fd3951e6f3

[PATCH RFC 2/2] strparser: Call sock_owned_by_user_nocheck

2017-12-27 Thread Tom Herbert
m> Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index c5fda15ba319..1fdab5c4eda8 100644 --- a/net/strparser/strparser.c +++ b/net/strparser

Re: WARNING in strp_data_ready

2017-12-27 Thread Tom Herbert
Did you try the patch I posted? On Wed, Dec 27, 2017 at 10:25 AM, Dmitry Vyukov wrote: > On Wed, Dec 6, 2017 at 4:44 PM, Dmitry Vyukov wrote: >>> wrote: On 10/24/2017 08:20 AM, syzbot wrote: > Hello, > >

Re: [PATCH v5 net-next 0/7] net: ILA notification mechanism and fixes

2017-12-26 Thread Tom Herbert
On Tue, Dec 26, 2017 at 2:29 PM, David Miller <da...@davemloft.net> wrote: > From: Tom Herbert <t...@quantonium.net> > Date: Thu, 21 Dec 2017 11:33:25 -0800 > >> This patch set adds support to get netlink notifications for ILA >> routes when a route is us

[PATCH v2 net-next 2/2] strparser: Call sock_owned_by_user_nocheck

2017-12-23 Thread Tom Herbert
m> Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index c5fda15ba319..1fdab5c4eda8 100644 --- a/net/strparser/strparser.c +++ b/net/strparser

[PATCH v2 net-next 0/2] kcm: Fix two locking issues

2017-12-23 Thread Tom Herbert
lock and KCM socket lock are acquired in the same order as the RX path. Tested: Ran KCM traffic without incident. v2: Remove patches to address potential deadlock. I couldn't convince myself this is an issue after looking at the code some more. Tom Herbert (2): sock: Add

[PATCH v2 net-next 1/2] sock: Add sock_owned_by_user_nocheck

2017-12-23 Thread Tom Herbert
This allows checking socket lock ownership with producing lockdep warnings. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/sock.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index 6c1db823f8b9..66fd3951e6f3

[PATCH net-next 0/4] kcm: Fix two locking issues

2017-12-22 Thread Tom Herbert
lock and KCM socket lock are acquired in the same order as the RX path. Tested: Ran KCM traffic without incident. Tom Herbert (4): sock: Add sock_owned_by_user_nocheck strparser: Call sock_owned_by_user_nocheck sock_lock: Add try_sock_lock kcm: Address deadlock between TX and RX paths

[PATCH net-next 4/4] kcm: Address deadlock between TX and RX paths

2017-12-22 Thread Tom Herbert
been added to kcm structure to prevent multiple threads doing write_msgs when the KCM lock is dropped. kernel_sendpage_locked is now called to do the send data with lock already held. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/kcm.h | 1 + net/kcm/kcmsock.

[PATCH net-next 3/4] sock_lock: Add try_sock_lock

2017-12-22 Thread Tom Herbert
try_sock lock is an opportunistic attempt to acquire a socket lock without blocking or sleeping. If the socket lock is acquired then true is returned, else false is returned. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/sock.h | 7 +++ net/core/sock.c

[PATCH net-next 2/4] strparser: Call sock_owned_by_user_nocheck

2017-12-22 Thread Tom Herbert
m> Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index c5fda15ba319..1fdab5c4eda8 100644 --- a/net/strparser/strparser.c +++ b/net/strparser

[PATCH net-next 1/4] sock: Add sock_owned_by_user_nocheck

2017-12-22 Thread Tom Herbert
This allows checking socket lock ownership with producing lockdep warnings. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/sock.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index 0a32f3ce381c..3b4ca2046f8c

[PATCH v5 net-next 5/7] ila: Create main ila source file

2017-12-21 Thread Tom Herbert
Create a main ila file that contains the module initialization functions as well as netlink definitions. Previously these were defined in ila_xlat and ila_common. This approach allows better extensibility. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/Makefile

[PATCH v5 net-next 4/7] ila: Call library function alloc_bucket_locks

2017-12-21 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/ila_xlat.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/net/ip

[PATCH v5 net-next 7/7] ila: Route notify

2017-12-21 Thread Tom Herbert
-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/ila.h | 2 + include/uapi/linux/rtnetlink.h | 1 + net/ipv6/ila/ila_lwt.c | 273 - 3 files changed, 191 insertions(+), 85 deletions(-) diff --git a/include/uapi/linux/i

[PATCH v5 net-next 3/7] ila: Fix use of rhashtable walk in ila_xlat.c

2017-12-21 Thread Tom Herbert
Perform better EAGAIN handling, handle case where ila_dump_info fails and we missed objects in the dump, and add a skip index to skip over ila entires in a list on a rhashtable node that have already been visited (by a previous call to ila_nl_dump). Signed-off-by: Tom Herbert <t...@quantonium.

[PATCH v5 net-next 2/7] rtnetlink: Add notify route message types

2017-12-21 Thread Tom Herbert
Add notify route message and notify rtnl group. This is used to send a notification about a route. For example, this will be used with ILA to notify a daemon to send an ILA redirect. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/rtnetlink.h | 5 + 1 file chan

[PATCH v5 net-next 6/7] ila: Flush netlink command to clear xlat table

2017-12-21 Thread Tom Herbert
Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/ila.h | 1 + net/ipv6/ila/ila.h | 1 + net/ipv6/ila/ila_main.c | 6 + net/ipv6/ila/ila_xlat.c

[PATCH v5 net-next 0/7] net: ILA notification mechanism and fixes

2017-12-21 Thread Tom Herbert
notifications to be regular routing messages of event RTM_ADDR_RESOLVE, family RTNL_FAMILY_ILA, and group RTNLGRP_ILA_NOTIFY Tom Herbert (7): lwt: Add net to build_state argument rtnetlink: Add notify route message types ila: Fix use of rhashtable walk in ila_xlat.c ila: Call library

[PATCH v5 net-next 1/7] lwt: Add net to build_state argument

2017-12-21 Thread Tom Herbert
Users of LWT need to know net if they want to have per net operations in LWT. Acked-by: Roopa Prabhu <ro...@cumulusnetworks.com> Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/lwtunnel.h| 6 +++--- net/core/lwt_bpf.c| 2 +- net/core/lwtunnel.c |

[PATCH v4 net-next 1/6] lwt: Add net to build_state argument

2017-12-15 Thread Tom Herbert
Users of LWT need to know net if they want to have per net operations in LWT. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/lwtunnel.h| 6 +++--- net/core/lwt_bpf.c| 2 +- net/core/lwtunnel.c | 4 ++-- net/ipv4/fib_semantics.c | 13 - ne

[PATCH v4 net-next 6/6] ila: Route notify

2017-12-15 Thread Tom Herbert
address resolution needs to be done on an address. - One an ILA router an ILA host route entry may include a noitification. The purpose of this is to get a notification to a userspace daemon to send and ILA redirect Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi

[PATCH v4 net-next 3/6] ila: Call library function alloc_bucket_locks

2017-12-15 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/ila_xlat.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/net/ip

[PATCH v4 net-next 4/6] ila: create main ila source file

2017-12-15 Thread Tom Herbert
Create a main ila file that contains the module initialization functions as well as netlink definitions. Previously these were defined in ila_xlat and ila_common. This approach allows better extensibility. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/Makefile

[PATCH v4 net-next 5/6] ila: Flush netlink command to clear xlat table

2017-12-15 Thread Tom Herbert
Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/ila.h | 1 + net/ipv6/ila/ila.h | 1 + net/ipv6/ila/ila_main.c | 6 + net/ipv6/ila/ila_xlat.c

[PATCH v4 net-next 0/6] net: ILA notification mechanism and fixes

2017-12-15 Thread Tom Herbert
to be regular routing messages of event RTM_ADDR_RESOLVE, family RTNL_FAMILY_ILA, and group RTNLGRP_ILA_NOTIFY Tom Herbert (6): lwt: Add net to build_state argument ila: Fix use of rhashtable walk in ila_xlat.c ila: Call library function alloc_bucket_locks ila: create main ila source file

[PATCH v4 net-next 2/6] ila: Fix use of rhashtable walk in ila_xlat.c

2017-12-15 Thread Tom Herbert
Perform better EAGAIN handling, handle case where ila_dump_info fails and we missed objects in the dump, and add a skip index to skip over ila entires in a list on a rhashtable node that have already been visited (by a previous call to ila_nl_dump). Signed-off-by: Tom Herbert <t...@quantonium.

Re: [PATCH v3 net-next 0/9] net: Generic network resolver backend and ILA resolver

2017-12-11 Thread Tom Herbert
On Mon, Dec 11, 2017 at 2:16 PM, Tom Herbert <t...@quantonium.net> wrote: > On Mon, Dec 11, 2017 at 1:34 PM, David Miller <da...@davemloft.net> wrote: >> From: Tom Herbert <t...@quantonium.net> >> Date: Mon, 11 Dec 2017 12:38:28 -0800 >> >>> DOS

Re: [PATCH v3 net-next 0/9] net: Generic network resolver backend and ILA resolver

2017-12-11 Thread Tom Herbert
On Mon, Dec 11, 2017 at 1:34 PM, David Miller <da...@davemloft.net> wrote: > From: Tom Herbert <t...@quantonium.net> > Date: Mon, 11 Dec 2017 12:38:28 -0800 > >> DOS mitigations: >> >> - The number of outstanding resolutions is limited by the size of the >

[PATCH v3 net-next 1/9] lwt: Add net to build_state argument

2017-12-11 Thread Tom Herbert
Users of LWT need to know net if they want to have per net operations in LWT. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/lwtunnel.h| 6 +++--- net/core/lwt_bpf.c| 2 +- net/core/lwtunnel.c | 4 ++-- net/ipv4/fib_semantics.c | 13 - ne

[PATCH v3 net-next 7/9] ila: Resolver mechanism

2017-12-11 Thread Tom Herbert
for such messages and perform an ILA resolution protocol to determine the ILA mapping. If the mapping is resolved then a /128 ila encap router is set so that host can perform ILA translation and send directly to destination. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi

[PATCH v3 net-next 9/9] ila: add netlink control ILA resolver

2017-12-11 Thread Tom Herbert
Add a netlink family to processe netlinkf for the ILA resolver. This calls the net resolver netlink functions. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/ila.h| 11 net/ipv6/ila/ila.h | 8 ++ net/ipv6/ila/ila_main.c

[PATCH v3 net-next 6/9] net: Generic resolver backend

2017-12-11 Thread Tom Herbert
a timeout. If the timeout is set then the maximum rate of new resolution requests is max_table_size / timeout. For instance, with a maximum size of 1000 entries and a timeout of 100 msecs the maximum rate of resolutions requests is 1/s. Signed-off-by: Tom Herbert <t...@quantonium.net> --- inclu

[PATCH v3 net-next 5/9] ila: Flush netlink command to clear xlat table

2017-12-11 Thread Tom Herbert
Add ILA_CMD_FLUSH netlink command to clear the ILA translation table. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/uapi/linux/ila.h | 1 + net/ipv6/ila/ila.h | 1 + net/ipv6/ila/ila_main.c | 6 + net/ipv6/ila/ila_xlat.c

[PATCH v3 net-next 8/9] resolver: add netlink control

2017-12-11 Thread Tom Herbert
the backend functions to provide netlink for the resolver. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/net/resolver.h | 26 +++- net/ipv6/ila/ila_resolver.c | 3 +- net/resolver/resolver.c | 280 +++- 3 files changed, 305 inse

[PATCH v3 net-next 4/9] ila: create main ila source file

2017-12-11 Thread Tom Herbert
Create a main ila file that contains the module intialization functions as well as netlink definitions. Previously these were defined in ila_xlat and ila_common. This approach allows better extensibility. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/Makefile

[PATCH v3 net-next 3/9] ila: Call library function alloc_bucket_locks

2017-12-11 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. Signed-off-by: Tom Herbert <t...@quantonium.net> --- net/ipv6/ila/ila_xlat.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/net/ip

[PATCH v3 net-next 0/9] net: Generic network resolver backend and ILA resolver

2017-12-11 Thread Tom Herbert
tate - Made resolve timeout an attribute of the LWT encap route - Changed ILA notifications to be regular routing messages of event RTM_ADDR_RESOLVE, family RTNL_FAMILY_ILA, and group RTNLGRP_ILA_NOTIFY Tom Herbert (9): lwt: Add net to build_state argument ila: Fix use of rhashtable walk

[PATCH v3 net-next 2/9] ila: Fix use of rhashtable walk in ila_xlat.c

2017-12-11 Thread Tom Herbert
Perform better EAGAIN handling, handle case where ila_dump_info fails and we miss mis objects in the dump, and add a skip index to skip over ila entires in a list on a rhashtable node that have already been visited (by a previous call to ila_nl_dump). Signed-off-by: Tom Herbert &l

Re: [RFC v2 6/6] flow_dissector: Parse batman-adv unicast headers

2017-12-06 Thread Tom Herbert
On Wed, Dec 6, 2017 at 8:54 AM, Willem de Bruijn <willemdebruijn.ker...@gmail.com> wrote: > On Wed, Dec 6, 2017 at 5:26 AM, Sven Eckelmann > <sven.eckelm...@openmesh.com> wrote: >> On Dienstag, 5. Dezember 2017 09:19:45 CET Tom Herbert wrote: >> [...] >>> S

Re: [RFC v2 6/6] flow_dissector: Parse batman-adv unicast headers

2017-12-05 Thread Tom Herbert
On Tue, Dec 5, 2017 at 6:35 AM, Sven Eckelmann wrote: > The batman-adv unicast packets contain a full layer 2 frame in encapsulated > form. The flow dissector must therefore be able to parse the batman-adv > unicast header to reach the layer 2+3 information. > >

[PATCH v2 net-next 3/5] rhashtable: abstract out function to get hash

2017-12-04 Thread Tom Herbert
Split out most of rht_key_hashfn which is calculating the hash into its own function. This way the hash function can be called separately to get the hash value. Acked-by: Thomas Graf <tg...@suug.ch> Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/linux/rhash

[PATCH v2 net-next 5/5] rhashtable: Call library function alloc_bucket_locks

2017-12-04 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. This function is based on the old alloc_bucket_locks in rhashtable and should produce the same effect. Signed-off-by: Tom Herbert <t...@quantonium.net> --- lib/rhashtable.

[PATCH v2 net-next 4/5] spinlock: Add library function to allocate spinlock buckets array

2017-12-04 Thread Tom Herbert
the number of spinlocks to allocate. The number allocated is rounded up to a power of two to make the array amenable to hash lookup. Signed-off-by: Tom Herbert <t...@quantonium.net> --- include/linux/spinlock.h | 6 ++ lib/Makefile | 2 +- lib/bucket_locks.c

[PATCH v2 net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-12-04 Thread Tom Herbert
. __rhashtable_walk_find_next is called from rhashtable_walk_next and rhastable_walk_peek. end_of_table is an added field to the iter structure. This indicates that the end of table was reached (walker.tbl being NULL is not a sufficient condition for end of table). Signed-off-by: Tom Herbert &l

[PATCH v2 net-next 0/5] rhashtable: New features in walk and bucket

2017-12-04 Thread Tom Herbert
when the iterator has reached to the eno. Tom Herbert (5): rhashtable: Change rhashtable_walk_start to return void rhashtable: Add rhastable_walk_peek rhashtable: abstract out function to get hash spinlock: Add library function to allocate spinlock buckets array rhashtable: Call library

[PATCH v2 net-next 1/5] rhashtable: Change rhashtable_walk_start to return void

2017-12-04 Thread Tom Herbert
the few cases where the caller cares about the resize event, particularly where the table can be walked in mulitple parts for netlink or seq file dump, the function rhashtable_walk_start_check has been added that returns -EAGAIN on a resize event. Signed-off-by: Tom Herbert <t...@qua

  1   2   3   4   5   6   7   8   9   10   >