Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/928373/?format=api
{ "id": 928373, "url": "http://patchwork.ozlabs.org/api/patches/928373/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180612151846.86792.83754.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": "<20180612151846.86792.83754.stgit@ahduyck-green-test.jf.intel.com>", "list_archive_url": null, "date": "2018-06-12T15:18:46", "name": "[jkirsher/next-queue,v2,4/7] net: Add support for subordinate traffic classes to netdev_pick_tx", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "9f0dd8ccb1c36bf829d1cc3c0ab5ad17310c13e8", "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/20180612151846.86792.83754.stgit@ahduyck-green-test.jf.intel.com/mbox/", "series": [ { "id": 49759, "url": "http://patchwork.ozlabs.org/api/series/49759/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=49759", "date": "2018-06-12T15:18:25", "name": "Add support for L2 Fwd Offload w/o ndo_select_queue", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/49759/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/928373/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/928373/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 414tzF0CFcz9s4Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Jun 2018 01:27:04 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6ED968A12A;\n\tTue, 12 Jun 2018 15:27:03 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id xH5n+ctHgQ58; Tue, 12 Jun 2018 15:27:01 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B7B598A138;\n\tTue, 12 Jun 2018 15:27:01 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id AAE7D1C0D68\n\tfor <intel-wired-lan@osuosl.org>;\n\tTue, 12 Jun 2018 15:27:00 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0B2E488AEA\n\tfor <intel-wired-lan@osuosl.org>;\n\tTue, 12 Jun 2018 15:26:54 +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 nQqkqfUIzTfo for <intel-wired-lan@osuosl.org>;\n\tTue, 12 Jun 2018 15:26:53 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 154CE88FE3\n\tfor <intel-wired-lan@osuosl.org>;\n\tTue, 12 Jun 2018 15:26:53 +0000 (UTC)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jun 2018 08:26:52 -0700", "from ahduyck-green-test.jf.intel.com ([10.166.244.179])\n\tby fmsmga008.fm.intel.com with ESMTP; 12 Jun 2018 08:26:52 -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,215,1526367600\"; d=\"scan'208\";a=\"47171144\"", "From": "Alexander Duyck <alexander.h.duyck@intel.com>", "To": "intel-wired-lan@osuosl.org, jeffrey.t.kirsher@intel.com,\n\tnetdev@vger.kernel.org", "Date": "Tue, 12 Jun 2018 11:18:46 -0400", "Message-ID": "<20180612151846.86792.83754.stgit@ahduyck-green-test.jf.intel.com>", "In-Reply-To": "<20180612151322.86792.97587.stgit@ahduyck-green-test.jf.intel.com>", "References": "<20180612151322.86792.97587.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 4/7] net: Add\n\tsupport for subordinate traffic classes to netdev_pick_tx", "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 change makes it so that we can support the concept of subordinate\ndevice traffic classes to the core networking code. In doing this we can\nstart pulling out the driver specific bits needed to support selecting a\nqueue based on an upper device.\n\nThe solution at is currently stands is only partially implemented. I have\nthe start of some XPS bits in here, but I would still need to allow for\nconfiguration of the XPS maps on the queues reserved for the subordinate\ndevices. For now I am using the reference to the sb_dev XPS map as just a\nway to skip the lookup of the lower device XPS map for now as that would\nresult in the wrong queue being picked.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 19 +++-----\n drivers/net/macvlan.c | 10 +---\n include/linux/netdevice.h | 4 +-\n net/core/dev.c | 57 +++++++++++++++----------\n 4 files changed, 45 insertions(+), 45 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 6e27848..053a54c 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -8219,20 +8219,17 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \t\t\t\t\t input, common, ring->queue_index);\n }\n \n+#ifdef IXGBE_FCOE\n 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-#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\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+\tif (accel_priv) {\n+\t\tu8 tc = netdev_get_prio_tc_map(dev, skb->priority);\n+\t\tstruct net_device *vdev = accel_priv;\n \n \t\ttxq = vdev->tc_to_txq[tc].offset;\n \t\ttxq += reciprocal_scale(skb_get_hash(skb),\n@@ -8241,8 +8238,6 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,\n \t\treturn txq;\n \t}\n \n-#ifdef IXGBE_FCOE\n-\n \t/*\n \t * only execute the code below if protocol is FCoE\n \t * or FIP and we have FCoE enabled on the adapter\n@@ -8268,11 +8263,9 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,\n \t\ttxq -= f->indices;\n \n \treturn txq + f->offset;\n-#else\n-\treturn fallback(dev, skb);\n-#endif\n }\n \n+#endif\n static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,\n \t\t\t struct xdp_frame *xdpf)\n {\n@@ -10076,7 +10069,6 @@ static int ixgbe_xdp_xmit(struct net_device *dev, int n,\n \t.ndo_open\t\t= ixgbe_open,\n \t.ndo_stop\t\t= ixgbe_close,\n \t.ndo_start_xmit\t\t= ixgbe_xmit_frame,\n-\t.ndo_select_queue\t= ixgbe_select_queue,\n \t.ndo_set_rx_mode\t= ixgbe_set_rx_mode,\n \t.ndo_validate_addr\t= eth_validate_addr,\n \t.ndo_set_mac_address\t= ixgbe_set_mac,\n@@ -10099,6 +10091,7 @@ static int ixgbe_xdp_xmit(struct net_device *dev, int n,\n \t.ndo_poll_controller\t= ixgbe_netpoll,\n #endif\n #ifdef IXGBE_FCOE\n+\t.ndo_select_queue\t= ixgbe_select_queue,\n \t.ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get,\n \t.ndo_fcoe_ddp_target = ixgbe_fcoe_ddp_target,\n \t.ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put,\ndiff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c\nindex adde8fc..401e1d1 100644\n--- a/drivers/net/macvlan.c\n+++ b/drivers/net/macvlan.c\n@@ -514,7 +514,6 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)\n \tconst struct macvlan_dev *vlan = netdev_priv(dev);\n \tconst struct macvlan_port *port = vlan->port;\n \tconst struct macvlan_dev *dest;\n-\tvoid *accel_priv = NULL;\n \n \tif (vlan->mode == MACVLAN_MODE_BRIDGE) {\n \t\tconst struct ethhdr *eth = (void *)skb->data;\n@@ -533,15 +532,10 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)\n \t\t\treturn NET_XMIT_SUCCESS;\n \t\t}\n \t}\n-\n-\t/* For packets that are non-multicast and not bridged we will pass\n-\t * the necessary information so that the lowerdev can distinguish\n-\t * the source of the packets via the accel_priv value.\n-\t */\n-\taccel_priv = vlan->accel_priv;\n xmit_world:\n \tskb->dev = vlan->lowerdev;\n-\treturn dev_queue_xmit_accel(skb, accel_priv);\n+\treturn dev_queue_xmit_accel(skb,\n+\t\t\t\t netdev_get_sb_channel(dev) ? dev : NULL);\n }\n \n static inline netdev_tx_t macvlan_netpoll_send_skb(struct macvlan_dev *vlan, struct sk_buff *skb)\ndiff --git a/include/linux/netdevice.h b/include/linux/netdevice.h\nindex 41b4660..91b3ca9 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -2090,7 +2090,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,\n \n struct netdev_queue *netdev_pick_tx(struct net_device *dev,\n \t\t\t\t struct sk_buff *skb,\n-\t\t\t\t void *accel_priv);\n+\t\t\t\t struct net_device *sb_dev);\n \n /* returns the headroom that the master device needs to take in account\n * when forwarding to this dev\n@@ -2552,7 +2552,7 @@ struct net_device *__dev_get_by_flags(struct net *net, unsigned short flags,\n void dev_disable_lro(struct net_device *dev);\n int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);\n int dev_queue_xmit(struct sk_buff *skb);\n-int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);\n+int dev_queue_xmit_accel(struct sk_buff *skb, struct net_device *sb_dev);\n int dev_direct_xmit(struct sk_buff *skb, u16 queue_id);\n int register_netdevice(struct net_device *dev);\n void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);\ndiff --git a/net/core/dev.c b/net/core/dev.c\nindex 27fe4f2..2249294 100644\n--- a/net/core/dev.c\n+++ b/net/core/dev.c\n@@ -2704,24 +2704,26 @@ void netif_device_attach(struct net_device *dev)\n * Returns a Tx hash based on the given packet descriptor a Tx queues' number\n * to be used as a distribution range.\n */\n-static u16 skb_tx_hash(const struct net_device *dev, struct sk_buff *skb)\n+static u16 skb_tx_hash(const struct net_device *dev,\n+\t\t const struct net_device *sb_dev,\n+\t\t struct sk_buff *skb)\n {\n \tu32 hash;\n \tu16 qoffset = 0;\n \tu16 qcount = dev->real_num_tx_queues;\n \n+\tif (dev->num_tc) {\n+\t\tu8 tc = netdev_get_prio_tc_map(dev, skb->priority);\n+\n+\t\tqoffset = sb_dev->tc_to_txq[tc].offset;\n+\t\tqcount = sb_dev->tc_to_txq[tc].count;\n+\t}\n+\n \tif (skb_rx_queue_recorded(skb)) {\n \t\thash = skb_get_rx_queue(skb);\n \t\twhile (unlikely(hash >= qcount))\n \t\t\thash -= qcount;\n-\t\treturn hash;\n-\t}\n-\n-\tif (dev->num_tc) {\n-\t\tu8 tc = netdev_get_prio_tc_map(dev, skb->priority);\n-\n-\t\tqoffset = dev->tc_to_txq[tc].offset;\n-\t\tqcount = dev->tc_to_txq[tc].count;\n+\t\treturn hash + qoffset;\n \t}\n \n \treturn (u16) reciprocal_scale(skb_get_hash(skb), qcount) + qoffset;\n@@ -3465,7 +3467,9 @@ int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)\n }\n #endif /* CONFIG_NET_EGRESS */\n \n-static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n+static inline int get_xps_queue(struct net_device *dev,\n+\t\t\t\tstruct net_device *sb_dev,\n+\t\t\t\tstruct sk_buff *skb)\n {\n #ifdef CONFIG_XPS\n \tstruct xps_dev_maps *dev_maps;\n@@ -3473,7 +3477,7 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n \tint queue_index = -1;\n \n \trcu_read_lock();\n-\tdev_maps = rcu_dereference(dev->xps_maps);\n+\tdev_maps = rcu_dereference(sb_dev->xps_maps);\n \tif (dev_maps) {\n \t\tunsigned int tci = skb->sender_cpu - 1;\n \n@@ -3501,17 +3505,20 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n #endif\n }\n \n-static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)\n+static u16 ___netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,\n+\t\t\t struct net_device *sb_dev)\n {\n \tstruct sock *sk = skb->sk;\n \tint queue_index = sk_tx_queue_get(sk);\n \n+\tsb_dev = sb_dev ? : dev;\n+\n \tif (queue_index < 0 || skb->ooo_okay ||\n \t queue_index >= dev->real_num_tx_queues) {\n-\t\tint new_index = get_xps_queue(dev, skb);\n+\t\tint new_index = get_xps_queue(dev, sb_dev, skb);\n \n \t\tif (new_index < 0)\n-\t\t\tnew_index = skb_tx_hash(dev, skb);\n+\t\t\tnew_index = skb_tx_hash(dev, sb_dev, skb);\n \n \t\tif (queue_index != new_index && sk &&\n \t\t sk_fullsock(sk) &&\n@@ -3524,9 +3531,15 @@ static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)\n \treturn queue_index;\n }\n \n+static u16 __netdev_pick_tx(struct net_device *dev,\n+\t\t\t struct sk_buff *skb)\n+{\n+\treturn ___netdev_pick_tx(dev, skb, NULL);\n+}\n+\n struct netdev_queue *netdev_pick_tx(struct net_device *dev,\n \t\t\t\t struct sk_buff *skb,\n-\t\t\t\t void *accel_priv)\n+\t\t\t\t struct net_device *sb_dev)\n {\n \tint queue_index = 0;\n \n@@ -3541,10 +3554,10 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,\n \t\tconst struct net_device_ops *ops = dev->netdev_ops;\n \n \t\tif (ops->ndo_select_queue)\n-\t\t\tqueue_index = ops->ndo_select_queue(dev, skb, accel_priv,\n+\t\t\tqueue_index = ops->ndo_select_queue(dev, skb, sb_dev,\n \t\t\t\t\t\t\t __netdev_pick_tx);\n \t\telse\n-\t\t\tqueue_index = __netdev_pick_tx(dev, skb);\n+\t\t\tqueue_index = ___netdev_pick_tx(dev, skb, sb_dev);\n \n \t\tqueue_index = netdev_cap_txqueue(dev, queue_index);\n \t}\n@@ -3556,7 +3569,7 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,\n /**\n *\t__dev_queue_xmit - transmit a buffer\n *\t@skb: buffer to transmit\n- *\t@accel_priv: private data used for L2 forwarding offload\n+ *\t@sb_dev: suboordinate device used for L2 forwarding offload\n *\n *\tQueue a buffer for transmission to a network device. The caller must\n *\thave set the device and priority and built the buffer before calling\n@@ -3579,7 +3592,7 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,\n * the BH enable code must have IRQs enabled so that it will not deadlock.\n * --BLG\n */\n-static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)\n+static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)\n {\n \tstruct net_device *dev = skb->dev;\n \tstruct netdev_queue *txq;\n@@ -3618,7 +3631,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)\n \telse\n \t\tskb_dst_force(skb);\n \n-\ttxq = netdev_pick_tx(dev, skb, accel_priv);\n+\ttxq = netdev_pick_tx(dev, skb, sb_dev);\n \tq = rcu_dereference_bh(txq->qdisc);\n \n \ttrace_net_dev_queue(skb);\n@@ -3692,9 +3705,9 @@ int dev_queue_xmit(struct sk_buff *skb)\n }\n EXPORT_SYMBOL(dev_queue_xmit);\n \n-int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv)\n+int dev_queue_xmit_accel(struct sk_buff *skb, struct net_device *sb_dev)\n {\n-\treturn __dev_queue_xmit(skb, accel_priv);\n+\treturn __dev_queue_xmit(skb, sb_dev);\n }\n EXPORT_SYMBOL(dev_queue_xmit_accel);\n \n", "prefixes": [ "jkirsher/next-queue", "v2", "4/7" ] }