Cover Letter Detail
Show a cover letter.
GET /api/covers/1558020/?format=api
{ "id": 1558020, "url": "http://patchwork.ozlabs.org/api/covers/1558020/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/cover/20211122112256.2011194-1-amorenoz@redhat.com/", "project": { "id": 47, "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api", "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": "<20211122112256.2011194-1-amorenoz@redhat.com>", "list_archive_url": null, "date": "2021-11-22T11:22:38", "name": "[ovs-dev,v1,00/18] python: add flow parsing library", "submitter": { "id": 77477, "url": "http://patchwork.ozlabs.org/api/people/77477/?format=api", "name": "Adrian Moreno", "email": "amorenoz@redhat.com" }, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/cover/20211122112256.2011194-1-amorenoz@redhat.com/mbox/", "series": [ { "id": 273222, "url": "http://patchwork.ozlabs.org/api/series/273222/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=273222", "date": "2021-11-22T11:22:39", "name": "python: add flow parsing library", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/273222/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/1558020/comments/", "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "ovs-dev@lists.linuxfoundation.org" ], "Authentication-Results": [ "bilbo.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=G++HZGsH;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)", "smtp2.osuosl.org (amavisd-new);\n dkim=pass (1024-bit key) header.d=redhat.com", "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com" ], "Received": [ "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyPz66G4yz9sRR\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 22 Nov 2021 22:23:30 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id E7B5E80B8C;\n\tMon, 22 Nov 2021 11:23:27 +0000 (UTC)", "from smtp1.osuosl.org ([127.0.0.1])\n\tby localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id eJWC5CfBdoOr; Mon, 22 Nov 2021 11:23:26 +0000 (UTC)", "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 238E580EFD;\n\tMon, 22 Nov 2021 11:23:25 +0000 (UTC)", "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id E928FC001E;\n\tMon, 22 Nov 2021 11:23:24 +0000 (UTC)", "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 0B0F5C002F\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:23 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 13BF540179\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:22 +0000 (UTC)", "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id pFSacjdwRSl6 for <dev@openvswitch.org>;\n Mon, 22 Nov 2021 11:23:18 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 217DE40389\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:17 +0000 (UTC)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-281-7xpkrPvvN_OM4QuJO1zx6A-1; Mon, 22 Nov 2021 06:23:04 -0500", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com\n [10.5.11.13])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EB8757207\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:03 +0000 (UTC)", "from amorenoz.users.ipa.redhat.com (unknown [10.2.16.196])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 9702060862;\n Mon, 22 Nov 2021 11:22:59 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1637580197;\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=G3/iLO78KWWZieWRpsRPhw6nDLkMnZHr4Cmd15TVts4=;\n b=G++HZGsHeZUd6QYORRWrIGVsNzcq9VvAInr7DUXpatf0pWIT1+mouFIbT4eEJ7d6Xuw5e1\n /MiJb2JVDoQMajSSjpQ+WjgJSHivDHC6zWEXYeB4Hd69FRAbkzsO03mORLAe6f3f+JuQ0a\n QhfRtz3wW1NRJvBb3mmLDu/F8QzbKMc=", "X-MC-Unique": "7xpkrPvvN_OM4QuJO1zx6A-1", "From": "Adrian Moreno <amorenoz@redhat.com>", "To": "dev@openvswitch.org", "Date": "Mon, 22 Nov 2021 12:22:38 +0100", "Message-Id": "<20211122112256.2011194-1-amorenoz@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Subject": "[ovs-dev] [PATCH v1 00/18] python: add flow parsing library", "X-BeenThere": "ovs-dev@openvswitch.org", "X-Mailman-Version": "2.1.15", "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>", "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": "While troubleshooting or developing new features in OVS, a considerable\namount of time is spent analyzing flows (whether that's Openflow flows\nor datapath flows). Currently, OVS has tools to dump flows with\ndifferent levels of verbosity as well as to filter flows prior to\ndumping them, e.g: 'ovs-ofctl dump-flows', 'ovs-appctl\ndpctl/dump-flows', etc.\n\nThe output of these commands is considered stable so it should be\npossible to write more layered tools that enable advanced flow analysis.\nHowever, the way flows are formatted into strings is not trivial to\nparse.\n\nThis series introduces the a flow parsing library capable of parsing\nboth Openflow and DPIF flows.\n\nThe library is based on generic key-value and list parsers and a number\nof common decoders. Based on that, an Openflow flow parser and a DPIF\nflow parser are introduced by defining a way to decode each possible\nfield and action they might contain.\n\nThe library has the following features:\n- Parsed key-value pairs keep some metadata that refer to the original\n strings they were extracted from. That way the flows can be printed\n and formatted in flexible ways.\n- It includes a basic flow filtering mechanism. A filter can be defined\n combining logical (||, &&, !), arithmetical (<, >, =) or mask (~=)\n operations\n- It supports IPAddress and Ethernet masking (based on netaddr)\n- The decoder to use for each key (match or action) is set explicitly to\n avoid expensive runtime type-guessing.\n- The decoders to use for Openflow fields is automatically generated\n based on meta-flow.h\n- Additional dependencies:\n - netaddr: For IP and Ethernet Address management\n - pyparsing: For filtering syntax\n - pytest: For unit tests:v\n\n\nOne key goal challenge of including this library is avoiding diversion\nbetween the C code that prints/parses the flows and the python parsing\ncode. To that effect, the series introduces the following mechanisms:\n- Decoding information of openflow fields is automatically generated\n based on meta-flow.h\n- The calls to ovs-ofctl made from tests/ofp-actions.at are wrapped by a\n python script that also runs the python parsers. If an exception is\n raised by the python code (meaning it was not capable of parsing the\n flow string), the test will fail\n- The calls to the test-odp made from tests/odp.at are wrapped by a\n python script that also runs the python parsers. If an exception is\n raised by the python code (meaning it was not capable of parsing the\n flow string), the test will fail.\n- A python unit test target ensures python code works and it's easy to\n add more flow examples to it\n- A dependency check is introduced. The python parsing code mainly\n depends on lib/ofp-actions.c and lib/odp-util.c. This series stores\n the md5sum of such files and adds a build target that ensures the\n files have not been changed. That way, anyone who modifies those files\n will get a warning the fist time they build the project. Dependency\n digests are easily updated using a string so hopefully this warning\n would not be too inconvenient.\n\nLibrary usage\n-------------\n>>> from ovs.flows.ofp import OFPFlowFactory\n>>> flow = OFPFlowFactory().from_string(\"cookie=0x2b32ab4d, table=41, n_packets=11, n_bytes=462, priority=33,ip,reg15=0x2/0x2,nw_src=10.128.0.2/24 actions=move:NXM_OF_TCP_DST[]->NXM_NX_XXREG0[32..47],ct(table=16,zone=NXM_NX_REG13[0..15],nat)\")\n>>> flow.info\n{'cookie': 724740941, 'table': 41, 'n_packets': 11, 'n_bytes': 462}\n>>> flow.match\n{'priority': 33, 'ip': True, 'reg15': Mask32('0x2/0x2'), 'nw_src': IPMask('10.128.0.2/24')}\n>>> flow.actions\n[{'move': {'src': {'field': 'NXM_OF_TCP_DST'}, 'dst': {'field': 'NXM_NX_XXREG0', 'start': 32, 'end': 47}}}, {'ct': {'table': 16, 'zone': {'field': 'NXM_NX_REG13', 'start': 0, 'end': 15}, 'nat': True}}]\n>>> from ovs.flows.filter import OFFilter\n>>> filt = OFFilter(\"nw_src ~= 10.128.0.10 and (table = 42 or n_packets > 0)\")\n>>> filt.evaluate(flow)\nTrue\n\nAnother way to try the library would be with a utility called\novs-ofparse that I'll send to the list as RFC soon\n\nRFC -> V1:\n- filters: created a class to represent the filtering result. That way\n we can store more information such as what key actually triggered the\n match. This enables functionality such as highlighting of keys based\n on an expression\n- Formatted python code according to flake8 requirements\n- Split ofp actions in ofp_act.py\n- drop ofparse utility (will send a RFC to the mail list soon)\n- Moved the initialization of the decoders objects to a factory so they\n are cached. This significantly decreases parsing time of large dumps.\n\n\nAdrian Moreno (18):\n python: add generic Key-Value parser\n python: add mask, ip and eth decoders\n python: add list parser\n build-aux: split extract-ofp-fields\n build-aux: generate ofp field decoders\n python: add flow base class\n python: introduce OpenFlow Flow parsing\n python: add ovs datapath flow parsing\n python: add flow filtering syntax\n python: add a json encoder to flow fields\n tests: wrap ovs-ofctl calls to test python parser\n tests: Wrap test-odp to also run python parsers\n python: detect changes in flow formatting code\n python: introduce unit tests\n python: add unit tests for list\n python: add unit tests for openflow parsing\n python: add unit tests to datapath parsing\n python: add unit tests for filtering engine\n\n .ci/linux-prepare.sh | 2 +-\n .gitignore | 2 +\n Documentation/intro/install/general.rst | 2 +\n Makefile.am | 3 +-\n Vagrantfile | 2 +-\n build-aux/automake.mk | 3 +-\n build-aux/extract-ofp-fields | 393 +------------\n build-aux/gen_ofp_field_decoders | 73 +++\n configure.ac | 1 +\n m4/openvswitch.m4 | 12 +\n python/.gitignore | 1 +\n python/automake.mk | 51 +-\n python/build/extract_ofp_fields.py | 386 +++++++++++++\n python/build/flow-parse-deps.py | 101 ++++\n python/ovs/flows/__init__.py | 0\n python/ovs/flows/decoders.py | 468 +++++++++++++++\n python/ovs/flows/deps.py | 5 +\n python/ovs/flows/filter.py | 225 ++++++++\n python/ovs/flows/flow.py | 94 +++\n python/ovs/flows/kv.py | 282 +++++++++\n python/ovs/flows/list.py | 123 ++++\n python/ovs/flows/odp.py | 723 ++++++++++++++++++++++++\n python/ovs/flows/ofp.py | 400 +++++++++++++\n python/ovs/flows/ofp_act.py | 233 ++++++++\n python/ovs/tests/test_filter.py | 225 ++++++++\n python/ovs/tests/test_kv.py | 74 +++\n python/ovs/tests/test_list.py | 67 +++\n python/ovs/tests/test_odp.py | 527 +++++++++++++++++\n python/ovs/tests/test_ofp.py | 524 +++++++++++++++++\n python/setup.py | 4 +-\n tests/automake.mk | 5 +-\n tests/odp.at | 36 +-\n tests/ofp-actions.at | 46 +-\n tests/ovs-test-dpparse.py | 83 +++\n tests/ovs-test-ofparse.py | 103 ++++\n 35 files changed, 4844 insertions(+), 435 deletions(-)\n create mode 100755 build-aux/gen_ofp_field_decoders\n create mode 100644 python/build/extract_ofp_fields.py\n create mode 100755 python/build/flow-parse-deps.py\n create mode 100644 python/ovs/flows/__init__.py\n create mode 100644 python/ovs/flows/decoders.py\n create mode 100644 python/ovs/flows/deps.py\n create mode 100644 python/ovs/flows/filter.py\n create mode 100644 python/ovs/flows/flow.py\n create mode 100644 python/ovs/flows/kv.py\n create mode 100644 python/ovs/flows/list.py\n create mode 100644 python/ovs/flows/odp.py\n create mode 100644 python/ovs/flows/ofp.py\n create mode 100644 python/ovs/flows/ofp_act.py\n create mode 100644 python/ovs/tests/test_filter.py\n create mode 100644 python/ovs/tests/test_kv.py\n create mode 100644 python/ovs/tests/test_list.py\n create mode 100644 python/ovs/tests/test_odp.py\n create mode 100644 python/ovs/tests/test_ofp.py\n create mode 100755 tests/ovs-test-dpparse.py\n create mode 100755 tests/ovs-test-ofparse.py" }