Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/737545/?format=api
{ "id": 737545, "url": "http://patchwork.ozlabs.org/api/patches/737545/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1489177325-13156-2-git-send-email-bimmy.pujari@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1489177325-13156-2-git-send-email-bimmy.pujari@intel.com>", "list_archive_url": null, "date": "2017-03-10T20:22:00", "name": "[next,S62,1/6] i40evf: enforce descriptor write-back mechanism for VF", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "fe94867bec069df62587f3ac66ea92088fb6fd56", "submitter": { "id": 68919, "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api", "name": "Pujari, Bimmy", "email": "bimmy.pujari@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1489177325-13156-2-git-send-email-bimmy.pujari@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/737545/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/737545/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vfxyr2b2lz9s7x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 11 Mar 2017 06:24:20 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9BC5C89D9E;\n\tFri, 10 Mar 2017 19:24:18 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id w8IM2XZKN-TJ; Fri, 10 Mar 2017 19:24:16 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 422C889DA2;\n\tFri, 10 Mar 2017 19:24:16 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5E30D1C0169\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Mar 2017 19:24:15 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5A55789CBD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Mar 2017 19:24:15 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id djInJwILpaIr for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Mar 2017 19:24:14 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 01DF789CA1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Mar 2017 19:24:13 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Mar 2017 11:24:12 -0800", "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([10.166.35.87])\n\tby orsmga001.jf.intel.com with ESMTP; 10 Mar 2017 11:24:12 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.36,142,1486454400\"; d=\"scan'208\";\n\ta=\"1107116165\"", "From": "Bimmy Pujari <bimmy.pujari@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 10 Mar 2017 12:22:00 -0800", "Message-Id": "<1489177325-13156-2-git-send-email-bimmy.pujari@intel.com>", "X-Mailer": "git-send-email 2.4.11", "In-Reply-To": "<1489177325-13156-1-git-send-email-bimmy.pujari@intel.com>", "References": "<1489177325-13156-1-git-send-email-bimmy.pujari@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S62 1/6] i40evf: enforce descriptor\n\twrite-back mechanism for VF", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "From: Preethi Banala <preethi.banala@intel.com>\n\nThe current driver mode is to use a write-back mechanism for the head\nregister which indicates transmit completions. The VF driver needs to be\nable to work on hardware that exclusively uses descriptor write-back, so\nchange the default driver mode of operation to descriptor write-back for\nVF. In our analysis, performance wasn't significantly different with\neither write-back method.\n\nTesting Hints:\n1) load PF driver in host\n2) create two VMs and load VF driver in both\n3) create SRIOV VFs in host and direct attach one VF to each VM\n4) Assign ip address in the same subnet for both VFs.\n5) Use iperf to send TCP/UDP traffic.\n\nSigned-off-by: Preethi Banala <preethi.banala@intel.com>\nChange-ID: Ia92e4ec77c2df8dc4515c71d53746d57d77759af\n---\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 64 +++-------------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 14 -----\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 4 --\n 3 files changed, 7 insertions(+), 75 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 8915c55..f1a99a8 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -137,10 +137,7 @@ u32 i40evf_get_tx_pending(struct i40e_ring *ring, bool in_sw)\n {\n \tu32 head, tail;\n \n-\tif (!in_sw)\n-\t\thead = i40e_get_head(ring);\n-\telse\n-\t\thead = ring->next_to_clean;\n+\thead = ring->next_to_clean;\n \ttail = readl(ring->tail);\n \n \tif (head != tail)\n@@ -165,7 +162,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n {\n \tu16 i = tx_ring->next_to_clean;\n \tstruct i40e_tx_buffer *tx_buf;\n-\tstruct i40e_tx_desc *tx_head;\n \tstruct i40e_tx_desc *tx_desc;\n \tunsigned int total_bytes = 0, total_packets = 0;\n \tunsigned int budget = vsi->work_limit;\n@@ -174,8 +170,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \ttx_desc = I40E_TX_DESC(tx_ring, i);\n \ti -= tx_ring->count;\n \n-\ttx_head = I40E_TX_DESC(tx_ring, i40e_get_head(tx_ring));\n-\n \tdo {\n \t\tstruct i40e_tx_desc *eop_desc = tx_buf->next_to_watch;\n \n@@ -186,8 +180,9 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\t/* prevent any other reads prior to eop_desc */\n \t\tread_barrier_depends();\n \n-\t\t/* we have caught up to head, no work left to do */\n-\t\tif (tx_head == tx_desc)\n+\t\t/* if the descriptor isn't done, no work yet to do */\n+\t\tif (!(eop_desc->cmd_type_offset_bsz &\n+\t\t cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))\n \t\t\tbreak;\n \n \t\t/* clear next_to_watch to prevent false hangs */\n@@ -464,10 +459,6 @@ int i40evf_setup_tx_descriptors(struct i40e_ring *tx_ring)\n \n \t/* round up to nearest 4K */\n \ttx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);\n-\t/* add u32 for head writeback, align after this takes care of\n-\t * guaranteeing this is at least one cache line in size\n-\t */\n-\ttx_ring->size += sizeof(u32);\n \ttx_ring->size = ALIGN(tx_ring->size, 4096);\n \ttx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,\n \t\t\t\t\t &tx_ring->dma, GFP_KERNEL);\n@@ -2012,7 +2003,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tu16 i = tx_ring->next_to_use;\n \tu32 td_tag = 0;\n \tdma_addr_t dma;\n-\tu16 desc_count = 1;\n \n \tif (tx_flags & I40E_TX_FLAGS_HW_VLAN) {\n \t\ttd_cmd |= I40E_TX_DESC_CMD_IL2TAG1;\n@@ -2048,7 +2038,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \n \t\t\ttx_desc++;\n \t\t\ti++;\n-\t\t\tdesc_count++;\n \n \t\t\tif (i == tx_ring->count) {\n \t\t\t\ttx_desc = I40E_TX_DESC(tx_ring, 0);\n@@ -2070,7 +2059,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \n \t\ttx_desc++;\n \t\ti++;\n-\t\tdesc_count++;\n \n \t\tif (i == tx_ring->count) {\n \t\t\ttx_desc = I40E_TX_DESC(tx_ring, 0);\n@@ -2096,46 +2084,8 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \n \ti40e_maybe_stop_tx(tx_ring, DESC_NEEDED);\n \n-\t/* write last descriptor with EOP bit */\n-\ttd_cmd |= I40E_TX_DESC_CMD_EOP;\n-\n-\t/* We can OR these values together as they both are checked against\n-\t * 4 below and at this point desc_count will be used as a boolean value\n-\t * after this if/else block.\n-\t */\n-\tdesc_count |= ++tx_ring->packet_stride;\n-\n-\t/* Algorithm to optimize tail and RS bit setting:\n-\t * if queue is stopped\n-\t *\tmark RS bit\n-\t *\treset packet counter\n-\t * else if xmit_more is supported and is true\n-\t *\tadvance packet counter to 4\n-\t *\treset desc_count to 0\n-\t *\n-\t * if desc_count >= 4\n-\t *\tmark RS bit\n-\t *\treset packet counter\n-\t * if desc_count > 0\n-\t *\tupdate tail\n-\t *\n-\t * Note: If there are less than 4 descriptors\n-\t * pending and interrupts were disabled the service task will\n-\t * trigger a force WB.\n-\t */\n-\tif (netif_xmit_stopped(txring_txq(tx_ring))) {\n-\t\tgoto do_rs;\n-\t} else if (skb->xmit_more) {\n-\t\t/* set stride to arm on next packet and reset desc_count */\n-\t\ttx_ring->packet_stride = WB_STRIDE;\n-\t\tdesc_count = 0;\n-\t} else if (desc_count >= WB_STRIDE) {\n-do_rs:\n-\t\t/* write last descriptor with RS bit set */\n-\t\ttd_cmd |= I40E_TX_DESC_CMD_RS;\n-\t\ttx_ring->packet_stride = 0;\n-\t}\n-\n+\t/* write last descriptor with RS and EOP bits */\n+\ttd_cmd |= I40E_TXD_CMD;\n \ttx_desc->cmd_type_offset_bsz =\n \t\t\tbuild_ctob(td_cmd, td_offset, size, td_tag);\n \n@@ -2151,7 +2101,7 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tfirst->next_to_watch = tx_desc;\n \n \t/* notify HW of packet */\n-\tif (desc_count) {\n+\tif (netif_xmit_stopped(txring_txq(tx_ring)) || !skb->xmit_more) {\n \t\twritel(i, tx_ring->tail);\n \n \t\t/* we need this if more than one processor can write to our tail\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\nindex fc959f9..aba40ed 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n@@ -393,20 +393,6 @@ int __i40evf_maybe_stop_tx(struct i40e_ring *tx_ring, int size);\n bool __i40evf_chk_linearize(struct sk_buff *skb);\n \n /**\n- * i40e_get_head - Retrieve head from head writeback\n- * @tx_ring: Tx ring to fetch head of\n- *\n- * Returns value of Tx ring head based on value stored\n- * in head write-back location\n- **/\n-static inline u32 i40e_get_head(struct i40e_ring *tx_ring)\n-{\n-\tvoid *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;\n-\n-\treturn le32_to_cpu(*(volatile __le32 *)head);\n-}\n-\n-/**\n * i40e_xmit_descriptor_count - calculate number of Tx descriptors needed\n * @skb: send buffer\n * @tx_ring: ring to send buffer on\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex a2a7354..4bc2488 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -260,10 +260,6 @@ void i40evf_configure_queues(struct i40evf_adapter *adapter)\n \t\tvqpi->txq.queue_id = i;\n \t\tvqpi->txq.ring_len = adapter->tx_rings[i].count;\n \t\tvqpi->txq.dma_ring_addr = adapter->tx_rings[i].dma;\n-\t\tvqpi->txq.headwb_enabled = 1;\n-\t\tvqpi->txq.dma_headwb_addr = vqpi->txq.dma_ring_addr +\n-\t\t (vqpi->txq.ring_len * sizeof(struct i40e_tx_desc));\n-\n \t\tvqpi->rxq.vsi_id = vqci->vsi_id;\n \t\tvqpi->rxq.queue_id = i;\n \t\tvqpi->rxq.ring_len = adapter->rx_rings[i].count;\n", "prefixes": [ "next", "S62", "1/6" ] }