get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130179,
    "url": "http://patchwork.dpdk.org/api/patches/130179/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230811163419.165790-9-hkalra@marvell.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": "<20230811163419.165790-9-hkalra@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230811163419.165790-9-hkalra@marvell.com",
    "date": "2023-08-11T16:34:18",
    "name": "[8/9] common/cnxk: support represented port for cnxk",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "579aaadebdd6af38d2bf89b8913ff42d66dbf6cf",
    "submitter": {
        "id": 1182,
        "url": "http://patchwork.dpdk.org/api/people/1182/?format=api",
        "name": "Harman Kalra",
        "email": "hkalra@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230811163419.165790-9-hkalra@marvell.com/mbox/",
    "series": [
        {
            "id": 29193,
            "url": "http://patchwork.dpdk.org/api/series/29193/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29193",
            "date": "2023-08-11T16:34:10",
            "name": "net/cnxk: support for port representors",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29193/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/130179/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/130179/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 046A543036;\n\tFri, 11 Aug 2023 18:36:01 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C6B3943261;\n\tFri, 11 Aug 2023 18:35:23 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 13C1240144\n for <dev@dpdk.org>; Fri, 11 Aug 2023 18:35:22 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 37BEFxAt020668 for <dev@dpdk.org>; Fri, 11 Aug 2023 09:35:22 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sd8ya2qv6-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 11 Aug 2023 09:35:22 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Fri, 11 Aug 2023 09:35:20 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Fri, 11 Aug 2023 09:35:20 -0700",
            "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id 01EBE3F7068;\n Fri, 11 Aug 2023 09:35:14 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=XBM5zILv64amtO4c9OnklYnL8SzmACRQpuA5PGlzrvM=;\n b=DK3pPvbZDlK35iaPH8v6/soYE9CtOiUR1wvEdjh94vWQEVYPPDW2oCOhn7kpDYmiHkWS\n qiLDPZZ+1g1jux3wySv3wWteeylkNlSopOVCi0hq8D7ClaJz6BiNqbUdOwwJHhy5U6gD\n /CAE5gR7XNp90wuixT8ywG+SQBUZ5Ta3HLqwHBmV5/h/LVixq2E+pmrNh+RVRA0B2xFG\n zfY4GUPR1Bqh1VdnfaRgfYQ3Mb/v+wPMsWYtOJp/mrsqy4bFGENDmZPuwSg0F1+bxUMr\n 0eNCUI+wtF1dGHHEHDs7SXOMy6j28qNAJ9h4KoaKASdwQKNu+Grn28gViqs8IvjYZHXe aA==",
        "From": "Harman Kalra <hkalra@marvell.com>",
        "To": "<jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, \"Kiran\n Kumar K\" <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n Satha Rao <skoteshwar@marvell.com>",
        "CC": "<dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>",
        "Subject": "[PATCH 8/9] common/cnxk: support represented port for cnxk",
        "Date": "Fri, 11 Aug 2023 22:04:18 +0530",
        "Message-ID": "<20230811163419.165790-9-hkalra@marvell.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20230811163419.165790-1-hkalra@marvell.com>",
        "References": "<20230811163419.165790-1-hkalra@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "jPc9YsfliIhRNFdGNGWalVzOBn8GVGdg",
        "X-Proofpoint-GUID": "jPc9YsfliIhRNFdGNGWalVzOBn8GVGdg",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26\n definitions=2023-08-11_08,2023-08-10_01,2023-05-22_02",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "Adding represented port item an action support for cnxk\ndevice. Flow operations can be performed via representor\nports as well as represented ports.\n\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n drivers/common/cnxk/roc_npc.c       | 54 ++++++++++++++++------\n drivers/common/cnxk/roc_npc.h       | 16 ++++++-\n drivers/common/cnxk/roc_npc_mcam.c  | 69 ++++++++++++++---------------\n drivers/common/cnxk/roc_npc_parse.c | 14 ++++++\n drivers/common/cnxk/roc_npc_priv.h  |  1 +\n drivers/net/cnxk/cnxk_flow.c        | 27 +++++++++--\n drivers/net/cnxk/cnxk_rep.h         | 13 ++++++\n 7 files changed, 140 insertions(+), 54 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c\nindex 586bc55791..0a5bc5c2b1 100644\n--- a/drivers/common/cnxk/roc_npc.c\n+++ b/drivers/common/cnxk/roc_npc.c\n@@ -779,10 +779,14 @@ npc_parse_pattern(struct npc *npc, const struct roc_npc_item_info pattern[],\n \t\t  struct roc_npc_flow *flow, struct npc_parse_state *pst)\n {\n \tnpc_parse_stage_func_t parse_stage_funcs[] = {\n-\t\tnpc_parse_meta_items, npc_parse_mark_item, npc_parse_pre_l2, npc_parse_cpt_hdr,\n-\t\tnpc_parse_higig2_hdr, npc_parse_tx_queue,  npc_parse_la,     npc_parse_lb,\n-\t\tnpc_parse_lc,\t      npc_parse_ld,\t   npc_parse_le,     npc_parse_lf,\n-\t\tnpc_parse_lg,\t      npc_parse_lh,\n+\t\tnpc_parse_meta_items, npc_parse_represented_port_id,\n+\t\tnpc_parse_mark_item,  npc_parse_pre_l2,\n+\t\tnpc_parse_cpt_hdr,    npc_parse_higig2_hdr,\n+\t\tnpc_parse_tx_queue,   npc_parse_la,\n+\t\tnpc_parse_lb,\t      npc_parse_lc,\n+\t\tnpc_parse_ld,\t      npc_parse_le,\n+\t\tnpc_parse_lf,\t      npc_parse_lg,\n+\t\tnpc_parse_lh,\n \t};\n \tuint8_t layer = 0;\n \tint key_offset;\n@@ -843,11 +847,11 @@ npc_parse_attr(struct npc *npc, const struct roc_npc_attr *attr,\n \t\treturn NPC_ERR_PARAM;\n \telse if (attr->priority >= npc->flow_max_priority)\n \t\treturn NPC_ERR_PARAM;\n-\telse if ((!attr->egress && !attr->ingress) ||\n-\t\t (attr->egress && attr->ingress))\n+\telse if ((!attr->egress && !attr->ingress && !attr->transfer) ||\n+\t\t (attr->egress && attr->ingress && attr->transfer))\n \t\treturn NPC_ERR_PARAM;\n \n-\tif (attr->ingress)\n+\tif (attr->ingress || attr->transfer)\n \t\tflow->nix_intf = ROC_NPC_INTF_RX;\n \telse\n \t\tflow->nix_intf = ROC_NPC_INTF_TX;\n@@ -1002,15 +1006,18 @@ npc_rss_action_program(struct roc_npc *roc_npc,\n \t\t       struct roc_npc_flow *flow)\n {\n \tconst struct roc_npc_action_rss *rss;\n+\tstruct roc_npc *npc = roc_npc;\n \tuint32_t rss_grp;\n \tuint8_t alg_idx;\n \tint rc;\n \n+\tif (flow->has_rep)\n+\t\tnpc = roc_npc->rep_npc;\n+\n \tfor (; actions->type != ROC_NPC_ACTION_TYPE_END; actions++) {\n \t\tif (actions->type == ROC_NPC_ACTION_TYPE_RSS) {\n \t\t\trss = (const struct roc_npc_action_rss *)actions->conf;\n-\t\t\trc = npc_rss_action_configure(roc_npc, rss, &alg_idx,\n-\t\t\t\t\t\t      &rss_grp, flow->mcam_id);\n+\t\t\trc = npc_rss_action_configure(npc, rss, &alg_idx, &rss_grp, flow->mcam_id);\n \t\t\tif (rc)\n \t\t\t\treturn rc;\n \n@@ -1448,6 +1455,17 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n \tmemset(flow, 0, sizeof(*flow));\n \tmemset(&parse_state, 0, sizeof(parse_state));\n \n+\tflow->port_id = -1;\n+\tif (roc_npc->rep_npc) {\n+\t\tflow->rep_channel = roc_nix_to_nix_priv(roc_npc->rep_npc->roc_nix)->rx_chan_base;\n+\t\tflow->rep_pf_func = roc_npc->rep_pf_func;\n+\t\tflow->rep_mbox = roc_npc_to_npc_priv(roc_npc->rep_npc)->mbox;\n+\t\tflow->has_rep = true;\n+\t\tflow->is_rep_vf = !roc_nix_is_pf(roc_npc->rep_npc->roc_nix);\n+\t\tflow->port_id = roc_npc->rep_port_id;\n+\t\tflow->rep_npc = roc_npc_to_npc_priv(roc_npc->rep_npc);\n+\t}\n+\n \tparse_state.dst_pf_func = dst_pf_func;\n \n \trc = npc_parse_rule(roc_npc, attr, pattern, actions, flow, &parse_state);\n@@ -1475,6 +1493,7 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n \t\t*errcode = rc;\n \t\tgoto set_rss_failed;\n \t}\n+\troc_npc->rep_npc = NULL;\n \n \tif (flow->use_pre_alloc == 0)\n \t\tlist = &npc->flow_list[flow->priority];\n@@ -1484,6 +1503,7 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n \tTAILQ_FOREACH(flow_iter, list, next) {\n \t\tif (flow_iter->mcam_id > flow->mcam_id) {\n \t\t\tTAILQ_INSERT_BEFORE(flow_iter, flow, next);\n+\t\t\troc_npc->rep_npc = NULL;\n \t\t\treturn flow;\n \t\t}\n \t}\n@@ -1491,6 +1511,7 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n \treturn flow;\n \n set_rss_failed:\n+\troc_npc->rep_npc = NULL;\n \tif (flow->use_pre_alloc == 0) {\n \t\trc = roc_npc_mcam_free_entry(roc_npc, flow->mcam_id);\n \t\tif (rc != 0) {\n@@ -1502,6 +1523,7 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n \t\tnpc_inline_dev_ipsec_action_free(npc, flow);\n \t}\n err_exit:\n+\troc_npc->rep_npc = NULL;\n \tplt_free(flow);\n \treturn NULL;\n }\n@@ -1509,15 +1531,19 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,\n int\n npc_rss_group_free(struct npc *npc, struct roc_npc_flow *flow)\n {\n+\tstruct npc *lnpc = npc;\n \tuint32_t rss_grp;\n \n+\tif (flow->has_rep)\n+\t\tlnpc = flow->rep_npc;\n+\n \tif ((flow->npc_action & 0xF) == NIX_RX_ACTIONOP_RSS) {\n \t\trss_grp = (flow->npc_action >> NPC_RSS_ACT_GRP_OFFSET) &\n \t\t\t  NPC_RSS_ACT_GRP_MASK;\n \t\tif (rss_grp == 0 || rss_grp >= npc->rss_grps)\n \t\t\treturn -EINVAL;\n \n-\t\tplt_bitmap_clear(npc->rss_grp_entries, rss_grp);\n+\t\tplt_bitmap_clear(lnpc->rss_grp_entries, rss_grp);\n \t}\n \n \treturn 0;\n@@ -1591,7 +1617,7 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow)\n }\n \n void\n-roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc)\n+roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc, int rep_port_id)\n {\n \tstruct npc *npc = roc_npc_to_npc_priv(roc_npc);\n \tstruct roc_npc_flow *flow_iter;\n@@ -1605,12 +1631,14 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc)\n \n \t\t/* List in ascending order of mcam entries */\n \t\tTAILQ_FOREACH(flow_iter, list, next) {\n-\t\t\troc_npc_flow_mcam_dump(file, roc_npc, flow_iter);\n+\t\t\tif (rep_port_id == -1 || rep_port_id == flow_iter->port_id)\n+\t\t\t\troc_npc_flow_mcam_dump(file, roc_npc, flow_iter);\n \t\t}\n \t}\n \n \tTAILQ_FOREACH(flow_iter, &npc->ipsec_list, next) {\n-\t\troc_npc_flow_mcam_dump(file, roc_npc, flow_iter);\n+\t\tif (rep_port_id == -1 || rep_port_id == flow_iter->port_id)\n+\t\t\troc_npc_flow_mcam_dump(file, roc_npc, flow_iter);\n \t}\n }\n \ndiff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h\nindex 2ada774934..0f50c55175 100644\n--- a/drivers/common/cnxk/roc_npc.h\n+++ b/drivers/common/cnxk/roc_npc.h\n@@ -41,6 +41,7 @@ enum roc_npc_item_type {\n \tROC_NPC_ITEM_TYPE_MARK,\n \tROC_NPC_ITEM_TYPE_TX_QUEUE,\n \tROC_NPC_ITEM_TYPE_IPV6_ROUTING_EXT,\n+\tROC_NPC_ITEM_TYPE_REPRESENTED_PORT,\n \tROC_NPC_ITEM_TYPE_END,\n };\n \n@@ -272,7 +273,8 @@ struct roc_npc_attr {\n \tuint32_t priority;\t/**< Rule priority level within group. */\n \tuint32_t ingress : 1;\t/**< Rule applies to ingress traffic. */\n \tuint32_t egress : 1;\t/**< Rule applies to egress traffic. */\n-\tuint32_t reserved : 30; /**< Reserved, must be zero. */\n+\tuint32_t transfer : 1;\t/**< Rule applies to transfer traffic. */\n+\tuint32_t reserved : 29; /**< Reserved, must be zero. */\n };\n \n struct roc_npc_flow_dump_data {\n@@ -312,6 +314,13 @@ struct roc_npc_flow {\n \tuint16_t match_id;\n \tuint8_t is_inline_dev;\n \tbool use_pre_alloc;\n+\tuint16_t rep_pf_func;\n+\tuint16_t rep_channel;\n+\tstruct mbox *rep_mbox;\n+\tbool has_rep;\n+\tbool is_rep_vf;\n+\tstruct npc *rep_npc;\n+\tint port_id;\n \n \tTAILQ_ENTRY(roc_npc_flow) next;\n };\n@@ -366,6 +375,9 @@ struct roc_npc {\n \tbool is_sdp_mask_set;\n \tuint16_t sdp_channel;\n \tuint16_t sdp_channel_mask;\n+\tstruct roc_npc *rep_npc;\n+\tuint16_t rep_pf_func;\n+\tint rep_port_id;\n \n #define ROC_NPC_MEM_SZ (6 * 1024)\n \tuint8_t reserved[ROC_NPC_MEM_SZ];\n@@ -401,7 +413,7 @@ int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc, uint32_t ctr_i\n int __roc_api roc_npc_inl_mcam_read_counter(uint32_t ctr_id, uint64_t *count);\n int __roc_api roc_npc_inl_mcam_clear_counter(uint32_t ctr_id);\n int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc);\n-void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc);\n+void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc, int rep_port_id);\n void __roc_api roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc,\n \t\t\t\t      struct roc_npc_flow *mcam);\n int __roc_api roc_npc_mark_actions_get(struct roc_npc *roc_npc);\ndiff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c\nindex 62e0ce21b2..d25e82c652 100644\n--- a/drivers/common/cnxk/roc_npc_mcam.c\n+++ b/drivers/common/cnxk/roc_npc_mcam.c\n@@ -143,8 +143,8 @@ npc_lid_lt_in_kex(struct npc *npc, uint8_t lid, uint8_t lt)\n }\n \n static void\n-npc_construct_ldata_mask(struct npc *npc, struct plt_bitmap *bmap, uint8_t lid,\n-\t\t\t uint8_t lt, uint8_t ld)\n+npc_construct_ldata_mask(struct npc *npc, struct plt_bitmap *bmap, uint8_t lid, uint8_t lt,\n+\t\t\t uint8_t ld)\n {\n \tstruct npc_xtract_info *x_info, *infoflag;\n \tint hdr_off, keylen;\n@@ -197,8 +197,7 @@ npc_construct_ldata_mask(struct npc *npc, struct plt_bitmap *bmap, uint8_t lid,\n  * @param len length of the match\n  */\n static bool\n-npc_is_kex_enabled(struct npc *npc, uint8_t lid, uint8_t lt, int offset,\n-\t\t   int len)\n+npc_is_kex_enabled(struct npc *npc, uint8_t lid, uint8_t lt, int offset, int len)\n {\n \tstruct plt_bitmap *bmap;\n \tuint32_t bmap_sz;\n@@ -349,8 +348,8 @@ npc_mcam_alloc_entries(struct mbox *mbox, int ref_mcam, int *alloc_entry, int re\n }\n \n int\n-npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam,\n-\t\t     struct roc_npc_flow *ref_mcam, int prio, int *resp_count)\n+npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam, struct roc_npc_flow *ref_mcam,\n+\t\t     int prio, int *resp_count)\n {\n \tstruct npc_mcam_alloc_entry_req *req;\n \tstruct npc_mcam_alloc_entry_rsp *rsp;\n@@ -450,22 +449,17 @@ npc_mcam_write_entry(struct mbox *mbox, struct roc_npc_flow *mcam)\n static void\n npc_mcam_process_mkex_cfg(struct npc *npc, struct npc_get_kex_cfg_rsp *kex_rsp)\n {\n-\tvolatile uint64_t(\n-\t\t*q)[NPC_MAX_INTF][NPC_MAX_LID][NPC_MAX_LT][NPC_MAX_LD];\n+\tvolatile uint64_t(*q)[NPC_MAX_INTF][NPC_MAX_LID][NPC_MAX_LT][NPC_MAX_LD];\n \tstruct npc_xtract_info *x_info = NULL;\n \tint lid, lt, ld, fl, ix;\n \tnpc_dxcfg_t *p;\n \tuint64_t keyw;\n \tuint64_t val;\n \n-\tnpc->keyx_supp_nmask[NPC_MCAM_RX] =\n-\t\tkex_rsp->rx_keyx_cfg & 0x7fffffffULL;\n-\tnpc->keyx_supp_nmask[NPC_MCAM_TX] =\n-\t\tkex_rsp->tx_keyx_cfg & 0x7fffffffULL;\n-\tnpc->keyx_len[NPC_MCAM_RX] =\n-\t\tnpc_supp_key_len(npc->keyx_supp_nmask[NPC_MCAM_RX]);\n-\tnpc->keyx_len[NPC_MCAM_TX] =\n-\t\tnpc_supp_key_len(npc->keyx_supp_nmask[NPC_MCAM_TX]);\n+\tnpc->keyx_supp_nmask[NPC_MCAM_RX] = kex_rsp->rx_keyx_cfg & 0x7fffffffULL;\n+\tnpc->keyx_supp_nmask[NPC_MCAM_TX] = kex_rsp->tx_keyx_cfg & 0x7fffffffULL;\n+\tnpc->keyx_len[NPC_MCAM_RX] = npc_supp_key_len(npc->keyx_supp_nmask[NPC_MCAM_RX]);\n+\tnpc->keyx_len[NPC_MCAM_TX] = npc_supp_key_len(npc->keyx_supp_nmask[NPC_MCAM_TX]);\n \n \tkeyw = (kex_rsp->rx_keyx_cfg >> 32) & 0x7ULL;\n \tnpc->keyw[NPC_MCAM_RX] = keyw;\n@@ -485,8 +479,7 @@ npc_mcam_process_mkex_cfg(struct npc *npc, struct npc_get_kex_cfg_rsp *kex_rsp)\n \n \t/* Update LID, LT and LDATA cfg */\n \tp = &npc->prx_dxcfg;\n-\tq = (volatile uint64_t(*)[][NPC_MAX_LID][NPC_MAX_LT][NPC_MAX_LD])(\n-\t\t&kex_rsp->intf_lid_lt_ld);\n+\tq = (volatile uint64_t(*)[][NPC_MAX_LID][NPC_MAX_LT][NPC_MAX_LD])(&kex_rsp->intf_lid_lt_ld);\n \tfor (ix = 0; ix < NPC_MAX_INTF; ix++) {\n \t\tfor (lid = 0; lid < NPC_MAX_LID; lid++) {\n \t\t\tfor (lt = 0; lt < NPC_MAX_LT; lt++) {\n@@ -539,8 +532,7 @@ npc_mcam_fetch_kex_cfg(struct npc *npc)\n \t\tgoto done;\n \t}\n \n-\tmbox_memcpy((char *)npc->profile_name, kex_rsp->mkex_pfl_name,\n-\t\t    MKEX_NAME_LEN);\n+\tmbox_memcpy((char *)npc->profile_name, kex_rsp->mkex_pfl_name, MKEX_NAME_LEN);\n \n \tnpc->exact_match_ena = (kex_rsp->rx_keyx_cfg >> 40) & 0xF;\n \tnpc_mcam_process_mkex_cfg(npc, kex_rsp);\n@@ -551,9 +543,8 @@ npc_mcam_fetch_kex_cfg(struct npc *npc)\n }\n \n static void\n-npc_mcam_set_channel(struct roc_npc_flow *flow,\n-\t\t     struct npc_mcam_write_entry_req *req, uint16_t channel,\n-\t\t     uint16_t chan_mask, bool is_second_pass)\n+npc_mcam_set_channel(struct roc_npc_flow *flow, struct npc_mcam_write_entry_req *req,\n+\t\t     uint16_t channel, uint16_t chan_mask, bool is_second_pass)\n {\n \tuint16_t chan = 0, mask = 0;\n \n@@ -733,6 +724,14 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow, struct npc_\n \n \t\t\tnpc_mcam_set_channel(flow, req, inl_dev->channel, inl_dev->chan_mask,\n \t\t\t\t\t     false);\n+\t\t} else if (flow->has_rep) {\n+\t\t\tpf_func = flow->rep_pf_func;\n+\t\t\treq->entry_data.action &= ~(GENMASK(19, 4));\n+\t\t\treq->entry_data.action |= (uint64_t)pf_func << 4;\n+\t\t\tflow->npc_action &= ~(GENMASK(19, 4));\n+\t\t\tflow->npc_action |= (uint64_t)pf_func << 4;\n+\t\t\tnpc_mcam_set_channel(flow, req, flow->rep_channel, (BIT_ULL(12) - 1),\n+\t\t\t\t\t     false);\n \t\t} else if (npc->is_sdp_link) {\n \t\t\tnpc_mcam_set_channel(flow, req, npc->sdp_channel, npc->sdp_channel_mask,\n \t\t\t\t\t     pst->is_second_pass_rule);\n@@ -789,9 +788,8 @@ npc_set_vlan_ltype(struct npc_parse_state *pst)\n \tuint64_t val, mask;\n \tuint8_t lb_offset;\n \n-\tlb_offset =\n-\t\t__builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &\n-\t\t\t\t   ((1ULL << NPC_LTYPE_LB_OFFSET) - 1));\n+\tlb_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &\n+\t\t\t\t       ((1ULL << NPC_LTYPE_LB_OFFSET) - 1));\n \tlb_offset *= 4;\n \n \tmask = ~((0xfULL << lb_offset));\n@@ -811,9 +809,8 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)\n \tuint8_t lc_offset, lcflag_offset;\n \tuint64_t val, mask;\n \n-\tlc_offset =\n-\t\t__builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &\n-\t\t\t\t   ((1ULL << NPC_LTYPE_LC_OFFSET) - 1));\n+\tlc_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &\n+\t\t\t\t       ((1ULL << NPC_LTYPE_LC_OFFSET) - 1));\n \tlc_offset *= 4;\n \n \tmask = ~((0xfULL << lc_offset));\n@@ -903,13 +900,11 @@ npc_program_mcam(struct npc *npc, struct npc_parse_state *pst, bool mcam_alloc)\n \t\t\t\t\t\tdata_off = 0;\n \t\t\t\t\t\tindex++;\n \t\t\t\t\t}\n-\t\t\t\t\tkey_data[index] |=\n-\t\t\t\t\t\t((uint64_t)data << data_off);\n+\t\t\t\t\tkey_data[index] |= ((uint64_t)data << data_off);\n \n \t\t\t\t\tif (lt == 0)\n \t\t\t\t\t\tmask = 0;\n-\t\t\t\t\tkey_mask[index] |=\n-\t\t\t\t\t\t((uint64_t)mask << data_off);\n+\t\t\t\t\tkey_mask[index] |= ((uint64_t)mask << data_off);\n \t\t\t\t\tdata_off += 4;\n \t\t\t\t}\n \t\t\t}\n@@ -934,8 +929,12 @@ npc_program_mcam(struct npc *npc, struct npc_parse_state *pst, bool mcam_alloc)\n \t    (pst->flow->npc_action & NIX_RX_ACTIONOP_UCAST_IPSEC))\n \t\tskip_base_rule = true;\n \n-\tif (pst->is_vf && pst->flow->nix_intf == NIX_INTF_RX && !skip_base_rule) {\n-\t\tmbox = mbox_get(npc->mbox);\n+\tif ((pst->is_vf || pst->flow->is_rep_vf) && pst->flow->nix_intf == NIX_INTF_RX &&\n+\t    !skip_base_rule) {\n+\t\tif (pst->flow->has_rep)\n+\t\t\tmbox = mbox_get(pst->flow->rep_mbox);\n+\t\telse\n+\t\t\tmbox = mbox_get(npc->mbox);\n \t\t(void)mbox_alloc_msg_npc_read_base_steer_rule(mbox);\n \t\trc = mbox_process_msg(mbox, (void *)&base_rule_rsp);\n \t\tif (rc) {\ndiff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c\nindex ecd1b3e13b..f59a053761 100644\n--- a/drivers/common/cnxk/roc_npc_parse.c\n+++ b/drivers/common/cnxk/roc_npc_parse.c\n@@ -35,6 +35,20 @@ npc_parse_mark_item(struct npc_parse_state *pst)\n \treturn 0;\n }\n \n+int\n+npc_parse_represented_port_id(struct npc_parse_state *pst)\n+{\n+\tif (pst->pattern->type != ROC_NPC_ITEM_TYPE_REPRESENTED_PORT)\n+\t\treturn 0;\n+\n+\tif (pst->flow->nix_intf != NIX_INTF_RX)\n+\t\treturn -EINVAL;\n+\n+\tpst->pattern++;\n+\n+\treturn 0;\n+}\n+\n static int\n npc_flow_raw_item_prepare(const struct roc_npc_flow_item_raw *raw_spec,\n \t\t\t  const struct roc_npc_flow_item_raw *raw_mask,\ndiff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h\nindex 593dca353b..50c54b895d 100644\n--- a/drivers/common/cnxk/roc_npc_priv.h\n+++ b/drivers/common/cnxk/roc_npc_priv.h\n@@ -448,6 +448,7 @@ int npc_mask_is_supported(const char *mask, const char *hw_mask, int len);\n int npc_parse_item_basic(const struct roc_npc_item_info *item, struct npc_parse_item_info *info);\n int npc_parse_meta_items(struct npc_parse_state *pst);\n int npc_parse_mark_item(struct npc_parse_state *pst);\n+int npc_parse_represented_port_id(struct npc_parse_state *pst);\n int npc_parse_pre_l2(struct npc_parse_state *pst);\n int npc_parse_higig2_hdr(struct npc_parse_state *pst);\n int npc_parse_cpt_hdr(struct npc_parse_state *pst);\ndiff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c\nindex 970daec035..c08b09338d 100644\n--- a/drivers/net/cnxk/cnxk_flow.c\n+++ b/drivers/net/cnxk/cnxk_flow.c\n@@ -187,9 +187,28 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \t\t\t\tplt_err(\"Output port not under same driver\");\n \t\t\t\tgoto err_exit;\n \t\t\t}\n-\t\t\thw_dst = portid_eth_dev->data->dev_private;\n-\t\t\troc_npc_dst = &hw_dst->npc;\n-\t\t\t*dst_pf_func = roc_npc_dst->pf_func;\n+\n+\t\t\tif (cnxk_ethdev_is_representor(if_name)) {\n+\t\t\t\tstruct rte_eth_dev *rep_eth_dev = portid_eth_dev;\n+\t\t\t\tstruct rte_flow_action_mark *act_mark;\n+\t\t\t\tstruct cnxk_rep_dev *rep_dev;\n+\n+\t\t\t\trep_dev = cnxk_rep_pmd_priv(rep_eth_dev);\n+\t\t\t\t*dst_pf_func = rep_dev->pf_func;\n+\t\t\t\tplt_rep_dbg(\"Representor port %d act port %d rep_dev->pf_func 0x%x\",\n+\t\t\t\t\t    port_act->id, act_ethdev->port_id, rep_dev->pf_func);\n+\n+\t\t\t\t/* Add Mark action */\n+\t\t\t\ti++;\n+\t\t\t\tact_mark = plt_zmalloc(sizeof(struct rte_flow_action_mark), 0);\n+\t\t\t\tact_mark->id = 1;\n+\t\t\t\tin_actions[i].type = ROC_NPC_ACTION_TYPE_MARK;\n+\t\t\t\tin_actions[i].conf = (struct rte_flow_action_mark *)act_mark;\n+\t\t\t} else {\n+\t\t\t\thw_dst = portid_eth_dev->data->dev_private;\n+\t\t\t\troc_npc_dst = &hw_dst->npc;\n+\t\t\t\t*dst_pf_func = roc_npc_dst->pf_func;\n+\t\t\t}\n \t\t\tbreak;\n \n \t\tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n@@ -477,7 +496,7 @@ cnxk_flow_dev_dump(struct rte_eth_dev *eth_dev, struct rte_flow *flow,\n \t\treturn -EINVAL;\n \t}\n \n-\troc_npc_flow_dump(file, npc);\n+\troc_npc_flow_dump(file, npc, -1);\n \n \treturn 0;\n }\ndiff --git a/drivers/net/cnxk/cnxk_rep.h b/drivers/net/cnxk/cnxk_rep.h\nindex 4886527f83..1b3de65329 100644\n--- a/drivers/net/cnxk/cnxk_rep.h\n+++ b/drivers/net/cnxk/cnxk_rep.h\n@@ -6,6 +6,8 @@\n #ifndef __CNXK_REP_H__\n #define __CNXK_REP_H__\n \n+#include <regex.h>\n+\n #define CNXK_REP_XPORT_VDEV_CFG_MZ  \"rep_xport_vdev_cfg\"\n #define CNXK_REP_XPORT_VDEV_DEVARGS \"role=server\"\n #define CNXK_REP_XPORT_VDEV_NAME\t   \"net_memif\"\n@@ -64,6 +66,17 @@ cnxk_rep_xport_eth_dev(uint16_t portid)\n \treturn &rte_eth_devices[portid];\n }\n \n+static inline int\n+cnxk_ethdev_is_representor(const char *if_name)\n+{\n+\tregex_t regex;\n+\tint val;\n+\n+\tval = regcomp(&regex, \"net_.*_representor_.*\", 0);\n+\tval = regexec(&regex, if_name, 0, NULL, 0);\n+\treturn (val == 0);\n+}\n+\n /* Prototypes */\n int cnxk_rep_dev_probe(struct rte_pci_device *pci_dev, struct rte_eth_dev *pf_ethdev,\n \t\t       struct rte_eth_devargs *eth_da);\n",
    "prefixes": [
        "8/9"
    ]
}