From patchwork Wed Apr 1 11:57:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 2218545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H60rU77N; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4fm3Qh6QpMz1yFv for ; Wed, 01 Apr 2026 22:58:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 354E54111D; Wed, 1 Apr 2026 11:58:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1MOJpU9PsXUU; Wed, 1 Apr 2026 11:57:59 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BC79B41100 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H60rU77N Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id BC79B41100; Wed, 1 Apr 2026 11:57:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A1EB6C0551; Wed, 1 Apr 2026 11:57:58 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4AB79C003D for ; Wed, 1 Apr 2026 11:57:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3109561109 for ; Wed, 1 Apr 2026 11:57:57 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id oXVuCgYaYAZd for ; Wed, 1 Apr 2026 11:57:56 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=echaudro@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 6357F61128 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6357F61128 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H60rU77N Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6357F61128 for ; Wed, 1 Apr 2026 11:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775044675; 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=Zyov+xf9t+U2+eDO2co4ZpSyIg0IIQdKodhKHVxNLvs=; b=H60rU77Na/u9Sqk1Pm80yvBx4g5JZblnWJbOPqJq9+IgGAgozI1A7kLZdb2MbCnyRJtiMh 3qkAIYl6o6GATx7QTb9P60g9r8F+MCWX+N9fI4iitZR9scCMTU01hrDOhp24om8c/kjB6V xwybQdg4cHFOu7ccyCmygMlOk9bWrjk= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-359-DAhVpMIgPfG4wfvwflvW9A-1; Wed, 01 Apr 2026 07:57:52 -0400 X-MC-Unique: DAhVpMIgPfG4wfvwflvW9A-1 X-Mimecast-MFC-AGG-ID: DAhVpMIgPfG4wfvwflvW9A_1775044671 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C47F018002D6; Wed, 1 Apr 2026 11:57:50 +0000 (UTC) Received: from ebuild.chome (unknown [10.44.50.103]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 573031954102; Wed, 1 Apr 2026 11:57:49 +0000 (UTC) To: dev@openvswitch.org Date: Wed, 1 Apr 2026 13:57:22 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -EPLANeAc7HL_HxjergGtOTpvJrmVyJfRc9QCRPDu5w_1775044671 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2 2/2] dummy-offload: Use pmd_thread_lifecycle APIs for HW simulator. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eelco Chaudron via dev From: Eelco Chaudron Reply-To: Eelco Chaudron Cc: elibr@nvidia.com, i.maximets@ovn.org Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Replace per-netdev dummy_netdev_hw_offload_run() callback with PMD thread infrastructure. Move offload work processing into dummy_pmd_thread_work_cb(). Signed-off-by: Eelco Chaudron --- lib/dpif-offload-dummy.c | 24 +++++++++--------------- lib/dummy.h | 1 - lib/netdev-dummy.c | 1 - 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/dpif-offload-dummy.c b/lib/dpif-offload-dummy.c index 80d6ce67c3..4335b199b9 100644 --- a/lib/dpif-offload-dummy.c +++ b/lib/dpif-offload-dummy.c @@ -972,15 +972,16 @@ dummy_netdev_simulate_offload(struct netdev *netdev, struct dp_packet *packet, return packet_stolen; } -void -dummy_netdev_hw_offload_run(struct netdev *netdev) +static void +dummy_pmd_thread_work_cb(unsigned core_id OVS_UNUSED, int numa_id OVS_UNUSED, + void *ctx) { - const struct dpif_offload *offload = ovsrcu_get( - const struct dpif_offload *, &netdev->dpif_offload); + const struct dpif_offload *offload = ctx; struct dpif_offload_port *port_; - if (!dpif_offload_enabled() || !offload - || strcmp(dpif_offload_type(offload), "dummy")) { + COVERAGE_INC(dummy_offload_do_work); + + if (!offload) { return; } @@ -1023,13 +1024,6 @@ dummy_netdev_hw_offload_run(struct netdev *netdev) } } -static void -dummy_pmd_thread_work_cb(unsigned core_id OVS_UNUSED, int numa_id OVS_UNUSED, - void *ctx OVS_UNUSED) -{ - COVERAGE_INC(dummy_offload_do_work); -} - static void dummy_pmd_thread_lifecycle(const struct dpif_offload *dpif_offload, bool exit, unsigned core_id, int numa_id, @@ -1050,9 +1044,9 @@ dummy_pmd_thread_lifecycle(const struct dpif_offload *dpif_offload, ovs_assert(!*callback || *callback == dummy_pmd_thread_work_cb); if (exit) { - free(*ctx); + *ctx = NULL; } else { - *ctx = *ctx ? *ctx : xstrdup("DUMMY_OFFLOAD_WORK"); + *ctx = (void *) dpif_offload; *callback = dummy_pmd_thread_work_cb; } } diff --git a/lib/dummy.h b/lib/dummy.h index f250ae5933..312fbed17c 100644 --- a/lib/dummy.h +++ b/lib/dummy.h @@ -49,6 +49,5 @@ void ofpact_dummy_enable(void); bool is_dummy_netdev_class(const struct netdev_class *); bool dummy_netdev_simulate_offload(struct netdev *, struct dp_packet *, int queue_id, struct flow *); -void dummy_netdev_hw_offload_run(struct netdev *); #endif /* dummy.h */ diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index d5e8599349..17ff436290 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -695,7 +695,6 @@ netdev_dummy_run(const struct netdev_class *netdev_class) ovs_mutex_lock(&dev->mutex); dummy_packet_conn_run(dev); ovs_mutex_unlock(&dev->mutex); - dummy_netdev_hw_offload_run(&dev->up); } ovs_mutex_unlock(&dummy_list_mutex); }