get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73776,
    "url": "http://patchwork.dpdk.org/api/patches/73776/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200710171946.23246-7-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-7-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200710171946.23246-7-hemant.agrawal@nxp.com",
    "date": "2020-07-10T17:19:44",
    "name": "[v2,7/9] net/dpaa: add support for Virtual Storage Profile",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6ed4a7289bda0d6e2f4536eb33a0e1fdb67947c9",
    "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-7-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/73776/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/73776/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 75B70A052A;\n\tFri, 10 Jul 2020 19:25:08 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F2A1D1DEBE;\n\tFri, 10 Jul 2020 19:24:22 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id 5BBB01DDB3\n for <dev@dpdk.org>; Fri, 10 Jul 2020 19:24:14 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3EA6B201352;\n Fri, 10 Jul 2020 19:24:14 +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 388DA20133F;\n Fri, 10 Jul 2020 19:24:12 +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 EEB4A40314;\n Sat, 11 Jul 2020 01:24:09 +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:44 +0530",
        "Message-Id": "<20200710171946.23246-7-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 7/9] net/dpaa: add support for Virtual Storage\n\tProfile",
        "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 Virtual Storage profile (VSP) feature.\nWith VSP support when memory pool is created, the hw buffer pool id\ni.e. bpid is not allocated; thhe bpid is identified by dpaa flow\ncreate API.\nThe memory pool of RX queue is attached to specific BMan pool\naccording to the VSP ID when RX queue is setup.\nfor fmlib based hash queue, vsp base ID is assigned to each queue.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\n---\n drivers/bus/dpaa/include/fsl_qman.h |   1 +\n drivers/net/dpaa/dpaa_ethdev.c      | 135 +++++++++++++++++-----\n drivers/net/dpaa/dpaa_ethdev.h      |   7 ++\n drivers/net/dpaa/dpaa_flow.c        | 167 +++++++++++++++++++++++++++-\n drivers/net/dpaa/dpaa_flow.h        |   5 +\n 5 files changed, 287 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h\nindex 8ba37411a..d98b9bee3 100644\n--- a/drivers/bus/dpaa/include/fsl_qman.h\n+++ b/drivers/bus/dpaa/include/fsl_qman.h\n@@ -1229,6 +1229,7 @@ struct qman_fq {\n \n \tint q_fd;\n \tu16 ch_id;\n+\tint8_t vsp_id;\n \tu8 cgr_groupid;\n \tu8 is_static:4;\n \tu8 qp_initialized:4;\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex c2d480397..8549fc2ce 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -722,6 +722,56 @@ static int dpaa_eth_multicast_disable(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static void dpaa_fman_if_pool_setup(struct rte_eth_dev *dev)\n+{\n+\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n+\tstruct fman_if_ic_params icp;\n+\tuint32_t fd_offset;\n+\tuint32_t bp_size;\n+\n+\tmemset(&icp, 0, sizeof(icp));\n+\t/* set ICEOF for to the default value , which is 0*/\n+\ticp.iciof = DEFAULT_ICIOF;\n+\ticp.iceof = DEFAULT_RX_ICEOF;\n+\ticp.icsz = DEFAULT_ICSZ;\n+\tfman_if_set_ic_params(dev->process_private, &icp);\n+\n+\tfd_offset = RTE_PKTMBUF_HEADROOM + DPAA_HW_BUF_RESERVE;\n+\tfman_if_set_fdoff(dev->process_private, fd_offset);\n+\n+\t/* Buffer pool size should be equal to Dataroom Size*/\n+\tbp_size = rte_pktmbuf_data_room_size(dpaa_intf->bp_info->mp);\n+\n+\tfman_if_set_bp(dev->process_private,\n+\t\t       dpaa_intf->bp_info->mp->size,\n+\t\t       dpaa_intf->bp_info->bpid, bp_size);\n+}\n+\n+static inline int dpaa_eth_rx_queue_bp_check(\n+\tstruct rte_eth_dev *dev, int8_t vsp_id, uint32_t bpid)\n+{\n+\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n+\tstruct fman_if *fif = dev->process_private;\n+\n+\tif (fif->num_profiles) {\n+\t\tif (vsp_id < 0)\n+\t\t\tvsp_id = fif->base_profile_id;\n+\t} else {\n+\t\tif (vsp_id < 0)\n+\t\t\tvsp_id = 0;\n+\t}\n+\n+\tif (dpaa_intf->vsp_bpid[vsp_id] &&\n+\t\tbpid != dpaa_intf->vsp_bpid[vsp_id]) {\n+\t\tDPAA_PMD_ERR(\n+\t\t\t\"Various MPs are assigned to RXQs with same VSP\");\n+\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static\n int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t\t    uint16_t nb_desc,\n@@ -757,6 +807,20 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \tDPAA_PMD_INFO(\"Rx queue setup for queue index: %d fq_id (0x%x)\",\n \t\t\tqueue_idx, rxq->fqid);\n \n+\tif (!fif->num_profiles) {\n+\t\tif (dpaa_intf->bp_info && dpaa_intf->bp_info->bp &&\n+\t\t\tdpaa_intf->bp_info->mp != mp) {\n+\t\t\tDPAA_PMD_WARN(\n+\t\t\t\t\"Multiple pools on same interface not supported\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t} else {\n+\t\tif (dpaa_eth_rx_queue_bp_check(dev, rxq->vsp_id,\n+\t\t\tDPAA_MEMPOOL_TO_POOL_INFO(mp)->bpid)) {\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \t/* Max packet can fit in single buffer */\n \tif (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) {\n \t\t;\n@@ -779,36 +843,41 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t     buffsz - RTE_PKTMBUF_HEADROOM);\n \t}\n \n-\tif (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) {\n-\t\tstruct fman_if_ic_params icp;\n-\t\tuint32_t fd_offset;\n-\t\tuint32_t bp_size;\n+\tdpaa_intf->bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);\n \n-\t\tif (!mp->pool_data) {\n-\t\t\tDPAA_PMD_ERR(\"Not an offloaded buffer pool!\");\n-\t\t\treturn -1;\n+\t/* For shared interface, it's done in kernel, skip.*/\n+\tif (!fif->is_shared_mac)\n+\t\tdpaa_fman_if_pool_setup(dev);\n+\n+\tif (fif->num_profiles) {\n+\t\tint8_t vsp_id = rxq->vsp_id;\n+\n+\t\tif (vsp_id >= 0) {\n+\t\t\tret = dpaa_port_vsp_update(dpaa_intf, fmc_q, vsp_id,\n+\t\t\t\t\tDPAA_MEMPOOL_TO_POOL_INFO(mp)->bpid,\n+\t\t\t\t\tfif);\n+\t\t\tif (ret) {\n+\t\t\t\tDPAA_PMD_ERR(\"dpaa_port_vsp_update failed\");\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t} else {\n+\t\t\tDPAA_PMD_INFO(\"Base profile is associated to\"\n+\t\t\t\t\" RXQ fqid:%d\\r\\n\", rxq->fqid);\n+\t\t\tif (fif->is_shared_mac) {\n+\t\t\t\tDPAA_PMD_ERR(\n+\t\t\t\t\t\"Fatal: Base profile is associated to\"\n+\t\t\t\t\t\" shared interface on DPDK.\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\t\t\tdpaa_intf->vsp_bpid[fif->base_profile_id] =\n+\t\t\t\tDPAA_MEMPOOL_TO_POOL_INFO(mp)->bpid;\n \t\t}\n-\t\tdpaa_intf->bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);\n-\n-\t\tmemset(&icp, 0, sizeof(icp));\n-\t\t/* set ICEOF for to the default value , which is 0*/\n-\t\ticp.iciof = DEFAULT_ICIOF;\n-\t\ticp.iceof = DEFAULT_RX_ICEOF;\n-\t\ticp.icsz = DEFAULT_ICSZ;\n-\t\tfman_if_set_ic_params(fif, &icp);\n-\n-\t\tfd_offset = RTE_PKTMBUF_HEADROOM + DPAA_HW_BUF_RESERVE;\n-\t\tfman_if_set_fdoff(fif, fd_offset);\n-\n-\t\t/* Buffer pool size should be equal to Dataroom Size*/\n-\t\tbp_size = rte_pktmbuf_data_room_size(mp);\n-\t\tfman_if_set_bp(fif, mp->size,\n-\t\t\t       dpaa_intf->bp_info->bpid, bp_size);\n-\t\tdpaa_intf->valid = 1;\n-\t\tDPAA_PMD_DEBUG(\"if:%s fd_offset = %d offset = %d\",\n-\t\t\t\tdpaa_intf->name, fd_offset,\n-\t\t\t\tfman_if_get_fdoff(fif));\n+\t} else {\n+\t\tdpaa_intf->vsp_bpid[0] =\n+\t\t\tDPAA_MEMPOOL_TO_POOL_INFO(mp)->bpid;\n \t}\n+\n+\tdpaa_intf->valid = 1;\n \tDPAA_PMD_DEBUG(\"if:%s sg_on = %d, max_frm =%d\", dpaa_intf->name,\n \t\tfman_if_get_sg_enable(fif),\n \t\tdev->data->dev_conf.rxmode.max_rx_pkt_len);\n@@ -1605,6 +1674,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \tuint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES];\n \tuint32_t cgrid_tx[MAX_DPAA_CORES];\n \tuint32_t dev_rx_fqids[DPAA_MAX_NUM_PCD_QUEUES];\n+\tint8_t dev_vspids[DPAA_MAX_NUM_PCD_QUEUES];\n+\tint8_t vsp_id = -1;\n \n \tPMD_INIT_FUNC_TRACE();\n \n@@ -1624,6 +1695,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \tmemset((char *)dev_rx_fqids, 0,\n \t\tsizeof(uint32_t) * DPAA_MAX_NUM_PCD_QUEUES);\n \n+\tmemset(dev_vspids, -1, DPAA_MAX_NUM_PCD_QUEUES);\n+\n \t/* Initialize Rx FQ's */\n \tif (default_q) {\n \t\tnum_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES;\n@@ -1703,6 +1776,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \t\telse\n \t\t\tfqid = dev_rx_fqids[loop];\n \n+\t\tvsp_id = dev_vspids[loop];\n+\n \t\tif (dpaa_intf->cgr_rx)\n \t\t\tdpaa_intf->cgr_rx[loop].cgrid = cgrid[loop];\n \n@@ -1711,6 +1786,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \t\t\tfqid);\n \t\tif (ret)\n \t\t\tgoto free_rx;\n+\t\tdpaa_intf->rx_queues[loop].vsp_id = vsp_id;\n \t\tdpaa_intf->rx_queues[loop].dpaa_intf = dpaa_intf;\n \t}\n \tdpaa_intf->nb_rx_queues = num_rx_fqs;\n@@ -2051,6 +2127,11 @@ static void __attribute__((destructor(102))) dpaa_finish(void)\n \t\t\t\t\tif (dpaa_fm_deconfig(dpaa_intf, fif))\n \t\t\t\t\t\tDPAA_PMD_WARN(\"DPAA FM \"\n \t\t\t\t\t\t\t\"deconfig failed\\n\");\n+\t\t\t\tif (fif->num_profiles) {\n+\t\t\t\t\tif (dpaa_port_vsp_cleanup(dpaa_intf,\n+\t\t\t\t\t\t\t\t  fif))\n+\t\t\t\t\t\tDPAA_PMD_WARN(\"DPAA FM vsp cleanup failed\\n\");\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (is_global_init)\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h\nindex b10c4a20b..dd182c4d5 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.h\n+++ b/drivers/net/dpaa/dpaa_ethdev.h\n@@ -103,6 +103,10 @@\n #define DPAA_FD_CMD_CFQ\t\t\t0x00ffffff\n /**< Confirmation Frame Queue */\n \n+#define DPAA_VSP_PROFILE_MAX_NUM\t8\n+\n+#define DPAA_DEFAULT_RXQ_VSP_ID\t\t1\n+\n /* Each network interface is represented by one of these */\n struct dpaa_if {\n \tint valid;\n@@ -122,6 +126,9 @@ struct dpaa_if {\n \tvoid *netenv_handle;\n \tvoid *scheme_handle[2];\n \tuint32_t scheme_count;\n+\n+\tvoid *vsp_handle[DPAA_VSP_PROFILE_MAX_NUM];\n+\tuint32_t vsp_bpid[DPAA_VSP_PROFILE_MAX_NUM];\n };\n \n struct dpaa_if_stats {\ndiff --git a/drivers/net/dpaa/dpaa_flow.c b/drivers/net/dpaa/dpaa_flow.c\nindex 7b920b055..dbdf59c62 100644\n--- a/drivers/net/dpaa/dpaa_flow.c\n+++ b/drivers/net/dpaa/dpaa_flow.c\n@@ -12,6 +12,7 @@\n #include <dpaa_flow.h>\n #include <rte_dpaa_logs.h>\n #include <fmlib/fm_port_ext.h>\n+#include <fmlib/fm_vsp_ext.h>\n \n #define DPAA_MAX_NUM_ETH_DEV\t8\n \n@@ -47,6 +48,17 @@ static struct dpaa_fm_info fm_info;\n static struct dpaa_fm_model fm_model;\n static const char *fm_log = \"/tmp/fmdpdk.bin\";\n \n+static inline uint8_t fm_default_vsp_id(struct fman_if *fif)\n+{\n+\t/* Avoid being same as base profile which could be used\n+\t * for kernel interface of shared mac.\n+\t */\n+\tif (fif->base_profile_id)\n+\t\treturn 0;\n+\telse\n+\t\treturn DPAA_DEFAULT_RXQ_VSP_ID;\n+}\n+\n static void fm_prev_cleanup(void)\n {\n \tuint32_t fman_id = 0, i = 0, devid;\n@@ -300,11 +312,18 @@ set_hashParams_sctp(ioc_fm_pcd_kg_scheme_params_t *scheme_params, int hdr_idx)\n static int set_scheme_params(ioc_fm_pcd_kg_scheme_params_t *scheme_params,\n \tioc_fm_pcd_net_env_params_t *dist_units,\n \tstruct dpaa_if *dpaa_intf,\n-\tstruct fman_if *fif __rte_unused)\n+\tstruct fman_if *fif)\n {\n \tint dist_idx, hdr_idx = 0;\n \tPMD_INIT_FUNC_TRACE();\n \n+\tif (fif->num_profiles) {\n+\t\tscheme_params->param.override_storage_profile = true;\n+\t\tscheme_params->param.storage_profile.direct = true;\n+\t\tscheme_params->param.storage_profile.profile_select\n+\t\t\t.direct_relative_profileId = fm_default_vsp_id(fif);\n+\t}\n+\n \tscheme_params->param.use_hash = 1;\n \tscheme_params->param.modify = false;\n \tscheme_params->param.always_direct = false;\n@@ -787,6 +806,14 @@ int dpaa_fm_config(struct rte_eth_dev *dev, uint64_t req_dist_set)\n \t\treturn -1;\n \t}\n \n+\tif (fif->num_profiles) {\n+\t\tfor (i = 0; i < dpaa_intf->nb_rx_queues; i++)\n+\t\t\tdpaa_intf->rx_queues[i].vsp_id =\n+\t\t\t\tfm_default_vsp_id(fif);\n+\n+\t\ti = 0;\n+\t}\n+\n \t/* Set PCD netenv and scheme */\n \tif (req_dist_set) {\n \t\tret = set_pcd_netenv_scheme(dpaa_intf, req_dist_set, fif);\n@@ -912,3 +939,141 @@ int dpaa_fm_term(void)\n \t}\n \treturn 0;\n }\n+\n+static int dpaa_port_vsp_configure(struct dpaa_if *dpaa_intf,\n+\t\tuint8_t vsp_id, t_Handle fman_handle,\n+\t\tstruct fman_if *fif)\n+{\n+\tt_FmVspParams vsp_params;\n+\tt_FmBufferPrefixContent buf_prefix_cont;\n+\tuint8_t mac_idx[] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1};\n+\tuint8_t idx = mac_idx[fif->mac_idx];\n+\tint ret;\n+\n+\tif (vsp_id == fif->base_profile_id && fif->is_shared_mac) {\n+\t\t/* For shared interface, VSP of base\n+\t\t * profile is default pool located in kernel.\n+\t\t */\n+\t\tdpaa_intf->vsp_bpid[vsp_id] = 0;\n+\t\treturn 0;\n+\t}\n+\n+\tif (vsp_id >= DPAA_VSP_PROFILE_MAX_NUM) {\n+\t\tDPAA_PMD_ERR(\"VSP ID %d exceeds MAX number %d\",\n+\t\t\tvsp_id, DPAA_VSP_PROFILE_MAX_NUM);\n+\t\treturn -1;\n+\t}\n+\n+\tmemset(&vsp_params, 0, sizeof(vsp_params));\n+\tvsp_params.h_Fm = fman_handle;\n+\tvsp_params.relativeProfileId = vsp_id;\n+\tvsp_params.portParams.portId = idx;\n+\tif (fif->mac_type == fman_mac_1g) {\n+\t\tvsp_params.portParams.portType = e_FM_PORT_TYPE_RX;\n+\t} else if (fif->mac_type == fman_mac_2_5g) {\n+\t\tvsp_params.portParams.portType = e_FM_PORT_TYPE_RX_2_5G;\n+\t} else if (fif->mac_type == fman_mac_10g) {\n+\t\tvsp_params.portParams.portType = e_FM_PORT_TYPE_RX_10G;\n+\t} else {\n+\t\tDPAA_PMD_ERR(\"Mac type %d error\", fif->mac_type);\n+\t\treturn -1;\n+\t}\n+\tvsp_params.extBufPools.numOfPoolsUsed = 1;\n+\tvsp_params.extBufPools.extBufPool[0].id =\n+\t\tdpaa_intf->vsp_bpid[vsp_id];\n+\tvsp_params.extBufPools.extBufPool[0].size =\n+\t\tRTE_MBUF_DEFAULT_BUF_SIZE;\n+\n+\tdpaa_intf->vsp_handle[vsp_id] = FM_VSP_Config(&vsp_params);\n+\tif (!dpaa_intf->vsp_handle[vsp_id]) {\n+\t\tDPAA_PMD_ERR(\"FM_VSP_Config error for profile %d\", vsp_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* configure the application buffer (structure, size and\n+\t * content)\n+\t */\n+\n+\tmemset(&buf_prefix_cont, 0, sizeof(buf_prefix_cont));\n+\n+\tbuf_prefix_cont.privDataSize = 16;\n+\tbuf_prefix_cont.dataAlign = 64;\n+\tbuf_prefix_cont.passPrsResult = true;\n+\tbuf_prefix_cont.passTimeStamp = true;\n+\tbuf_prefix_cont.passHashResult = false;\n+\tbuf_prefix_cont.passAllOtherPCDInfo = false;\n+\tret = FM_VSP_ConfigBufferPrefixContent(dpaa_intf->vsp_handle[vsp_id],\n+\t\t\t\t\t       &buf_prefix_cont);\n+\tif (ret != E_OK) {\n+\t\tDPAA_PMD_ERR(\"FM_VSP_ConfigBufferPrefixContent error for profile %d err: %d\",\n+\t\t\t     vsp_id, ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* initialize the FM VSP module */\n+\tret = FM_VSP_Init(dpaa_intf->vsp_handle[vsp_id]);\n+\tif (ret != E_OK) {\n+\t\tDPAA_PMD_ERR(\"FM_VSP_Init error for profile %d err:%d\",\n+\t\t\t vsp_id, ret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int dpaa_port_vsp_update(struct dpaa_if *dpaa_intf,\n+\t\tbool fmc_mode, uint8_t vsp_id, uint32_t bpid,\n+\t\tstruct fman_if *fif)\n+{\n+\tint ret = 0;\n+\tt_Handle fman_handle;\n+\n+\tif (!fif->num_profiles)\n+\t\treturn 0;\n+\n+\tif (vsp_id >= fif->num_profiles)\n+\t\treturn 0;\n+\n+\tif (dpaa_intf->vsp_bpid[vsp_id] == bpid)\n+\t\treturn 0;\n+\n+\tif (dpaa_intf->vsp_handle[vsp_id]) {\n+\t\tret = FM_VSP_Free(dpaa_intf->vsp_handle[vsp_id]);\n+\t\tif (ret != E_OK) {\n+\t\t\tDPAA_PMD_ERR(\n+\t\t\t\t\"Error FM_VSP_Free: \"\n+\t\t\t\t\"err %d vsp_handle[%d]\",\n+\t\t\t\tret, vsp_id);\n+\t\t\treturn ret;\n+\t\t}\n+\t\tdpaa_intf->vsp_handle[vsp_id] = 0;\n+\t}\n+\n+\tif (fmc_mode)\n+\t\tfman_handle = FM_Open(0);\n+\telse\n+\t\tfman_handle = fm_info.fman_handle;\n+\n+\tdpaa_intf->vsp_bpid[vsp_id] = bpid;\n+\n+\treturn dpaa_port_vsp_configure(dpaa_intf, vsp_id, fman_handle, fif);\n+}\n+\n+int dpaa_port_vsp_cleanup(struct dpaa_if *dpaa_intf, struct fman_if *fif)\n+{\n+\tint idx, ret;\n+\n+\tfor (idx = 0; idx < (uint8_t)fif->num_profiles; idx++) {\n+\t\tif (dpaa_intf->vsp_handle[idx]) {\n+\t\t\tret = FM_VSP_Free(dpaa_intf->vsp_handle[idx]);\n+\t\t\tif (ret != E_OK) {\n+\t\t\t\tDPAA_PMD_ERR(\n+\t\t\t\t\"Error FM_VSP_Free: err %d vsp_handle[%d]\",\n+\t\t\t\t\tret, idx);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn E_OK;\n+}\ndiff --git a/drivers/net/dpaa/dpaa_flow.h b/drivers/net/dpaa/dpaa_flow.h\nindex d16bfec21..f5e131acf 100644\n--- a/drivers/net/dpaa/dpaa_flow.h\n+++ b/drivers/net/dpaa/dpaa_flow.h\n@@ -10,5 +10,10 @@ int dpaa_fm_term(void);\n int dpaa_fm_config(struct rte_eth_dev *dev, uint64_t req_dist_set);\n int dpaa_fm_deconfig(struct dpaa_if *dpaa_intf, struct fman_if *fif);\n void dpaa_write_fm_config_to_file(void);\n+int dpaa_port_vsp_update(struct dpaa_if *dpaa_intf,\n+\tbool fmc_mode, uint8_t vsp_id, uint32_t bpid, struct fman_if *fif);\n+int dpaa_port_vsp_cleanup(struct dpaa_if *dpaa_intf, struct fman_if *fif);\n+int dpaa_port_fmc_init(struct fman_if *fif,\n+\t\t       uint32_t *fqids, int8_t *vspids, int max_nb_rxq);\n \n #endif\n",
    "prefixes": [
        "v2",
        "7/9"
    ]
}