Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/72612/?format=api
https://patches.dpdk.org/api/patches/72612/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1593604482-47494-4-git-send-email-xavier.huwei@huawei.com/", "project": { "id": 1, "url": "https://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": "<1593604482-47494-4-git-send-email-xavier.huwei@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1593604482-47494-4-git-send-email-xavier.huwei@huawei.com", "date": "2020-07-01T11:54:35", "name": "[03/10] net/hns3: decrease non-nearby memory access in Rx", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9539034ceafe6c58bf994c97f9ab82d254da529e", "submitter": { "id": 1405, "url": "https://patches.dpdk.org/api/people/1405/?format=api", "name": "Wei Hu (Xavier)", "email": "xavier.huwei@huawei.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1593604482-47494-4-git-send-email-xavier.huwei@huawei.com/mbox/", "series": [ { "id": 10710, "url": "https://patches.dpdk.org/api/series/10710/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10710", "date": "2020-07-01T11:54:33", "name": "misc updates for hns3 PMD driver", "version": 1, "mbox": "https://patches.dpdk.org/series/10710/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/72612/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/72612/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 76974A0350;\n\tWed, 1 Jul 2020 13:58:03 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 382051D531;\n\tWed, 1 Jul 2020 13:56:44 +0200 (CEST)", "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 5C2951D423\n for <dev@dpdk.org>; Wed, 1 Jul 2020 13:56:35 +0200 (CEST)", "from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60])\n by Forcepoint Email with ESMTP id 2EE59D52EC871C8FF89A\n for <dev@dpdk.org>; Wed, 1 Jul 2020 19:56:32 +0800 (CST)", "from localhost.localdomain (10.69.192.56) by\n DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id\n 14.3.487.0; Wed, 1 Jul 2020 19:56:21 +0800" ], "From": "\"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<xavier.huwei@huawei.com>", "Date": "Wed, 1 Jul 2020 19:54:35 +0800", "Message-ID": "<1593604482-47494-4-git-send-email-xavier.huwei@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1593604482-47494-1-git-send-email-xavier.huwei@huawei.com>", "References": "<1593604482-47494-1-git-send-email-xavier.huwei@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.69.192.56]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH 03/10] net/hns3: decrease non-nearby memory\n\taccess in Rx", "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: Chengchang Tang <tangchengchang@huawei.com>\n\nCurrently, hns3 PMD driver needs know the PVID configuration state and\ndo different processing in the 'rx_pkt_burst' ops implementation\nfunction.\n\nThis patch adds a member to struct hns3_rx_queue/hns3_tx_queue of the\ndriver to indicate the PVID configuration status, so it isn't need\nto access other data structure in the 'rx_pkt_burst' ops implementation,\nto avoid performance loss because of reducing cache miss.\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c | 21 ++++++++++++++++++++-\n drivers/net/hns3/hns3_rxtx.c | 37 +++++++++++++++++++++++++++++++------\n drivers/net/hns3/hns3_rxtx.h | 13 +++++++++++++\n 3 files changed, 64 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 7758855..926efce 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -908,6 +908,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)\n {\n \tstruct hns3_adapter *hns = dev->data->dev_private;\n \tstruct hns3_hw *hw = &hns->hw;\n+\tbool pvid_en_state_change;\n+\tuint16_t pvid_state;\n \tint ret;\n \n \tif (pvid > RTE_ETHER_MAX_VLAN_ID) {\n@@ -916,10 +918,27 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)\n \t\treturn -EINVAL;\n \t}\n \n+\t/*\n+\t * If PVID configuration state change, should refresh the PVID\n+\t * configuration state in struct hns3_tx_queue/hns3_rx_queue.\n+\t */\n+\tpvid_state = hw->port_base_vlan_cfg.state;\n+\tif ((on && pvid_state == HNS3_PORT_BASE_VLAN_ENABLE) ||\n+\t (!on && pvid_state == HNS3_PORT_BASE_VLAN_DISABLE))\n+\t\tpvid_en_state_change = false;\n+\telse\n+\t\tpvid_en_state_change = true;\n+\n \trte_spinlock_lock(&hw->lock);\n \tret = hns3_vlan_pvid_configure(hns, pvid, on);\n \trte_spinlock_unlock(&hw->lock);\n-\treturn ret;\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (pvid_en_state_change)\n+\t\thns3_update_all_queues_pvid_state(hw);\n+\n+\treturn 0;\n }\n \n static void\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 4e3391d..d744d85 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -316,6 +316,31 @@ hns3_init_tx_queue_hw(struct hns3_tx_queue *txq)\n }\n \n void\n+hns3_update_all_queues_pvid_state(struct hns3_hw *hw)\n+{\n+\tuint16_t nb_rx_q = hw->data->nb_rx_queues;\n+\tuint16_t nb_tx_q = hw->data->nb_tx_queues;\n+\tstruct hns3_rx_queue *rxq;\n+\tstruct hns3_tx_queue *txq;\n+\tint pvid_state;\n+\tint i;\n+\n+\tpvid_state = hw->port_base_vlan_cfg.state;\n+\tfor (i = 0; i < hw->cfg_max_queues; i++) {\n+\t\tif (i < nb_rx_q) {\n+\t\t\trxq = hw->data->rx_queues[i];\n+\t\t\tif (rxq != NULL)\n+\t\t\t\trxq->pvid_state = pvid_state;\n+\t\t}\n+\t\tif (i < nb_tx_q) {\n+\t\t\ttxq = hw->data->tx_queues[i];\n+\t\t\tif (txq != NULL)\n+\t\t\t\ttxq->pvid_state = pvid_state;\n+\t\t}\n+\t}\n+}\n+\n+void\n hns3_enable_all_queues(struct hns3_hw *hw, bool en)\n {\n \tuint16_t nb_rx_q = hw->data->nb_rx_queues;\n@@ -1223,6 +1248,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \trxq->pkt_first_seg = NULL;\n \trxq->pkt_last_seg = NULL;\n \trxq->port_id = dev->data->port_id;\n+\trxq->pvid_state = hw->port_base_vlan_cfg.state;\n \trxq->configured = true;\n \trxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +\n \t\t\t\tidx * HNS3_TQP_REG_SIZE);\n@@ -1451,7 +1477,7 @@ hns3_rx_set_cksum_flag(struct rte_mbuf *rxm, uint64_t packet_type,\n }\n \n static inline void\n-hns3_rxd_to_vlan_tci(struct rte_eth_dev *dev, struct rte_mbuf *mb,\n+hns3_rxd_to_vlan_tci(struct hns3_rx_queue *rxq, struct rte_mbuf *mb,\n \t\t uint32_t l234_info, const struct hns3_desc *rxd)\n {\n #define HNS3_STRP_STATUS_NUM\t\t0x4\n@@ -1459,8 +1485,6 @@ hns3_rxd_to_vlan_tci(struct rte_eth_dev *dev, struct rte_mbuf *mb,\n #define HNS3_NO_STRP_VLAN_VLD\t\t0x0\n #define HNS3_INNER_STRP_VLAN_VLD\t0x1\n #define HNS3_OUTER_STRP_VLAN_VLD\t0x2\n-\tstruct hns3_adapter *hns = dev->data->dev_private;\n-\tstruct hns3_hw *hw = &hns->hw;\n \tuint32_t strip_status;\n \tuint32_t report_mode;\n \n@@ -1486,7 +1510,7 @@ hns3_rxd_to_vlan_tci(struct rte_eth_dev *dev, struct rte_mbuf *mb,\n \t};\n \tstrip_status = hns3_get_field(l234_info, HNS3_RXD_STRP_TAGP_M,\n \t\t\t\t HNS3_RXD_STRP_TAGP_S);\n-\treport_mode = report_type[hw->port_base_vlan_cfg.state][strip_status];\n+\treport_mode = report_type[rxq->pvid_state][strip_status];\n \tswitch (report_mode) {\n \tcase HNS3_NO_STRP_VLAN_VLD:\n \t\tmb->vlan_tci = 0;\n@@ -1532,7 +1556,6 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \tnb_rx = 0;\n \tnb_rx_bd = 0;\n \trxq = rx_queue;\n-\tdev = &rte_eth_devices[rxq->port_id];\n \n \trx_id = rxq->next_to_clean;\n \trx_ring = rxq->rx_ring;\n@@ -1609,6 +1632,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \n \t\tnmb = rte_mbuf_raw_alloc(rxq->mb_pool);\n \t\tif (unlikely(nmb == NULL)) {\n+\t\t\tdev = &rte_eth_devices[rxq->port_id];\n \t\t\tdev->data->rx_mbuf_alloc_failed++;\n \t\t\tbreak;\n \t\t}\n@@ -1685,7 +1709,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \t\t\thns3_rx_set_cksum_flag(first_seg,\n \t\t\t\t\t first_seg->packet_type,\n \t\t\t\t\t cksum_err);\n-\t\thns3_rxd_to_vlan_tci(dev, first_seg, l234_info, &rxd);\n+\t\thns3_rxd_to_vlan_tci(rxq, first_seg, l234_info, &rxd);\n \n \t\trx_pkts[nb_rx++] = first_seg;\n \t\tfirst_seg = NULL;\n@@ -1763,6 +1787,7 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \ttxq->next_to_clean = 0;\n \ttxq->tx_bd_ready = txq->nb_tx_desc - 1;\n \ttxq->port_id = dev->data->port_id;\n+\ttxq->pvid_state = hw->port_base_vlan_cfg.state;\n \ttxq->configured = true;\n \ttxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +\n \t\t\t\tidx * HNS3_TQP_REG_SIZE);\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 380d27b..b85c64f 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -242,6 +242,12 @@ struct hns3_rx_queue {\n \tuint16_t rx_buf_len;\n \tuint16_t rx_free_thresh;\n \n+\t/*\n+\t * port based vlan configuration state.\n+\t * value range: HNS3_PORT_BASE_VLAN_DISABLE / HNS3_PORT_BASE_VLAN_ENABLE\n+\t */\n+\tuint16_t pvid_state;\n+\n \tbool rx_deferred_start; /* don't start this queue in dev start */\n \tbool configured; /* indicate if rx queue has been configured */\n \n@@ -268,6 +274,12 @@ struct hns3_tx_queue {\n \tuint16_t next_to_use;\n \tuint16_t tx_bd_ready;\n \n+\t/*\n+\t * port based vlan configuration state.\n+\t * value range: HNS3_PORT_BASE_VLAN_DISABLE / HNS3_PORT_BASE_VLAN_ENABLE\n+\t */\n+\tuint16_t pvid_state;\n+\n \tbool tx_deferred_start; /* don't start this queue in dev start */\n \tbool configured; /* indicate if tx queue has been configured */\n \n@@ -378,5 +390,6 @@ int hns3_set_fake_rx_or_tx_queues(struct rte_eth_dev *dev, uint16_t nb_rx_q,\n \t\t\t\t uint16_t nb_tx_q);\n int hns3_config_gro(struct hns3_hw *hw, bool en);\n int hns3_restore_gro_conf(struct hns3_hw *hw);\n+void hns3_update_all_queues_pvid_state(struct hns3_hw *hw);\n \n #endif /* _HNS3_RXTX_H_ */\n", "prefixes": [ "03/10" ] }{ "id": 72612, "url": "