Re: [PATCH net] openvswitch: Fix upcall OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS

2020-11-05 Thread Gregory Rose
On 11/3/2020 4:11 PM, Yi-Hung Wei wrote: TUNNEL_GENEVE_OPT is set on tun_flags in struct sw_flow_key when a packet is coming from a geneve tunnel no matter the size of geneve option is zero or not. On the other hand, TUNNEL_VXLAN_OPT or TUNNEL_ERSPAN_OPT is set when the VXLAN or ERSPAN option

Re: net: Initialize return value in gro_cells_receive

2020-10-07 Thread Gregory Rose
On 10/7/2020 9:37 AM, Eric Dumazet wrote: On 10/7/20 5:50 PM, Gregory Rose wrote: On 10/7/2020 1:21 AM, Eric Dumazet wrote: On 10/6/20 8:53 PM, Gregory Rose wrote: The 'res' return value is uninitalized and may be returned with some random value.  Initialize to NET_RX_D

Re: net: Initialize return value in gro_cells_receive

2020-10-07 Thread Gregory Rose
On 10/7/2020 1:21 AM, Eric Dumazet wrote: On 10/6/20 8:53 PM, Gregory Rose wrote: The 'res' return value is uninitalized and may be returned with some random value.  Initialize to NET_RX_DROP as the default return value. Signed-off-by: Greg Rose diff --git a/net/core/gro_cel

net: Initialize return value in gro_cells_receive

2020-10-06 Thread Gregory Rose
The 'res' return value is uninitalized and may be returned with some random value. Initialize to NET_RX_DROP as the default return value. Signed-off-by: Greg Rose diff --git a/net/core/gro_cells.c b/net/core/gro_cells.c index e095fb871d91..4e835960db07 100644 --- a/net/core/gro_cells.c +++ b/n

Re: [ovs-discuss] Double free in recent kernels after memleak fix

2020-08-04 Thread Gregory Rose
On 8/3/2020 12:01 PM, Johan Knöös via discuss wrote: Hi Open vSwitch contributors, We have found openvswitch is causing double-freeing of memory. The issue was not present in kernel version 5.5.17 but is present in 5.6.14 and newer kernels. After reverting the RCU commits below for debugging

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

2019-10-21 Thread Gregory Rose
On 10/21/2019 3:01 AM, Stefano Brivio wrote: From: Hillf Danton syzbot found the following crash on: HEAD commit:1e78030e Merge tag 'mmc-v5.3-rc1' of git://git.kernel.org/.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=148d3d1a60 kernel config: ht

Re: [PATCH net-next v4 00/10] optimize openvswitch flow looking up

2019-10-17 Thread Gregory Rose
On 10/17/2019 12:22 PM, David Miller wrote: From: xiangxia.m@gmail.com Date: Tue, 15 Oct 2019 18:30:30 +0800 This series patch optimize openvswitch for performance or simplify codes. ... Pravin and company, please review! Hi Dave, I've tested the patches and provided my 'Tested-by'

Re: [PATCH net-next v3 00/10] optimize openvswitch flow looking up

2019-10-15 Thread Gregory Rose
On 10/11/2019 7:00 AM, xiangxia.m@gmail.com wrote: From: Tonghao Zhang This series patch optimize openvswitch for performance or simplify codes. Patch 1, 2, 4: Port Pravin B Shelar patches to linux upstream with little changes. Patch 5, 6, 7: Optimize the flow looking up and simplify th

Re: [PATCH net-next v2 00/10] optimize openvswitch flow looking up

2019-10-15 Thread Gregory Rose
On 10/15/2019 1:25 AM, Tonghao Zhang wrote: On Tue, Oct 15, 2019 at 6:26 AM Gregory Rose wrote: [snip] Hi Tonghao, I did make the change you suggested: git diff diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index bc14b12..210018a 100644 --- a/net/openvswitch

Re: [PATCH net-next v2 00/10] optimize openvswitch flow looking up

2019-10-14 Thread Gregory Rose
On 10/10/2019 1:42 AM, Tonghao Zhang wrote: On Wed, Oct 9, 2019 at 1:33 AM Gregory Rose wrote: [snip] Hi Tonghao, I've applied your patch series and built a 5.4.0-rc1 kernel with them. x@ubuntu-1604:~$ modinfo openvswitch filename: /lib/modules/5.4.0-rc1+/kernel/net/openvs

Re: [PATCH net-next v2 00/10] optimize openvswitch flow looking up

2019-10-08 Thread Gregory Rose
On 10/7/2019 6:00 PM, xiangxia.m@gmail.com wrote: From: Tonghao Zhang This series patch optimize openvswitch for performance or simplify codes. Patch 1, 2, 4: Port Pravin B Shelar patches to linux upstream with little changes. Patch 5, 6, 7: Optimize the flow looking up and simplify the

