Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8016964rwb; Wed, 23 Nov 2022 14:12:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6dN+rULHu2ljdFVVkR4UWY0apaasqhfe4mbiPkst0aoHm0dEjULhbRuCNidVi2m5/6QLJu X-Received: by 2002:a17:90b:198e:b0:20d:23ee:c041 with SMTP id mv14-20020a17090b198e00b0020d23eec041mr31989901pjb.140.1669241553710; Wed, 23 Nov 2022 14:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669241553; cv=none; d=google.com; s=arc-20160816; b=SrqjQ4djd0yCfAIXnoCGe64nyhYKwktkmxbHqGxHQdm/2+e7mhssdPB67G/9SHDEAr lQv9vAcdWGTorYMVpui2JxRyQvbYRxk7NFa3kTfALMQ0PmJFknZeYsc01NZNRlcQ7q6Z 84A1iEYQEpjGuVO1KurQ5Hlw7SSZL0giwRUzAK5vkfg5elu4QomjKgotd/JWJ7EACVRF XurLDlcXELcpi91G3PGn3rI24wd6P7BmVPJhCNdyShNdd5aY3SebUtz6z5qUUEtf+12Q LuXf/KMa5pWes/RFLy6yFEimFmy7MllH+70WV43h/rNPwjPRoKpUWEP5P9/Ro+dzTmx0 nuoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:to:content-language:cc:user-agent:mime-version:date :message-id; bh=NAs+WUGSRrSHZt16suWGXm69jv7hj7nVXd4SYZpNx3k=; b=hrSRqWncK/zy7kROZ4zcqvXL6RlCNqBXKuhYamKUXW+rUiHEUv1AImmMQ9IlchSEeJ 645chszX5X99Vpf8UbK7jRhOohbBHdBnGBWKGVOOot4A7nTcKCcc79urMOir6S9BqI6K PkKBy6eBfPrpiOX+96lDlJtAnJkk/TUU6+GKY7xTjJ1u1LfP+DHSrgeyYbi0vI6+KdwU tA882ew39ltkI6ubYYAItnTYSbIoU9XhnbeSSho9cLsCcKJvdc/kmhXz8eVyaZIv+hyc nb7EKASyeNuenHD2jSd+JiEnMUBxEggCP96zYaIGxiflaAM+62HGTi6sPkh8g+pfpmvV flaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a056a000a9100b005634d0b379dsi18637907pfl.115.2022.11.23.14.12.21; Wed, 23 Nov 2022 14:12:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234723AbiKWVW2 (ORCPT + 88 others); Wed, 23 Nov 2022 16:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238032AbiKWVWT (ORCPT ); Wed, 23 Nov 2022 16:22:19 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03EF5E9F4; Wed, 23 Nov 2022 13:22:17 -0800 (PST) Received: (Authenticated sender: i.maximets@ovn.org) by mail.gandi.net (Postfix) with ESMTPSA id 3F0AE100003; Wed, 23 Nov 2022 21:22:11 +0000 (UTC) Message-ID: Date: Wed, 23 Nov 2022 22:22:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Cc: i.maximets@ovn.org, Pravin B Shelar , Jakub Kicinski , "David S. Miller" , Paolo Abeni , Eric Dumazet , Thomas Graf , dev@openvswitch.org, Eelco Chaudron , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Language: en-US To: Aaron Conole , netdev@vger.kernel.org References: <20221122140307.705112-1-aconole@redhat.com> <20221122140307.705112-2-aconole@redhat.com> From: Ilya Maximets Subject: Re: [RFC net-next 1/6] openvswitch: exclude kernel flow key from upcalls In-Reply-To: <20221122140307.705112-2-aconole@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NEUTRAL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/22 15:03, Aaron Conole wrote: > When processing upcall commands, two groups of data are available to > userspace for processing: the actual packet data and the kernel > sw flow key data. The inclusion of the flow key allows the userspace > avoid running through the dissection again. > > However, the userspace can choose to ignore the flow key data, as is > the case in some ovs-vswitchd upcall processing. For these messages, > having the flow key data merely adds additional data to the upcall > pipeline without any actual gain. Userspace simply throws the data > away anyway. Hi, Aaron. While it's true that OVS in userpsace is re-parsing the packet from scratch and using the newly parsed key for the OpenFlow translation, the kernel-porvided key is still used in a few important places. Mainly for the compatibility checking. The use is described here in more details: https://docs.kernel.org/networking/openvswitch.html#flow-key-compatibility We need to compare the key generated in userspace with the key generated by the kernel to know if it's safe to install the new flow to the kernel, i.e. if the kernel and OVS userpsace are parsing the packet in the same way. On the other hand, OVS today doesn't check the data, it only checks which fields are present. So, if we can generate and pass the bitmap of fields present in the key or something similar without sending the full key, that might still save some CPU cycles and memory in the socket buffer while preserving the ability to check for forward and backward compatibility. What do you think? The rest of the patch set seems useful even without patch #1 though. Nit: This patch #1 should probably be merged with the patch #6 and be at the end of a patch set, so the selftest and the main code are updated at the same time. Best regards, Ilya Maximets.