Show a patch.

GET /api/patches/459/
Content-Type: application/json
Vary: Accept

    "id": 459,
    "url": "",
    "web_url": "",
    "project": {
        "id": 1,
        "url": "",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "",
        "list_email": "",
        "web_url": "",
        "scm_url": "git://",
        "webscm_url": ""
    "msgid": "<>",
    "date": "2014-09-23T13:14:02",
    "name": "[dpdk-dev,1/6] ether: enhancement for VMDQ support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cb9fd54b62579b50662f5fd53b6276b65001e8e6",
    "submitter": {
        "id": 40,
        "url": "",
        "name": "Chen, Jing D",
        "email": ""
    "delegate": null,
    "mbox": "",
    "series": [],
    "comments": "",
    "check": "pending",
    "checks": "",
    "tags": {},
    "headers": {
        "Delivered-To": "",
        "List-Subscribe": "<>,\n\t<>",
        "X-Original-To": "",
        "Date": "Tue, 23 Sep 2014 21:14:02 +0800",
        "In-Reply-To": "<>",
        "Precedence": "list",
        "X-BeenThere": "",
        "References": "<>",
        "X-Mailer": "git-send-email",
        "List-Archive": "<>",
        "To": "",
        "Errors-To": "",
        "Received": [
            "from [] (localhost [IPv6:::1])\n\tby (Postfix) with ESMTP id 85F2758FE;\n\tTue, 23 Sep 2014 15:11:05 +0200 (CEST)",
            "from ( [])\n\tby (Postfix) with ESMTP id 1537B333\n\tfor <>; Tue, 23 Sep 2014 15:11:03 +0200 (CEST)",
            "from ([])\n\tby with ESMTP; 23 Sep 2014 06:14:16 -0700",
            "from ([])\n\tby with ESMTP; 23 Sep 2014 06:14:15 -0700",
            "from (\n\t[])\n\tby with ESMTP id s8NDEDoQ012263;\n\tTue, 23 Sep 2014 21:14:13 +0800",
            "from (localhost [])\n\tby (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s8NDEBrO001293; Tue, 23 Sep 2014 21:14:13 +0800",
            "(from jingche2@localhost)\n\tby (8.13.6/8.13.6/Submit) id s8NDEBV4001289; \n\tTue, 23 Sep 2014 21:14:11 +0800"
        "From": "\"Chen Jing D(Mark)\" <>",
        "List-Help": "<>",
        "X-ExtLoop1": "1",
        "Message-Id": "<>",
        "Sender": "\"dev\" <>",
        "List-Id": "patches and discussions about DPDK <>",
        "Subject": "[dpdk-dev] [PATCH 1/6] ether: enhancement for VMDQ support",
        "List-Unsubscribe": "<>,\n\t<>",
        "Return-Path": "<>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,580,1406617200\"; d=\"scan'208\";a=\"577540960\"",
        "List-Post": "<>",
        "X-Mailman-Version": "2.1.15"
    "content": "From: \"Chen Jing D(Mark)\" <>\n\nThe change includes several parts:\n1. Clear pool bitmap when trying to remove specific MAC.\n2. Define RSS, DCB and VMDQ flags to combine rx_mq_mode.\n3. Use 'struct' to replace 'union', which to expand the rx_adv_conf\n   arguments to better support RSS, DCB and VMDQ.\n4. Fix bug in rte_eth_dev_config_restore function, which will restore\n   all MAC address to default pool.\n5. Define additional 3 arguments for better VMDQ support.\n\nSigned-off-by: Chen Jing D(Mark) <>\nAcked-by: Konstantin Ananyev <>\nAcked-by: Jingjing Wu <>\nAcked-by: Jijiang Liu <>\nAcked-by: Huawei Xie <>\n---\n lib/librte_ether/rte_ethdev.c |   12 +++++++-----\n lib/librte_ether/rte_ethdev.h |   39 ++++++++++++++++++++++++++++-----------\n 2 files changed, 35 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex fd1010a..b7ef56e 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -771,7 +771,8 @@ rte_eth_dev_config_restore(uint8_t port_id)\n \t\t\tcontinue;\n \n \t\t/* add address to the hardware */\n-\t\tif  (*dev->dev_ops->mac_addr_add)\n+\t\tif  (*dev->dev_ops->mac_addr_add &&\n+\t\t\tdev->data->mac_pool_sel[i] & (1ULL << pool))\n \t\t\t(*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool);\n \t\telse {\n \t\t\tPMD_DEBUG_TRACE(\"port %d: MAC address array not supported\\n\",\n@@ -1249,10 +1250,8 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)\n \t}\n \tdev = &rte_eth_devices[port_id];\n \n-\t/* Default device offload capabilities to zero */\n-\tdev_info->rx_offload_capa = 0;\n-\tdev_info->tx_offload_capa = 0;\n-\tdev_info->if_index = 0;\n+\t/* Set all fields with zero */\n+\tmemset(dev_info, 0, sizeof(*dev_info));\n \tFUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);\n \t(*dev->dev_ops->dev_infos_get)(dev, dev_info);\n \tdev_info->pci_dev = dev->pci_dev;\n@@ -2022,6 +2021,9 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr)\n \t/* Update address in NIC data structure */\n \tether_addr_copy(&null_mac_addr, &dev->data->mac_addrs[index]);\n \n+\t/* Update pool bitmap in NIC data structure */\n+\tdev->data->mac_pool_sel[index] = 0;\n+\n \treturn 0;\n }\n \ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 50df654..8f3b6df 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -251,21 +251,34 @@ struct rte_eth_thresh {\n \tuint8_t wthresh; /**< Ring writeback threshold. */\n };\n \n+#define ETH_MQ_RX_RSS_FLAG  0x1\n+#define ETH_MQ_RX_DCB_FLAG  0x2\n+#define ETH_MQ_RX_VMDQ_FLAG 0x4\n+\n /**\n  *  A set of values to identify what method is to be used to route\n  *  packets to multiple queues.\n  */\n enum rte_eth_rx_mq_mode {\n-\tETH_MQ_RX_NONE = 0,  /**< None of DCB,RSS or VMDQ mode */\n-\n-\tETH_MQ_RX_RSS,       /**< For RX side, only RSS is on */\n-\tETH_MQ_RX_DCB,       /**< For RX side,only DCB is on. */\n-\tETH_MQ_RX_DCB_RSS,   /**< Both DCB and RSS enable */\n-\n-\tETH_MQ_RX_VMDQ_ONLY, /**< Only VMDQ, no RSS nor DCB */\n-\tETH_MQ_RX_VMDQ_RSS,  /**< RSS mode with VMDQ */\n-\tETH_MQ_RX_VMDQ_DCB,  /**< Use VMDQ+DCB to route traffic to queues */\n-\tETH_MQ_RX_VMDQ_DCB_RSS, /**< Enable both VMDQ and DCB in VMDq */\n+\t/**< None of DCB,RSS or VMDQ mode */\n+\tETH_MQ_RX_NONE = 0,\n+\n+\t/**< For RX side, only RSS is on */\n+\tETH_MQ_RX_RSS = ETH_MQ_RX_RSS_FLAG,\n+\t/**< For RX side,only DCB is on. */\n+\tETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,\n+\t/**< Both DCB and RSS enable */\n+\tETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,\n+\n+\t/**< Only VMDQ, no RSS nor DCB */\n+\tETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,\n+\t/**< RSS mode with VMDQ */\n+\tETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,\n+\t/**< Use VMDQ+DCB to route traffic to queues */\n+\tETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,\n+\t/**< Enable both VMDQ and DCB in VMDq */\n+\tETH_MQ_RX_VMDQ_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG |\n+\t\t\t\t ETH_MQ_RX_VMDQ_FLAG,\n };\n \n /**\n@@ -840,7 +853,7 @@ struct rte_eth_conf {\n \t\t\t\t Read the datasheet of given ethernet controller\n \t\t\t\t for details. The possible values of this field\n \t\t\t\t are defined in implementation of each driver. */\n-\tunion {\n+\tstruct {\n \t\tstruct rte_eth_rss_conf rss_conf; /**< Port RSS configuration */\n \t\tstruct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;\n \t\t/**< Port vmdq+dcb configuration. */\n@@ -906,6 +919,10 @@ struct rte_eth_dev_info {\n \tuint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */\n \tuint32_t rx_offload_capa; /**< Device RX offload capabilities. */\n \tuint32_t tx_offload_capa; /**< Device TX offload capabilities. */\n+\t/**< Specify the queue range belongs to VMDQ pools if VMDQ applicable */\n+\tuint16_t vmdq_queue_base;\n+\tuint16_t vmdq_queue_num;\n+\tuint16_t vmdq_pool_base; /** < Specify the start pool ID of VMDQ pools */\n };\n \n struct rte_eth_dev;\n",
    "prefixes": [