Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1528343/?format=api
{ "id": 1528343, "url": "http://patchwork.ozlabs.org/api/patches/1528343/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210915124319.1683219-7-cmi@nvidia.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": "<20210915124319.1683219-7-cmi@nvidia.com>", "list_archive_url": null, "date": "2021-09-15T12:43:18", "name": "[ovs-dev,v15,6/7] ofproto: Introduce API to process sFlow offload packet", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d3a0c4e610cd67e49b83a3fb17b0ec2926bfe48d", "submitter": { "id": 80086, "url": "http://patchwork.ozlabs.org/api/people/80086/?format=api", "name": "Chris Mi", "email": "cmi@nvidia.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210915124319.1683219-7-cmi@nvidia.com/mbox/", "series": [ { "id": 262447, "url": "http://patchwork.ozlabs.org/api/series/262447/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=262447", "date": "2021-09-15T12:43:12", "name": "Add offload support for sFlow", "version": 15, "mbox": "http://patchwork.ozlabs.org/series/262447/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1528343/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/1528343/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "ovs-dev@lists.linuxfoundation.org" ], "Authentication-Results": "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)", "Received": [ "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::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 ozlabs.org (Postfix) with ESMTPS id 4H8fz55qXsz9t0k\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Sep 2021 22:43:45 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id A263F82BEB;\n\tWed, 15 Sep 2021 12:43:41 +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 BJmw6x_hJee4; Wed, 15 Sep 2021 12:43:40 +0000 (UTC)", "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 927BA82B2F;\n\tWed, 15 Sep 2021 12:43:38 +0000 (UTC)", "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 1B5C3C0031;\n\tWed, 15 Sep 2021 12:43:35 +0000 (UTC)", "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 1DC63C000D\n for <dev@openvswitch.org>; Wed, 15 Sep 2021 12:43:31 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 8A3A060BA4\n for <dev@openvswitch.org>; Wed, 15 Sep 2021 12:43:29 +0000 (UTC)", "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id Qg3lYJSqRWDQ for <dev@openvswitch.org>;\n Wed, 15 Sep 2021 12:43:29 +0000 (UTC)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by smtp3.osuosl.org (Postfix) with ESMTP id 5778560B89\n for <dev@openvswitch.org>; Wed, 15 Sep 2021 12:43:28 +0000 (UTC)", "from Internal Mail-Server by MTLPINE1 (envelope-from cmi@nvidia.com)\n with SMTP; 15 Sep 2021 15:43:21 +0300", "from c-141-46-1-010.mtl.labs.mlnx (c-141-46-1-010.mtl.labs.mlnx\n [10.141.46.10])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 18FChLba010242;\n Wed, 15 Sep 2021 15:43:21 +0300" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0", "To": "dev@openvswitch.org", "Date": "Wed, 15 Sep 2021 15:43:18 +0300", "Message-Id": "<20210915124319.1683219-7-cmi@nvidia.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210915124319.1683219-1-cmi@nvidia.com>", "References": "<20210915124319.1683219-1-cmi@nvidia.com>", "MIME-Version": "1.0", "Cc": "elibr@nvidia.com, simon.horman@netronome.com, roniba@nvidia.com,\n i.maximets@ovn.org", "Subject": "[ovs-dev] [PATCH v15 6/7] ofproto: Introduce API to process sFlow\n\toffload packet", "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>", "From": "Chris Mi via dev <ovs-dev@openvswitch.org>", "Reply-To": "Chris Mi <cmi@nvidia.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": "Process sFlow offload packet in handler thread if handler id is 0.\n\nSigned-off-by: Chris Mi <cmi@nvidia.com>\nReviewed-by: Eli Britstein <elibr@nvidia.com>\n---\n ofproto/ofproto-dpif-upcall.c | 63 +++++++++++++++++++++++++++++++++++\n 1 file changed, 63 insertions(+)", "diff": "diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c\nindex 1c9c720f0..4a36a45bb 100644\n--- a/ofproto/ofproto-dpif-upcall.c\n+++ b/ofproto/ofproto-dpif-upcall.c\n@@ -22,6 +22,7 @@\n #include \"connmgr.h\"\n #include \"coverage.h\"\n #include \"cmap.h\"\n+#include \"lib/dpif-offload-provider.h\"\n #include \"lib/dpif-provider.h\"\n #include \"dpif.h\"\n #include \"openvswitch/dynamic-string.h\"\n@@ -779,6 +780,57 @@ udpif_get_n_flows(struct udpif *udpif)\n return flow_count;\n }\n \n+static void\n+process_offload_sflow(struct udpif *udpif, struct dpif_offload_sflow *sflow)\n+{\n+ const struct dpif_sflow_attr *attr = sflow->attr;\n+ const struct user_action_cookie *cookie;\n+ struct dpif_sflow *dpif_sflow;\n+ struct ofproto_dpif *ofproto;\n+ struct upcall upcall;\n+ uint32_t iifindex;\n+ struct flow flow;\n+\n+ if (!attr) {\n+ VLOG_WARN_RL(&rl, \"%s: sFlow upcall is missing its attribute\",\n+ __func__);\n+ return;\n+ }\n+\n+ cookie = nl_attr_get(attr->userdata);\n+ if (!cookie) {\n+ VLOG_WARN_RL(&rl, \"%s: user action cookie is missing\", __func__);\n+ return;\n+ }\n+ ofproto = ofproto_dpif_lookup_by_uuid(&cookie->ofproto_uuid);\n+ if (!ofproto) {\n+ VLOG_WARN_RL(&rl, \"%s: sFlow upcall can't find ofproto dpif for UUID \"\n+ UUID_FMT, __func__, UUID_ARGS(&cookie->ofproto_uuid));\n+ return;\n+ }\n+ dpif_sflow = ofproto->sflow;\n+ if (!dpif_sflow) {\n+ VLOG_WARN_RL(&rl, \"%s: sFlow upcall is missing dpif information\",\n+ __func__);\n+ return;\n+ }\n+\n+ memset(&flow, 0, sizeof flow);\n+ if (attr->tunnel) {\n+ memcpy(&flow.tunnel, attr->tunnel, sizeof flow.tunnel);\n+ }\n+ iifindex = sflow->iifindex;\n+ flow.in_port.odp_port = netdev_ifindex_to_odp_port(iifindex);\n+ memset(&upcall, 0, sizeof upcall);\n+ upcall.flow = &flow;\n+ upcall.cookie = *cookie;\n+ upcall.packet = &sflow->packet;\n+ upcall.sflow = dpif_sflow;\n+ upcall.ufid = &attr->ufid;\n+ upcall.type = SFLOW_UPCALL;\n+ process_upcall(udpif, &upcall, NULL, NULL);\n+}\n+\n /* The upcall handler thread tries to read a batch of UPCALL_MAX_BATCH\n * upcalls from dpif, processes the batch and installs corresponding flows\n * in dpif. */\n@@ -795,6 +847,17 @@ udpif_upcall_handler(void *arg)\n dpif_recv_wait(udpif->dpif, handler->handler_id);\n latch_wait(&udpif->exit_latch);\n }\n+ /* Only handler id 0 thread process sFlow offload packet. */\n+ if (handler->handler_id == 0) {\n+ struct dpif_offload_sflow sflow;\n+ int err;\n+\n+ dpif_offload_sflow_recv_wait(udpif->dpif);\n+ err = dpif_offload_sflow_recv(udpif->dpif, &sflow);\n+ if (!err) {\n+ process_offload_sflow(udpif, &sflow);\n+ }\n+ }\n poll_block();\n }\n \n", "prefixes": [ "ovs-dev", "v15", "6/7" ] }