Re: [ovs-dev] selftests: openvswitch: Questions about possible enhancements

2024-04-25 Thread Jakub Kicinski
On Thu, 25 Apr 2024 19:57:19 +0100 Simon Horman wrote: > openvswitch.sh does not appear to have any dependencies on Open vSwitch > user-space. My understanding is that, rather, it makes use of > tools/testing/selftests/net/openvswitch/ovs-dpctl.py to talk to the Kernel > using Netlink (which is

Re: [ovs-dev] selftests: openvswitch: Questions about possible enhancements

2024-04-24 Thread Jakub Kicinski
On Wed, 24 Apr 2024 17:44:05 +0100 Simon Horman wrote: > I have recently been exercising the Open vSwitch kernel selftests, > using vng, Speaking of ovs tests, we currently don't run them in CI (and suffer related skips in pmtu.sh) because Amazon Linux doesn't have ovs packaged and building it

Re: [ovs-dev] [PATCH net-next v4] net: openvswitch: Check vport netdev name

2024-04-22 Thread Jakub Kicinski
On Fri, 19 Apr 2024 14:14:25 +0800 Jun Gu wrote: > vport->dev = dev_get_by_name(ovs_dp_get_net(vport->dp), name); > - if (!vport->dev) { > + /* Ensure that the device exists and that the provided > + * name is not one of its aliases. > + */ > + if (!vport->dev ||

Re: [ovs-dev] [PATCH net-next v4] net: openvswitch: Check vport netdev name

2024-04-19 Thread Jakub Kicinski
On Fri, 19 Apr 2024 12:31:33 +0800 Jun Gu wrote: > From: "jun.gu" > > Ensure that the provided netdev name is not one of its aliases to > prevent unnecessary creation and destruction of the vport by > ovs-vswitchd. > > Signed-off-by: jun.gu > Acked-by: Eelco Chaudron I said: When you

Re: [ovs-dev] [PATCH net-next v4] net: openvswitch: Check vport netdev name

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 10:32:42 +0800 jun.gu wrote: > + if ((!vport->dev) || strcmp(name, ovs_vport_name(vport))) { Please drop the unnecessary brackets. When you repost, start a new thread, do not post new version in-reply-to. -- pw-bot: cr ___ dev

[ovs-dev] [PATCH net-next v3 2/3] net: openvswitch: remove unnecessary linux/genetlink.h include

2024-03-29 Thread Jakub Kicinski
genl_family perhaps? it's not necessary, types of externs do not need to be known). Signed-off-by: Jakub Kicinski --- CC: pshe...@ovn.org CC: d...@openvswitch.org --- net/openvswitch/meter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/net/openvswitch/meter.h b/net/openvswitch/meter.h index

[ovs-dev] [PATCH net-next v3 3/3] genetlink: remove linux/genetlink.h

2024-03-29 Thread Jakub Kicinski
-by: Sven Eckelmann Signed-off-by: Jakub Kicinski --- v3: - fix double space in a comment v2: - remove extern - include linux/net.h - improve the comment, not "all" requests are serialized CC: ja...@zx2c4.com CC: mareklind...@neomailbox.ch CC: s...@simonwunderlich.de CC: a...@unstable.c

Re: [ovs-dev] [PATCH net-next v2 3/3] genetlink: remove linux/genetlink.h

2024-03-25 Thread Jakub Kicinski
On Mon, 25 Mar 2024 19:45:05 +0200 Andy Shevchenko wrote: > > +/* Non-parallel generic netlink requests are serialized by a global lock. > > */ > > While at it, maybe drop extra space? (I noticed it was originally like this. Fair, I'll post v3. > > +#define MODULE_ALIAS_GENL_FAMILY(family)

[ovs-dev] [PATCH net-next v2 2/3] net: openvswitch: remove unnecessary linux/genetlink.h include

2024-03-25 Thread Jakub Kicinski
genl_family perhaps? it's not necessary, types of externs do not need to be known). Signed-off-by: Jakub Kicinski --- CC: pshe...@ovn.org CC: d...@openvswitch.org --- net/openvswitch/meter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/net/openvswitch/meter.h b/net/openvswitch/meter.h index

[ovs-dev] [PATCH net-next v2 3/3] genetlink: remove linux/genetlink.h

2024-03-25 Thread Jakub Kicinski
-by: Sven Eckelmann Signed-off-by: Jakub Kicinski --- v2: - remove extern - include linux/net.h - improve the comment, not "all" requests are serialized CC: ja...@zx2c4.com CC: mareklind...@neomailbox.ch CC: s...@simonwunderlich.de CC: a...@unstable.cc CC: pshe...@ovn.org CC: andr

[ovs-dev] [PATCH net-next 3/3] genetlink: remove linux/genetlink.h

2024-03-09 Thread Jakub Kicinski
-by: Jakub Kicinski --- CC: ja...@zx2c4.com CC: mareklind...@neomailbox.ch CC: s...@simonwunderlich.de CC: a...@unstable.cc CC: s...@narfation.org CC: pshe...@ovn.org CC: andriy.shevche...@linux.intel.com CC: wiregu...@lists.zx2c4.com CC: d...@openvswitch.org --- drivers/net/wireguard/main.c

[ovs-dev] [PATCH net-next 2/3] net: openvswitch: remove unnecessary linux/genetlink.h include

2024-03-09 Thread Jakub Kicinski
genl_family perhaps? it's not necessary, types of externs do not need to be known). Signed-off-by: Jakub Kicinski --- CC: pshe...@ovn.org CC: d...@openvswitch.org --- net/openvswitch/meter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/net/openvswitch/meter.h b/net/openvswitch/meter.h index

Re: [ovs-dev] [RFC 0/7] selftests: openvswitch: cleanups for running as selftests

2024-02-19 Thread Jakub Kicinski
On Fri, 16 Feb 2024 10:28:39 -0500 Aaron Conole wrote: > The series is a host of cleanups to the openvswitch selftest suite > which should be ready to run under the netdev selftest runners using > vng. For now, the testing has been done with RW directories, but > additional testing will be done

Re: [ovs-dev] [PATCH 00/14] Batch 1: Annotate structs with __counted_by

2023-10-02 Thread Jakub Kicinski
On Wed, 27 Sep 2023 08:57:36 -0700 Kees Cook wrote: > > Since the element count member must be set before accessing the annotated > > flexible array member, some patches also move the member's initialization > > earlier. (These are noted in the individual patches.) > > Hi, just checking on this

Re: [ovs-dev] [PATCH net] net: openvswitch: reject negative ifindex

2023-08-15 Thread Jakub Kicinski
attr': '.ifindex'} > > > > Accept 0 since it used to be silently ignored. > > > > Fixes: 54c4ef34c4b6 ("openvswitch: allow specifying ifindex of new > > interfaces") > > Reported-by: syzbot+7456b5dcf65111553...@syzkaller.appspotmail.com > > Signed-o

[ovs-dev] [PATCH net-next v3 03/10] genetlink: remove userhdr from struct genl_info

2023-08-14 Thread Jakub Kicinski
off-by: Jakub Kicinski --- CC: philipp.reis...@linbit.com CC: lars.ellenb...@linbit.com CC: christoph.boehmwal...@linbit.com CC: ax...@kernel.dk CC: pshe...@ovn.org CC: jma...@redhat.com CC: ying@windriver.com CC: jacob.e.kel...@intel.com CC: drbd-...@lists.linbit.com CC: linux-bl...@vger.kernel.org CC

[ovs-dev] [PATCH net] net: openvswitch: reject negative ifindex

2023-08-14 Thread Jakub Kicinski
ff\xff\xff\x7f\x00\x00\x00\x00\x08\x00\x01\x00\x08\x00\x00\x00'], 'bad-attr': '.ifindex'} Accept 0 since it used to be silently ignored. Fixes: 54c4ef34c4b6 ("openvswitch: allow specifying ifindex of new interfaces") Reported-by: syzbot+7456b5dcf65111553...@syzkaller.appspotmail.com Signed-off-b

Re: [ovs-dev] [net-next v4 1/7] net: openvswitch: add last-action drop reason

2023-08-10 Thread Jakub Kicinski
On Thu, 10 Aug 2023 14:13:29 -0400 Aaron Conole wrote: > I think they can be resolved in the same way the mac80211 drops are > resolved by using (__force u32) to pass the reason argument. Yup, preferably by creating a helper which takes enum ovs_drop_reason and does the forcing, rather than

[ovs-dev] [PATCH net-next v2 03/10] genetlink: remove userhdr from struct genl_info

2023-08-10 Thread Jakub Kicinski
off-by: Jakub Kicinski --- CC: philipp.reis...@linbit.com CC: lars.ellenb...@linbit.com CC: christoph.boehmwal...@linbit.com CC: ax...@kernel.dk CC: pshe...@ovn.org CC: jma...@redhat.com CC: ying@windriver.com CC: jacob.e.kel...@intel.com CC: drbd-...@lists.linbit.com CC: linux-bl...@vger.kernel.org CC

Re: [ovs-dev] [PATCH net-next 03/10] genetlink: remove userhdr from struct genl_info

2023-08-09 Thread Jakub Kicinski
On Wed, 09 Aug 2023 22:59:47 +0200 Johannes Berg wrote: > On Wed, 2023-08-09 at 11:26 -0700, Jakub Kicinski wrote: > > Only three families use info->userhdr and fixed headers > > are discouraged for new families. So remove the pointer > > from struct genl_info to

[ovs-dev] [PATCH net-next 03/10] genetlink: remove userhdr from struct genl_info

2023-08-09 Thread Jakub Kicinski
Only three families use info->userhdr and fixed headers are discouraged for new families. So remove the pointer from struct genl_info to save some space. Compute the header pointer at runtime. Saved space will be used for a family pointer in later patches. Signed-off-by: Jakub Kicinski ---

Re: [ovs-dev] [PATCH net-next 0/3] net: handle the exp removal problem with ovs upcall properly

2023-07-18 Thread Jakub Kicinski
On Sun, 16 Jul 2023 17:09:16 -0400 Xin Long wrote: > With the OVS upcall, the original ct in the skb will be dropped, and when > the skb comes back from userspace it has to create a new ct again through > nf_conntrack_in() in either OVS __ovs_ct_lookup() or TC tcf_ct_act(). > > However, the new

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: add drop action

2023-07-10 Thread Jakub Kicinski
On Mon, 10 Jul 2023 20:39:11 +0200 Ilya Maximets wrote: > > As far as I understand what you're proposing, yes :) > > OK. Just to spell it all out: > > Userspace will install a flow with an OVS_FLOW_CMD_NEW: > > match:ip,tcp,... actions:something,something,drop(0) > match:ip,udp,...

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: add drop action

2023-07-10 Thread Jakub Kicinski
On Mon, 10 Jul 2023 18:51:19 +0200 Ilya Maximets wrote: > Makes sense. I wasn't sure that's a good solution from a kernel perspective > either. It's better than defining all these reasons, IMO, but it's not good > enough to be considered acceptable, I agree. > > How about we define just 2

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: add drop action

2023-07-07 Thread Jakub Kicinski
On Fri, 7 Jul 2023 18:04:36 +0200 Ilya Maximets wrote: > >> That already exists, right? Johannes added it in the last release for > >> WiFi. > > > > I'm not sure. The SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE behaves > > similarly > > to that on a surface. However, looking closer, any value

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: add drop action

2023-07-07 Thread Jakub Kicinski
On Fri, 7 Jul 2023 12:30:38 +0200 Ilya Maximets wrote: > A wild idea: How about we do not define actual reasons? i.e. define a > subsystem and just call kfree_skb_reason(skb, SUBSYSTEM | value), where > 'value' is whatever userspace gives as long as it is within a subsystem > range? That

Re: [ovs-dev] [PATCH net v3] net: openvswitch: fix race on port output

2023-04-06 Thread Jakub Kicinski
On Wed, 5 Apr 2023 07:53:41 + Felix Huettner wrote: > assume the following setup on a single machine: > 1. An openvswitch instance with one bridge and default flows > 2. two network namespaces "server" and "client" > 3. two ovs interfaces "server" and "client" on the bridge > 4. for each ovs

Re: [ovs-dev] [PATCH] net: openvswitch: fix race on port output

2023-04-03 Thread Jakub Kicinski
On Mon, 3 Apr 2023 11:18:46 + Felix Hüttner wrote: > On Sat, 1 Apr 2023 6:25:00 +0000 Jakub Kicinski wrote: > > On Fri, 31 Mar 2023 06:25:13 + Felix Hüttner wrote: > > > diff --git a/net/core/dev.c b/net/core/dev.c > > > index 253584777101..6628323b7bea 100644

Re: [ovs-dev] [PATCH] net: openvswitch: fix race on port output

2023-03-31 Thread Jakub Kicinski
On Fri, 31 Mar 2023 08:19:09 + Felix Huettner wrote: > 1. An openvswitch instance with one bridge and default flows > 2. two network namespaces "server" and "client" > 3. two ovs interfaces "server" and "client" on the bridge > 4. for each ovs interface a veth pair with a matching name and 32

Re: [ovs-dev] [PATCH] net: openvswitch: fix race on port output

2023-03-31 Thread Jakub Kicinski
On Fri, 31 Mar 2023 06:25:13 + Felix Hüttner wrote: > diff --git a/net/core/dev.c b/net/core/dev.c > index 253584777101..6628323b7bea 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -3199,6 +3199,7 @@ static u16 skb_tx_hash(const struct net_device *dev, > } > > if

Re: [ovs-dev] [PATCHv2 net-next 0/5] net: move more duplicate code of ovs and tc conntrack into nf_conntrack_ovs

2023-02-09 Thread Jakub Kicinski
On Tue, 7 Feb 2023 17:52:05 -0500 Xin Long wrote: > We've moved some duplicate code into nf_nat_ovs in: > > "net: eliminate the duplicate code in the ct nat functions of ovs and tc" > > This patchset addresses more code duplication in the conntrack of ovs > and tc then creates

Re: [ovs-dev] [PATCH net-next v2 1/3] string_helpers: Move string_is_valid() to the header

2023-02-07 Thread Jakub Kicinski
On Mon, 6 Feb 2023 18:13:12 +0200 Andy Shevchenko wrote: > +static inline bool string_is_valid(const char *s, int len) > +{ > + return memchr(s, '\0', len) ? true : false; > +} I was tempted to suggest adding a kdoc, but perhaps the function doesn't have an obvious enough name? Maybe we

Re: [ovs-dev] 回复: [PATCH v2 1/1] net: openvswitch: reduce cpu_used_mask memory

2023-02-01 Thread Jakub Kicinski
On Wed, 1 Feb 2023 21:35:15 -0800 Jakub Kicinski wrote: > On Thu, 2 Feb 2023 05:09:51 + 陶 缘 wrote: > > I guest you are pointing to the field "From: taoyuan_e...@hotmail.com" in > > the patch header linked from "Headers show" section in the patch page > &g

Re: [ovs-dev] 回复: [PATCH v2 1/1] net: openvswitch: reduce cpu_used_mask memory

2023-02-01 Thread Jakub Kicinski
On Thu, 2 Feb 2023 05:09:51 + 陶 缘 wrote: > I guest you are pointing to the field "From: taoyuan_e...@hotmail.com" in the > patch header linked from "Headers show" section in the patch page > > >

Re: [ovs-dev] [PATCH] scripts/spelling.txt: add "exsits" pattern and fix typo instances

2023-01-26 Thread Jakub Kicinski
On Thu, 26 Jan 2023 16:22:05 +0100 Luca Ceresoli wrote: > Fix typos and add the following to the scripts/spelling.txt: > > exsits||exists > > Signed-off-by: Luca Ceresoli You need to split this up per subsystem, I reckon :( ___ dev mailing list

Re: [ovs-dev] [PATCH] [PATCH v6 net-next] net: openvswitch: Add support to count upcall packets

2022-11-30 Thread Jakub Kicinski
On Wed, 30 Nov 2022 04:15:59 -0500 wangchuanlei wrote: > +/** > + * ovs_vport_get_upcall_stats - retrieve upcall stats > + * > + * @vport: vport from which to retrieve the stats > + * @ovs_vport_upcall_stats: location to store stats s/ovs_vport_upcall_// > + * > + * Retrieves upcall stats for

[ovs-dev] [PATCH net] net: openvswitch: add missing .resv_start_op

2022-10-27 Thread Jakub Kicinski
enetlink: start to validate reserved header bytes") Signed-off-by: Jakub Kicinski --- CC: pshe...@ovn.org CC: p...@paul-moore.com CC: d...@openvswitch.org --- net/openvswitch/datapath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.

Re: [ovs-dev] [PATCH 02/12] skbuff: Proactively round up to kmalloc bucket size

2022-09-22 Thread Jakub Kicinski
ere to alloc_size for consistency but one could argue either way :) Acked-by: Jakub Kicinski ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Re: [ovs-dev] [PATCH v2 net 2/2] net: openvswitch: allow conntrack in non-initial user namespace

2022-09-22 Thread Jakub Kicinski
On Wed, 21 Sep 2022 03:19:46 +0200 Michael Weiß wrote: > Similar to the previous commit, the Netlink interface of the OVS > conntrack module was restricted to global CAP_NET_ADMIN by using > GENL_ADMIN_PERM. This is changed to GENL_UNS_ADMIN_PERM to support > unprivileged containers in non-initial

[ovs-dev] [PATCH net-next] genetlink: start to validate reserved header bytes

2022-08-24 Thread Jakub Kicinski
that new families do the right thing by default put the onus of opting out of validation on existing families. Signed-off-by: Jakub Kicinski --- CC: j...@resnulli.us CC: johan...@sipsolutions.net CC: linux-bl...@vger.kernel.org CC: osmocom-net-g...@lists.osmocom.org CC: linux-w...@vger.kernel.org CC

Re: [ovs-dev] [PATCH net-next v2 1/3] openvswitch: allow specifying ifindex of new interfaces

2022-08-23 Thread Jakub Kicinski
On Tue, 23 Aug 2022 16:50:21 +0300 Andrey Zhadchenko wrote: > > Are you 100% sure that all user space making this call initializes > > dp_ifindex to 0? There is no validation in the kernel today that > > the field is not garbage as far as I can tell. > > > > If you are sure, please add the

Re: [ovs-dev] [PATCH net-next v2 3/3] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests

2022-08-22 Thread Jakub Kicinski
On Fri, 19 Aug 2022 18:30:44 +0300 Andrey Zhadchenko wrote: > -static size_t ovs_dp_cmd_msg_size(void) > +static size_t ovs_dp_cmd_msg_size(struct datapath *dp) > { > size_t msgsize = NLMSG_ALIGN(sizeof(struct ovs_header)); > + struct dp_nlsk_pids *pids =

Re: [ovs-dev] [PATCH net-next v2 2/3] openvswitch: fix memory leak at failed datapath creation

2022-08-22 Thread Jakub Kicinski
On Mon, 22 Aug 2022 08:53:44 -0400 Aaron Conole wrote: > Thanks for this patch. I guess independent of this series, this patch > should be applied to the net tree as well - it fixes an existing issue. Yes, please, this needs to be reposted separately as [PATCH net].

Re: [ovs-dev] [PATCH net-next v2 1/3] openvswitch: allow specifying ifindex of new interfaces

2022-08-22 Thread Jakub Kicinski
On Fri, 19 Aug 2022 18:30:42 +0300 Andrey Zhadchenko wrote: > CRIU is preserving ifindexes of net devices after restoration. However, > current Open vSwitch API does not allow to target ifindex, so we cannot > correctly restore OVS configuration. > > Use ovs_header->dp_ifindex during

Re: [ovs-dev] [PATCH net-next 1/2] openvswitch: Fix double reporting of drops in dropwatch

2022-07-29 Thread Jakub Kicinski
On Thu, 28 Jul 2022 12:12:58 -0400 Mike Pattrick wrote: > Frames sent to userspace can be reported as dropped in > ovs_dp_process_packet, however, if they are dropped in the netlink code > then netlink_attachskb will report the same frame as dropped. > > This patch checks for error codes which

Re: [ovs-dev] [PATCH net-next] net: rename reference+tracking helpers

2022-06-08 Thread Jakub Kicinski
On Wed, 8 Jun 2022 16:58:08 -0600 David Ahern wrote: > On 6/8/22 8:58 AM, Jakub Kicinski wrote: > > IMO to encourage use of the track-capable API we could keep their names > > short and call the legacy functions __netdev_hold() as I mentioned or > > maybe netdev_hold_not

Re: [ovs-dev] [PATCH net-next] net: rename reference+tracking helpers

2022-06-08 Thread Jakub Kicinski
On Wed, 8 Jun 2022 10:27:15 +0200 Jiri Pirko wrote: > Wed, Jun 08, 2022 at 06:39:55AM CEST, k...@kernel.org wrote: > >Netdev reference helpers have a dev_ prefix for historic > >reasons. Renaming the old helpers would be too much churn > > Hmm, I think it would be great to eventually rename the

[ovs-dev] [PATCH net-next] net: rename reference+tracking helpers

2022-06-07 Thread Jakub Kicinski
ack() -> netdev_put() dev_replace_track() -> netdev_ref_replace() Signed-off-by: Jakub Kicinski --- CC: dsah...@kernel.org CC: steffen.klass...@secunet.com CC: jreu...@yaina.de CC: ra...@blackwall.org CC: j...@resnulli.us CC: kgr...@linux.ibm.com CC: ivec...@redhat.com CC: jma...@redhat.com

Re: [ovs-dev] [PATCH RFC 4/5] net/tls: Add support for PF_TLSH (a TLS handshake listener)

2022-04-28 Thread Jakub Kicinski
On Thu, 28 Apr 2022 10:09:17 -0400 Benjamin Coddington wrote: > > Noob reply: wish I knew. (I somewhat hoped _you_ would've been able to > > tell me.) > > > > Thing is, the only method I could think of for fd passing is the POSIX fd > > passing via unix_attach_fds()/unix_detach_fds(). But that's

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-09 Thread Jakub Kicinski
On Wed, 9 Mar 2022 14:43:07 +0100 Ilya Maximets wrote: > >> It's a bit of an uncharted territory, hard to say what's right. > >> It may be a little easier to code up the rejection if we have > >> the types defined (which I think we need to do in > >> __parse_flow_nlattrs()? seems OvS does its own

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-08 Thread Jakub Kicinski
On Tue, 8 Mar 2022 19:25:31 +0100 Ilya Maximets wrote: > > since its rc7 we end up with kernel and ovs broken with each other. > > can we revert the kernel patches anyway and introduce them again later > > when ovs userspace is also updated? > > I don't think this patch is part of 5-17-rc7.

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-08 Thread Jakub Kicinski
On Tue, 8 Mar 2022 20:33:12 +0100 Ilya Maximets wrote: > On 3/8/22 17:17, Jakub Kicinski wrote: > > On Tue, 8 Mar 2022 15:12:45 +0100 Ilya Maximets wrote: > >> Yes, that is something that I had in mind too. The only thing that makes > >> me uncomfortable is OVS_KEY

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-08 Thread Jakub Kicinski
On Tue, 8 Mar 2022 15:12:45 +0100 Ilya Maximets wrote: > >> diff --git a/include/uapi/linux/openvswitch.h > >> b/include/uapi/linux/openvswitch.h > >> index 9d1710f20505..ab6755621e02 100644 > >> --- a/include/uapi/linux/openvswitch.h > >> +++ b/include/uapi/linux/openvswitch.h > >> @@ -351,11

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-07 Thread Jakub Kicinski
On Tue, 8 Mar 2022 01:04:00 +0100 Ilya Maximets wrote: > > Thanks for the explanation, we can apply a revert if that'd help your > > CI / ongoing development but sounds like the fix really is in user > > space. Expecting netlink attribute lists not to grow is not fair. > > I don't think it was

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-07 Thread Jakub Kicinski
On Mon, 7 Mar 2022 23:14:13 +0100 Ilya Maximets wrote: > The main problem is that userspace uses the modified copy of the uapi header > which looks like this: > >

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-03-07 Thread Jakub Kicinski
On Mon, 7 Mar 2022 10:49:31 +0200 Roi Dayan wrote: > >> I think there is a missing userspace fix. didnt verify yet. > >> but in ovs userspace odp-netlink.h created from > >> datapath/linux/compat/include/linux/openvswitch.h > >> and that file is not synced the change here. > >> So the new enum

Re: [ovs-dev] [PATCH net v4 1/1] openvswitch: Fix setting ipv6 fields causing hw csum failure

2022-02-22 Thread Jakub Kicinski
You'll need to rebase, the patch which made everything force inlined got merged. On Sun, 20 Feb 2022 15:21:14 +0200 Paul Blakey wrote: > +static inline __wsum > +csum_block_replace(__wsum csum, __wsum old, __wsum new, int offset) > +{ > + return csum_block_add(csum_block_sub(csum, old,

Re: [ovs-dev] [PATCH net v3 1/1] openvswitch: Fix setting ipv6 fields causing hw csum failure

2022-02-17 Thread Jakub Kicinski
On Wed, 16 Feb 2022 15:53:08 +0200 Paul Blakey wrote: > + skb->csum = > + ~csum_block_add(csum_block_sub(~skb->csum, > +(__force __wsum) > (ipv6_tclass << 4), 1), > + (__force

Re: [ovs-dev] [PATCH net 1/1] net/sched: act_ct: Fix flow table lookup failure with no originating ifindex

2022-02-17 Thread Jakub Kicinski
On Thu, 17 Feb 2022 11:34:24 +0200 Paul Blakey wrote: > Fixes: 9795ded7f924 ("net/sched: act_ct: Fill offloading tupledx") Fixes tag: Fixes: 9795ded7f924 ("net/sched: act_ct: Fill offloading tupledx") Has these problem(s): - Subject does not match target commit subject Just use

Re: [ovs-dev] [PATCH net v2 1/1] openvswitch: Fix setting ipv6 fields causing hw csum failure

2022-02-14 Thread Jakub Kicinski
On Mon, 14 Feb 2022 14:48:51 +0200 Paul Blakey wrote: > Ipv6 ttl, label and tos fields are modified without first > pulling/pushing the ipv6 header, which would have updated > the hw csum (if available). This might cause csum validation > when sending the packet to the stack, as can be seen in >

Re: [ovs-dev] [PATCH net 1/1] openvswitch: Fix setting ipv6 fields causing hw csum failure

2022-02-10 Thread Jakub Kicinski
On Thu, 10 Feb 2022 10:53:24 +0200 Paul Blakey wrote: > > The calls seem a little heavy for single byte replacements. > > Can you instead add a helper based on csum_replace4() maybe? > > > > BTW doesn't pedit have the same problem? > > I don't think they are heavier then csum_replace4,

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2022-02-09 Thread Jakub Kicinski
On Wed, 9 Feb 2022 12:46:01 -0800 Cpp Code wrote: > > ok, I see advantage of using skb_header_pointer() in this case, but > > replacing all check_header() with skb_header_pointer() would add lot > > of copy operation in flow extract. Anyways for this use case > > skb_header_pointer() is fine. > >

Re: [ovs-dev] [PATCH net 1/1] openvswitch: Fix setting ipv6 fields causing hw csum failure

2022-02-08 Thread Jakub Kicinski
On Mon, 7 Feb 2022 16:41:01 +0200 Paul Blakey wrote: > Ipv6 ttl, label and tos fields are modified without first > pulling/pushing the ipv6 header, which would have updated > the hw csum (if available). This might cause csum validation > when sending the packet to the stack, as can be seen in >

Re: [ovs-dev] [PATCH net 1/1] net: openvswitch: Fix ct_state nat flags for conns arriving from tc

2022-01-04 Thread Jakub Kicinski
On Tue, 4 Jan 2022 10:28:21 +0200 Paul Blakey wrote: > Netfilter conntrack maintains NAT flags per connection indicating > whether NAT was configured for the connection. Openvswitch maintains > NAT flags on the per packet flow key ct_state field, indicating > whether NAT was actually executed on

Re: [ovs-dev] [PATCH net v2 2/3] net/sched: flow_dissector: Fix matching on zone id for invalid conns

2021-12-10 Thread Jakub Kicinski
On Thu, 9 Dec 2021 09:57:33 +0200 Paul Blakey wrote: > @@ -238,10 +239,12 @@ void > skb_flow_dissect_ct(const struct sk_buff *skb, > struct flow_dissector *flow_dissector, > void *target_container, u16 *ctinfo_map, > - size_t mapsize, bool

Re: [ovs-dev] [PATCH net 0/3] net/sched: Fix ct zone matching for invalid conntrack state

2021-12-08 Thread Jakub Kicinski
On Wed, 8 Dec 2021 19:02:37 +0200 Paul Blakey wrote: > Currently, when a packet is marked as invalid conntrack_in in act_ct, > post_ct will be set, and connection info (nf_conn) will be removed > from the skb. Later openvswitch and flower matching will parse this > as ct_state=+trk+inv. But

Re: [ovs-dev] [PATCH net-next v8] net: openvswitch: IPv6: Add IPv6 extension header support

2021-11-02 Thread Jakub Kicinski
On Fri, 29 Oct 2021 11:20:08 -0700 Toms Atteka wrote: > This change adds a new OpenFlow field OFPXMT_OFB_IPV6_EXTHDR and > packets can be filtered using ipv6_ext flag. > > Signed-off-by: Toms Atteka Hi! This patch didn't get reviewed in time for the v5.16 merge window, please continue the work

Re: [ovs-dev] [PATCH net-next v6] net: openvswitch: IPv6: Add IPv6 extension header support

2021-09-29 Thread Jakub Kicinski
On Wed, 29 Sep 2021 08:19:05 +0200 Nicolas Dichtel wrote: > > /* Insert a kernel only KEY_ATTR */ > > #define OVS_KEY_ATTR_TUNNEL_INFO__OVS_KEY_ATTR_MAX > > #undef OVS_KEY_ATTR_MAX > > #define OVS_KEY_ATTR_MAX__OVS_KEY_ATTR_MAX > Following the other thread [1], this will break if

Re: [ovs-dev] [PATCH net-next v6] net: openvswitch: IPv6: Add IPv6 extension header support

2021-09-28 Thread Jakub Kicinski
On Tue, 28 Sep 2021 12:47:27 -0700 Toms Atteka wrote: > diff --git a/include/uapi/linux/openvswitch.h > b/include/uapi/linux/openvswitch.h > index a87b44cd5590..dc6eb5f6399f 100644 > --- a/include/uapi/linux/openvswitch.h > +++ b/include/uapi/linux/openvswitch.h > @@ -346,6 +346,13 @@ enum

Re: [ovs-dev] [PATCH net-next v5] net: openvswitch: IPv6: Add IPv6 extension header support

2021-09-21 Thread Jakub Kicinski
On Mon, 20 Sep 2021 11:20:38 -0700 Toms Atteka wrote: > This change adds a new OpenFlow field OFPXMT_OFB_IPV6_EXTHDR and > packets can be filtered using ipv6_ext flag. > > Signed-off-by: Toms Atteka Please make sure to check the files you touch with ./scripts/kernel-doc -none You're adding

Re: [ovs-dev] [PATCH v2] openvswitch: Fix condition check in do_execute_actions() by using nla_ok()

2021-09-17 Thread Jakub Kicinski
On Fri, 17 Sep 2021 08:07:14 + Jiasheng Jiang wrote: > Just using 'rem > 0' might be unsafe, so it's better > to use the nla_ok() instead. > Because we can see from the nla_next() that > '*remaining' might be smaller than 'totlen'. And nla_ok() > will avoid it happening. > For example,

Re: [ovs-dev] [PATCH] openvswitch: Fix condition check by using nla_ok()

2021-09-16 Thread Jakub Kicinski
On Thu, 16 Sep 2021 07:36:40 -0700 Jakub Kicinski wrote: > On Thu, 16 Sep 2021 01:43:23 + Jiasheng Jiang wrote: > > Just using 'rem > 0' might be unsafe, so it's better > > to use the nla_ok() instead. > > Because we can see from the nla_next() that > > '*re

Re: [ovs-dev] [PATCH] openvswitch: Fix condition check by using nla_ok()

2021-09-16 Thread Jakub Kicinski
On Thu, 16 Sep 2021 01:43:23 + Jiasheng Jiang wrote: > Just using 'rem > 0' might be unsafe, so it's better > to use the nla_ok() instead. > Because we can see from the nla_next() that > '*remaining' might be smaller than 'totlen'. And nla_ok() > will avoid it happening. > > Signed-off-by:

Re: [ovs-dev] [External] [PATCH] ovs: datapath: clear skb->tstamp in forwarding path

2021-08-17 Thread Jakub Kicinski
On Tue, 17 Aug 2021 10:25:24 +0800 范开喜 wrote: > fq qdisc requires tstamp to be cleared in the forwarding path. Now ovs > doesn't clear skb->tstamp. We encountered a problem with linux > version 5.4.56 and ovs version 2.14.1, and packets failed to > dequeue from qdisc when fq qdisc was attached to

Re: [ovs-dev] [PATCH net v2] net: openvswitch: fix TTL decrement exception action execution

2020-12-14 Thread Jakub Kicinski
On Mon, 7 Dec 2020 05:08:39 -0500 Eelco Chaudron wrote: > Currently, the exception actions are not processed correctly as the wrong > dataset is passed. This change fixes this, including the misleading > comment. > > In addition, a check was added to make sure we work on an IPv4 packet, > and

Re: [ovs-dev] [PATCH net] net: openvswitch: fix TTL decrement exception action execution

2020-12-04 Thread Jakub Kicinski
On Fri, 4 Dec 2020 07:16:23 -0500 Eelco Chaudron wrote: > Currently, the exception actions are not processed correctly as the wrong > dataset is passed. This change fixes this, including the misleading > comment. > > In addition, a check was added to make sure we work on an IPv4 packet, > and

Re: [ovs-dev] [PATCH net] openvswitch: fix error return code in validate_and_copy_dec_ttl()

2020-12-04 Thread Jakub Kicinski
On Fri, 04 Dec 2020 13:07:48 +0100 Eelco Chaudron wrote: > > Fix to return a negative error code from the error handling > > case instead of 0, as done elsewhere in this function. > > > > Changing 'return start' to 'return action_start' can fix this bug. > > > > Fixes: 69929d4c49e1 ("net:

Re: [ovs-dev] [PATCH net] net: openvswitch: fix TTL decrement action netlink message format

2020-11-23 Thread Jakub Kicinski
On Mon, 23 Nov 2020 20:36:39 +0100 Matteo Croce wrote: > On Fri, Nov 20, 2020 at 10:12 PM Jakub Kicinski wrote: > > On Thu, 19 Nov 2020 04:04:04 -0500 Eelco Chaudron wrote: > > > Currently, the openvswitch module is not accepting the correctly formated > > >

Re: [ovs-dev] [PATCH net] net: openvswitch: fix TTL decrement action netlink message format

2020-11-20 Thread Jakub Kicinski
On Thu, 19 Nov 2020 04:04:04 -0500 Eelco Chaudron wrote: > Currently, the openvswitch module is not accepting the correctly formated > netlink message for the TTL decrement action. For both setting and getting > the dec_ttl action, the actions should be nested in the > OVS_DEC_TTL_ATTR_ACTION

Re: [ovs-dev] [PATCH net-next v2] net: openvswitch: Be liberal in tcp conntrack.

2020-11-20 Thread Jakub Kicinski
On Fri, 20 Nov 2020 07:32:11 +0100 Florian Westphal wrote: > Jakub Kicinski wrote: > > On Mon, 16 Nov 2020 18:31:26 +0530 nusid...@redhat.com wrote: > > > From: Numan Siddique > > > > > > There is no easy way to distinguish if a conntracked tcp pa

Re: [ovs-dev] [PATCH net-next v2] net: openvswitch: Be liberal in tcp conntrack.

2020-11-19 Thread Jakub Kicinski
On Mon, 16 Nov 2020 18:31:26 +0530 nusid...@redhat.com wrote: > From: Numan Siddique > > There is no easy way to distinguish if a conntracked tcp packet is > marked invalid because of tcp_in_window() check error or because > it doesn't belong to an existing connection. With this patch, >

Re: [ovs-dev] [net-next] netfiler: conntrack: Add the option to set ct tcp flag - BE_LIBERAL per-ct basis.

2020-11-09 Thread Jakub Kicinski
On Mon, 9 Nov 2020 12:59:30 +0530 nusid...@redhat.com wrote: > From: Numan Siddique > > Before calling nf_conntrack_in(), caller can set this flag in the > connection template for a tcp packet and any errors in the > tcp_in_window() will be ignored. > > A helper function -

Re: [ovs-dev] [PATCH net v2] net: openvswitch: silence suspicious RCU usage warning

2020-11-03 Thread Jakub Kicinski
On Tue, 3 Nov 2020 09:25:49 +0100 Eelco Chaudron wrote: > Silence suspicious RCU usage warning in ovs_flow_tbl_masks_cache_resize() > by replacing rcu_dereference() with rcu_dereference_ovsl(). > > In addition, when creating a new datapath, make sure it's configured under > the ovs_lock. > >

Re: [ovs-dev] [PATCH net-next] openvswitch: Use IS_ERR instead of IS_ERR_OR_NULL

2020-11-02 Thread Jakub Kicinski
On Sat, 31 Oct 2020 14:01:53 +0800 YueHaibing wrote: > Fix smatch warning: > > net/openvswitch/meter.c:427 ovs_meter_cmd_set() warn: passing zero to > 'PTR_ERR' > > dp_meter_create() never returns NULL, use IS_ERR > instead of IS_ERR_OR_NULL to fix this. > > Signed-off-by: YueHaibing

Re: [ovs-dev] [PATCH net] net: openvswitch: silence suspicious RCU usage warning

2020-11-02 Thread Jakub Kicinski
On Mon, 02 Nov 2020 09:52:19 +0100 Eelco Chaudron wrote: > On 30 Oct 2020, at 22:28, Jakub Kicinski wrote: > >> @@ -1695,6 +1695,9 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, > >> struct genl_info *info) > >>if (err) > >>goto err_des

Re: [ovs-dev] [PATCH net] net: openvswitch: silence suspicious RCU usage warning

2020-10-30 Thread Jakub Kicinski
On Thu, 29 Oct 2020 15:53:21 +0100 Eelco Chaudron wrote: > Silence suspicious RCU usage warning in ovs_flow_tbl_masks_cache_resize() > by replacing rcu_dereference() with rcu_dereference_ovsl(). > > In addition, when creating a new datapath, make sure it's configured under > the ovs_lock. > >

Re: [ovs-dev] [PATCH net v4] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-18 Thread Jakub Kicinski
On Sat, 17 Oct 2020 20:24:51 +0200 Eelco Chaudron wrote: > The flow_lookup() function uses per CPU variables, which must be called > with BH disabled. However, this is fine in the general NAPI use case > where the local BH is disabled. But, it's also called from the netlink > context. The below

Re: [ovs-dev] [PATCH net v3] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-16 Thread Jakub Kicinski
On Thu, 15 Oct 2020 19:09:33 +0200 Eelco Chaudron wrote: > The flow_lookup() function uses per CPU variables, which must be called > with BH disabled. However, this is fine in the general NAPI use case > where the local BH is disabled. But, it's also called from the netlink > context. The below

Re: [ovs-dev] [PATCH 1/9 net-next] net: netdevice.h: sw_netstats_rx_add helper

2020-10-05 Thread Jakub Kicinski
On Mon, 5 Oct 2020 22:34:18 +0200 Fabian Frederick wrote: > +static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned > int len) > +{ > + struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); > + > + u64_stats_update_begin(>syncp); > + tstats->rx_bytes +=

Re: [ovs-dev] [PATCH net-next v2 2/2] net: openvswitch: make masks cache size configurable

2020-07-23 Thread Jakub Kicinski
On Thu, 23 Jul 2020 14:58:31 +0200 Eelco Chaudron wrote: > + if ((size & (size - 1)) != 0 || is_power_of_2() ? > + (size * sizeof(struct mask_cache_entry)) > PCPU_MIN_UNIT_SIZE) > + return NULL; > + new->cache_size = size; > + if (new->cache_size > 0) { > +

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: make masks cache size configurable

2020-07-22 Thread Jakub Kicinski
On Wed, 22 Jul 2020 10:27:52 +0200 Eelco Chaudron wrote: > This patch makes the masks cache size configurable, or with > a size of 0, disable it. > > Reviewed-by: Paolo Abeni > Signed-off-by: Eelco Chaudron Hi Elco! This patch adds a bunch of new sparse warnings:

[ovs-dev] [PATCH net 08/16] openvswitch: add missing attribute validation for hash

2020-03-02 Thread Jakub Kicinski
Add missing attribute validation for OVS_PACKET_ATTR_HASH to the netlink policy. Fixes: bd1903b7c459 ("net: openvswitch: add hash info to upcall") Signed-off-by: Jakub Kicinski --- CC: Pravin B Shelar CC: Tonghao Zhang CC: d...@openvswitch.org --- net/openvswitch/datapath.c | 1

Re: [ovs-dev] [PATCH net] net: openvswitch: free vport unless register_netdevice() succeeds

2019-10-22 Thread Jakub Kicinski
On Mon, 21 Oct 2019 12:01:57 +0200, Stefano Brivio wrote: > From: Hillf Danton > > syzbot found the following crash on: > The function in net core, register_netdevice(), may fail with vport's > destruction callback either invoked or not. After commit 309b66970ee2, I've added the correct

Re: [ovs-dev] AF_XDP with QoS support question

2019-06-08 Thread Jakub Kicinski
On Fri, 7 Jun 2019 19:55:34 -0700, William Tu wrote: > Hi, > > When using AF_XDP, the TC qdisc layer is by-passed and packets go to > userspace directly. One problem is that there is no QoS support when > using AF_XDP. > > For egress shaping, I'm thinking about using tc-mqprio, which has >