Re: [PATCH V3 net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments

2019-08-28 Thread Gregory Rose
On 8/28/2019 2:54 PM, David Miller wrote: From: Greg Rose Date: Tue, 27 Aug 2019 07:58:09 -0700 When IP fragments are reassembled before being sent to conntrack, the key from the last fragment is used. Unless there are reordering issues, the last fragment received will not contain the L4 port

Re: [PATCH V3 net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments

2019-08-27 Thread Gregory Rose
On 8/27/2019 5:33 PM, Pravin Shelar wrote: On Tue, Aug 27, 2019 at 7:58 AM Greg Rose wrote: When IP fragments are reassembled before being sent to conntrack, the key from the last fragment is used. Unless there are reordering issues, the last fragment received will not contain the L4 ports,

Re: [PATCH V2 net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments

2019-08-27 Thread Gregory Rose
On 8/26/2019 10:13 PM, Pravin Shelar wrote: On Mon, Aug 26, 2019 at 1:46 PM Greg Rose wrote: When IP fragments are reassembled before being sent to conntrack, the key from the last fragment is used. Unless there are reordering issues, the last fragment received will not contain the L4 ports,

Re: [PATCH net-next] openvswitch: Print error when ovs_execute_actions() fails

2019-08-02 Thread Gregory Rose
On 8/1/2019 2:14 PM, Yifeng Sun wrote: Currently in function ovs_dp_process_packet(), return values of ovs_execute_actions() are silently discarded. This patch prints out an error message when error happens so as to provide helpful hints for debugging. Signed-off-by: Yifeng Sun --- net/openvs

Re: [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-12 Thread Gregory Rose
On 7/12/2019 3:18 PM, David Miller wrote: From: Taehee Yoo Date: Sat, 6 Jul 2019 01:08:09 +0900 When a vport is deleted, the maximum headroom size would be changed. If the vport which has the largest headroom is deleted, the new max_headroom would be set. But, if the new headroom size is e

Re: [ovs-dev] [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-12 Thread Gregory Rose
On 7/5/2019 9:08 AM, Taehee Yoo wrote: When a vport is deleted, the maximum headroom size would be changed. If the vport which has the largest headroom is deleted, the new max_headroom would be set. But, if the new headroom size is equal to the old headroom size, updating routine is unnecessary

Re: [ovs-dev] [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-11 Thread Gregory Rose
On 7/11/2019 2:07 PM, Pravin Shelar wrote: I was bit busy for last couple of days. I will finish review by EOD today. Thanks, Pravin. net-next is closed anyway so no rush, but thanks! - Greg On Mon, Jul 8, 2019 at 4:22 PM Gregory Rose wrote: On 7/8/2019 4:18 PM, Gregory Rose wrote

Re: [ovs-dev] [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-08 Thread Gregory Rose
On 7/8/2019 4:18 PM, Gregory Rose wrote: On 7/8/2019 4:08 PM, David Miller wrote: From: Taehee Yoo Date: Sat,  6 Jul 2019 01:08:09 +0900 When a vport is deleted, the maximum headroom size would be changed. If the vport which has the largest headroom is deleted, the new max_headroom would

Re: [ovs-dev] [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-08 Thread Gregory Rose
On 7/8/2019 4:08 PM, David Miller wrote: From: Taehee Yoo Date: Sat, 6 Jul 2019 01:08:09 +0900 When a vport is deleted, the maximum headroom size would be changed. If the vport which has the largest headroom is deleted, the new max_headroom would be set. But, if the new headroom size is equal

Re: [ovs-dev] [PATCH net-next] net: openvswitch: remove unnecessary ASSERT_OVSL in ovs_vport_del()

2019-06-10 Thread Gregory Rose
On 6/9/2019 10:19 AM, Taehee Yoo wrote: ASSERT_OVSL() in ovs_vport_del() is unnecessary because ovs_vport_del() is only called by ovs_dp_detach_port() and ovs_dp_detach_port() calls ASSERT_OVSL() too. Signed-off-by: Taehee Yoo --- net/openvswitch/vport.c | 2 -- 1 file changed, 2 deletions

Re: [ovs-dev] [PATCH net] net: openvswitch: do not free vport if register_netdevice() is failed.

2019-06-10 Thread Gregory Rose
On 6/9/2019 7:26 AM, Taehee Yoo wrote: In order to create an internal vport, internal_dev_create() is used and that calls register_netdevice() internally. If register_netdevice() fails, it calls dev->priv_destructor() to free private data of netdev. actually, a private data of this is a vport.

Re: EoGRE sends undersized frames without padding

2019-06-07 Thread Gregory Rose
On 6/7/2019 12:57 PM, Cong Wang wrote: On Thu, Jun 6, 2019 at 12:36 AM Steinar H. Gunderson wrote: On Wed, Jun 05, 2019 at 06:17:51PM -0700, Cong Wang wrote: Hmm, sounds like openvswitch should pad the packets in this scenario, like hardware switches padding those on real wires. Well, openv

Re: [PATCHv2 net] net: ip6_gre: access skb data after skb_cow_head()

2019-05-30 Thread Gregory Rose
On 5/30/2019 9:59 AM, William Tu wrote: When increases the headroom, skb's data pointer might get re-allocated. As a result, the skb->data before the skb_cow_head becomes a dangling pointer, and dereferences to daddr causes general protection fault at the following line in __gre6_xmit(): if

Re: [PATCH v2 net-next] net: openvswitch: Add a new action check_pkt_len

2019-03-26 Thread Gregory Rose
Ben Pfaff Signed-off-by: Numan Siddique CC: Gregory Rose CC: Pravin B Shelar --- v1 -> v2 - * Addressed the review comments. - Removed the vlan-tag length when checking the packet length - Reordered the netlink attributes - Changed the comments to use 'attribu

Re: [ovs-dev] openvswitch crash on i386

2019-03-05 Thread Gregory Rose
On 3/5/2019 2:52 PM, Gregory Rose wrote: I have an i386 Ubuntu 18 VM to test this on.  I'll investigate and see what I can find. - Greg I have a repro.  It's not the same kernel (4.13 in my case) but looks like the same issue. - Greg

Re: [ovs-dev] openvswitch crash on i386

2019-03-05 Thread Gregory Rose
On 3/5/2019 11:58 AM, Joe Stringer wrote: On Tue, Mar 5, 2019 at 2:12 AM Christian Ehrhardt wrote: On Tue, Mar 5, 2019 at 10:58 AM Juerg Haefliger wrote: Hi, Running the following commands in a loop will crash an i386 5.0 kernel typically within a few iterations: ovs-vsctl add-br test ovs

Re: [PATCH net] net: ip6_gre: fix possible NULL pointer dereference in ip6erspan_set_version

2019-02-20 Thread Gregory Rose
On 2/20/2019 12:23 AM, Lorenzo Bianconi wrote: Fix a possible NULL pointer dereference in ip6erspan_set_version checking nlattr data pointer kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: [#1] PREEMPT SMP KAS

Re: [PATCH net] net: ip6_gre: initialize erspan_ver just for erspan tunnels

2019-02-15 Thread Gregory Rose
On 2/15/2019 6:10 AM, Lorenzo Bianconi wrote: After commit c706863bc890 ("net: ip6_gre: always reports o_key to userspace"), ip6gre and ip6gretap tunnels started reporting TUNNEL_KEY output flag even if it is not configured. ip6gre_fill_info checks erspan_ver value to add TUNNEL_KEY for erspan

Re: [ovs-dev] [PATCH net-next V2 1/1] openvswitch: Declare ovs key structures using macros

2019-02-05 Thread Gregory Rose
On 2/5/2019 4:02 AM, Eli Britstein wrote: On 2/4/2019 10:07 PM, David Miller wrote: From: Yi-Hung Wei Date: Mon, 4 Feb 2019 10:47:18 -0800 For example, to see how 'struct ovs_key_ipv6' is defined, now we need to trace how OVS_KEY_IPV6_FIELDS is defined, and how OVS_KEY_FIELD_ARR and OVS_KEY

Re: [ovs-dev] [PATCH net-next V2 1/1] openvswitch: Declare ovs key structures using macros

2019-02-04 Thread Gregory Rose
On 2/3/2019 1:12 AM, Eli Britstein wrote: Declare ovs key structures using macros as a pre-step towards to enable retrieving fields information, as a work done in proposed commit in the OVS tree https://patchwork.ozlabs.org/patch/1023406/ ("odp-util: Do not rewrite fields with the same values a

Re: [PATCH net] openvswitch: Fix push/pop ethernet validation

2018-10-31 Thread Gregory Rose
On 10/31/2018 10:52 AM, Jaime Caamaño Ruiz wrote: When there are both pop and push ethernet header actions among the actions to be applied to a packet, an unexpected EINVAL (Invalid argument) error is obtained. This is due to mac_proto not being reset correctly when those actions are validated.

Re: [PATCH net-next] net: ip6_gre: get ipv6hdr after skb_cow_head()

2018-07-13 Thread Gregory Rose
On 7/12/2018 10:40 PM, Prashant Bhole wrote: A KASAN:use-after-free bug was found related to ip6-erspan while running selftests/net/ip6_gre_headroom.sh It happens because of following sequence: - ipv6hdr pointer is obtained from skb - skb_cow_head() is called, skb->head memory is reallocated - o

Re: [ovs-dev] [PATCH] openvswitch: make vport_ops:send()'s return type consistent

2018-05-07 Thread Gregory Rose
On 4/24/2018 6:19 AM, Luc Van Oostenryck wrote: The method struct vport_ops:send() is defined as returning an 'netdev_tx_t', which is defined as a typedef for a bitwise type and otherwise used for the start_xmit() methods. However, most openvswitch drivers use for this method dev_queue_xmit() whi

Re: [ovs-dev] [PATCH] openvswitch: fix internal_dev_xmit()'s return type

2018-05-07 Thread Gregory Rose
On 4/24/2018 6:17 AM, Luc Van Oostenryck wrote: The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Ooste

Re: [pci PATCH v8 2/4] ena: Migrate over to unmanaged SR-IOV support

2018-04-20 Thread Gregory Rose
On 4/20/2018 9:30 AM, Alexander Duyck wrote: Instead of implementing our own version of a SR-IOV configuration stub in the ena driver we can just reuse the existing pci_sriov_configure_simple function. Signed-off-by: Alexander Duyck --- v5: Replaced call to pci_sriov_configure_unmanaged with

Re: [pci PATCH v8 4/4] pci-pf-stub: Add PF driver stub for PFs that function only to enable VFs

2018-04-20 Thread Gregory Rose
On 4/20/2018 9:31 AM, Alexander Duyck wrote: Add a new driver called "pci-pf-stub" to act as a "white-list" for PF devices that provide no other functionality other then acting as a means of allocating a set of VFs. For now I only have one example ID provided by Amazon in terms of devices that re

Re: [pci PATCH v8 1/4] pci: Add pci_sriov_configure_simple for PFs that don't manage VF resources

2018-04-20 Thread Gregory Rose
On 4/20/2018 9:28 AM, Alexander Duyck wrote: This patch adds a common configuration function called pci_sriov_configure_simple that will allow for managing VFs on devices where the PF is not capable of managing VF resources. Signed-off-by: Alexander Duyck Tested-by: Mark Rustad --- v5: New p

Re: [PATCH net-next 2/2] openvswitch: Support conntrack zone limit

2018-04-18 Thread Gregory Rose
On 4/17/2018 5:30 PM, Yi-Hung Wei wrote: s/to commit/from committing/ s/entry/entries/ Thanks, will fix that in both patches in v2. I think this is a great idea but I suggest porting to the iproute2 package so everyone can use it. Then git rid of the OVS specific prefixes. Presuming of cours

Re: [PATCH net-next 2/2] openvswitch: Support conntrack zone limit

2018-04-16 Thread Gregory Rose
On 4/16/2018 11:15 AM, Yi-Hung Wei wrote: Currently, nf_conntrack_max is used to limit the maximum number of conntrack entries in the conntrack table for every network namespace. For the VMs and containers that reside in the same namespace, they share the same conntrack table, and the total # of

Re: [PATCH net-next 1/2] openvswitch: Add conntrack limit netlink definition

2018-04-16 Thread Gregory Rose
On 4/16/2018 11:15 AM, Yi-Hung Wei wrote: Define netlink messages and attributes to support user kernel communication that using conntrack limit feature. s/using/uses the/ Signed-off-by: Yi-Hung Wei --- include/uapi/linux/openvswitch.h | 62 1 file

Re: [PATCH] pci-iov: Add support for unmanaged SR-IOV

2018-02-28 Thread Gregory Rose
On 2/28/2018 9:49 AM, Alexander Duyck wrote: On Tue, Feb 27, 2018 at 2:25 PM, Alexander Duyck wrote: On Tue, Feb 27, 2018 at 1:40 PM, Alex Williamson wrote: On Tue, 27 Feb 2018 11:06:54 -0800 Alexander Duyck wrote: From: Alexander Duyck This patch is meant to add support for SR-IOV on de

Re: [PATCH iproute2 net-next] gre6: add collect metadata support

2017-12-04 Thread Gregory Rose
On 12/1/2017 3:03 PM, William Tu wrote: The patch adds 'external' option to support collect metadata gre6 tunnel. Example of L3 and L2 gre device: bash:~# ip link add dev ip6gre123 type ip6gre external bash:~# ip link add dev ip6gretap123 type ip6gretap external Hi William, one question.  Is t