get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73772,
    "url": "http://patchwork.dpdk.org/api/patches/73772/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200710171946.23246-3-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200710171946.23246-3-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200710171946.23246-3-hemant.agrawal@nxp.com",
    "date": "2020-07-10T17:19:40",
    "name": "[v2,3/9] net/dpaa: add VSP support in FMLIB",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1f4a0e203bc3d9724866e269bebddc09b340b529",
    "submitter": {
        "id": 477,
        "url": "http://patchwork.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200710171946.23246-3-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 10958,
            "url": "http://patchwork.dpdk.org/api/series/10958/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10958",
            "date": "2020-07-10T17:19:38",
            "name": "[v2,1/9] net/dpaa: support Rxq and Txq info routines",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/10958/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/73772/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/73772/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 A4A99A052A;\n\tFri, 10 Jul 2020 19:24:15 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 16FB01DD9C;\n\tFri, 10 Jul 2020 19:24:13 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by dpdk.org (Postfix) with ESMTP id 1AD791DD94\n for <dev@dpdk.org>; Fri, 10 Jul 2020 19:24:11 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ECEA11A04A6;\n Fri, 10 Jul 2020 19:24:10 +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 1D0401A04A5;\n Fri, 10 Jul 2020 19:24:09 +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 D8142402E3;\n Sat, 11 Jul 2020 01:24:06 +0800 (SGT)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tJun Yang <jun.yang@nxp.com>",
        "Date": "Fri, 10 Jul 2020 22:49:40 +0530",
        "Message-Id": "<20200710171946.23246-3-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200710171946.23246-1-hemant.agrawal@nxp.com>",
        "References": "<20200710171946.23246-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v2 3/9] 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>\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 | 141 +++++++++++++++++++++++++++\n drivers/net/dpaa/meson.build        |   1 +\n 4 files changed, 286 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 0d2f32ba1..8db4e457f 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 000000000..b511b5159\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_VSPAlloc(t_Handle h_FmPort,\n+\t\tt_FmPortVSPAllocParams *p_Params)\n+{\n+\tt_Device *p_Dev = (t_Device *)h_FmPort;\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_FmPortVSPAllocParams));\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_FmVspParams *p_FmVspParams)\n+{\n+\tt_Device *p_Dev = NULL;\n+\tt_Device *p_VspDev = NULL;\n+\tioc_fm_vsp_params_t param;\n+\n+\tp_Dev = p_FmVspParams->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_FmVspParams, sizeof(t_FmVspParams));\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_VspDev = (t_Device *)malloc(sizeof(t_Device));\n+\tif (!p_VspDev) {\n+\t\tDPAA_PMD_ERR(\"FM VSP Params!\\n\");\n+\t\treturn NULL;\n+\t}\n+\tmemset(p_VspDev, 0, sizeof(t_Device));\n+\tp_VspDev->h_UserPriv = (t_Handle)p_Dev;\n+\tp_Dev->owners++;\n+\tp_VspDev->id = PTR_TO_UINT(param.id);\n+\n+\t_fml_dbg(\"VSP Configuration completed\\n\");\n+\n+\treturn (t_Handle)p_VspDev;\n+}\n+\n+uint32_t FM_VSP_Init(t_Handle h_FmVsp)\n+{\n+\tt_Device *p_Dev = NULL;\n+\tt_Device *p_VspDev = (t_Device *)h_FmVsp;\n+\tioc_fm_obj_t id;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_Dev = (t_Device *)p_VspDev->h_UserPriv;\n+\tid.obj = UINT_TO_PTR(p_VspDev->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_FmVsp)\n+{\n+\tt_Device *p_Dev = NULL;\n+\tt_Device *p_VspDev = (t_Device *)h_FmVsp;\n+\tioc_fm_obj_t id;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_Dev = (t_Device *)p_VspDev->h_UserPriv;\n+\tid.obj = UINT_TO_PTR(p_VspDev->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_VspDev);\n+\n+\t_fml_dbg(\"Called.\\n\");\n+\n+\treturn E_OK;\n+}\n+\n+uint32_t FM_VSP_ConfigBufferPrefixContent(t_Handle h_FmVsp,\n+\t\tt_FmBufferPrefixContent *p_FmBufferPrefixContent)\n+{\n+\tt_Device *p_Dev = NULL;\n+\tt_Device *p_VspDev = (t_Device *)h_FmVsp;\n+\tioc_fm_buffer_prefix_content_params_t params;\n+\n+\t_fml_dbg(\"Calling...\\n\");\n+\n+\tp_Dev = (t_Device *)p_VspDev->h_UserPriv;\n+\tparams.p_fm_vsp = UINT_TO_PTR(p_VspDev->id);\n+\tmemcpy(&params.fm_buffer_prefix_content,\n+\t       p_FmBufferPrefixContent, sizeof(*p_FmBufferPrefixContent));\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..904f5312d\n--- /dev/null\n+++ b/drivers/net/dpaa/fmlib/fm_vsp_ext.h\n@@ -0,0 +1,141 @@\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_FmVspParams {\n+\tt_Handle\th_Fm;\n+\t\t\t/**< A handle to the FM object this VSP related to */\n+\tt_FmExtPools\textBufPools;/**< Which external buffer pools are used\n+\t\t\t(up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes.\n+\t\t\tparameter associated with Rx / OP port */\n+\tuint16_t\tliodnOffset;\t/**< VSP's LIODN offset */\n+\tstruct {\n+\t\te_FmPortType\tportType; /**< Port type */\n+\t\tuint8_t\tportId;           /**< Port Id - relative to type */\n+\t} portParams;\n+\tuint8_t\trelativeProfileId;  /**< VSP Id - relative to VSP's range\n+\t\t\t\tdefined in relevant FM object */\n+} t_FmVspParams;\n+\n+typedef struct ioc_fm_vsp_params_t {\n+\tstruct t_FmVspParams vsp_params;\n+\tvoid\t\t*id;\t\t/**< return value */\n+} ioc_fm_vsp_params_t;\n+\n+typedef struct t_FmPortVSPAllocParams {\n+\tuint8_t     numOfProfiles;\n+\t\t/**< Number of Virtual Storage Profiles; must be a power of 2 */\n+\tuint8_t     dfltRelativeId;\n+\t/**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port\n+\tThe same default Virtual-Storage-Profile-id will be for coupled Tx port\n+\tif relevant function called for Rx port */\n+} t_FmPortVSPAllocParams;\n+\n+typedef struct ioc_fm_port_vsp_alloc_params_t {\n+\tstruct t_FmPortVSPAllocParams 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\n+\t\tof the external buffer; Note that the private-area will\n+\t\tstart from the base of the buffer address. */\n+\tbool pass_prs_result;\n+\t\t\t/**< TRUE to pass the parse result to/from the FM;\n+\t\t\tUser may use FM_PORT_GetBufferPrsResult() in order to\n+\t\t\tget the parser-result from a buffer. */\n+\tbool pass_time_stamp;\n+\t\t\t/**< TRUE to pass the timeStamp to/from the FM\n+\t\t\tUser may use FM_PORT_GetBufferTimeStamp() in order to\n+\t\t\tget the parser-result from a buffer. */\n+\tbool pass_hash_result;\n+\t\t\t/**< TRUE to pass the KG hash result to/from the FM\n+\t\t\tUser may use FM_PORT_GetBufferHashResult() in order to\n+\t\t\tget the parser-result from a buffer. */\n+\tbool pass_all_other_pcd_info;\n+\t\t\t/**< Add all other Internal-Context information:\n+\t\t\tAD, hash-result, key, etc. */\n+\tuint16_t data_align; /**< 0 to use driver's default alignment [64],\n+\t\t\tother value for selecting a data alignment\n+\t\t\t(must be a power of 2);\n+\t\t\tif write optimization is used, must be >= 16. */\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+} 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_VSPAlloc(t_Handle h_FmPort, t_FmPortVSPAllocParams *p_Params);\n+\n+t_Handle FM_VSP_Config(t_FmVspParams *p_FmVspParams);\n+\n+uint32_t FM_VSP_Init(t_Handle h_FmVsp);\n+\n+uint32_t FM_VSP_Free(t_Handle h_FmVsp);\n+\n+uint32_t FM_VSP_ConfigBufferPrefixContent(t_Handle h_FmVsp,\n+\t\tt_FmBufferPrefixContent *p_FmBufferPrefixContent);\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 67803cd34..94d509528 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": [
        "v2",
        "3/9"
    ]
}