Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/96124/?format=api
http://patchwork.dpdk.org/api/patches/96124/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210721041505.10795-2-ivan.malov@oktetlabs.ru/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210721041505.10795-2-ivan.malov@oktetlabs.ru>", "list_archive_url": "https://inbox.dpdk.org/dev/20210721041505.10795-2-ivan.malov@oktetlabs.ru", "date": "2021-07-21T04:15:04", "name": "[v3,1/2] net/sfc: extend logging in MAE backend of RTE flow support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "90f5327f49b9577f14ac9923dc2579e1ad30d5ed", "submitter": { "id": 869, "url": "http://patchwork.dpdk.org/api/people/869/?format=api", "name": "Ivan Malov", "email": "Ivan.Malov@oktetlabs.ru" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210721041505.10795-2-ivan.malov@oktetlabs.ru/mbox/", "series": [ { "id": 17922, "url": "http://patchwork.dpdk.org/api/series/17922/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17922", "date": "2021-07-21T04:15:03", "name": "RTE flow support logging improvements", "version": 3, "mbox": "http://patchwork.dpdk.org/series/17922/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/96124/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/96124/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 15795A0C47;\n\tWed, 21 Jul 2021 06:15:31 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 07845410DB;\n\tWed, 21 Jul 2021 06:15:27 +0200 (CEST)", "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 4ED9640E64\n for <dev@dpdk.org>; Wed, 21 Jul 2021 06:15:24 +0200 (CEST)", "from localhost.localdomain (unknown [5.144.120.226])\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 shelob.oktetlabs.ru (Postfix) with ESMTPSA id D6D4F7F52A;\n Wed, 21 Jul 2021 07:15:22 +0300 (MSK)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru D6D4F7F52A", "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1626840922;\n bh=9JSWPHbEEdFuSDsgZjdaFdDUA7Hr2sMWY2V3FR++kGU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=EtfORSynX4+/nHvwrZZ7aLUlcoAqpS3ohU8swMNgGIG22aRItrGmWGcXgHgjAH0du\n Bq0PPzBKoAzzXoumYlOtGSbpimKD4Z3cLuKxVr6ew02XcwL7eX/a1+fvyDidccBPbr\n 8xDwGnw+gWbmMYsrrVA70XHZY/qZ7FrkeLh7Wu2E=", "From": "Ivan Malov <ivan.malov@oktetlabs.ru>", "To": "dev@dpdk.org", "Cc": "David Marchand <david.marchand@redhat.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Andy Moreton <amoreton@xilinx.com>", "Date": "Wed, 21 Jul 2021 07:15:04 +0300", "Message-Id": "<20210721041505.10795-2-ivan.malov@oktetlabs.ru>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20210721041505.10795-1-ivan.malov@oktetlabs.ru>", "References": "<20210707105628.16705-1-ivan.malov@oktetlabs.ru>\n <20210721041505.10795-1-ivan.malov@oktetlabs.ru>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 1/2] net/sfc: extend logging in MAE backend of\n RTE flow support", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Extra log statements will provide more details to the user\nin the case of errors discovered in the pattern or actions.\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\nReviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/net/sfc/sfc_mae.c | 94 +++++++++++++++++++++++++++++++--------\n 1 file changed, 75 insertions(+), 19 deletions(-)", "diff": "diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c\nindex 61e795db9b..14fc6fe5be 100644\n--- a/drivers/net/sfc/sfc_mae.c\n+++ b/drivers/net/sfc/sfc_mae.c\n@@ -752,6 +752,8 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \n \tfor (ethertype_idx = 0;\n \t ethertype_idx < pdata->nb_vlan_tags; ++ethertype_idx) {\n+\t\trte_be16_t tpid_v = ethertypes[ethertype_idx].value;\n+\t\trte_be16_t tpid_m = ethertypes[ethertype_idx].mask;\n \t\tunsigned int tpid_idx;\n \n \t\t/*\n@@ -761,7 +763,7 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \t\t */\n \t\tenforce_tag_presence[0] = B_FALSE;\n \n-\t\tif (ethertypes[ethertype_idx].mask == RTE_BE16(0)) {\n+\t\tif (tpid_m == RTE_BE16(0)) {\n \t\t\tif (pdata->tci_masks[ethertype_idx] == RTE_BE16(0))\n \t\t\t\tenforce_tag_presence[ethertype_idx] = B_TRUE;\n \n@@ -771,19 +773,22 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \t\t}\n \n \t\t/* Exact match is supported only. */\n-\t\tif (ethertypes[ethertype_idx].mask != RTE_BE16(0xffff)) {\n+\t\tif (tpid_m != RTE_BE16(0xffff)) {\n+\t\t\tsfc_err(ctx->sa, \"TPID mask must be 0x0 or 0xffff; got 0x%04x\",\n+\t\t\t\trte_be_to_cpu_16(tpid_m));\n \t\t\trc = EINVAL;\n \t\t\tgoto fail;\n \t\t}\n \n \t\tfor (tpid_idx = pdata->nb_vlan_tags - ethertype_idx - 1;\n \t\t tpid_idx < nb_supported_tpids; ++tpid_idx) {\n-\t\t\tif (ethertypes[ethertype_idx].value ==\n-\t\t\t supported_tpids[tpid_idx])\n+\t\t\tif (tpid_v == supported_tpids[tpid_idx])\n \t\t\t\tbreak;\n \t\t}\n \n \t\tif (tpid_idx == nb_supported_tpids) {\n+\t\t\tsfc_err(ctx->sa, \"TPID 0x%04x is unsupported\",\n+\t\t\t\trte_be_to_cpu_16(tpid_v));\n \t\t\trc = EINVAL;\n \t\t\tgoto fail;\n \t\t}\n@@ -793,14 +798,19 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \n \tif (pdata->innermost_ethertype_restriction.mask == RTE_BE16(0xffff)) {\n \t\tstruct sfc_mae_ethertype *et = ðertypes[ethertype_idx];\n+\t\trte_be16_t enforced_et;\n+\n+\t\tenforced_et = pdata->innermost_ethertype_restriction.value;\n \n \t\tif (et->mask == 0) {\n \t\t\tet->mask = RTE_BE16(0xffff);\n-\t\t\tet->value =\n-\t\t\t pdata->innermost_ethertype_restriction.value;\n+\t\t\tet->value = enforced_et;\n \t\t} else if (et->mask != RTE_BE16(0xffff) ||\n-\t\t\t et->value !=\n-\t\t\t pdata->innermost_ethertype_restriction.value) {\n+\t\t\t et->value != enforced_et) {\n+\t\t\tsfc_err(ctx->sa, \"L3 EtherType must be 0x0/0x0 or 0x%04x/0xffff; got 0x%04x/0x%04x\",\n+\t\t\t\trte_be_to_cpu_16(enforced_et),\n+\t\t\t\trte_be_to_cpu_16(et->value),\n+\t\t\t\trte_be_to_cpu_16(et->mask));\n \t\t\trc = EINVAL;\n \t\t\tgoto fail;\n \t\t}\n@@ -820,10 +830,14 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \t\tif (pdata->l3_next_proto_mask == 0) {\n \t\t\tpdata->l3_next_proto_mask = 0xff;\n \t\t\tpdata->l3_next_proto_value =\n-\t\t\t pdata->l3_next_proto_restriction_value;\n+\t\t\t\tpdata->l3_next_proto_restriction_value;\n \t\t} else if (pdata->l3_next_proto_mask != 0xff ||\n \t\t\t pdata->l3_next_proto_value !=\n \t\t\t pdata->l3_next_proto_restriction_value) {\n+\t\t\tsfc_err(ctx->sa, \"L3 next protocol must be 0x0/0x0 or 0x%02x/0xff; got 0x%02x/0x%02x\",\n+\t\t\t\tpdata->l3_next_proto_restriction_value,\n+\t\t\t\tpdata->l3_next_proto_value,\n+\t\t\t\tpdata->l3_next_proto_mask);\n \t\t\trc = EINVAL;\n \t\t\tgoto fail;\n \t\t}\n@@ -2374,6 +2388,7 @@ sfc_mae_rule_parse_action_vxlan_encap(\n \tsize_t next_proto_ofst = 0;\n \tsize_t ethertype_ofst = 0;\n \tuint64_t exp_items;\n+\tint rc;\n \n \tif (pattern == NULL) {\n \t\treturn rte_flow_error_set(error, EINVAL,\n@@ -2593,14 +2608,27 @@ sfc_mae_rule_parse_action_vxlan_encap(\n \t/* Take care of the masks. */\n \tsfc_mae_header_force_item_masks(buf, parsed_items, nb_parsed_items);\n \n-\treturn (spec != NULL) ? efx_mae_action_set_populate_encap(spec) : 0;\n+\trc = efx_mae_action_set_populate_encap(spec);\n+\tif (rc != 0) {\n+\t\trc = rte_flow_error_set(error, rc, RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\tNULL, \"failed to request action ENCAP\");\n+\t}\n+\n+\treturn rc;\n }\n \n static int\n-sfc_mae_rule_parse_action_mark(const struct rte_flow_action_mark *conf,\n+sfc_mae_rule_parse_action_mark(struct sfc_adapter *sa,\n+\t\t\t const struct rte_flow_action_mark *conf,\n \t\t\t efx_mae_actions_t *spec)\n {\n-\treturn efx_mae_action_set_populate_mark(spec, conf->id);\n+\tint rc;\n+\n+\trc = efx_mae_action_set_populate_mark(spec, conf->id);\n+\tif (rc != 0)\n+\t\tsfc_err(sa, \"failed to request action MARK: %s\", strerror(rc));\n+\n+\treturn rc;\n }\n \n static int\n@@ -2618,10 +2646,19 @@ sfc_mae_rule_parse_action_phy_port(struct sfc_adapter *sa,\n \t\tphy_port = conf->index;\n \n \trc = efx_mae_mport_by_phy_port(phy_port, &mport);\n-\tif (rc != 0)\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to convert phys. port ID %u to m-port selector: %s\",\n+\t\t\tphy_port, strerror(rc));\n \t\treturn rc;\n+\t}\n \n-\treturn efx_mae_action_set_populate_deliver(spec, &mport);\n+\trc = efx_mae_action_set_populate_deliver(spec, &mport);\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to request action DELIVER with m-port selector 0x%08x: %s\",\n+\t\t\tmport.sel, strerror(rc));\n+\t}\n+\n+\treturn rc;\n }\n \n static int\n@@ -2642,10 +2679,20 @@ sfc_mae_rule_parse_action_pf_vf(struct sfc_adapter *sa,\n \t\tvf = vf_conf->id;\n \n \trc = efx_mae_mport_by_pcie_function(encp->enc_pf, vf, &mport);\n-\tif (rc != 0)\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to convert PF %u VF %d to m-port: %s\",\n+\t\t\tencp->enc_pf, (vf != EFX_PCI_VF_INVALID) ? (int)vf : -1,\n+\t\t\tstrerror(rc));\n \t\treturn rc;\n+\t}\n+\n+\trc = efx_mae_action_set_populate_deliver(spec, &mport);\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to request action DELIVER with m-port selector 0x%08x: %s\",\n+\t\t\tmport.sel, strerror(rc));\n+\t}\n \n-\treturn efx_mae_action_set_populate_deliver(spec, &mport);\n+\treturn rc;\n }\n \n static int\n@@ -2666,10 +2713,19 @@ sfc_mae_rule_parse_action_port_id(struct sfc_adapter *sa,\n \n \trc = sfc_mae_switch_port_by_ethdev(mae->switch_domain_id,\n \t\t\t\t\t port_id, &mport);\n-\tif (rc != 0)\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to find MAE switch port SW entry for RTE ethdev port %u: %s\",\n+\t\t\tport_id, strerror(rc));\n \t\treturn rc;\n+\t}\n \n-\treturn efx_mae_action_set_populate_deliver(spec, &mport);\n+\trc = efx_mae_action_set_populate_deliver(spec, &mport);\n+\tif (rc != 0) {\n+\t\tsfc_err(sa, \"failed to request action DELIVER with m-port selector 0x%08x: %s\",\n+\t\t\tmport.sel, strerror(rc));\n+\t}\n+\n+\treturn rc;\n }\n \n static int\n@@ -2729,7 +2785,7 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa,\n \tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\tSFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_MARK,\n \t\t\t\t bundle->actions_mask);\n-\t\trc = sfc_mae_rule_parse_action_mark(action->conf, spec);\n+\t\trc = sfc_mae_rule_parse_action_mark(sa, action->conf, spec);\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_PHY_PORT:\n \t\tSFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_PHY_PORT,\n", "prefixes": [ "v3", "1/2" ] }{ "id": 96124, "url": "