get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28442,
    "url": "https://patches.dpdk.org/api/patches/28442/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170907114527.26649-1-v.kuramshin@samsung.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20170907114527.26649-1-v.kuramshin@samsung.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170907114527.26649-1-v.kuramshin@samsung.com",
    "date": "2017-09-07T11:45:27",
    "name": "[dpdk-dev,v2] examples/l2fwd-cat: fix build according to API changes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1c77d898b862ca5df49895756a0defe0de45d24d",
    "submitter": {
        "id": 785,
        "url": "https://patches.dpdk.org/api/people/785/?format=api",
        "name": "Vladimir Kuramshin",
        "email": "v.kuramshin@samsung.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170907114527.26649-1-v.kuramshin@samsung.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28442/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/28442/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 55AEE16829;\n\tThu,  7 Sep 2017 13:45:57 +0200 (CEST)",
            "from mailout2.w1.samsung.com (mailout2.w1.samsung.com\n\t[210.118.77.12]) by dpdk.org (Postfix) with ESMTP id A7790968\n\tfor <dev@dpdk.org>; Thu,  7 Sep 2017 13:45:56 +0200 (CEST)",
            "from eucas1p1.samsung.com (unknown [182.198.249.206])\n\tby mailout2.w1.samsung.com (KnoxPortal) with ESMTP id\n\t20170907114553euoutp02eba004ecebbc4494fdfa694cedd87189~iEcLP9S1X0987909879euoutp02g;\n\tThu,  7 Sep 2017 11:45:53 +0000 (GMT)",
            "from eusmges5.samsung.com (unknown [203.254.199.245]) by\n\teucas1p2.samsung.com (KnoxPortal) with ESMTP id\n\t20170907114553eucas1p25ddc73174c8e88e8d6ddea1a6c1a52c4~iEcKfhb-G3092930929eucas1p2G;\n\tThu,  7 Sep 2017 11:45:53 +0000 (GMT)",
            "from eucas1p1.samsung.com ( [182.198.249.206]) by\n\teusmges5.samsung.com (EUCPMTA) with SMTP id F8.24.12743.07131B95;\n\tThu,  7 Sep 2017 12:45:52 +0100 (BST)",
            "from eusmgms2.samsung.com (unknown [182.198.249.180]) by\n\teucas1p1.samsung.com (KnoxPortal) with ESMTP id\n\t20170907114552eucas1p182c484310d70f1d52f64b9ea7fb96ed6~iEcJ4Iqzv2483724837eucas1p1P;\n\tThu,  7 Sep 2017 11:45:52 +0000 (GMT)",
            "from eusync1.samsung.com ( [203.254.199.211]) by\n\teusmgms2.samsung.com (EUCPMTA) with SMTP id 77.29.20118.07131B95;\n\tThu,  7 Sep 2017 12:45:52 +0100 (BST)",
            "from localhost.localdomain ([106.109.129.68]) by\n\teusync1.samsung.com (Oracle Communications Messaging Server\n\t7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id\n\t<0OVW00ICURC91V90@eusync1.samsung.com>; \n\tThu, 07 Sep 2017 12:45:52 +0100 (BST)"
        ],
        "X-AuditID": "cbfec7f5-f79d06d0000031c7-05-59b1317073a6",
        "From": "Vladimir Kuramshin <v.kuramshin@samsung.com>",
        "To": "tomasz.kantecki@intel.com",
        "Cc": "dev@dpdk.org, Vladimir Kuramshin <v.kuramshin@samsung.com>",
        "Date": "Thu, 07 Sep 2017 14:45:27 +0300",
        "Message-id": "<20170907114527.26649-1-v.kuramshin@samsung.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-reply-to": "<20170829095153.12627-1-v.kuramshin@samsung.com>",
        "X-Brightmail-Tracker": [
            "H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsWy7djPc7oFhhsjDR6/NbZ492k7k8W01b/Z\n\tLU7f3MzuwOzxa8FSVo/Fe14yefRtWcUYwBzFZZOSmpNZllqkb5fAlXGhZz9LwVHTim2rZ7E1\n\tME7Q6mLk5JAQMJFo/XSHEcIWk7hwbz1bFyMXh5DAUkaJOzubWCGcz4wS2/4/Y4TpmLv5ElRi\n\tGaPEkX97GCGc/4wSz1esYAGpYhMwkli1cT8biC0iICuxasdUMJtZwE7i9sN5zCC2sICXxNtZ\n\tM8HiLAKqEvP3vGYHsXkFbCQOHHzHBLFNXuLcg9tg9ZwCthIbv99gAVkmIfCUVeLdtNdARRxA\n\tjovEk3ZliHphiVfHt7BD2DISlyd3Q9V3M0qcbZ3DCuFMYZTYs+wJC0SVvcSpm1eZIK7jk5i0\n\tbTozxFBeiY42IYgSD4mHU7cyQ9iOEpd3boT6eAKjxOQFq1gnMEovYGRYxSiSWlqcm55abKpX\n\tnJhbXJqXrpecn7uJERhzp/8d/7qDcekxq0OMAhyMSjy8DdIbIoVYE8uKK3MPMUpwMCuJ8F7W\n\t3xgpxJuSWFmVWpQfX1Sak1p8iFGag0VJnNc2qi1SSCA9sSQ1OzW1ILUIJsvEwSnVwLifM4bv\n\t96813+pWu0/zfXPBuMpvmbNP+Hr5E1ccd/VL2s/LtblzJ6WN3XI5j/ne078FGJY0T5pQ/k7G\n\tTjx/8ex1wnYSuxMmnPtzPZX9VfqHf+lcJ3u79pQs9PNkPzo5hmlzreDDFysu/70/p+hz97lb\n\tH9p+WPUV8nbH5O9qfCHHPCtkgc6ErT5KLMUZiYZazEXFiQD9BkVktQIAAA==",
            "H4sIAAAAAAAAA+NgFvrGJMWRmVeSWpSXmKPExsVy+t/xy7oFhhsjDdoaJC3efdrOZDFt9W92\n\ti9M3N7M7MHv8WrCU1WPxnpdMHn1bVjEGMEdx2aSk5mSWpRbp2yVwZVzo2c9ScNS0YtvqWWwN\n\tjBO0uhg5OSQETCTmbr7ECmGLSVy4t56ti5GLQ0hgCaPElAP72SGcRiaJHb8PMYFUsQkYSaza\n\tuJ8NxBYRkJVYtWMqmM0sYCdx++E8ZhBbWMBL4u2smWBxFgFVifl7XrOD2LwCNhIHDr5jgtgm\n\tL3HuwW2wek4BW4mN32+wgNhCQDWLXi1lnMDIu4CRYRWjSGppcW56brGRXnFibnFpXrpecn7u\n\tJkZgaGw79nPLDsaud8GHGAU4GJV4eBP+r48UYk0sK67MPcQowcGsJMJ7WX9jpBBvSmJlVWpR\n\tfnxRaU5q8SFGaQ4WJXHe3j2rI4UE0hNLUrNTUwtSi2CyTBycUg2MNSdccn49mb4gbH0Bt4bC\n\tViMbkd1l053V245NiGb5u9eoPOFxh6DL9xhRqcbVh3bbSxQGrpW69XLzpj91N5/4d4n/tzm2\n\ttVJNtevjR+bv8xZZ8re/6ay/3N9pdVgw5/mXfM/ot9Wp2/ez7lawylET9pKy+Xwk5YHy6v2K\n\t52a//NRctix4mk+AEktxRqKhFnNRcSIAARTTtgkCAAA="
        ],
        "X-CMS-MailID": "20170907114552eucas1p182c484310d70f1d52f64b9ea7fb96ed6",
        "X-Msg-Generator": "CA",
        "X-Sender-IP": "182.198.249.180",
        "X-Local-Sender": "=?utf-8?q?Vladimir_Kuramshin=1BSRR-Virtualization_Lab=1B?=\n\t=?utf-8?b?7IK87ISx7KCE7J6QG0V4cGVydCBFbmdpbmVlcg==?=",
        "X-Global-Sender": "=?utf-8?q?Vladimir_Kuramshin=1BSRR-Virtualization_Lab=1B?=\n\t=?utf-8?q?Samsung_Electronics=1BExpert_Engineer?=",
        "X-Sender-Code": "=?utf-8?q?C10=1BCISHQ=1BC10GD01GD010154?=",
        "CMS-TYPE": "201P",
        "X-CMS-RootMailID": "20170907114552eucas1p182c484310d70f1d52f64b9ea7fb96ed6",
        "X-RootMTR": "20170907114552eucas1p182c484310d70f1d52f64b9ea7fb96ed6",
        "References": "<20170829095153.12627-1-v.kuramshin@samsung.com>\n\t<CGME20170907114552eucas1p182c484310d70f1d52f64b9ea7fb96ed6@eucas1p1.samsung.com>",
        "Subject": "[dpdk-dev] [PATCH v2] examples/l2fwd-cat: fix build according to\n\tAPI changes",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Current version is compatible with PQOS version 1.3\nbut not compatible with higher versions. This change\nmakes l2fwd-cat example compatible with versions since 1.4\n\nSigned-off-by: Vladimir Kuramshin <v.kuramshin@samsung.com>\n---\nVersion 2 changes: fixed checkpatch warnings\n\"Prefer 'unsigned int *' to bare use of 'unsigned *'\"\n\n examples/l2fwd-cat/Makefile |  5 +---\n examples/l2fwd-cat/cat.c    | 60 ++++++++++++++++++++++-----------------------\n 2 files changed, 30 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile\nindex ae921ade6..a7fe6d68e 100644\n--- a/examples/l2fwd-cat/Makefile\n+++ b/examples/l2fwd-cat/Makefile\n@@ -40,9 +40,6 @@ endif\n # Default target, can be overridden by command line or environment\n RTE_TARGET ?= x86_64-native-linuxapp-gcc\n \n-# Location of PQoS library and includes,\n-PQOS_LIBRARY_PATH = $(PQOS_INSTALL_PATH)/libpqos.a\n-\n include $(RTE_SDK)/mk/rte.vars.mk\n \n # binary name\n@@ -65,6 +62,6 @@ CFLAGS += -I$(PQOS_INSTALL_PATH)/../include\n CFLAGS_cat.o := -D_GNU_SOURCE\n \n LDLIBS += -L$(PQOS_INSTALL_PATH)\n-LDLIBS += $(PQOS_LIBRARY_PATH)\n+LDLIBS += -lpqos\n \n include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c\nindex 6133bf5bb..6b464bffa 100644\n--- a/examples/l2fwd-cat/cat.c\n+++ b/examples/l2fwd-cat/cat.c\n@@ -53,7 +53,7 @@\n static const struct pqos_cap *m_cap;\n static const struct pqos_cpuinfo *m_cpu;\n static const struct pqos_capability *m_cap_l3ca;\n-static unsigned m_sockets[PQOS_MAX_SOCKETS];\n+static unsigned int *m_sockets;\n static unsigned m_sock_count;\n static struct cat_config m_config[PQOS_MAX_CORES];\n static unsigned m_config_count;\n@@ -271,16 +271,16 @@ parse_l3ca(const char *l3ca)\n \t\t/* scan the separator '@', ','(next) or '\\0'(finish) */\n \t\tl3ca += strcspn(l3ca, \"@,\");\n \n-\t\tif (*l3ca == '@') {\n-\t\t\t/* explicit assign cpu_set */\n-\t\t\toffset = parse_set(l3ca + 1, &cpuset);\n-\t\t\tif (offset < 0 || CPU_COUNT(&cpuset) == 0)\n-\t\t\t\tgoto err;\n+\t\tif (*l3ca != '@')\n+\t\t\tgoto err;\n \n-\t\t\tend = l3ca + 1 + offset;\n-\t\t} else\n+\t\t/* explicit assign cpu_set */\n+\t\toffset = parse_set(l3ca + 1, &cpuset);\n+\t\tif (offset < 0 || CPU_COUNT(&cpuset) == 0)\n \t\t\tgoto err;\n \n+\t\tend = l3ca + 1 + offset;\n+\n \t\tif (*end != ',' && *end != '\\0')\n \t\t\tgoto err;\n \n@@ -353,9 +353,6 @@ parse_l3ca(const char *l3ca)\n \t\tidx++;\n \t} while (*end != '\\0' && idx < PQOS_MAX_CORES);\n \n-\tif (m_config_count == 0)\n-\t\tgoto err;\n-\n \treturn 0;\n \n err:\n@@ -408,7 +405,7 @@ check_cpus(void)\n \t\t\t\t\tgoto exit;\n \t\t\t\t}\n \n-\t\t\t\tret = pqos_l3ca_assoc_get(cpu_id, &cos_id);\n+\t\t\t\tret = pqos_alloc_assoc_get(cpu_id, &cos_id);\n \t\t\t\tif (ret != PQOS_RETVAL_OK) {\n \t\t\t\t\tprintf(\"PQOS: Failed to read COS \"\n \t\t\t\t\t\t\"associated to cpu %u.\\n\",\n@@ -512,7 +509,7 @@ check_and_select_classes(unsigned cos_id_map[][PQOS_MAX_SOCKETS])\n \tfor (j = 0; j < m_cpu->num_cores; j++) {\n \t\tcpu_id = m_cpu->cores[j].lcore;\n \n-\t\tret = pqos_l3ca_assoc_get(cpu_id, &cos_id);\n+\t\tret = pqos_alloc_assoc_get(cpu_id, &cos_id);\n \t\tif (ret != PQOS_RETVAL_OK) {\n \t\t\tprintf(\"PQOS: Failed to read COS associated to \"\n \t\t\t\t\"cpu %u on phy_pkg %u.\\n\", cpu_id, phy_pkg_id);\n@@ -598,10 +595,10 @@ configure_cat(unsigned cos_id_map[][PQOS_MAX_SOCKETS])\n \n \t\tl3ca.cdp = m_config[i].cdp;\n \t\tif (m_config[i].cdp == 1) {\n-\t\t\tl3ca.code_mask = m_config[i].code_mask;\n-\t\t\tl3ca.data_mask = m_config[i].data_mask;\n+\t\t\tl3ca.u.s.code_mask = m_config[i].code_mask;\n+\t\t\tl3ca.u.s.data_mask = m_config[i].data_mask;\n \t\t} else\n-\t\t\tl3ca.ways_mask = m_config[i].mask;\n+\t\t\tl3ca.u.ways_mask = m_config[i].mask;\n \n \t\tfor (j = 0; j < m_sock_count; j++) {\n \t\t\tphy_pkg_id = m_sockets[j];\n@@ -637,7 +634,7 @@ configure_cat(unsigned cos_id_map[][PQOS_MAX_SOCKETS])\n \n \t\t\tcos_id = cos_id_map[i][phy_pkg_id];\n \n-\t\t\tret = pqos_l3ca_assoc_set(cpu_id, cos_id);\n+\t\t\tret = pqos_alloc_assoc_set(cpu_id, cos_id);\n \t\t\tif (ret != PQOS_RETVAL_OK) {\n \t\t\t\tprintf(\"PQOS: Failed to associate COS %u to \"\n \t\t\t\t\t\"cpu %u\\n\", cos_id, cpu_id);\n@@ -754,24 +751,24 @@ print_cat_config(void)\n \t\t\tif (tab[n].cdp == 1) {\n \t\t\t\tprintf(\"PQOS: COS: %u, cMASK: 0x%llx, \"\n \t\t\t\t\t\"dMASK: 0x%llx\\n\", tab[n].class_id,\n-\t\t\t\t\t(unsigned long long)tab[n].code_mask,\n-\t\t\t\t\t(unsigned long long)tab[n].data_mask);\n+\t\t\t\t\t(unsigned long long)tab[n].u.s.code_mask,\n+\t\t\t\t\t(unsigned long long)tab[n].u.s.data_mask);\n \t\t\t} else {\n \t\t\t\tprintf(\"PQOS: COS: %u, MASK: 0x%llx\\n\",\n \t\t\t\t\ttab[n].class_id,\n-\t\t\t\t\t(unsigned long long)tab[n].ways_mask);\n+\t\t\t\t\t(unsigned long long)tab[n].u.ways_mask);\n \t\t\t}\n \t\t}\n \t}\n \n \tfor (i = 0; i < m_sock_count; i++) {\n-\t\tunsigned lcores[PQOS_MAX_SOCKET_CORES] = {0};\n+\t\tunsigned int *lcores = NULL;\n \t\tunsigned lcount = 0;\n \t\tunsigned n = 0;\n \n-\t\tret = pqos_cpu_get_cores(m_cpu, m_sockets[i],\n-\t\t\t\tPQOS_MAX_SOCKET_CORES, &lcount, &lcores[0]);\n-\t\tif (ret != PQOS_RETVAL_OK) {\n+\t\tlcores = pqos_cpu_get_cores(m_cpu, m_sockets[i],\n+\t\t\t\t&lcount);\n+\t\tif (lcores == NULL || lcount == 0) {\n \t\t\tprintf(\"PQOS: Error retrieving core information!\\n\");\n \t\t\treturn;\n \t\t}\n@@ -780,13 +777,15 @@ print_cat_config(void)\n \t\tfor (n = 0; n < lcount; n++) {\n \t\t\tunsigned class_id = 0;\n \n-\t\t\tret = pqos_l3ca_assoc_get(lcores[n], &class_id);\n+\t\t\tret = pqos_alloc_assoc_get(lcores[n], &class_id);\n \t\t\tif (ret == PQOS_RETVAL_OK)\n \t\t\t\tprintf(\"PQOS: CPU: %u, COS: %u\\n\", lcores[n],\n \t\t\t\t\tclass_id);\n \t\t\telse\n \t\t\t\tprintf(\"PQOS: CPU: %u, ERROR\\n\", lcores[n]);\n \t\t}\n+\n+\t\tfree(lcores);\n \t}\n \n }\n@@ -849,7 +848,8 @@ cat_fini(void)\n \tm_cap = NULL;\n \tm_cpu = NULL;\n \tm_cap_l3ca = NULL;\n-\tmemset(m_sockets, 0, sizeof(m_sockets));\n+\tif (m_sockets != NULL)\n+\t\tfree(m_sockets);\n \tm_sock_count = 0;\n \tmemset(m_config, 0, sizeof(m_config));\n \tm_config_count = 0;\n@@ -875,7 +875,7 @@ cat_exit(void)\n \t\t\tif (CPU_ISSET(cpu_id, &m_config[i].cpumask) == 0)\n \t\t\t\tcontinue;\n \n-\t\t\tret = pqos_l3ca_assoc_set(cpu_id, 0);\n+\t\t\tret = pqos_alloc_assoc_set(cpu_id, 0);\n \t\t\tif (ret != PQOS_RETVAL_OK) {\n \t\t\t\tprintf(\"PQOS: Failed to associate COS 0 to \"\n \t\t\t\t\t\"cpu %u\\n\", cpu_id);\n@@ -927,7 +927,6 @@ cat_init(int argc, char **argv)\n \t/* PQoS Initialization - Check and initialize CAT capability */\n \tcfg.fd_log = STDOUT_FILENO;\n \tcfg.verbose = 0;\n-\tcfg.cdp_cfg = PQOS_REQUIRE_CDP_ANY;\n \tret = pqos_init(&cfg);\n \tif (ret != PQOS_RETVAL_OK) {\n \t\tprintf(\"PQOS: Error initializing PQoS library!\\n\");\n@@ -953,9 +952,8 @@ cat_init(int argc, char **argv)\n \t}\n \n \t/* Get CPU socket information */\n-\tret = pqos_cpu_get_sockets(m_cpu, PQOS_MAX_SOCKETS, &m_sock_count,\n-\t\tm_sockets);\n-\tif (ret != PQOS_RETVAL_OK) {\n+\tm_sockets = pqos_cpu_get_sockets(m_cpu, &m_sock_count);\n+\tif (m_sockets == NULL) {\n \t\tprintf(\"PQOS: Error retrieving CPU socket information!\\n\");\n \t\tret = -EFAULT;\n \t\tgoto err;\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}