get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/941422/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 941422,
    "url": "http://patchwork.ozlabs.org/api/patches/941422/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180709161948.8383.76209.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": "<20180709161948.8383.76209.stgit@ahduyck-green-test.jf.intel.com>",
    "list_archive_url": null,
    "date": "2018-07-09T16:19:48",
    "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": "accepted",
    "archived": false,
    "hash": "ee44533fcbfd0462226b0822f583978d61ae5103",
    "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/20180709161948.8383.76209.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/941422/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/941422/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.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 41PW3f1ZLkz9rvt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Jul 2018 02:28:30 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AABBA878E5;\n\tMon,  9 Jul 2018 16:28:28 +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 jTVlFAJmgptJ; Mon,  9 Jul 2018 16:28:25 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B5EBD8787C;\n\tMon,  9 Jul 2018 16:28:25 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 7FAC01CE44F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Jul 2018 16:28:24 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7D31985E41\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Jul 2018 16:28:24 +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 FJvi9gWEr_7p for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Jul 2018 16:28:23 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 9BD9985E3F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Jul 2018 16:28:23 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Jul 2018 09:28:22 -0700",
            "from ahduyck-green-test.jf.intel.com ([10.166.244.179])\n\tby FMSMGA003.fm.intel.com with ESMTP; 09 Jul 2018 09:28:22 -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=\"63350961\"",
        "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:48 -0400",
        "Message-ID": "<20180709161948.8383.76209.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 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                                |   58 +++++++++++++++----------\n 4 files changed, 45 insertions(+), 46 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 3ff34ca..41ef58f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -8213,20 +8213,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@@ -8235,8 +8232,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@@ -8262,11 +8257,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@@ -10068,7 +10061,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@@ -10091,6 +10083,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 4648a9a..5729bc80 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -2103,7 +2103,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@@ -2568,7 +2568,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 cc1d6bb..09a7cc2 100644\n--- a/net/core/dev.c\n+++ b/net/core/dev.c\n@@ -2786,24 +2786,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@@ -3573,7 +3575,8 @@ static int __get_xps_queue_idx(struct net_device *dev, struct sk_buff *skb,\n }\n #endif\n \n-static int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n+static int get_xps_queue(struct net_device *dev, struct net_device *sb_dev,\n+\t\t\t struct sk_buff *skb)\n {\n #ifdef CONFIG_XPS\n \tstruct xps_dev_maps *dev_maps;\n@@ -3587,7 +3590,7 @@ static int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n \tif (!static_key_false(&xps_rxqs_needed))\n \t\tgoto get_cpus_map;\n \n-\tdev_maps = rcu_dereference(dev->xps_rxqs_map);\n+\tdev_maps = rcu_dereference(sb_dev->xps_rxqs_map);\n \tif (dev_maps) {\n \t\tint tci = sk_rx_queue_get(sk);\n \n@@ -3598,7 +3601,7 @@ static int get_xps_queue(struct net_device *dev, struct sk_buff *skb)\n \n get_cpus_map:\n \tif (queue_index < 0) {\n-\t\tdev_maps = rcu_dereference(dev->xps_cpus_map);\n+\t\tdev_maps = rcu_dereference(sb_dev->xps_cpus_map);\n \t\tif (dev_maps) {\n \t\t\tunsigned int tci = skb->sender_cpu - 1;\n \n@@ -3614,17 +3617,20 @@ static 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@@ -3637,9 +3643,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@@ -3654,10 +3666,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@@ -3669,7 +3681,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@@ -3692,7 +3704,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@@ -3731,7 +3743,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@@ -3805,9 +3817,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"
    ]
}