From patchwork Wed Jul 10 17:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Adri=C3=A1n_Moreno?= X-Patchwork-Id: 1958925 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=YP+eYzlV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 4WK4454PnZz1xpN for ; Thu, 11 Jul 2024 03:05:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CD0CC820C1; Wed, 10 Jul 2024 17:05:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id niv39SnHTpVp; Wed, 10 Jul 2024 17:05:22 +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 smtp1.osuosl.org C3B5082081 Authentication-Results: smtp1.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=YP+eYzlV Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id C3B5082081; Wed, 10 Jul 2024 17:05:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 92E4FC0A99; Wed, 10 Jul 2024 17:05:22 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id E64B9C0A97 for ; Wed, 10 Jul 2024 17:05:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CDB23415B2 for ; Wed, 10 Jul 2024 17:05:19 +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 AEvI5a4k8x12 for ; Wed, 10 Jul 2024 17:05:19 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amorenoz@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org E1B11415B3 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E1B11415B3 Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YP+eYzlV Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id E1B11415B3 for ; Wed, 10 Jul 2024 17:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720631117; 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=je7ArBlBFCyJyqOpPVtnfvitpDG9CjNuT4LT+sIwzt0=; b=YP+eYzlViGahnqkuNZFrkC8DxPfyXqVf3Ne48+cW7zo70GVW5ElCAFGoyh45Zltftb+Bz5 dtLb7j0jell8mlGo2DeNvGJG4rg1U61IbpmNkXm2ODjPC35jX1wJifLceRVEXSsdU+8RiJ ERpW7qRAlLfM3jM+pxd8H5DjhI8sxxk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-671-nacu8Jl6OGiQcfXb36QUnQ-1; Wed, 10 Jul 2024 13:05:15 -0400 X-MC-Unique: nacu8Jl6OGiQcfXb36QUnQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F08D419792D0 for ; Wed, 10 Jul 2024 17:05:14 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.192.91]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07F131955F3B; Wed, 10 Jul 2024 17:05:13 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Wed, 10 Jul 2024 19:04:48 +0200 Message-ID: <20240710170504.2162803-2-amorenoz@redhat.com> In-Reply-To: <20240710170504.2162803-1-amorenoz@redhat.com> References: <20240710170504.2162803-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v5 01/13] python: ovs: flow: Support dp-extra-info section. 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" DPDK flows can have this extra section that, for now, only has one possible key (miniflow_bits). Add it to the ODPFlow flow. Signed-off-by: Adrian Moreno Acked-by: Eelco Chaudron --- python/ovs/flow/odp.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/python/ovs/flow/odp.py b/python/ovs/flow/odp.py index a8f8c067a..d5faff03e 100644 --- a/python/ovs/flow/odp.py +++ b/python/ovs/flow/odp.py @@ -119,7 +119,15 @@ class ODPFlow(Flow): ] action_pos += 8 # len("actions:") - actions = odp_string[action_pos:] + + dp_extra_pos = odp_string[action_pos:].find("dp-extra-info") + if dp_extra_pos > 0: + dp_extra_pos += action_pos + actions = odp_string[action_pos : dp_extra_pos] + dp_extra_pos += 14 # len("dp-extra-info:") + dp_extra = odp_string[dp_extra_pos :] + else: + actions = odp_string[action_pos:] field_parts = rest.lstrip(" ").partition(" ") @@ -160,6 +168,19 @@ class ODPFlow(Flow): ) sections.append(asection) + if dp_extra_pos > 0: + dparser = KVParser( + dp_extra, KVDecoders({"miniflow_bits": decode_default}) + ) + dparser.parse() + dsection = Section( + name="dp_extra_info", + pos=dp_extra_pos, + string=dp_extra, + data=dparser.kv(), + ) + sections.append(dsection) + super(ODPFlow, self).__init__(sections, odp_string, id) def __str__(self):