get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 75510,
    "url": "http://patches.dpdk.org/api/patches/75510/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200813180121.19480-2-hemant.agrawal@nxp.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": "<20200813180121.19480-2-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200813180121.19480-2-hemant.agrawal@nxp.com",
    "date": "2020-08-13T18:01:15",
    "name": "[v5,2/8] net/dpaa: add VSP support in FMLIB",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e3109ba5cac34c84f7f9576008d8a04b88fdd0ac",
    "submitter": {
        "id": 477,
        "url": "http://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200813180121.19480-2-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 11643,
            "url": "http://patches.dpdk.org/api/series/11643/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11643",
            "date": "2020-08-13T18:01:15",
            "name": "[v5,1/8] net/dpaa: add support for fmlib in dpdk",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/11643/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/75510/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/75510/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A37F5A04B0;\n\tThu, 13 Aug 2020 20:06:52 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A218A1C0C2;\n\tThu, 13 Aug 2020 20:06:51 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id C92674CBD\n for <dev@dpdk.org>; Thu, 13 Aug 2020 20:06:49 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A2588201038;\n Thu, 13 Aug 2020 20:06:49 +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 326352014A2;\n Thu, 13 Aug 2020 20:06:48 +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 244F6402DD;\n Thu, 13 Aug 2020 20:06:46 +0200 (CEST)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Thu, 13 Aug 2020 23:31:15 +0530",
        "Message-Id": "<20200813180121.19480-2-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200813180121.19480-1-hemant.agrawal@nxp.com>",
        "References": "<20200811123001.30045-1-hemant.agrawal@nxp.com>\n <20200813180121.19480-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v5 2/8] net/dpaa: add VSP support in FMLIB",
        "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 <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": "From: Jun Yang <jun.yang@nxp.com>\n\nThis patch adds support for VSP (Virtual Storage Profile)\nin fmlib routines.\nVSP allow a network interface to be divided into physical\nand virtual instance(s).\nThe concept is very similar to SRIOV.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/net/dpaa/Makefile           |   1 +\n drivers/net/dpaa/fmlib/fm_vsp.c     | 143 +++++++++++++++++++++++++\n drivers/net/dpaa/fmlib/fm_vsp_ext.h | 155 ++++++++++++++++++++++++++++\n drivers/net/dpaa/meson.build        |   1 +\n 4 files changed, 300 insertions(+)\n create mode 100644 drivers/net/dpaa/fmlib/fm_vsp.c\n create mode 100644 drivers/net/dpaa/fmlib/fm_vsp_ext.h",
    "diff": "diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile\nindex deb9d5ed61..5eaa4abcb5 100644\n--- a/drivers/net/dpaa/Makefile\n+++ b/drivers/net/dpaa/Makefile\n@@ -28,6 +28,7 @@ EXPORT_MAP := rte_pmd_dpaa_version.map\n \n # Interfaces with DPDK\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += fmlib/fm_lib.c\n+SRCS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += fmlib/fm_vsp.c\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += dpaa_ethdev.c\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += dpaa_rxtx.c\n \ndiff --git a/drivers/net/dpaa/fmlib/fm_vsp.c b/drivers/net/dpaa/fmlib/fm_vsp.c\nnew file mode 100644\nindex 0000000000..fde8eb77e3\n--- /dev/null\n+++ b/drivers/net/dpaa/fmlib/fm_vsp.c\n@@ -0,0 +1,143 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2019-2020 NXP\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <fcntl.h>\n+#include <errno.h>\n+#include <unistd.h>\n+#include <termios.h>\n+#include <sys/ioctl.h>\n+#include <stdbool.h>\n+\n+#include <rte_common.h>\n+#include \"fm_ext.h\"\n+#include \"fm_pcd_ext.h\"\n+#include \"fm_port_ext.h\"\n+#include \"fm_vsp_ext.h\"\n+#include <dpaa_ethdev.h>\n+\n+uint32_t fm_port_vsp_alloc(t_handle h_fm_port,\n+\t\tt_fm_port_vspalloc_params *p_params)\n+{\n+\tt_device *p_dev = (t_device *)h_fm_port;\n+\tioc_fm_port_vsp_alloc_params_t params;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\tmemset(&params, 0, sizeof(ioc_fm_port_vsp_alloc_params_t));\n+\tmemcpy(&params.params, p_params, sizeof(t_fm_port_vspalloc_params));\n+\n+\tif (ioctl(p_dev->fd, FM_PORT_IOC_VSP_ALLOC, &params))\n+\t\tRETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);\n+\n+\t_fml_dbg(\"Called.\\n\");\n+\n+\treturn E_OK;\n+}\n+\n+t_handle fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params)\n+{\n+\tt_device *p_dev = NULL;\n+\tt_device *p_vsp_dev = NULL;\n+\tioc_fm_vsp_params_t param;\n+\n+\tp_dev = p_fm_vsp_params->h_fm;\n+\n+\t_fml_dbg(\"Performing VSP Configuration...\\n\");\n+\n+\tmemset(&param, 0, sizeof(ioc_fm_vsp_params_t));\n+\tmemcpy(&param, p_fm_vsp_params, sizeof(t_fm_vsp_params));\n+\tparam.vsp_params.h_fm = UINT_TO_PTR(p_dev->id);\n+\tparam.id = NULL;\n+\n+\tif (ioctl(p_dev->fd, FM_IOC_VSP_CONFIG, &param)) {\n+\t\tDPAA_PMD_ERR(\"%s ioctl error\\n\", __func__);\n+\t\treturn NULL;\n+\t}\n+\n+\tp_vsp_dev = (t_device *)malloc(sizeof(t_device));\n+\tif (!p_vsp_dev) {\n+\t\tDPAA_PMD_ERR(\"FM VSP Params!\\n\");\n+\t\treturn NULL;\n+\t}\n+\tmemset(p_vsp_dev, 0, sizeof(t_device));\n+\tp_vsp_dev->h_user_priv = (t_handle)p_dev;\n+\tp_dev->owners++;\n+\tp_vsp_dev->id = PTR_TO_UINT(param.id);\n+\n+\t_fml_dbg(\"VSP Configuration completed\\n\");\n+\n+\treturn (t_handle)p_vsp_dev;\n+}\n+\n+uint32_t fm_vsp_init(t_handle h_fm_vsp)\n+{\n+\tt_device *p_dev = NULL;\n+\tt_device *p_vsp_dev = (t_device *)h_fm_vsp;\n+\tioc_fm_obj_t id;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_dev = (t_device *)p_vsp_dev->h_user_priv;\n+\tid.obj = UINT_TO_PTR(p_vsp_dev->id);\n+\n+\tif (ioctl(p_dev->fd, FM_IOC_VSP_INIT, &id)) {\n+\t\tDPAA_PMD_ERR(\"%s ioctl error\\n\", __func__);\n+\t\tRETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);\n+\t}\n+\n+\t_fml_dbg(\"Called.\\n\");\n+\n+\treturn E_OK;\n+}\n+\n+uint32_t fm_vsp_free(t_handle h_fm_vsp)\n+{\n+\tt_device *p_dev = NULL;\n+\tt_device *p_vsp_dev = (t_device *)h_fm_vsp;\n+\tioc_fm_obj_t id;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_dev = (t_device *)p_vsp_dev->h_user_priv;\n+\tid.obj = UINT_TO_PTR(p_vsp_dev->id);\n+\n+\tif (ioctl(p_dev->fd, FM_IOC_VSP_FREE, &id)) {\n+\t\tDPAA_PMD_ERR(\"%s ioctl error\\n\", __func__);\n+\t\tRETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);\n+\t}\n+\n+\tp_dev->owners--;\n+\tfree(p_vsp_dev);\n+\n+\t_fml_dbg(\"Called.\\n\");\n+\n+\treturn E_OK;\n+}\n+\n+uint32_t fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,\n+\t\tt_fm_buffer_prefix_content *p_fm_buffer_prefix_content)\n+{\n+\tt_device *p_dev = NULL;\n+\tt_device *p_vsp_dev = (t_device *)h_fm_vsp;\n+\tioc_fm_buffer_prefix_content_params_t params;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_dev = (t_device *)p_vsp_dev->h_user_priv;\n+\tparams.p_fm_vsp = UINT_TO_PTR(p_vsp_dev->id);\n+\tmemcpy(&params.fm_buffer_prefix_content,\n+\t       p_fm_buffer_prefix_content, sizeof(*p_fm_buffer_prefix_content));\n+\n+\tif (ioctl(p_dev->fd, FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT,\n+\t\t  &params)) {\n+\t\tDPAA_PMD_ERR(\"%s ioctl error\\n\", __func__);\n+\t\tRETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);\n+\t}\n+\n+\t_fml_dbg(\"Called.\\n\");\n+\n+\treturn E_OK;\n+}\ndiff --git a/drivers/net/dpaa/fmlib/fm_vsp_ext.h b/drivers/net/dpaa/fmlib/fm_vsp_ext.h\nnew file mode 100644\nindex 0000000000..dfb1d65e2c\n--- /dev/null\n+++ b/drivers/net/dpaa/fmlib/fm_vsp_ext.h\n@@ -0,0 +1,155 @@\n+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n+ *\n+ * Copyright 2008-2012 Freescale Semiconductor, Inc\n+ * Copyright 2019-2020 NXP\n+ *\n+ */\n+\n+/*\n+ * @File          fm_vsp_ext.h\n+ *\n+ * @Description   FM Virtual Storage-Profile\n+ */\n+#ifndef __FM_VSP_EXT_H\n+#define __FM_VSP_EXT_H\n+#include \"ncsw_ext.h\"\n+#include \"fm_ext.h\"\n+#include \"net_ext.h\"\n+\n+typedef struct t_fm_vsp_params {\n+\tt_handle\th_fm;\n+\t\t\t/**< A handle to the FM object this VSP related to */\n+\tt_fm_ext_pools\text_buf_pools;\n+\t\t\t/**< Which external buffer pools are used (up to\n+\t\t\t * FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes.\n+\t\t\t * Parameter associated with Rx / OP port\n+\t\t\t */\n+\tuint16_t\tliodn_offset;\t/**< VSP's LIODN offset */\n+\tstruct {\n+\t\te_fm_port_type\tport_type; /**< Port type */\n+\t\tuint8_t\tport_id;           /**< Port Id - relative to type */\n+\t} port_params;\n+\tuint8_t\trelative_profile_id;\n+\t\t\t/**< VSP Id - relative to VSP's range defined in\n+\t\t\t * relevant FM object\n+\t\t\t */\n+} t_fm_vsp_params;\n+\n+typedef struct ioc_fm_vsp_params_t {\n+\tstruct t_fm_vsp_params vsp_params;\n+\tvoid\t\t*id;\t\t/**< return value */\n+} ioc_fm_vsp_params_t;\n+\n+typedef struct t_fm_port_vspalloc_params {\n+\tuint8_t     num_of_profiles;\n+\t\t/**< Number of Virtual Storage Profiles; must be a power of 2 */\n+\tuint8_t     dflt_relative_id;\n+\t/**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port. The\n+\t * same default Virtual-Storage-Profile-id will be for coupled Tx port\n+\t * if relevant function called for Rx port\n+\t */\n+} t_fm_port_vspalloc_params;\n+\n+typedef struct ioc_fm_port_vsp_alloc_params_t {\n+\tstruct t_fm_port_vspalloc_params params;\n+\tvoid\t*p_fm_tx_port;\n+\t/**< Handle to coupled Tx Port; not relevant for OP port. */\n+} ioc_fm_port_vsp_alloc_params_t;\n+\n+typedef struct ioc_fm_buffer_prefix_content_t {\n+\tuint16_t priv_data_size;\n+\t\t/**< Number of bytes to be left at the beginning of the external\n+\t\t * buffer; Note that the private-area will start from the base\n+\t\t * of the buffer address.\n+\t\t */\n+\tbool pass_prs_result;\n+\t\t\t/**< TRUE to pass the parse result to/from the FM; User\n+\t\t\t * may use fm_port_get_buffer_prs_result() in order to\n+\t\t\t * get the parser-result from a buffer.\n+\t\t\t */\n+\tbool pass_time_stamp;\n+\t\t\t/**< TRUE to pass the timeStamp to/from the FM User may\n+\t\t\t * use fm_port_get_buffer_time_stamp() in order to get\n+\t\t\t * the parser-result from a buffer.\n+\t\t\t */\n+\tbool pass_hash_result;\n+\t\t\t/**< TRUE to pass the KG hash result to/from the FM User\n+\t\t\t * may use fm_port_get_buffer_hash_result() in order to\n+\t\t\t * get the parser-result from a buffer.\n+\t\t\t */\n+\tbool pass_all_other_pcd_info;\n+\t\t\t/**< Add all other Internal-Context information: AD,\n+\t\t\t * hash-result, key, etc.\n+\t\t\t */\n+\tuint16_t data_align;\n+\t\t\t/**< 0 to use driver's default alignment [64],\n+\t\t\t * other value for selecting a data alignment (must be a\n+\t\t\t * power of 2); if write optimization is used, must be\n+\t\t\t * >= 16.\n+\t\t\t */\n+\tuint8_t manip_extra_space;\n+\t\t\t/**< Maximum extra size needed\n+\t\t\t * (insertion-size minus removal-size);\n+\t\t\t * Note that this field impacts the size of the\n+\t\t\t * buffer-prefix (i.e. it pushes the data offset);\n+\t\t\t * This field is irrelevant if DPAA_VERSION==10\n+\t\t\t */\n+} ioc_fm_buffer_prefix_content_t;\n+\n+typedef struct ioc_fm_buffer_prefix_content_params_t {\n+\tvoid    *p_fm_vsp;\n+\tioc_fm_buffer_prefix_content_t fm_buffer_prefix_content;\n+} ioc_fm_buffer_prefix_content_params_t;\n+\n+uint32_t fm_port_vsp_alloc(t_handle h_fm_port,\n+\t\t\t  t_fm_port_vspalloc_params *p_params);\n+\n+t_handle fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params);\n+\n+uint32_t fm_vsp_init(t_handle h_fm_vsp);\n+\n+uint32_t fm_vsp_free(t_handle h_fm_vsp);\n+\n+uint32_t fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,\n+\t\tt_fm_buffer_prefix_content *p_fm_buffer_prefix_content);\n+\n+#if defined(CONFIG_COMPAT)\n+#define FM_PORT_IOC_VSP_ALLOC_COMPAT \\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), \\\n+\tioc_compat_fm_port_vsp_alloc_params_t)\n+#endif\n+#define FM_PORT_IOC_VSP_ALLOC \\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), \\\n+\tioc_fm_port_vsp_alloc_params_t)\n+\n+#if defined(CONFIG_COMPAT)\n+#define FM_IOC_VSP_CONFIG_COMPAT \\\n+\t_IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_compat_fm_vsp_params_t)\n+#endif\n+#define FM_IOC_VSP_CONFIG \\\n+\t_IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t)\n+\n+#if defined(CONFIG_COMPAT)\n+#define FM_IOC_VSP_INIT_COMPAT \\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_compat_fm_obj_t)\n+#endif\n+#define FM_IOC_VSP_INIT\t\\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t)\n+\n+#if defined(CONFIG_COMPAT)\n+#define FM_IOC_VSP_FREE_COMPAT\t\\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_compat_fm_obj_t)\n+#endif\n+#define FM_IOC_VSP_FREE\t\\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t)\n+\n+#if defined(CONFIG_COMPAT)\n+#define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT_COMPAT \\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), \\\n+\tioc_compat_fm_buffer_prefix_content_params_t)\n+#endif\n+#define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT \\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), \\\n+\tioc_fm_buffer_prefix_content_params_t)\n+\n+#endif /* __FM_VSP_EXT_H */\ndiff --git a/drivers/net/dpaa/meson.build b/drivers/net/dpaa/meson.build\nindex 67803cd34a..94d5095281 100644\n--- a/drivers/net/dpaa/meson.build\n+++ b/drivers/net/dpaa/meson.build\n@@ -9,6 +9,7 @@ deps += ['mempool_dpaa']\n \n sources = files('dpaa_ethdev.c',\n \t\t'fmlib/fm_lib.c',\n+\t\t'fmlib/fm_vsp.c',\n \t\t'dpaa_rxtx.c')\n \n if cc.has_argument('-Wno-pointer-arith')\n",
    "prefixes": [
        "v5",
        "2/8"
    ]
}