Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/140158/?format=api
http://patchwork.dpdk.org/api/patches/140158/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240517063152.1567603-1-shaiq.wani@intel.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": "<20240517063152.1567603-1-shaiq.wani@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240517063152.1567603-1-shaiq.wani@intel.com", "date": "2024-05-17T06:31:52", "name": "net/cpfl: get running host ID", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "05d7719e9549cd3df0502b10b4d99032b78c6306", "submitter": { "id": 3327, "url": "http://patchwork.dpdk.org/api/people/3327/?format=api", "name": "Shaiq Wani", "email": "shaiq.wani@intel.com" }, "delegate": { "id": 10, "url": "http://patchwork.dpdk.org/api/users/10/?format=api", "username": "bruce", "first_name": "Bruce", "last_name": "Richardson", "email": "bruce.richardson@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240517063152.1567603-1-shaiq.wani@intel.com/mbox/", "series": [ { "id": 31941, "url": "http://patchwork.dpdk.org/api/series/31941/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31941", "date": "2024-05-17T06:31:52", "name": "net/cpfl: get running host ID", "version": 1, "mbox": "http://patchwork.dpdk.org/series/31941/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/140158/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/140158/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 635BD44048;\n\tFri, 17 May 2024 08:32:29 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EDE324029E;\n\tFri, 17 May 2024 08:32:28 +0200 (CEST)", "from mgamail.intel.com (mgamail.intel.com [192.198.163.18])\n by mails.dpdk.org (Postfix) with ESMTP id E24164029B\n for <dev@dpdk.org>; Fri, 17 May 2024 08:32:26 +0200 (CEST)", "from orviesa005.jf.intel.com ([10.64.159.145])\n by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 May 2024 23:32:26 -0700", "from unknown (HELO srv24.iind.intel.com) ([10.138.167.40])\n by orviesa005.jf.intel.com with ESMTP; 16 May 2024 23:32:25 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1715927547; x=1747463547;\n h=from:to:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=tX4/q7mLWiIlKZg31PCRBqnzzteuQpLY6LjSZKIGw8Q=;\n b=VLzZUZ9JXke3Jc2YwXY9QOQlIEDONeT9VY5hdLe/l62XkHQrGPBfugFw\n wLD9r2HjUeg0VtuLy77GnpbGqOTN4qyTqY5EDjxyZAjolCIe0JoTp/2zi\n iPPu7RdhsiSniFYJiKccVX6LT3Mx6M1w+2ReVeP5AzW1HTQpq5N3zuLWj\n Thvr8eXIKmgnbhCfa2MgGf5de12UL3ius22wtIFdd4o67LsLtDeR5HBjw\n UzfyFzBDO0gmRGbFe8UYOtscVjn0vCyAMpK/hJhLh6StaHtwIbq6nQK29\n nNnZT2yonDKBdvEJk3DlSr+OtwKHtVcocbQ8FKUKTOJs+SwscXg0O/fvW g==;", "X-CSE-ConnectionGUID": [ "WABgBjEzQZ++07KuP3QySQ==", "T9aB0WJiTwyNasGa11HzIw==" ], "X-CSE-MsgGUID": [ "dpuhFPAFQXCPeHOsD0TqdA==", "GRKtnFyZQxy4keEgsCO1IA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,11074\"; a=\"11891783\"", "E=Sophos;i=\"6.08,166,1712646000\"; d=\"scan'208\";a=\"11891783\"", "E=Sophos;i=\"6.08,166,1712646000\"; d=\"scan'208\";a=\"36487177\"" ], "X-ExtLoop1": "1", "From": "Shaiq Wani <shaiq.wani@intel.com>", "To": "dev@dpdk.org", "Subject": "[PATCH] net/cpfl: get running host ID", "Date": "Fri, 17 May 2024 06:31:52 +0000", "Message-Id": "<20240517063152.1567603-1-shaiq.wani@intel.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Check whether CPFL PMD runs on host IMC or ACC\n\nSigned-off-by: Shaiq Wani <shaiq.wani@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.c | 25 +++++++++++++++++++++++++\n drivers/net/cpfl/cpfl_ethdev.h | 6 +++++-\n 2 files changed, 30 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex ef19aa1b6a..ed719ee474 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -2269,8 +2269,32 @@ cpfl_repr_allowlist_uninit(struct cpfl_adapter_ext *adapter)\n {\n \trte_hash_free(adapter->repr_allowlist_hash);\n }\n+static uint8_t\n+get_running_host_id(void)\n+{\n+\tchar buf[BUFSIZ];\n+\tFILE *fd;\n+\tuint8_t host_id = CPFL_INVALID_HOST_ID;\n+\n+\tfd = fopen(\"/etc/issue.net\", \"r\");\n+\tif (fd == NULL) {\n+\t\tPMD_INIT_LOG(ERR, \"Cannot open /etc/issue.net\\n\");\n+\t\treturn host_id;\n+\t}\n \n+\tif (fgets(buf, sizeof(buf), fd)) {\n+\t\t/* get the first line */\n+\t\tif (strstr(buf, \"IMC\"))\n+\t\t\tPMD_INIT_LOG(ERR, \"CPFL PMD cannot running on IMC.\");\n+\t\telse if (strstr(buf, \"ACC\"))\n+\t\t\thost_id = CPFL_HOST_ID_ACC;\n+\t\telse\n+\t\t\thost_id = CPFL_HOST_ID_HOST;\n+\t}\n \n+\tfclose(fd);\n+\treturn host_id;\n+}\n static int\n cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adapter,\n \t\t struct cpfl_devargs *devargs)\n@@ -2289,6 +2313,7 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a\n \thw->vendor_id = pci_dev->id.vendor_id;\n \thw->device_id = pci_dev->id.device_id;\n \thw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;\n+\tadapter->host_id = get_running_host_id();\n \n \tstrncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);\n \ndiff --git a/drivers/net/cpfl/cpfl_ethdev.h b/drivers/net/cpfl/cpfl_ethdev.h\nindex 457db6d6be..9dd8e2ba41 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.h\n+++ b/drivers/net/cpfl/cpfl_ethdev.h\n@@ -66,6 +66,7 @@\n #define CPFL_PF_TYPE_NUM\t2\n #define CPFL_HOST_ID_HOST\t0\n #define CPFL_HOST_ID_ACC\t1\n+#define CPFL_INVALID_HOST_ID UINT8_MAX\n #define CPFL_PF_TYPE_APF\t0\n #define CPFL_PF_TYPE_CPF\t1\n \n@@ -230,6 +231,8 @@ struct cpfl_adapter_ext {\n \tuint8_t ctrl_vport_recv_info[IDPF_DFLT_MBX_BUF_SIZE];\n \tstruct idpf_ctlq_info *ctlqp[CPFL_CFGQ_NUM];\n \tstruct cpfl_ctlq_create_info cfgq_info[CPFL_CFGQ_NUM];\n+\n+\tuint8_t host_id;\n };\n \n TAILQ_HEAD(cpfl_adapter_list, cpfl_adapter_ext);\n@@ -296,7 +299,8 @@ cpfl_get_vsi_id(struct cpfl_itf *itf)\n \n \t\tvport_identity.func_type = CPCHNL2_FTYPE_LAN_PF;\n \t\t/* host: CPFL_HOST0_CPF_ID, acc: CPFL_ACC_CPF_ID */\n-\t\tvport_identity.pf_id = CPFL_ACC_CPF_ID;\n+\t\tvport_identity.pf_id = (itf->adapter->host_id == CPFL_HOST_ID_ACC) ?\n+\t\t\t\t\t\t\t\tCPFL_ACC_CPF_ID : CPFL_HOST0_CPF_ID;\n \t\tvport_identity.vf_id = 0;\n \t\tvport_identity.vport_id = vport_id;\n \t\tret = rte_hash_lookup_data(itf->adapter->vport_map_hash,\n", "prefixes": [] }{ "id": 140158, "url": "