Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10779936rwb; Fri, 25 Nov 2022 07:43:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Vzb9o8105a5rzOHP3wAFc7GKPJboiXASA57CFD3GBgXA/eUn1IrA6Hg9AsZ7/g93uUIev X-Received: by 2002:a05:6402:4011:b0:461:96ba:b9c with SMTP id d17-20020a056402401100b0046196ba0b9cmr36197420eda.353.1669391001723; Fri, 25 Nov 2022 07:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391001; cv=none; d=google.com; s=arc-20160816; b=G7SFPPvXfgxo9pFfgEtrbpE9h7MbKesRo/enB+YCzz8hBiwlkaeKzgTWCLjgTNi+RI DhwMiuttuiuSwF8xa9qADL1tqnRXBGcWS2Jt0JMr8a6e16qROewCnxAXO+la7rHkwSUo A+hcQ96Uuq8PVFCKYy7wG8agqgyndg8hqSmJv8ZB7JaQ+smURw4TvQ9gkvjvMOy3jpgQ x9n1rK3m/PBapbTVk1T/v6sVn57vmJQ15Na3hxMjCVpK8LD649ciOuvzNn9MR3dGFEtU hG33N+zA+D6qcBUQysNJktnlIe2j09IerFbB1PmSQnK1h58seN+1VR2XViIDCIbncmtK 3FzQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=m1BChkWM80kgyYM0SCDcwv+2ZPer/HomIwTgropL0ac=; b=WNGyhWmWOsVuKkZ93plKQeSTwYS+JoGjTNMmfG+uB4aTIhRNaSZm2EuZReUKm+dlhz 0hdR/4QyoI4ErF1YdrH9i2QhFCcD+wLIKfQoDw0NbuhBhBGtsu975J7JAssq8wVAsT5m WZxGDApJsyo4mASfP//j5D+5xNMy3oFHME6wbx3VqJy/5z6eqDPjuys6t42s4ky0fCoQ bgyCE9ldZFlru/fgKy7+9kLU90eotchXMw79rAgnnTGpXxIz4TX915h7/3FoaSWJGFZV Lo2uv4gRzZbz2ZzgODEMicz71GPLvDVnI18Wlfig1uZLBp0p1Q8Q7G+qom6eCIb/jebU y9ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UD1zdeXX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a170906974e00b007ae6f13645dsi3650045ejy.498.2022.11.25.07.42.59; Fri, 25 Nov 2022 07:43:21 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UD1zdeXX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbiKYPab (ORCPT + 86 others); Fri, 25 Nov 2022 10:30:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiKYPa3 (ORCPT ); Fri, 25 Nov 2022 10:30:29 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57AA2528A for ; Fri, 25 Nov 2022 07:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669390175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m1BChkWM80kgyYM0SCDcwv+2ZPer/HomIwTgropL0ac=; b=UD1zdeXXbKFNTy/j3j7doEZ5Msw4/MWHh1FKraO8zrE7ORcWdWw8jUTdExdFYskM99BgCa AHRdIdiRYOh9XBKJKBh1781EhMb7dOQvBIkDOYYzB6hHpAl7vwc71Kd4hoIDbwDZOx9xLj DvpGGHUXCOmmfrKarsSH4/degN8EWJk= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-498-skXYgnKRO6GqUKDElOgG5g-1; Fri, 25 Nov 2022 10:29:33 -0500 X-MC-Unique: skXYgnKRO6GqUKDElOgG5g-1 Received: by mail-qt1-f199.google.com with SMTP id ay12-20020a05622a228c00b003a52bd33749so4357526qtb.8 for ; Fri, 25 Nov 2022 07:29:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m1BChkWM80kgyYM0SCDcwv+2ZPer/HomIwTgropL0ac=; b=1agl0to5NJILS/DnoJs8NQiYGf/MJODNHb5dFaI70syDmtBGuoVQfZv9ow+nugyVsq Qjg2oIh+pglHkRm5Qpr6gwb8LVcFVHal7XwK4cz/snIkVRdcB4qip1E3KZ0JqM7rGbSf AzGhhzLAlpFr4jWZACvXLmSDu0Jvn1kQpHWWKPEAAXChWjH8RrDiMeTwfgRA1sd4Ifr5 8yyQ8JUEFf+2+xFy2xYikz+0T//n2NwAvRAq7hzLSK6iOO1HnJ1lK+2TWNvHzgNGfC7f BSdPHKG3fc1BkFGgsA+qMVrjeTjm9NUxAM2hB2AkOgJx/26Ebs2pO1qcYlBCbZWLnOPu JHhQ== X-Gm-Message-State: ANoB5pmUF24enrl5nM+C8uJtnKAdftc1WfCezHrhWTxq5ArdcdCym3+C w6/uippAwVG5MVlNNXZam+mIl/+9m0sPgHEdE8KP+Iso8zRN9Dq+P6FacXTHYmmYVaUg+GJinpp Aw+K1d/ugTFNUvHtMsjTaCJb2 X-Received: by 2002:a37:8e05:0:b0:6fc:53ae:a979 with SMTP id q5-20020a378e05000000b006fc53aea979mr3317495qkd.735.1669390173395; Fri, 25 Nov 2022 07:29:33 -0800 (PST) X-Received: by 2002:a37:8e05:0:b0:6fc:53ae:a979 with SMTP id q5-20020a378e05000000b006fc53aea979mr3317469qkd.735.1669390173123; Fri, 25 Nov 2022 07:29:33 -0800 (PST) Received: from [192.168.0.146] ([139.47.72.25]) by smtp.gmail.com with ESMTPSA id u12-20020a05620a430c00b006fa4cac54a5sm2932849qko.72.2022.11.25.07.29.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 07:29:32 -0800 (PST) Message-ID: <83a0b3e4-1327-c1c4-4eb4-9a25ff533d1d@redhat.com> Date: Fri, 25 Nov 2022 16:29:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [ovs-dev] [RFC net-next 1/6] openvswitch: exclude kernel flow key from upcalls Content-Language: en-US To: Ilya Maximets , Aaron Conole , netdev@vger.kernel.org Cc: dev@openvswitch.org, linux-kernel@vger.kernel.org, Eric Dumazet , linux-kselftest@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Shuah Khan , "David S. Miller" References: <20221122140307.705112-1-aconole@redhat.com> <20221122140307.705112-2-aconole@redhat.com> From: Adrian Moreno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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/23/22 22:22, Ilya Maximets wrote: > 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. > Hi Ilya, Do we need to do that for every packet? Could we send a bitmask of supported fields to userspace at feature negotiation and let OVS slowpath flows that it knows the kernel won't be able to handle properly? > 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. > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > Thanks -- Adrián Moreno