Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137781/?format=api
http://patches.dpdk.org/api/patches/137781/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240301191451.57168-12-hkalra@marvell.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": "<20240301191451.57168-12-hkalra@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240301191451.57168-12-hkalra@marvell.com", "date": "2024-03-01T19:14:38", "name": "[v5,11/23] common/cnxk: representee notification callback", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "c091faae5a2bb26da11bb63827f9e5c416068ba9", "submitter": { "id": 1182, "url": "http://patches.dpdk.org/api/people/1182/?format=api", "name": "Harman Kalra", "email": "hkalra@marvell.com" }, "delegate": { "id": 310, "url": "http://patches.dpdk.org/api/users/310/?format=api", "username": "jerin", "first_name": "Jerin", "last_name": "Jacob", "email": "jerinj@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240301191451.57168-12-hkalra@marvell.com/mbox/", "series": [ { "id": 31343, "url": "http://patches.dpdk.org/api/series/31343/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31343", "date": "2024-03-01T19:14:27", "name": "net/cnxk: support for port representors", "version": 5, "mbox": "http://patches.dpdk.org/series/31343/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/137781/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/137781/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 74EC343C0F;\n\tFri, 1 Mar 2024 20:16:28 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CA0E243474;\n\tFri, 1 Mar 2024 20:15:34 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 38B8B4344F\n for <dev@dpdk.org>; Fri, 1 Mar 2024 20:15:32 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 4219mhYG013735 for <dev@dpdk.org>; Fri, 1 Mar 2024 11:15:31 -0800", "from dc5-exch05.marvell.com ([199.233.59.128])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3wkcq59sgn-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 01 Mar 2024 11:15:31 -0800 (PST)", "from DC5-EXCH05.marvell.com (10.69.176.209) by\n DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1258.12; Fri, 1 Mar 2024 11:15:30 -0800", "from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com\n (10.69.176.209) with Microsoft SMTP Server id 15.2.1258.12 via Frontend\n Transport; Fri, 1 Mar 2024 11:15:30 -0800", "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id C511B3F71FE;\n Fri, 1 Mar 2024 11:15:27 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-type; s=pfpt0220; bh=4eCv1I85s/0ycuP3kfojO\n h1l0owdSgT982NKX2zGaUo=; b=JVTXYeDjeCgdJrxVMwKRNMgscFaNVu1kFwtpf\n NGOH2wkMt4COauxBWsJQokMD/b1d19e8cTXbWI9EKY6HU7kPnrq9ZF6tOQP2RS7c\n cIaPrit5P/6z53bwc9itmY8Ms9FdbC9mY+uU+d5MOL57Qs0pdOf2zfJVKqMphpFL\n 6crwtU6AZXC27+/lIaL2r/sWecMJam9nMWoCa48T80jVA/ywCzEmM4QGodLyOYIz\n mudC7lTMc3nSI+Mz0WO4LwP6pckCIeGgtppk6+ylckE0my6qEWZ3apAbFQNr3sE5\n /+g1Yu5u+AQK4R0yphxoSC1EG2SknffUvYo5SrOvAh8x11e3g==", "From": "Harman Kalra <hkalra@marvell.com>", "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>, Harman Kalra <hkalra@marvell.com>", "CC": "<dev@dpdk.org>", "Subject": "[PATCH v5 11/23] common/cnxk: representee notification callback", "Date": "Sat, 2 Mar 2024 00:44:38 +0530", "Message-ID": "<20240301191451.57168-12-hkalra@marvell.com>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20240301191451.57168-1-hkalra@marvell.com>", "References": "<20230811163419.165790-1-hkalra@marvell.com>\n <20240301191451.57168-1-hkalra@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-GUID": "YZk5lsj_HZljBu_kzdjI9amLBASWPZAd", "X-Proofpoint-ORIG-GUID": "YZk5lsj_HZljBu_kzdjI9amLBASWPZAd", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2024-03-01_20,2024-03-01_03,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": "Setting up a callback which gets invoked every time a representee\ncomes up or goes down. Later this callback gets handled by network\ncounterpart.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n drivers/common/cnxk/roc_dev.c | 70 ++++++++++++++++++++++++++++++\n drivers/common/cnxk/roc_dev_priv.h | 3 ++\n drivers/common/cnxk/roc_eswitch.c | 23 ++++++++++\n drivers/common/cnxk/roc_eswitch.h | 31 +++++++++++++\n drivers/common/cnxk/roc_mbox.c | 2 +\n drivers/common/cnxk/roc_mbox.h | 19 +++++++-\n drivers/common/cnxk/version.map | 2 +\n 7 files changed, 149 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c\nindex 084343c3b4..75fc94e64a 100644\n--- a/drivers/common/cnxk/roc_dev.c\n+++ b/drivers/common/cnxk/roc_dev.c\n@@ -537,6 +537,75 @@ pf_vf_mbox_send_up_msg(struct dev *dev, void *rec_msg)\n \t}\n }\n \n+static int\n+mbox_up_handler_rep_repte_notify(struct dev *dev, struct rep_repte_req *req, struct msg_rsp *rsp)\n+{\n+\tstruct roc_eswitch_repte_notify_msg *notify_msg;\n+\tint rc = 0;\n+\n+\tplt_base_dbg(\"pf:%d/vf:%d msg id 0x%x (%s) from: pf:%d/vf:%d\", dev_get_pf(dev->pf_func),\n+\t\t dev_get_vf(dev->pf_func), req->hdr.id, mbox_id2name(req->hdr.id),\n+\t\t dev_get_pf(req->hdr.pcifunc), dev_get_vf(req->hdr.pcifunc));\n+\n+\tplt_base_dbg(\"repte pcifunc %x, enable %d\", req->repte_pcifunc, req->enable);\n+\tif (dev->ops && dev->ops->repte_notify) {\n+\t\tnotify_msg = plt_zmalloc(sizeof(struct roc_eswitch_repte_notify_msg), 0);\n+\t\tif (!notify_msg) {\n+\t\t\tplt_err(\"Failed to allocate memory\");\n+\t\t\trc = -ENOMEM;\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tnotify_msg->type = ROC_ESWITCH_REPTE_STATE;\n+\t\tnotify_msg->state.hw_func = req->repte_pcifunc;\n+\t\tnotify_msg->state.enable = req->enable;\n+\n+\t\trc = dev->ops->repte_notify(dev->roc_nix, (void *)notify_msg);\n+\t\tif (rc < 0)\n+\t\t\tplt_err(\"Failed to sent new representee %x notification to %s\",\n+\t\t\t\treq->repte_pcifunc, (req->enable == true) ? \"enable\" : \"disable\");\n+\n+\t\tplt_free(notify_msg);\n+\t}\n+fail:\n+\trsp->hdr.rc = rc;\n+\treturn rc;\n+}\n+\n+static int\n+mbox_up_handler_rep_set_mtu(struct dev *dev, struct rep_mtu *req, struct msg_rsp *rsp)\n+{\n+\tstruct roc_eswitch_repte_notify_msg *notify_msg;\n+\tint rc = 0;\n+\n+\tplt_base_dbg(\"pf:%d/vf:%d msg id 0x%x (%s) from: pf:%d/vf:%d\", dev_get_pf(dev->pf_func),\n+\t\t dev_get_vf(dev->pf_func), req->hdr.id, mbox_id2name(req->hdr.id),\n+\t\t dev_get_pf(req->hdr.pcifunc), dev_get_vf(req->hdr.pcifunc));\n+\n+\tplt_base_dbg(\"rep pcifunc %x, rep id %d mtu %d\", req->rep_pcifunc, req->rep_id, req->mtu);\n+\tif (dev->ops && dev->ops->repte_notify) {\n+\t\tnotify_msg = plt_zmalloc(sizeof(struct roc_eswitch_repte_notify_msg), 0);\n+\t\tif (!notify_msg) {\n+\t\t\tplt_err(\"Failed to allocate memory\");\n+\t\t\trc = -ENOMEM;\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tnotify_msg->type = ROC_ESWITCH_REPTE_MTU;\n+\t\tnotify_msg->mtu.hw_func = req->rep_pcifunc;\n+\t\tnotify_msg->mtu.rep_id = req->rep_id;\n+\t\tnotify_msg->mtu.mtu = req->mtu;\n+\n+\t\trc = dev->ops->repte_notify(dev->roc_nix, (void *)notify_msg);\n+\t\tif (rc < 0)\n+\t\t\tplt_err(\"Failed to send new mtu notification for representee %x \",\n+\t\t\t\treq->rep_pcifunc);\n+\n+\t\tplt_free(notify_msg);\n+\t}\n+fail:\n+\trsp->hdr.rc = rc;\n+\treturn rc;\n+}\n+\n static int\n mbox_up_handler_mcs_intr_notify(struct dev *dev, struct mcs_intr_info *info, struct msg_rsp *rsp)\n {\n@@ -711,6 +780,7 @@ mbox_process_msgs_up(struct dev *dev, struct mbox_msghdr *req)\n \t}\n \t\tMBOX_UP_CGX_MESSAGES\n \t\tMBOX_UP_MCS_MESSAGES\n+\t\tMBOX_UP_REP_MESSAGES\n #undef M\n \t}\n \ndiff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h\nindex 5b2c5096f8..50e12cbf17 100644\n--- a/drivers/common/cnxk/roc_dev_priv.h\n+++ b/drivers/common/cnxk/roc_dev_priv.h\n@@ -36,12 +36,15 @@ typedef void (*q_err_cb_t)(void *roc_nix, void *data);\n /* Link status get callback */\n typedef void (*link_status_get_t)(void *roc_nix,\n \t\t\t\t struct cgx_link_user_info *link);\n+/* Representee notification callback */\n+typedef int (*repte_notify_t)(void *roc_nix, void *notify_msg);\n \n struct dev_ops {\n \tlink_info_t link_status_update;\n \tptp_info_t ptp_info_update;\n \tlink_status_get_t link_status_get;\n \tq_err_cb_t q_err_cb;\n+\trepte_notify_t repte_notify;\n };\n \n #define dev_is_vf(dev) ((dev)->hwcap & DEV_HWCAP_F_VF)\ndiff --git a/drivers/common/cnxk/roc_eswitch.c b/drivers/common/cnxk/roc_eswitch.c\nindex 020a891a32..14819bad75 100644\n--- a/drivers/common/cnxk/roc_eswitch.c\n+++ b/drivers/common/cnxk/roc_eswitch.c\n@@ -319,3 +319,26 @@ roc_eswitch_nix_vlan_tpid_set(struct roc_nix *roc_nix, uint32_t type, uint16_t t\n \n \treturn rc;\n }\n+\n+int\n+roc_eswitch_nix_process_repte_notify_cb_register(struct roc_nix *roc_nix,\n+\t\t\t\t\t\t process_repte_notify_t proc_repte_nt)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct dev *dev = &nix->dev;\n+\n+\tif (proc_repte_nt == NULL)\n+\t\treturn NIX_ERR_PARAM;\n+\n+\tdev->ops->repte_notify = (repte_notify_t)proc_repte_nt;\n+\treturn 0;\n+}\n+\n+void\n+roc_eswitch_nix_process_repte_notify_cb_unregister(struct roc_nix *roc_nix)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct dev *dev = &nix->dev;\n+\n+\tdev->ops->repte_notify = NULL;\n+}\ndiff --git a/drivers/common/cnxk/roc_eswitch.h b/drivers/common/cnxk/roc_eswitch.h\nindex 34b75d10ac..e0df0038d4 100644\n--- a/drivers/common/cnxk/roc_eswitch.h\n+++ b/drivers/common/cnxk/roc_eswitch.h\n@@ -8,6 +8,34 @@\n #define ROC_ESWITCH_VLAN_TPID 0x8100\n #define ROC_ESWITCH_LBK_CHAN 63\n \n+typedef enum roc_eswitch_repte_notify_msg_type {\n+\tROC_ESWITCH_REPTE_STATE = 0,\n+\tROC_ESWITCH_REPTE_MTU,\n+} roc_eswitch_repte_notify_msg_type_t;\n+\n+struct roc_eswitch_repte_state {\n+\tbool enable;\n+\tuint16_t hw_func;\n+};\n+\n+struct roc_eswitch_repte_mtu {\n+\tuint16_t mtu;\n+\tuint16_t rep_id;\n+\tuint16_t hw_func;\n+};\n+\n+struct roc_eswitch_repte_notify_msg {\n+\troc_eswitch_repte_notify_msg_type_t type;\n+\tunion {\n+\t\tstruct roc_eswitch_repte_state state;\n+\t\tstruct roc_eswitch_repte_mtu mtu;\n+\t};\n+};\n+\n+/* Process representee notification callback */\n+typedef int (*process_repte_notify_t)(void *roc_nix,\n+\t\t\t\t struct roc_eswitch_repte_notify_msg *notify_msg);\n+\n /* NPC */\n int __roc_api roc_eswitch_npc_mcam_rx_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow,\n \t\t\t\t\t uint16_t pcifunc, uint16_t vlan_tci,\n@@ -23,4 +51,7 @@ int __roc_api roc_eswitch_npc_rss_action_configure(struct roc_npc *roc_npc,\n /* NIX */\n int __roc_api roc_eswitch_nix_vlan_tpid_set(struct roc_nix *nix, uint32_t type, uint16_t tpid,\n \t\t\t\t\t bool is_vf);\n+int __roc_api roc_eswitch_nix_process_repte_notify_cb_register(struct roc_nix *roc_nix,\n+\t\t\t\t\t\t process_repte_notify_t proc_repte_nt);\n+void __roc_api roc_eswitch_nix_process_repte_notify_cb_unregister(struct roc_nix *roc_nix);\n #endif /* __ROC_ESWITCH_H__ */\ndiff --git a/drivers/common/cnxk/roc_mbox.c b/drivers/common/cnxk/roc_mbox.c\nindex 7b734fcd24..10cdbc4d13 100644\n--- a/drivers/common/cnxk/roc_mbox.c\n+++ b/drivers/common/cnxk/roc_mbox.c\n@@ -499,6 +499,7 @@ mbox_id2name(uint16_t id)\n \t\treturn #_name;\n \t\tMBOX_MESSAGES\n \t\tMBOX_UP_CGX_MESSAGES\n+\t\tMBOX_UP_REP_MESSAGES\n #undef M\n \t}\n }\n@@ -514,6 +515,7 @@ mbox_id2size(uint16_t id)\n \t\treturn sizeof(struct _req_type);\n \t\tMBOX_MESSAGES\n \t\tMBOX_UP_CGX_MESSAGES\n+\t\tMBOX_UP_REP_MESSAGES\n #undef M\n \t}\n }\ndiff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h\nindex b76e97e9f9..d28e3ffd70 100644\n--- a/drivers/common/cnxk/roc_mbox.h\n+++ b/drivers/common/cnxk/roc_mbox.h\n@@ -357,9 +357,13 @@ struct mbox_msghdr {\n \n #define MBOX_UP_MCS_MESSAGES M(MCS_INTR_NOTIFY, 0xE00, mcs_intr_notify, mcs_intr_info, msg_rsp)\n \n+#define MBOX_UP_REP_MESSAGES\t\t\t\t\t\t \\\n+M(REP_REPTE_NOTIFY, 0xEF1, rep_repte_notify, rep_repte_req, msg_rsp) \\\n+M(REP_SET_MTU, 0xEF2, rep_set_mtu, rep_mtu, msg_rsp)\n+\n enum {\n #define M(_name, _id, _1, _2, _3) MBOX_MSG_##_name = _id,\n-\tMBOX_MESSAGES MBOX_UP_CGX_MESSAGES MBOX_UP_MCS_MESSAGES\n+\tMBOX_MESSAGES MBOX_UP_CGX_MESSAGES MBOX_UP_MCS_MESSAGES MBOX_UP_REP_MESSAGES\n #undef M\n };\n \n@@ -2799,4 +2803,17 @@ struct nix_spi_to_sa_delete_req {\n \tuint16_t __io hash_index;\n \tuint8_t __io way;\n };\n+\n+struct rep_repte_req {\n+\tstruct mbox_msghdr hdr;\n+\tuint16_t __io repte_pcifunc;\n+\tbool __io enable;\n+};\n+\n+struct rep_mtu {\n+\tstruct mbox_msghdr hdr;\n+\tuint16_t __io rep_pcifunc;\n+\tuint16_t __io rep_id;\n+\tuint16_t __io mtu;\n+};\n #endif /* __ROC_MBOX_H__ */\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex 0331c0fb9d..5dd42c8044 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -87,6 +87,8 @@ INTERNAL {\n \troc_dpi_disable;\n \troc_dpi_enable;\n \troc_error_msg_get;\n+\troc_eswitch_nix_process_repte_notify_cb_register;\n+\troc_eswitch_nix_process_repte_notify_cb_unregister;\n \troc_eswitch_nix_vlan_tpid_set;\n \troc_eswitch_npc_mcam_delete_rule;\n \troc_eswitch_npc_mcam_rx_rule;\n", "prefixes": [ "v5", "11/23" ] }{ "id": 137781, "url": "