Show a patch.

GET /api/patches/73402/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 73402,
    "url": "https://patches.dpdk.org/api/patches/73402/",
    "web_url": "https://patches.dpdk.org/patch/73402/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200707092244.12791-23-hemant.agrawal@nxp.com>",
    "date": "2020-07-07T09:22:37",
    "name": "[v2,22/29] net/dpaa2: support iscrimination between IPv4 and IPv6",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "96a168c7ddd251ededbb1afa1ec7692aff0b355e",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73402/mbox/",
    "series": [
        {
            "id": 10842,
            "url": "https://patches.dpdk.org/api/series/10842/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10842",
            "date": "2020-07-07T09:22:15",
            "name": "NXP DPAAx enhancements",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10842/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73402/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73402/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Message-Id": "<20200707092244.12791-23-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tJun Yang <jun.yang@nxp.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AD4AFA00BE;\n\tTue,  7 Jul 2020 11:31:42 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 24A891DD37;\n\tTue,  7 Jul 2020 11:27:34 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id 7ABD81DD44\n for <dev@dpdk.org>; Tue,  7 Jul 2020 11:27:14 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4F31120060D;\n Tue,  7 Jul 2020 11:27:14 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 683162008E1;\n Tue,  7 Jul 2020 11:27:12 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C816F40305;\n Tue,  7 Jul 2020 17:27:09 +0800 (SGT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 22/29] net/dpaa2: support iscrimination\n\tbetween IPv4 and IPv6",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": "<20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "Precedence": "list",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "References": "<20200527132326.1382-1-hemant.agrawal@nxp.com>\n <20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Date": "Tue,  7 Jul 2020 14:52:37 +0530",
        "X-Mailman-Version": "2.1.15",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>"
    },
    "content": "From: Jun Yang <jun.yang@nxp.com>\n\nDiscriminate between IPv4 and IPv6 in generic IP flow setup.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\n---\n drivers/net/dpaa2/dpaa2_flow.c | 153 +++++++++++++++++----------------\n 1 file changed, 80 insertions(+), 73 deletions(-)",
    "diff": "diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c\nindex 95756bf7b..6f3139f86 100644\n--- a/drivers/net/dpaa2/dpaa2_flow.c\n+++ b/drivers/net/dpaa2/dpaa2_flow.c\n@@ -1284,6 +1284,70 @@ dpaa2_configure_flow_vlan(struct rte_flow *flow,\n \treturn 0;\n }\n \n+static int\n+dpaa2_configure_flow_ip_discrimation(\n+\tstruct dpaa2_dev_priv *priv, struct rte_flow *flow,\n+\tconst struct rte_flow_item *pattern,\n+\tint *local_cfg,\tint *device_configured,\n+\tuint32_t group)\n+{\n+\tint index, ret;\n+\tstruct proto_discrimination proto;\n+\n+\tindex = dpaa2_flow_extract_search(\n+\t\t\t&priv->extract.qos_key_extract.dpkg,\n+\t\t\tNET_PROT_ETH, NH_FLD_ETH_TYPE);\n+\tif (index < 0) {\n+\t\tret = dpaa2_flow_proto_discrimination_extract(\n+\t\t\t\t&priv->extract.qos_key_extract,\n+\t\t\t\tRTE_FLOW_ITEM_TYPE_ETH);\n+\t\tif (ret) {\n+\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\"QoS Extract ETH_TYPE to discriminate IP failed.\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\t(*local_cfg) |= DPAA2_QOS_TABLE_RECONFIGURE;\n+\t}\n+\n+\tindex = dpaa2_flow_extract_search(\n+\t\t\t&priv->extract.tc_key_extract[group].dpkg,\n+\t\t\tNET_PROT_ETH, NH_FLD_ETH_TYPE);\n+\tif (index < 0) {\n+\t\tret = dpaa2_flow_proto_discrimination_extract(\n+\t\t\t\t&priv->extract.tc_key_extract[group],\n+\t\t\t\tRTE_FLOW_ITEM_TYPE_ETH);\n+\t\tif (ret) {\n+\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\"FS Extract ETH_TYPE to discriminate IP failed.\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\t(*local_cfg) |= DPAA2_FS_TABLE_RECONFIGURE;\n+\t}\n+\n+\tret = dpaa2_flow_rule_move_ipaddr_tail(flow, priv, group);\n+\tif (ret) {\n+\t\tDPAA2_PMD_ERR(\n+\t\t\t\"Move ipaddr before IP discrimination set failed\");\n+\t\treturn -1;\n+\t}\n+\n+\tproto.type = RTE_FLOW_ITEM_TYPE_ETH;\n+\tif (pattern->type == RTE_FLOW_ITEM_TYPE_IPV4)\n+\t\tproto.eth_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);\n+\telse\n+\t\tproto.eth_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);\n+\tret = dpaa2_flow_proto_discrimination_rule(priv, flow, proto, group);\n+\tif (ret) {\n+\t\tDPAA2_PMD_ERR(\"IP discrimination rule set failed\");\n+\t\treturn -1;\n+\t}\n+\n+\t(*device_configured) |= (*local_cfg);\n+\n+\treturn 0;\n+}\n+\n+\n static int\n dpaa2_configure_flow_generic_ip(\n \tstruct rte_flow *flow,\n@@ -1327,73 +1391,16 @@ dpaa2_configure_flow_generic_ip(\n \tflow->tc_id = group;\n \tflow->tc_index = attr->priority;\n \n-\tif (!spec_ipv4 && !spec_ipv6) {\n-\t\t/* Don't care any field of IP header,\n-\t\t * only care IP protocol.\n-\t\t * Example: flow create 0 ingress pattern ipv6 /\n-\t\t */\n-\t\t/* Eth type is actually used for IP identification.\n-\t\t */\n-\t\t/* TODO: Current design only supports Eth + IP,\n-\t\t *  Eth + vLan + IP needs to add.\n-\t\t */\n-\t\tstruct proto_discrimination proto;\n-\n-\t\tindex = dpaa2_flow_extract_search(\n-\t\t\t\t&priv->extract.qos_key_extract.dpkg,\n-\t\t\t\tNET_PROT_ETH, NH_FLD_ETH_TYPE);\n-\t\tif (index < 0) {\n-\t\t\tret = dpaa2_flow_proto_discrimination_extract(\n-\t\t\t\t\t&priv->extract.qos_key_extract,\n-\t\t\t\t\tRTE_FLOW_ITEM_TYPE_ETH);\n-\t\t\tif (ret) {\n-\t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"QoS Ext ETH_TYPE to discriminate IP failed.\");\n-\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tlocal_cfg |= DPAA2_QOS_TABLE_RECONFIGURE;\n-\t\t}\n-\n-\t\tindex = dpaa2_flow_extract_search(\n-\t\t\t\t&priv->extract.tc_key_extract[group].dpkg,\n-\t\t\t\tNET_PROT_ETH, NH_FLD_ETH_TYPE);\n-\t\tif (index < 0) {\n-\t\t\tret = dpaa2_flow_proto_discrimination_extract(\n-\t\t\t\t\t&priv->extract.tc_key_extract[group],\n-\t\t\t\t\tRTE_FLOW_ITEM_TYPE_ETH);\n-\t\t\tif (ret) {\n-\t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"FS Ext ETH_TYPE to discriminate IP failed\");\n-\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tlocal_cfg |= DPAA2_FS_TABLE_RECONFIGURE;\n-\t\t}\n-\n-\t\tret = dpaa2_flow_rule_move_ipaddr_tail(flow, priv, group);\n-\t\tif (ret) {\n-\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\"Move ipaddr before IP discrimination set failed\");\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\tproto.type = RTE_FLOW_ITEM_TYPE_ETH;\n-\t\tif (pattern->type == RTE_FLOW_ITEM_TYPE_IPV4)\n-\t\t\tproto.eth_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);\n-\t\telse\n-\t\t\tproto.eth_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);\n-\t\tret = dpaa2_flow_proto_discrimination_rule(priv, flow,\n-\t\t\t\t\t\t\tproto, group);\n-\t\tif (ret) {\n-\t\t\tDPAA2_PMD_ERR(\"IP discrimination rule set failed\");\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\t(*device_configured) |= local_cfg;\n+\tret = dpaa2_configure_flow_ip_discrimation(priv,\n+\t\t\tflow, pattern, &local_cfg,\n+\t\t\tdevice_configured, group);\n+\tif (ret) {\n+\t\tDPAA2_PMD_ERR(\"IP discrimation failed!\");\n+\t\treturn -1;\n+\t}\n \n+\tif (!spec_ipv4 && !spec_ipv6)\n \t\treturn 0;\n-\t}\n \n \tif (mask_ipv4) {\n \t\tif (dpaa2_flow_extract_support((const uint8_t *)mask_ipv4,\n@@ -1433,10 +1440,10 @@ dpaa2_configure_flow_generic_ip(\n \t\t\t\tNET_PROT_IP, NH_FLD_IP_SRC);\n \t\tif (index < 0) {\n \t\t\tret = dpaa2_flow_extract_add(\n-\t\t\t\t\t\t&priv->extract.qos_key_extract,\n-\t\t\t\t\t\tNET_PROT_IP,\n-\t\t\t\t\t\tNH_FLD_IP_SRC,\n-\t\t\t\t\t\t0);\n+\t\t\t\t\t&priv->extract.qos_key_extract,\n+\t\t\t\t\tNET_PROT_IP,\n+\t\t\t\t\tNH_FLD_IP_SRC,\n+\t\t\t\t\t0);\n \t\t\tif (ret) {\n \t\t\t\tDPAA2_PMD_ERR(\"QoS Extract add IP_SRC failed.\");\n \n@@ -1519,10 +1526,10 @@ dpaa2_configure_flow_generic_ip(\n \t\t\telse\n \t\t\t\tsize = NH_FLD_IPV6_ADDR_SIZE;\n \t\t\tret = dpaa2_flow_extract_add(\n-\t\t\t\t\t\t&priv->extract.qos_key_extract,\n-\t\t\t\t\t\tNET_PROT_IP,\n-\t\t\t\t\t\tNH_FLD_IP_DST,\n-\t\t\t\t\t\tsize);\n+\t\t\t\t\t&priv->extract.qos_key_extract,\n+\t\t\t\t\tNET_PROT_IP,\n+\t\t\t\t\tNH_FLD_IP_DST,\n+\t\t\t\t\tsize);\n \t\t\tif (ret) {\n \t\t\t\tDPAA2_PMD_ERR(\"QoS Extract add IP_DST failed.\");\n \n",
    "prefixes": [
        "v2",
        "22/29"
    ]
}