Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/941424/?format=api
{ "id": 941424, "url": "http://patchwork.ozlabs.org/api/patches/941424/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180709161943.8383.34753.stgit@ahduyck-green-test.jf.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": "<20180709161943.8383.34753.stgit@ahduyck-green-test.jf.intel.com>", "list_archive_url": null, "date": "2018-07-09T16:19:43", "name": "[jkirsher/next-queue,v2,3/7] ixgbe: Add code to populate and use macvlan tc to Tx queue map", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "83cad5f21b62462d135c4bcb6eab37ff46e806f3", "submitter": { "id": 251, "url": "http://patchwork.ozlabs.org/api/people/251/?format=api", "name": "Duyck, Alexander H", "email": "alexander.h.duyck@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/20180709161943.8383.34753.stgit@ahduyck-green-test.jf.intel.com/mbox/", "series": [ { "id": 54497, "url": "http://patchwork.ozlabs.org/api/series/54497/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=54497", "date": "2018-07-09T16:19:32", "name": "Add support for L2 Fwd Offload w/o ndo_select_queue", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/54497/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/941424/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/941424/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 41PW3m5Jqrz9rvt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Jul 2018 02:28:36 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DF4FB85E5B;\n\tMon, 9 Jul 2018 16:28:34 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 0LNsjUXHkpzO; Mon, 9 Jul 2018 16:28:33 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1B9D685E3F;\n\tMon, 9 Jul 2018 16:28:33 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8B81F1CE44F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 9 Jul 2018 16:28:32 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 875DA22DE3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 9 Jul 2018 16:28:32 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OGdKyQvfbQ5M for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 9 Jul 2018 16:28:31 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 8F04121FA7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 9 Jul 2018 16:28:31 +0000 (UTC)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Jul 2018 09:28:31 -0700", "from ahduyck-green-test.jf.intel.com ([10.166.244.179])\n\tby fmsmga008.fm.intel.com with ESMTP; 09 Jul 2018 09:28:17 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,330,1526367600\"; d=\"scan'208\";a=\"53695880\"", "From": "Alexander Duyck <alexander.h.duyck@intel.com>", "To": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,\n\tjeffrey.t.kirsher@intel.com", "Date": "Mon, 09 Jul 2018 12:19:43 -0400", "Message-ID": "<20180709161943.8383.34753.stgit@ahduyck-green-test.jf.intel.com>", "In-Reply-To": "<20180709161743.8383.97754.stgit@ahduyck-green-test.jf.intel.com>", "References": "<20180709161743.8383.97754.stgit@ahduyck-green-test.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [jkirsher/next-queue PATCH v2 3/7] ixgbe: Add\n\tcode to populate and use macvlan tc to Tx queue map", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "This patch makes it so that we use the tc_to_txq mapping in the macvlan\ndevice in order to select the Tx queue for outgoing packets.\n\nThe idea here is to try and move away from using ixgbe_select_queue and to\ncome up with a generic way to make this work for devices going forward. By\nencoding this information in the netdev this can become something that can\nbe used generically as a solution for similar setups going forward.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 44 ++++++++++++++++++++++---\n 1 file changed, 38 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex c265963..3ff34ca 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -5275,6 +5275,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)\n static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,\n \t\t\t struct ixgbe_fwd_adapter *accel)\n {\n+\tu16 rss_i = adapter->ring_feature[RING_F_RSS].indices;\n+\tint num_tc = netdev_get_num_tc(adapter->netdev);\n \tstruct net_device *vdev = accel->netdev;\n \tint i, baseq, err;\n \n@@ -5286,6 +5288,11 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,\n \taccel->rx_base_queue = baseq;\n \taccel->tx_base_queue = baseq;\n \n+\t/* record configuration for macvlan interface in vdev */\n+\tfor (i = 0; i < num_tc; i++)\n+\t\tnetdev_bind_sb_channel_queue(adapter->netdev, vdev,\n+\t\t\t\t\t i, rss_i, baseq + (rss_i * i));\n+\n \tfor (i = 0; i < adapter->num_rx_queues_per_pool; i++)\n \t\tadapter->rx_ring[baseq + i]->netdev = vdev;\n \n@@ -5310,6 +5317,10 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,\n \n \tnetdev_err(vdev, \"L2FW offload disabled due to L2 filter error\\n\");\n \n+\t/* unbind the queues and drop the subordinate channel config */\n+\tnetdev_unbind_sb_channel(adapter->netdev, vdev);\n+\tnetdev_set_sb_channel(vdev, 0);\n+\n \tclear_bit(accel->pool, adapter->fwd_bitmask);\n \tkfree(accel);\n \n@@ -8206,18 +8217,22 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,\n \t\t\t void *accel_priv, select_queue_fallback_t fallback)\n {\n \tstruct ixgbe_fwd_adapter *fwd_adapter = accel_priv;\n-\tstruct ixgbe_adapter *adapter;\n-\tint txq;\n #ifdef IXGBE_FCOE\n+\tstruct ixgbe_adapter *adapter;\n \tstruct ixgbe_ring_feature *f;\n #endif\n+\tint txq;\n \n \tif (fwd_adapter) {\n-\t\tadapter = netdev_priv(dev);\n-\t\ttxq = reciprocal_scale(skb_get_hash(skb),\n-\t\t\t\t adapter->num_rx_queues_per_pool);\n+\t\tu8 tc = netdev_get_num_tc(dev) ?\n+\t\t\tnetdev_get_prio_tc_map(dev, skb->priority) : 0;\n+\t\tstruct net_device *vdev = fwd_adapter->netdev;\n+\n+\t\ttxq = vdev->tc_to_txq[tc].offset;\n+\t\ttxq += reciprocal_scale(skb_get_hash(skb),\n+\t\t\t\t\tvdev->tc_to_txq[tc].count);\n \n-\t\treturn txq + fwd_adapter->tx_base_queue;\n+\t\treturn txq;\n \t}\n \n #ifdef IXGBE_FCOE\n@@ -8771,6 +8786,11 @@ static int ixgbe_reassign_macvlan_pool(struct net_device *vdev, void *data)\n \t/* if we cannot find a free pool then disable the offload */\n \tnetdev_err(vdev, \"L2FW offload disabled due to lack of queue resources\\n\");\n \tmacvlan_release_l2fw_offload(vdev);\n+\n+\t/* unbind the queues and drop the subordinate channel config */\n+\tnetdev_unbind_sb_channel(adapter->netdev, vdev);\n+\tnetdev_set_sb_channel(vdev, 0);\n+\n \tkfree(accel);\n \n \treturn 0;\n@@ -9779,6 +9799,13 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)\n \tif (!macvlan_supports_dest_filter(vdev))\n \t\treturn ERR_PTR(-EMEDIUMTYPE);\n \n+\t/* We need to lock down the macvlan to be a single queue device so that\n+\t * we can reuse the tc_to_txq field in the macvlan netdev to represent\n+\t * the queue mapping to our netdev.\n+\t */\n+\tif (netif_is_multiqueue(vdev))\n+\t\treturn ERR_PTR(-ERANGE);\n+\n \tpool = find_first_zero_bit(adapter->fwd_bitmask, adapter->num_rx_pools);\n \tif (pool == adapter->num_rx_pools) {\n \t\tu16 used_pools = adapter->num_vfs + adapter->num_rx_pools;\n@@ -9835,6 +9862,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)\n \t\treturn ERR_PTR(-ENOMEM);\n \n \tset_bit(pool, adapter->fwd_bitmask);\n+\tnetdev_set_sb_channel(vdev, pool);\n \taccel->pool = pool;\n \taccel->netdev = vdev;\n \n@@ -9876,6 +9904,10 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)\n \t\tring->netdev = NULL;\n \t}\n \n+\t/* unbind the queues and drop the subordinate channel config */\n+\tnetdev_unbind_sb_channel(pdev, accel->netdev);\n+\tnetdev_set_sb_channel(accel->netdev, 0);\n+\n \tclear_bit(accel->pool, adapter->fwd_bitmask);\n \tkfree(accel);\n }\n", "prefixes": [ "jkirsher/next-queue", "v2", "3/7" ] }