get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 76256,
    "url": "http://patches.dpdk.org/api/patches/76256/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200901123650.29908-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": "<20200901123650.29908-2-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200901123650.29908-2-hemant.agrawal@nxp.com",
    "date": "2020-09-01T12:36:44",
    "name": "[v6,2/8] net/dpaa: add VSP support in FMLIB",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e4ffb4e3aeb8f464f2bdf9ddd8258ec88f5db99e",
    "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/20200901123650.29908-2-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 11875,
            "url": "http://patches.dpdk.org/api/series/11875/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11875",
            "date": "2020-09-01T12:36:44",
            "name": "[v6,1/8] net/dpaa: add support for fmlib in dpdk",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/11875/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76256/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/76256/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 215FDA04AC;\n\tTue,  1 Sep 2020 14:43:02 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 07D891C0BF;\n\tTue,  1 Sep 2020 14:43:01 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by dpdk.org (Postfix) with ESMTP id 449B21C0B7\n for <dev@dpdk.org>; Tue,  1 Sep 2020 14:42:59 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0D4481A00AB;\n Tue,  1 Sep 2020 14:42:59 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 906B01A0097;\n Tue,  1 Sep 2020 14:42:57 +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 83809402A2;\n Tue,  1 Sep 2020 14:42:55 +0200 (CEST)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Tue,  1 Sep 2020 18:06:44 +0530",
        "Message-Id": "<20200901123650.29908-2-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200901123650.29908-1-hemant.agrawal@nxp.com>",
        "References": "<20200813180121.19480-1-hemant.agrawal@nxp.com>\n <20200901123650.29908-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v6 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 doc/guides/nics/dpaa.rst            |   8 ++\n drivers/net/dpaa/fmlib/fm_vsp.c     | 148 ++++++++++++++++++++++++++++\n drivers/net/dpaa/fmlib/fm_vsp_ext.h | 131 ++++++++++++++++++++++++\n drivers/net/dpaa/meson.build        |   1 +\n 4 files changed, 288 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/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst\nindex 7e6010471..c4bfcd09a 100644\n--- a/doc/guides/nics/dpaa.rst\n+++ b/doc/guides/nics/dpaa.rst\n@@ -335,6 +335,14 @@ FMLIB\n    as well. This helps in overcoming the main limitaiton of FMC - i.e. lack\n    of dynamic configuration.\n \n+VSP (Virtual Storage Profile)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+   The storage profiled are means to provide virtualized interface. A ranges of\n+   storage profiles cab be associated to Ethernet ports.\n+   They are selected during classification. Specify how the frame should be\n+   written to memory and which buffer pool to select for packet storange in\n+   queues. Start and End margin of buffer can also be configured.\n+\n Limitations\n -----------\n \ndiff --git a/drivers/net/dpaa/fmlib/fm_vsp.c b/drivers/net/dpaa/fmlib/fm_vsp.c\nnew file mode 100644\nindex 000000000..78efd93f2\n--- /dev/null\n+++ b/drivers/net/dpaa/fmlib/fm_vsp.c\n@@ -0,0 +1,148 @@\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\n+fm_port_vsp_alloc(t_handle h_fm_port,\n+\t\t  t_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\n+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\n+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\n+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\n+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 000000000..b51c46162\n--- /dev/null\n+++ b/drivers/net/dpaa/fmlib/fm_vsp_ext.h\n@@ -0,0 +1,131 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2008-2012 Freescale Semiconductor, Inc\n+ * Copyright 2019-2020 NXP\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+#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+#define FM_IOC_VSP_CONFIG \\\n+\t_IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t)\n+\n+#define FM_IOC_VSP_INIT\t\\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t)\n+\n+#define FM_IOC_VSP_FREE\t\\\n+\t_IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t)\n+\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 b2cd555fd..aca1dccc3 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": [
        "v6",
        "2/8"
    ]
}