{"id":2228721,"url":"http://patchwork.ozlabs.org/api/covers/2228721/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/cover/20260427091153.3210301-1-amorenoz@redhat.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260427091153.3210301-1-amorenoz@redhat.com>","list_archive_url":null,"date":"2026-04-27T09:11:46","name":"[ovs-dev,net-next,v3,0/2] Decouple flow operations from RTNL","submitter":{"id":77477,"url":"http://patchwork.ozlabs.org/api/people/77477/?format=json","name":"Adrian Moreno","email":"amorenoz@redhat.com"},"mbox":"http://patchwork.ozlabs.org/project/openvswitch/cover/20260427091153.3210301-1-amorenoz@redhat.com/mbox/","series":[{"id":501610,"url":"http://patchwork.ozlabs.org/api/series/501610/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=501610","date":"2026-04-27T09:11:46","name":"Decouple flow operations from RTNL","version":3,"mbox":"http://patchwork.ozlabs.org/series/501610/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2228721/comments/","headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ovs-dev@lists.linuxfoundation.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=UfKaWJk0;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","smtp2.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=UfKaWJk0","smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","smtp1.osuosl.org;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.a=rsa-sha256 header.s=mimecast20190719 header.b=UfKaWJk0"],"Received":["from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3yWR0Mq8z1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 19:12:18 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 2D933425FD;\n\tMon, 27 Apr 2026 09:12:12 +0000 (UTC)","from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id l4mlv2VrZgpS; Mon, 27 Apr 2026 09:12:11 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id 4864240227;\n\tMon, 27 Apr 2026 09:12:11 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 224DFC04FB;\n\tMon, 27 Apr 2026 09:12:11 +0000 (UTC)","from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 48F41C04FA\n for <dev@openvswitch.org>; Mon, 27 Apr 2026 09:12:09 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 37E4A854CD\n for <dev@openvswitch.org>; Mon, 27 Apr 2026 09:12:09 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id Lycbq9whgjXl for <dev@openvswitch.org>;\n Mon, 27 Apr 2026 09:12:08 +0000 (UTC)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 29ACD854F2\n for <dev@openvswitch.org>; Mon, 27 Apr 2026 09:12:07 +0000 (UTC)","from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-8kmpqUAEPUmG_aAUQJJJGA-1; Mon,\n 27 Apr 2026 05:12:04 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 724431800609; Mon, 27 Apr 2026 09:12:03 +0000 (UTC)","from antares.redhat.com (unknown [10.44.33.10])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 3137E1800446; Mon, 27 Apr 2026 09:11:59 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4864240227","OpenDKIM Filter v2.11.0 smtp1.osuosl.org 29ACD854F2"],"Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124;\n helo=us-smtp-delivery-124.mimecast.com; envelope-from=amorenoz@redhat.com;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp1.osuosl.org 29ACD854F2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777281126;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=nxu8EEl/NSWtPFSsHpu2gcxuc2ncIwFUJimar90n8NA=;\n b=UfKaWJk09VwzL6dYUVZIOXzcT9x/Cg3HhQcTiVadcAtmR9t9WfA3cjE0CszcVRTD8TnctT\n RrXA5vr3pts2Pp+YB9mAGFLiTLhTSvfRIoqBzDveq5rRzem6Fbliz8QtxcrNEdlyyfl1zh\n +hq8JGwMh7tBPJimdQIXSL02C//PmOg=","X-MC-Unique":"8kmpqUAEPUmG_aAUQJJJGA-1","X-Mimecast-MFC-AGG-ID":"8kmpqUAEPUmG_aAUQJJJGA_1777281123","To":"netdev@vger.kernel.org","Date":"Mon, 27 Apr 2026 11:11:46 +0200","Message-ID":"<20260427091153.3210301-1-amorenoz@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111","X-Mimecast-MFC-PROC-ID":"ryPRpMoMx6HnKvy49qXBt7JgBzTCPgOA6T106nz91-c_1777281123","X-Mimecast-Originator":"redhat.com","Subject":"[ovs-dev] [PATCH net-next v3 0/2] Decouple flow operations from RTNL","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","From":"Adrian Moreno via dev <ovs-dev@openvswitch.org>","Reply-To":"Adrian Moreno <amorenoz@redhat.com>","Cc":"\"open list:OPENVSWITCH\" <dev@openvswitch.org>,\n open list <linux-kernel@vger.kernel.org>, Simon Horman <horms@kernel.org>,\n pabeni@redhat.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ovs-dev-bounces@openvswitch.org","Sender":"\"dev\" <ovs-dev-bounces@openvswitch.org>"},"content":"When RTNL is contended, network-related control-plane operations can be\ndelayed.\n\nIn such scenario, if OVS control-plane operations (such as vport\ncreation) take a bit longer, it's acceptable. However, flow installation\noperations happen as part of upcall processing, executed in the context\nof of handler threads. If they get delayed, it affects the data-plane\nand can even result in packet drops.\n\nBecause flow operations also use ovs_mutex for concurrency protection and\ngiven RTNL can nest under ovs_mutex, contention can be easily transferred\nfrom RTNL to ovs_mutex, causing delay in flow operations.\n\nIn order to protect flow operations from RTNL delays, this series\ndecouples them from ovs_mutex. First, the flow_table is converted into an\nrcu-protected pointer. Then two locking mechanisms are introduced: a\nper-table mutex and a refcount.\n\nThe mutex protects the flow_table against concurrent modifications,\nwhile the refcount is used to extend the lifetime of the flow_table\nbeyond the rcu read-protected region used to dereference it.\n\nv3:\n- Split in 2 patches (Paolo)\n- Improve locking in get_dp_stats (Paolo and Sashiko)\n- Use __always_unused in lockdep stubs (Paolo)\n- Use READ_ONCE/WRITE_ONCE for table->count (Aaron)\n- Take a reference in ovs_dp_masks_rebalance (Aaron) \n\nv2: Fix argument in ovs_flow_tbl_put (sparse)\n    Remove rcu checks in ovs_dp_masks_rebalance\n\nAdrian Moreno (2):\n  net: openvswitch: make flow_table an rcu pointer\n  net: openvswitch: decouple flow_table from ovs_mutex\n\n net/openvswitch/datapath.c   | 293 ++++++++++++++++++++++++-----------\n net/openvswitch/datapath.h   |   2 +-\n net/openvswitch/flow.c       |  13 +-\n net/openvswitch/flow.h       |   9 +-\n net/openvswitch/flow_table.c | 194 ++++++++++++++---------\n net/openvswitch/flow_table.h |  56 ++++++-\n 6 files changed, 396 insertions(+), 171 deletions(-)"}