Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/6581/?format=api
http://patches.dpdk.org/api/patches/6581/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1437746295-12184-6-git-send-email-konstantin.ananyev@intel.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": "<1437746295-12184-6-git-send-email-konstantin.ananyev@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1437746295-12184-6-git-send-email-konstantin.ananyev@intel.com", "date": "2015-07-24T13:58:15", "name": "[dpdk-dev,PATCHv2,5/5] ixgbe: remove awkward typecasts from ixgbe SSE PMD", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "2e70d39ef1da0504637a8e433c03614f964b5185", "submitter": { "id": 33, "url": "http://patches.dpdk.org/api/people/33/?format=api", "name": "Ananyev, Konstantin", "email": "konstantin.ananyev@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1437746295-12184-6-git-send-email-konstantin.ananyev@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/6581/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/6581/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id A1710C462;\n\tFri, 24 Jul 2015 16:00:12 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 4F3A0C45C\n\tfor <dev@dpdk.org>; Fri, 24 Jul 2015 16:00:10 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP; 24 Jul 2015 07:00:09 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 24 Jul 2015 07:00:08 -0700", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt6OE07fn026797; Fri, 24 Jul 2015 15:00:07 +0100", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t6OE07eR012480;\n\tFri, 24 Jul 2015 15:00:07 +0100", "(from kananye1@localhost)\n\tby sivswdev02.ir.intel.com with id t6OE07ao012476;\n\tFri, 24 Jul 2015 15:00:07 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.15,538,1432623600\"; d=\"scan'208\";a=\"529609285\"", "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 24 Jul 2015 14:58:15 +0100", "Message-Id": "<1437746295-12184-6-git-send-email-konstantin.ananyev@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": [ "<1437746295-12184-1-git-send-email-konstantin.ananyev@intel.com>", "<1437667506-3890-2-git-send-email-bruce.richardson@intel.com>" ], "References": [ "<1437667506-3890-2-git-send-email-bruce.richardson@intel.com>\n\t<1437746295-12184-1-git-send-email-konstantin.ananyev@intel.com>", "<1437667506-3890-2-git-send-email-bruce.richardson@intel.com>" ], "Subject": "[dpdk-dev] [PATCHv2 5/5] ixgbe: remove awkward typecasts from ixgbe\n\tSSE PMD", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The vector/SSE pmd used a different element type for the tx queue sw_ring\nentries. This led to lots of typecasts in the code which required specific\nuse of bracketing, leading to subtle errors.\nFor example, in the original code:\n\ttxe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i];\ninstead needs to be written as:\n\ttxe = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[i];\n\nWe can eliminate this problem, by having two software ring pointers in the\nstructure for the two different element types.\n\nv2 changes:\n- fix remaining wrong typecast.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n drivers/net/ixgbe/ixgbe_rxtx.h | 5 ++++-\n drivers/net/ixgbe/ixgbe_rxtx_vec.c | 22 ++++++++++------------\n 2 files changed, 14 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h\nindex befdc3a..1557438 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx.h\n+++ b/drivers/net/ixgbe/ixgbe_rxtx.h\n@@ -193,7 +193,10 @@ struct ixgbe_tx_queue {\n \t/** TX ring virtual address. */\n \tvolatile union ixgbe_adv_tx_desc *tx_ring;\n \tuint64_t tx_ring_phys_addr; /**< TX ring DMA address. */\n-\tstruct ixgbe_tx_entry *sw_ring; /**< virtual address of SW ring. */\n+\tunion {\n+\t\tstruct ixgbe_tx_entry *sw_ring; /**< address of SW ring for scalar PMD. */\n+\t\tstruct ixgbe_tx_entry_v *sw_ring_v; /**< address of SW ring for vector PMD */\n+\t};\n \tvolatile uint32_t *tdt_reg_addr; /**< Address of TDT register. */\n \tuint16_t nb_tx_desc; /**< number of TX descriptors. */\n \tuint16_t tx_tail; /**< current value of TDT reg. */\ndiff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c\nindex d3da31d..9c5390e 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c\n+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c\n@@ -608,8 +608,7 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq)\n \t * first buffer to free from S/W ring is at index\n \t * tx_next_dd - (tx_rs_thresh-1)\n \t */\n-\ttxep = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[txq->tx_next_dd -\n-\t\t\t(n - 1)];\n+\ttxep = &txq->sw_ring_v[txq->tx_next_dd - (n - 1)];\n \tm = __rte_pktmbuf_prefree_seg(txep[0].mbuf);\n \tif (likely(m != NULL)) {\n \t\tfree[0] = m;\n@@ -678,7 +677,7 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,\n \n \ttx_id = txq->tx_tail;\n \ttxdp = &txq->tx_ring[tx_id];\n-\ttxep = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[tx_id];\n+\ttxep = &txq->sw_ring_v[tx_id];\n \n \ttxq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_pkts);\n \n@@ -699,7 +698,7 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,\n \n \t\t/* avoid reach the end of ring */\n \t\ttxdp = &(txq->tx_ring[tx_id]);\n-\t\ttxep = &(((struct ixgbe_tx_entry_v *)txq->sw_ring)[tx_id]);\n+\t\ttxep = &txq->sw_ring_v[tx_id];\n \t}\n \n \ttx_backlog_entry(txep, tx_pkts, nb_commit);\n@@ -735,14 +734,14 @@ ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)\n \tfor (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1);\n \t i != txq->tx_tail;\n \t i = (i + 1) & max_desc) {\n-\t\ttxe = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[i];\n+\t\ttxe = &txq->sw_ring_v[i];\n \t\trte_pktmbuf_free_seg(txe->mbuf);\n \t}\n \ttxq->nb_tx_free = max_desc;\n \n \t/* reset tx_entry */\n \tfor (i = 0; i < txq->nb_tx_desc; i++) {\n-\t\ttxe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i];\n+\t\ttxe = &txq->sw_ring_v[i];\n \t\ttxe->mbuf = NULL;\n \t}\n }\n@@ -772,8 +771,8 @@ ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)\n \t\treturn;\n \n \tif (txq->sw_ring != NULL) {\n-\t\trte_free((struct ixgbe_rx_entry *)txq->sw_ring - 1);\n-\t\ttxq->sw_ring = NULL;\n+\t\trte_free(txq->sw_ring_v - 1);\n+\t\ttxq->sw_ring_v = NULL;\n \t}\n }\n \n@@ -781,7 +780,7 @@ static void __attribute__((cold))\n ixgbe_reset_tx_queue(struct ixgbe_tx_queue *txq)\n {\n \tstatic const union ixgbe_adv_tx_desc zeroed_desc = {{0}};\n-\tstruct ixgbe_tx_entry_v *txe = (struct ixgbe_tx_entry_v *)txq->sw_ring;\n+\tstruct ixgbe_tx_entry_v *txe = txq->sw_ring_v;\n \tuint16_t i;\n \n \t/* Zero out HW ring memory */\n@@ -838,12 +837,11 @@ ixgbe_rxq_vec_setup(struct ixgbe_rx_queue *rxq)\n int __attribute__((cold))\n ixgbe_txq_vec_setup(struct ixgbe_tx_queue *txq)\n {\n-\tif (txq->sw_ring == NULL)\n+\tif (txq->sw_ring_v == NULL)\n \t\treturn -1;\n \n \t/* leave the first one for overflow */\n-\ttxq->sw_ring = (struct ixgbe_tx_entry *)\n-\t\t((struct ixgbe_tx_entry_v *)txq->sw_ring + 1);\n+\ttxq->sw_ring_v = txq->sw_ring_v + 1;\n \ttxq->ops = &vec_txq_ops;\n \n \treturn 0;\n", "prefixes": [ "dpdk-dev", "PATCHv2", "5/5" ] }{ "id": 6581, "url": "