get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54251,
    "url": "http://patches.dpdk.org/api/patches/54251/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-28-git-send-email-anoobj@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<1559583160-13944-28-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559583160-13944-28-git-send-email-anoobj@marvell.com",
    "date": "2019-06-03T17:32:27",
    "name": "[27/39] eventdev: add default conf for Rx adapter conf",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "b538b95b9a1e758dc349eb157f2dcfc11bd4d311",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-28-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 4868,
            "url": "http://patches.dpdk.org/api/series/4868/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4868",
            "date": "2019-06-03T17:32:00",
            "name": "adding eventmode helper library",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4868/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54251/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54251/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1EC811BBA5;\n\tMon,  3 Jun 2019 19:36:18 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 466B81B9DF\n\tfor <dev@dpdk.org>; Mon,  3 Jun 2019 19:36:04 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx53HKsuP000981; Mon, 3 Jun 2019 10:36:03 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2sw2wmhdnx-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 03 Jun 2019 10:36:03 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 3 Jun 2019 10:36:02 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 3 Jun 2019 10:36:02 -0700",
            "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56])\n\tby maili.marvell.com (Postfix) with ESMTP id E30303F703F;\n\tMon,  3 Jun 2019 10:35:57 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=Gt90Sn2uOSGZ1UpzBtyLBBtrOcXOk2rwVDxK6eJsyP0=;\n\tb=fmVo4ooOIXAiunlWjy3EfnarvgOuhaqdKwx/mFePrU6iH4ncox2g8WCDZFzJp1meJp4+\n\tsU7E4sK3aRUXh4T82Y4yOcJ2SGpg3AUQSA/dliDj7g274Rk0sRxqHVvEfpZDnfokL8yK\n\thK+KTAwZ42TB7G+NdqDV2DH3qhWnReBKECJmZk6m9IaiWXxonzklsihP3STeJpo5m6HM\n\tB682vcoz5tuCsI0SJl0P45vIxyTPyItkwmRin7oS1pyQHKpthgab79Hzacpgv60DZ0qF\n\tFsfjsFp2FeaEOW7y7Gh7GIUQ8Jbd6N5jVKlxcwQfm/OmiTCJgcGE+Hvtz6x4/P5BYz5y\n\tCA== ",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Nikhil Rao <nikhil.rao@intel.com>,\n\t\"Erik Gabriel Carrillo\" <erik.g.carrillo@intel.com>, Abhinandan Gujjar\n\t<abhinandan.gujjar@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Narayana Prasad <pathreya@marvell.com>,\n\t<dev@dpdk.org>, Lukasz Bartosik <lbartosik@marvell.com>, Pavan Nikhilesh\n\t<pbhagavatula@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n\t\"Nipun  Gupta\" <nipun.gupta@nxp.com>, Harry van Haaren\n\t<harry.van.haaren@intel.com>, =?utf-8?q?Mattias_R=C3=B6nnblom?=\n\t<mattias.ronnblom@ericsson.com>,  Liang Ma <liang.j.ma@intel.com>",
        "Date": "Mon, 3 Jun 2019 23:02:27 +0530",
        "Message-ID": "<1559583160-13944-28-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "References": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-03_13:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH 27/39] eventdev: add default conf for Rx adapter\n\tconf",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Generate a default conf for Rx adapter, if not specified in the conf.\nThis routine will check the available eth ports and event queues, and\nmaps them 1:1. So one eth port will be connected to one event queue.\nThis way, event queue ID could be used to figure out the port on which\nthe packet came in.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n lib/librte_eventdev/rte_eventmode_helper.c         | 127 +++++++++++++++++++++\n .../rte_eventmode_helper_internal.h                |   4 +\n 2 files changed, 131 insertions(+)",
    "diff": "diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c\nindex 1729561..a24d654 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper.c\n+++ b/lib/librte_eventdev/rte_eventmode_helper.c\n@@ -47,6 +47,30 @@ internal_parse_decimal(const char *str)\n \treturn num;\n }\n \n+static inline unsigned int\n+internal_get_next_rx_core(struct eventmode_conf *em_conf,\n+\t\tunsigned int prev_core)\n+{\n+\tunsigned int next_core;\n+\n+get_next_core:\n+\t/* Get the next core */\n+\tnext_core = rte_get_next_lcore(prev_core, 0, 0);\n+\n+\t/* Check if we have reached max lcores */\n+\tif (next_core == RTE_MAX_LCORE)\n+\t\treturn next_core;\n+\n+\t/* Only some cores would be marked as rx cores. Skip others */\n+\tif (!(em_conf->eth_core_mask & (1 << next_core))) {\n+\t\tprev_core = next_core;\n+\t\tgoto get_next_core;\n+\t}\n+\n+\treturn next_core;\n+}\n+\n+\n /* Global functions */\n \n void __rte_experimental\n@@ -87,6 +111,7 @@ static void\n em_initialize_helper_conf(struct rte_eventmode_helper_conf *conf)\n {\n \tstruct eventmode_conf *em_conf = NULL;\n+\tunsigned int rx_core_id;\n \n \t/* Set default conf */\n \n@@ -102,6 +127,12 @@ em_initialize_helper_conf(struct rte_eventmode_helper_conf *conf)\n \t/* Schedule type: ordered */\n \t/* FIXME */\n \tem_conf->ext_params.sched_type = RTE_SCHED_TYPE_ORDERED;\n+\t/* Set rx core. Use first core other than master core as Rx core */\n+\trx_core_id = rte_get_next_lcore(0, /* curr core */\n+\t\t\t\t\t1, /* skip master core */\n+\t\t\t\t\t0  /* wrap */);\n+\n+\tem_conf->eth_core_mask = (1 << rx_core_id);\n }\n \n struct rte_eventmode_helper_conf * __rte_experimental\n@@ -236,6 +267,89 @@ rte_eventmode_helper_set_default_conf_eventdev(struct eventmode_conf *em_conf)\n }\n \n static int\n+rte_eventmode_helper_set_default_conf_rx_adapter(struct eventmode_conf *em_conf)\n+{\n+\tint nb_eth_dev;\n+\tint i;\n+\tint adapter_id;\n+\tint eventdev_id;\n+\tint conn_id;\n+\tstruct rx_adapter_conf *adapter;\n+\tstruct adapter_connection_info *conn;\n+\tstruct eventdev_params *eventdev_config;\n+\n+\t/* Create one adapter with all eth queues mapped to event queues 1:1 */\n+\n+\tif (em_conf->nb_eventdev == 0) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"No event devs registered\");\n+\t\treturn -1;\n+\t}\n+\n+\t/* Get the number of eth devs */\n+\tnb_eth_dev = rte_eth_dev_count_avail();\n+\n+\t/* Use the first event dev */\n+\teventdev_config = &(em_conf->eventdev_config[0]);\n+\n+\t/* Get eventdev ID */\n+\teventdev_id = eventdev_config->eventdev_id;\n+\tadapter_id = 0;\n+\n+\t/* Get adapter conf */\n+\tadapter = &(em_conf->rx_adapter[adapter_id]);\n+\n+\t/* Set adapter conf */\n+\tadapter->eventdev_id = eventdev_id;\n+\tadapter->adapter_id = adapter_id;\n+\tadapter->rx_core_id = internal_get_next_rx_core(em_conf, -1);\n+\n+\t/*\n+\t * All queues of one eth device (port) will be mapped to one event\n+\t * queue. Each port will have an individual connection.\n+\t *\n+\t */\n+\n+\t/* Make sure there is enough event queues for 1:1 mapping */\n+\tif (nb_eth_dev > eventdev_config->nb_eventqueue) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\"Not enough event queues for 1:1 mapping \"\n+\t\t\t\"[eth devs: %d, event queues: %d]\\n\",\n+\t\t\tnb_eth_dev,\n+\t\t\teventdev_config->nb_eventqueue);\n+\t\treturn -1;\n+\t}\n+\n+\tfor (i = 0; i < nb_eth_dev; i++) {\n+\n+\t\t/* Use only the ports enabled */\n+\t\tif ((em_conf->eth_portmask & (1 << i)) == 0)\n+\t\t\tcontinue;\n+\n+\t\t/* Get the connection id */\n+\t\tconn_id = adapter->nb_connections;\n+\n+\t\t/* Get the connection */\n+\t\tconn = &(adapter->conn[conn_id]);\n+\n+\t\t/* Set 1:1 mapping between eth ports & event queues*/\n+\t\tconn->ethdev_id = i;\n+\t\tconn->eventq_id = i;\n+\n+\t\t/* Add all eth queues of one eth port to one event queue */\n+\t\tconn->ethdev_rx_qid = -1;\n+\n+\t\t/* Update no of connections */\n+\t\tadapter->nb_connections++;\n+\n+\t}\n+\n+\t/* We have setup one adapter */\n+\tem_conf->nb_rx_adapter = 1;\n+\n+\treturn 0;\n+}\n+\n+static int\n rte_eventmode_helper_validate_conf(struct eventmode_conf *em_conf)\n {\n \tint ret;\n@@ -255,6 +369,16 @@ rte_eventmode_helper_validate_conf(struct eventmode_conf *em_conf)\n \t\t\treturn ret;\n \t}\n \n+\t/*\n+\t * See if rx adapters are specified. Else generate a default conf\n+\t * with one rx adapter and all eth queue - event queue mapped.\n+\t */\n+\tif (em_conf->nb_rx_adapter == 0) {\n+\t\tret = rte_eventmode_helper_set_default_conf_rx_adapter(em_conf);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -561,6 +685,9 @@ rte_eventmode_helper_initialize_devs(\n \t/* Get eventmode conf */\n \tem_conf = (struct eventmode_conf *)(mode_conf->mode_params);\n \n+\t/* Eventmode conf would need eth portmask */\n+\tem_conf->eth_portmask = mode_conf->eth_portmask;\n+\n \t/* Validate the conf requested */\n \tif (rte_eventmode_helper_validate_conf(em_conf) != 0) {\n \t\tRTE_EM_HLPR_LOG_ERR(\ndiff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h\nindex 9c68605..7cc5776 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper_internal.h\n+++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h\n@@ -88,6 +88,10 @@ struct eventmode_conf {\n \tstruct rte_eventmode_helper_event_link_info\n \t\t\tlink[EVENT_MODE_MAX_LCORE_LINKS];\n \t\t/**< Per link conf */\n+\tuint32_t eth_core_mask;\n+\t\t/**< Core mask of cores to be used for software Rx and Tx */\n+\tuint32_t eth_portmask;\n+\t\t/**< Mask of the eth ports to be used */\n \tunion {\n \t\tstruct {\n \t\t\tuint64_t sched_type\t\t\t: 2;\n",
    "prefixes": [
        "27/39"
    ]
}