Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75922/?format=api
http://patchwork.dpdk.org/api/patches/75922/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200825115305.58490-2-huwei013@chinasoftinc.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": "<20200825115305.58490-2-huwei013@chinasoftinc.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200825115305.58490-2-huwei013@chinasoftinc.com", "date": "2020-08-25T11:52:55", "name": "[01/11] net/hns3: get device capability from firmware", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "920bbe5f2049eb29c772cc9e0e245d3db19accc2", "submitter": { "id": 1537, "url": "http://patchwork.dpdk.org/api/people/1537/?format=api", "name": "Wei Hu (Xavier)", "email": "huwei013@chinasoftinc.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/20200825115305.58490-2-huwei013@chinasoftinc.com/mbox/", "series": [ { "id": 11778, "url": "http://patchwork.dpdk.org/api/series/11778/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=11778", "date": "2020-08-25T11:52:54", "name": "updates for hns3 PMD driver", "version": 1, "mbox": "http://patchwork.dpdk.org/series/11778/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/75922/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/75922/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 5FAE8A04B1;\n\tTue, 25 Aug 2020 13:53:35 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C6B9E1C1AE;\n\tTue, 25 Aug 2020 13:53:30 +0200 (CEST)", "from mail.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 735F8E07\n for <dev@dpdk.org>; Tue, 25 Aug 2020 13:53:26 +0200 (CEST)", "from localhost.localdomain (65.49.108.226) by INCCAS002.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 25 Aug 2020\n 19:53:19 +0800" ], "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>", "To": "<dev@dpdk.org>", "CC": "<ferruh.yigit@intel.com>, <xavier.huwei@huawei.com>", "Date": "Tue, 25 Aug 2020 19:52:55 +0800", "Message-ID": "<20200825115305.58490-2-huwei013@chinasoftinc.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200825115305.58490-1-huwei013@chinasoftinc.com>", "References": "<20200825115305.58490-1-huwei013@chinasoftinc.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[65.49.108.226]", "Subject": "[dpdk-dev] [PATCH 01/11] net/hns3: get device capability from\n\tfirmware", "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: \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>\n\nThis patch adds getting device capabilities from firmware, so driver can\nsupply differnet cpabilities and specifications to upper level\napplications base on differnet versions of hardware network engine.\n\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_cmd.c | 36 ++++++++++++++++++++++++++++------\n drivers/net/hns3/hns3_cmd.h | 19 +++++++++++++++++-\n drivers/net/hns3/hns3_ethdev.c | 3 ---\n drivers/net/hns3/hns3_ethdev.h | 29 +++++++++++++++++++++++++++\n 4 files changed, 77 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c\nindex cbb09887c..0299072ef 100644\n--- a/drivers/net/hns3/hns3_cmd.c\n+++ b/drivers/net/hns3/hns3_cmd.c\n@@ -426,8 +426,29 @@ hns3_cmd_send(struct hns3_hw *hw, struct hns3_cmd_desc *desc, int num)\n \treturn retval;\n }\n \n+static void hns3_parse_capability(struct hns3_hw *hw,\n+\t\t\t\t struct hns3_query_version_cmd *cmd)\n+{\n+\tuint32_t caps = rte_le_to_cpu_32(cmd->caps[0]);\n+\n+\tif (hns3_get_bit(caps, HNS3_CAPS_UDP_GSO_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_UDP_GSO_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_ADQ_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_ADQ_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_PTP_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_PTP_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TX_PUSH_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_PHY_IMP_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_TQP_TXRX_INDEP_B))\n+\t\thns3_set_bit(hw->capability, HNS3_CAPS_TQP_TXRX_INDEP_B, 1);\n+\tif (hns3_get_bit(caps, HNS3_CAPS_STASH_B))\n+\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_STASH_B, 1);\n+}\n+\n static enum hns3_cmd_status\n-hns3_cmd_query_firmware_version(struct hns3_hw *hw, uint32_t *version)\n+hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)\n {\n \tstruct hns3_query_version_cmd *resp;\n \tstruct hns3_cmd_desc desc;\n@@ -438,10 +459,13 @@ hns3_cmd_query_firmware_version(struct hns3_hw *hw, uint32_t *version)\n \n \t/* Initialize the cmd function */\n \tret = hns3_cmd_send(hw, &desc, 1);\n-\tif (ret == 0)\n-\t\t*version = rte_le_to_cpu_32(resp->firmware);\n+\tif (ret)\n+\t\treturn ret;\n \n-\treturn ret;\n+\thw->fw_version = rte_le_to_cpu_32(resp->firmware);\n+\thns3_parse_capability(hw, resp);\n+\n+\treturn 0;\n }\n \n int\n@@ -519,13 +543,13 @@ hns3_cmd_init(struct hns3_hw *hw)\n \t}\n \trte_atomic16_clear(&hw->reset.disable_cmd);\n \n-\tret = hns3_cmd_query_firmware_version(hw, &version);\n+\tret = hns3_cmd_query_firmware_version_and_capability(hw);\n \tif (ret) {\n \t\tPMD_INIT_LOG(ERR, \"firmware version query failed %d\", ret);\n \t\tgoto err_cmd_init;\n \t}\n \n-\thw->fw_version = version;\n+\tversion = hw->fw_version;\n \tPMD_INIT_LOG(INFO, \"The firmware version is %lu.%lu.%lu.%lu\",\n \t\t hns3_get_field(version, HNS3_FW_VERSION_BYTE3_M,\n \t\t\t\t HNS3_FW_VERSION_BYTE3_S),\ndiff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex d70f42e5d..a13b799f4 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -264,9 +264,26 @@ struct hns3_rx_priv_buff_cmd {\n #define HNS3_FW_VERSION_BYTE1_M\t\tGENMASK(15, 8)\n #define HNS3_FW_VERSION_BYTE0_S\t\t0\n #define HNS3_FW_VERSION_BYTE0_M\t\tGENMASK(7, 0)\n+\n+enum HNS3_CAPS_BITS {\n+\tHNS3_CAPS_UDP_GSO_B,\n+\tHNS3_CAPS_ATR_B,\n+\tHNS3_CAPS_ADQ_B,\n+\tHNS3_CAPS_PTP_B,\n+\tHNS3_CAPS_INT_QL_B,\n+\tHNS3_CAPS_SIMPLE_BD_B,\n+\tHNS3_CAPS_TX_PUSH_B,\n+\tHNS3_CAPS_PHY_IMP_B,\n+\tHNS3_CAPS_TQP_TXRX_INDEP_B,\n+\tHNS3_CAPS_HW_PAD_B,\n+\tHNS3_CAPS_STASH_B,\n+};\n+#define HNS3_QUERY_CAP_LENGTH\t\t3\n struct hns3_query_version_cmd {\n \tuint32_t firmware;\n-\tuint32_t firmware_rsv[5];\n+\tuint32_t hardware;\n+\tuint32_t rsv;\n+\tuint32_t caps[HNS3_QUERY_CAP_LENGTH]; /* capabilities of device */\n };\n \n #define HNS3_RX_PRIV_EN_B\t15\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex fab1914c3..44fd69fa1 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2837,9 +2837,6 @@ hns3_get_capability(struct hns3_hw *hw)\n \t}\n \thw->revision = revision;\n \n-\tif (revision >= PCI_REVISION_ID_HIP09_A)\n-\t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);\n-\n \treturn 0;\n }\n \ndiff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h\nindex 0e665e59b..1914e588d 100644\n--- a/drivers/net/hns3/hns3_ethdev.h\n+++ b/drivers/net/hns3/hns3_ethdev.h\n@@ -535,13 +535,42 @@ struct hns3_adapter {\n \n #define HNS3_DEV_SUPPORT_DCB_B\t\t\t0x0\n #define HNS3_DEV_SUPPORT_COPPER_B\t\t0x1\n+#define HNS3_DEV_SUPPORT_UDP_GSO_B\t\t0x2\n+#define HNS3_DEV_SUPPORT_ADQ_B\t\t\t0x3\n+#define HNS3_DEV_SUPPORT_PTP_B\t\t\t0x4\n+#define HNS3_DEV_SUPPORT_TX_PUSH_B\t\t0x5\n+#define HNS3_DEV_SUPPORT_INDEP_TXRX_B\t\t0x6\n+#define HNS3_DEV_SUPPORT_STASH_B\t\t0x7\n \n #define hns3_dev_dcb_supported(hw) \\\n \thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_DCB_B)\n \n+/* Support copper media type */\n #define hns3_dev_copper_supported(hw) \\\n \thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_COPPER_B)\n \n+/* Support UDP GSO offload */\n+#define hns3_dev_udp_gso_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_UDP_GSO_B)\n+\n+/* Support Application Device Queue */\n+#define hns3_dev_adq_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_ADQ_B)\n+\n+/* Support PTP timestamp offload */\n+#define hns3_dev_ptp_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_PTP_B)\n+\n+#define hns3_dev_tx_push_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_TX_PUSH_B)\n+\n+/* Support to Independently enable/disable/reset Tx or Rx queues */\n+#define hns3_dev_indep_txrx_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_INDEP_TXRX_B)\n+\n+#define hns3_dev_stash_supported(hw) \\\n+\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_STASH_B)\n+\n #define HNS3_DEV_PRIVATE_TO_HW(adapter) \\\n \t(&((struct hns3_adapter *)adapter)->hw)\n #define HNS3_DEV_PRIVATE_TO_ADAPTER(adapter) \\\n", "prefixes": [ "01/11" ] }{ "id": 75922, "url": "