Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/130173/?format=api
http://patchwork.dpdk.org/api/patches/130173/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230811163419.165790-5-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-5-hkalra@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230811163419.165790-5-hkalra@marvell.com", "date": "2023-08-11T16:34:14", "name": "[4/9] net/cnxk: callbacks for representor state", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "d8d5948e6cfaebbd643abed1c0c6a8f8ba725c99", "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-5-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/130173/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/130173/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 CF6AA43036;\n\tFri, 11 Aug 2023 18:35:12 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5B36343260;\n\tFri, 11 Aug 2023 18:35:09 +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 264FD40E03\n for <dev@dpdk.org>; Fri, 11 Aug 2023 18:35:07 +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 37BDcIHC011977 for <dev@dpdk.org>; Fri, 11 Aug 2023 09:35:06 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sd8ya2qs5-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 11 Aug 2023 09:35:06 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Fri, 11 Aug 2023 09:35:04 -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:04 -0700", "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id 445723F7099;\n Fri, 11 Aug 2023 09:35:02 -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=IZgoVWCM0NOFOxdNquLRTMSrIm0uOU7iZgVi4//FMx8=;\n b=fmLjvFRqy0y7I9ptbgfNk4crSXmFK4Qts5a2cDObJEOc5A9yowNXfSOdTXQtN9v3l+Ae\n rT01ivbETUCCwHsukOQUWHhuRM57vk/LH7o6RGDzAnD6aixezplGnBlk9eC1QtaDwWVt\n 1WTmsyCixK2/s5qoBR2YAoEXnTiFYc3g1ACNYpKuyHTIxpSWo5JUg8QVPzVhsOhxgdFm\n 77latReSiq0VRsdxrOAWpoD1cAeMILVt4NYUg5mhzVpG6zry7L0awVyjIeAI+ngegxyX\n /Paq7jjQZqHFgHzu50AC6ASYO7Fwn+abE+ppVnAIjK8xo2ndG0dJWVL3IxSUqc5lbajP ew==", "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 4/9] net/cnxk: callbacks for representor state", "Date": "Fri, 11 Aug 2023 22:04:14 +0530", "Message-ID": "<20230811163419.165790-5-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": "8-D_wV6nhYQyF49lEz0uJtGkTQ6Lj3N8", "X-Proofpoint-GUID": "8-D_wV6nhYQyF49lEz0uJtGkTQ6Lj3N8", "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": "Implementing the callbacks for processing representor state.\nThree operations currently supported:\n- set a representor to be active if its VF is enabled and set\nit appropriate pf func value.\n- check if the VF which sent a mbox has a representor\n- clear representor state if its VF goes down.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n drivers/net/cnxk/cnxk_rep.c | 65 +++++++++++++++++++++++++++++++++++++\n drivers/net/cnxk/cnxk_rep.h | 4 +++\n 2 files changed, 69 insertions(+)", "diff": "diff --git a/drivers/net/cnxk/cnxk_rep.c b/drivers/net/cnxk/cnxk_rep.c\nindex ebefc34ac8..4dd564058c 100644\n--- a/drivers/net/cnxk/cnxk_rep.c\n+++ b/drivers/net/cnxk/cnxk_rep.c\n@@ -39,6 +39,7 @@ cnxk_rep_dev_remove(struct rte_eth_dev *pf_ethdev)\n \tstruct cnxk_eth_dev *pf_dev = cnxk_eth_pmd_priv(pf_ethdev);\n \tint rc = 0;\n \n+\troc_nix_process_rep_state_cb_unregister(&pf_dev->nix);\n \trc = rte_eth_switch_domain_free(pf_dev->switch_domain_id);\n \tif (rc)\n \t\tplt_err(\"Failed to alloc switch domain: %d\", rc);\n@@ -183,6 +184,63 @@ cnxk_rep_dev_init(struct rte_eth_dev *eth_dev, void *params)\n \treturn 0;\n }\n \n+static int\n+cnxk_process_representor_status(void *roc_nix, uint16_t pf_func, uint8_t op)\n+{\n+\tstruct cnxk_eth_dev *pf_dev = (struct cnxk_eth_dev *)roc_nix;\n+\tstruct cnxk_rep_dev *rep_dev = NULL;\n+\tstruct rte_eth_dev *rep_eth_dev;\n+\tuint16_t match = 0, func_val;\n+\tbool is_vf_active;\n+\tint i, rc = 0;\n+\n+\tif (!pf_dev) {\n+\t\tplt_err(\"Failed to get PF ethdev handle\");\n+\t\treturn -1;\n+\t}\n+\n+\tswitch (op) {\n+\tcase 0: /* update pffunc of vf being represented */\n+\t\tmatch = 0;\n+\t\tfunc_val = pf_func;\n+\t\tis_vf_active = true;\n+\t\tbreak;\n+\tcase 1: /* check if any representor is representing pffunc */\n+\t\tmatch = pf_func;\n+\t\tfunc_val = pf_func;\n+\t\tis_vf_active = true;\n+\t\tbreak;\n+\tcase 2: /* vf is going down, reset rep state */\n+\t\tmatch = pf_func;\n+\t\tfunc_val = 0;\n+\t\tis_vf_active = false;\n+\t\tbreak;\n+\tdefault:\n+\t\tplt_err(\"Invalid op received %d pf_func %x\", op, pf_func);\n+\t\treturn -1;\n+\t};\n+\n+\tfor (i = 0; i < pf_dev->num_reps; i++) {\n+\t\trep_eth_dev = pf_dev->rep_info[i].rep_eth_dev;\n+\t\tif (!rep_eth_dev) {\n+\t\t\tplt_err(\"Failed to get rep ethdev handle\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\trep_dev = cnxk_rep_pmd_priv(rep_eth_dev);\n+\t\tif (rep_dev->pf_func == match) {\n+\t\t\tplt_base_dbg(\"Representor port %d op %d match %d func_val %d vf_active %d\",\n+\t\t\t\t i, op, match, func_val, is_vf_active);\n+\t\t\trep_dev->pf_func = func_val;\n+\t\t\trep_dev->is_vf_active = is_vf_active;\n+\t\t\trc = 1;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn rc;\n+}\n+\n int\n 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@@ -256,6 +314,13 @@ cnxk_rep_dev_probe(struct rte_pci_device *pci_dev, struct rte_eth_dev *pf_ethdev\n \t\tpf_dev->num_reps++;\n \t}\n \n+\t/* Register up msg callbacks for processing representor information */\n+\tif (roc_nix_process_rep_state_cb_register(&pf_dev->nix, cnxk_process_representor_status)) {\n+\t\tplt_err(\"Failed to register callback for representor status\");\n+\t\trc = -EINVAL;\n+\t\tgoto err;\n+\t}\n+\n \treturn 0;\n err:\n \treturn rc;\ndiff --git a/drivers/net/cnxk/cnxk_rep.h b/drivers/net/cnxk/cnxk_rep.h\nindex 24adb9649b..e3fc717a58 100644\n--- a/drivers/net/cnxk/cnxk_rep.h\n+++ b/drivers/net/cnxk/cnxk_rep.h\n@@ -17,6 +17,10 @@ struct cnxk_rep_dev {\n \tuint16_t vf_id;\n \tuint16_t switch_domain_id;\n \tstruct rte_eth_dev *parent_dev;\n+\tstruct rte_mempool *ctrl_chan_pool;\n+\tuint16_t rep_xport_vdev;\n+\tbool is_vf_active;\n+\tuint16_t pf_func;\n \tuint8_t mac_addr[RTE_ETHER_ADDR_LEN];\n };\n \n", "prefixes": [ "4/9" ] }{ "id": 130173, "url": "