get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 14409,
    "url": "https://patches.dpdk.org/api/patches/14409/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1467012016-8273-2-git-send-email-zhe.tao@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1467012016-8273-2-git-send-email-zhe.tao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1467012016-8273-2-git-send-email-zhe.tao@intel.com",
    "date": "2016-06-27T07:20:15",
    "name": "[dpdk-dev,v14,1/2] i40e: support floating VEB config",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "36adc8dd0dcf70b65d134dd7de4df199359e26b2",
    "submitter": {
        "id": 276,
        "url": "https://patches.dpdk.org/api/people/276/?format=api",
        "name": "Zhe Tao",
        "email": "zhe.tao@intel.com"
    },
    "delegate": {
        "id": 10,
        "url": "https://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1467012016-8273-2-git-send-email-zhe.tao@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/14409/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/14409/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B648A5A7B;\n\tMon, 27 Jun 2016 09:20:30 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 4AA175A0F\n\tfor <dev@dpdk.org>; Mon, 27 Jun 2016 09:20:29 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga104.fm.intel.com with ESMTP; 27 Jun 2016 00:20:28 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 27 Jun 2016 00:20:27 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id u5R7KPVs013045;\n\tMon, 27 Jun 2016 15:20:25 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid u5R7KMcx008318; Mon, 27 Jun 2016 15:20:24 +0800",
            "(from zhetao@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u5R7KMsY008314; \n\tMon, 27 Jun 2016 15:20:22 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.26,535,1459839600\"; d=\"scan'208\";\n\ta=\"1010264779\"",
        "From": "Zhe Tao <zhe.tao@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "zhe.tao@intel.com, jingjing.wu@intel.com",
        "Date": "Mon, 27 Jun 2016 15:20:15 +0800",
        "Message-Id": "<1467012016-8273-2-git-send-email-zhe.tao@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1467012016-8273-1-git-send-email-zhe.tao@intel.com>",
        "References": "<1467004353-7534-1-git-send-email-zhe.tao@intel.com>\n\t<1467012016-8273-1-git-send-email-zhe.tao@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v14 1/2] i40e: support floating VEB config",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add the new floating related argument option in the devarg.\nUsing this parameter, all the applications can decide whether to use legacy\nVEB/VEPA or floating VEB.\nTo enable this feature, the user should pass a devargs parameter to the\nEAL like \"-w 84:00.0,enable_floating_veb=1\", and the application will\ntell PMD whether to use the floating VEB feature or not.\nOnce the floating VEB feature is enabled, all the VFs created by\nthis PF device are connected to the floating VEB.\n\nAll the VEB/VEPA concepts are not specific for FVL, they are defined in\nthe 802.1Qbg spec. But the floating VEB concept is from i40e data sheet.\n\nThe standard VEB definition in 1Qbg is a bridge which has a uplink port\nto the outside world (maybe another bridge), but floating means this\nspecial VEB has no uplink port to the outside.\n\nFor floating VEB, it has two major difference comparing to\nthe standard VEB:\n1. doesn't has a up link connection which means\nthe traffic cannot go to outside world.\n2. doesn't need to connect to the physical port which means\nwhen the physical link is down the floating VEB can still works\nfine.\n\nSigned-off-by: Zhe Tao <zhe.tao@intel.com>\n---\n drivers/net/i40e/i40e_ethdev.c | 160 +++++++++++++++++++++++++++++++++++++++++\n drivers/net/i40e/i40e_ethdev.h |  10 +++\n 2 files changed, 170 insertions(+)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 24777d5..553ef56 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -63,6 +63,9 @@\n #include \"i40e_pf.h\"\n #include \"i40e_regs.h\"\n \n+#define ETH_I40E_FLOATING_VEB_ARG\t\"enable_floating_veb\"\n+#define ETH_I40E_FLOATING_VEB_LIST_ARG\t\"floating_veb_list\"\n+\n #define I40E_CLEAR_PXE_WAIT_MS     200\n \n /* Maximun number of capability elements */\n@@ -751,6 +754,161 @@ i40e_add_tx_flow_control_drop_filter(struct i40e_pf *pf)\n }\n \n static int\n+floating_veb_list_handler(__rte_unused const char *key,\n+\t\t\t  const char *floating_veb_value,\n+\t\t\t  void *opaque)\n+{\n+\tint idx = 0;\n+\tunsigned count = 0;\n+\tchar *end = NULL;\n+\tint min, max;\n+\tbool *vf_floating_veb = opaque;\n+\n+\twhile (isblank(*floating_veb_value))\n+\t\tfloating_veb_value++;\n+\n+\t/* Reset floating VEB configuration for VFs */\n+\tfor (idx = 0; idx < I40E_MAX_VF; idx++)\n+\t\tvf_floating_veb[idx] = false;\n+\n+\tmin = I40E_MAX_VF;\n+\tdo {\n+\t\twhile (isblank(*floating_veb_value))\n+\t\t\tfloating_veb_value++;\n+\t\tif (*floating_veb_value == '\\0')\n+\t\t\treturn -1;\n+\t\terrno = 0;\n+\t\tidx = strtoul(floating_veb_value, &end, 10);\n+\t\tif (errno || end == NULL)\n+\t\t\treturn -1;\n+\t\twhile (isblank(*end))\n+\t\t\tend++;\n+\t\tif (*end == '-') {\n+\t\t\tmin = idx;\n+\t\t} else if ((*end == '/') || (*end == '\\0')) {\n+\t\t\tmax = idx;\n+\t\t\tif (min == I40E_MAX_VF)\n+\t\t\t\tmin = idx;\n+\t\t\tif (max >= I40E_MAX_VF)\n+\t\t\t\tmax = I40E_MAX_VF - 1;\n+\t\t\tfor (idx = min; idx <= max; idx++) {\n+\t\t\t\tvf_floating_veb[idx] = true;\n+\t\t\t\tcount++;\n+\t\t\t}\n+\t\t\tmin = I40E_MAX_VF;\n+\t\t} else {\n+\t\t\treturn -1;\n+\t\t}\n+\t\tfloating_veb_value = end + 1;\n+\t} while (*end != '\\0');\n+\n+\tif (count == 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static void\n+config_vf_floating_veb(struct rte_devargs *devargs,\n+\t\t       uint16_t floating_veb,\n+\t\t       bool *vf_floating_veb)\n+{\n+\tstruct rte_kvargs *kvlist;\n+\tint i;\n+\tconst char *floating_veb_list = ETH_I40E_FLOATING_VEB_LIST_ARG;\n+\n+\tif (floating_veb == false)\n+\t\treturn;\n+\t/* All the VFs attach to the floating VEB by default\n+\t * when the floating VEB is enabled.\n+\t */\n+\tfor (i = 0; i < I40E_MAX_VF; i++)\n+\t\tvf_floating_veb[i] = true;\n+\n+\tif (devargs == NULL)\n+\t\treturn;\n+\n+\tkvlist = rte_kvargs_parse(devargs->args, NULL);\n+\tif (kvlist == NULL)\n+\t\treturn;\n+\n+\tif (!rte_kvargs_count(kvlist, floating_veb_list)) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn;\n+\t}\n+\t/* When the floating_veb_list parameter exists, all the VFs\n+\t * will attach to the legacy VEB firstly, then configure VFs\n+\t * to the floating VEB according to the floating_veb_list.\n+\t */\n+\tif (rte_kvargs_process(kvlist, floating_veb_list,\n+\t\t\t       floating_veb_list_handler,\n+\t\t\t       vf_floating_veb) < 0) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn;\n+\t}\n+\trte_kvargs_free(kvlist);\n+}\n+\n+static int\n+i40e_check_floating_handler(__rte_unused const char *key,\n+\t\t\t    const char *value,\n+\t\t\t    __rte_unused void *opaque)\n+{\n+\tif (strcmp(value, \"1\"))\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static int\n+is_floating_veb_supported(struct rte_devargs *devargs)\n+{\n+\tstruct rte_kvargs *kvlist;\n+\tconst char *floating_veb_key = ETH_I40E_FLOATING_VEB_ARG;\n+\n+\tif (devargs == NULL)\n+\t\treturn 0;\n+\n+\tkvlist = rte_kvargs_parse(devargs->args, NULL);\n+\tif (kvlist == NULL)\n+\t\treturn 0;\n+\n+\tif (!rte_kvargs_count(kvlist, floating_veb_key)) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn 0;\n+\t}\n+\t/* Floating VEB is enabled when there's key-value:\n+\t * enable_floating_veb=1\n+\t */\n+\tif (rte_kvargs_process(kvlist, floating_veb_key,\n+\t\t\t       i40e_check_floating_handler, NULL) < 0) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn 0;\n+\t}\n+\trte_kvargs_free(kvlist);\n+\n+\treturn 1;\n+}\n+\n+static void\n+config_floating_veb(struct rte_eth_dev *dev)\n+{\n+\tstruct rte_pci_device *pci_dev = dev->pci_dev;\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tmemset(pf->floating_veb_list, 0, sizeof(pf->floating_veb_list));\n+\n+\tif (hw->aq.fw_maj_ver >= FLOATING_VEB_SUPPORTED_FW_MAJ) {\n+\t\tpf->floating_veb = is_floating_veb_supported(pci_dev->devargs);\n+\t\tconfig_vf_floating_veb(pci_dev->devargs, pf->floating_veb,\n+\t\t\t\t       pf->floating_veb_list);\n+\t} else {\n+\t\tpf->floating_veb = false;\n+\t}\n+}\n+\n+static int\n eth_i40e_dev_init(struct rte_eth_dev *dev)\n {\n \tstruct rte_pci_device *pci_dev;\n@@ -843,6 +1001,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)\n \t\t     ((hw->nvm.version >> 4) & 0xff),\n \t\t     (hw->nvm.version & 0xf), hw->nvm.eetrack);\n \n+\t/* Need the special FW version to support floating VEB */\n+\tconfig_floating_veb(dev);\n \t/* Clear PXE mode */\n \ti40e_clear_pxe_mode(hw);\n \ndiff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex cfd2399..e246eb9 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -36,6 +36,7 @@\n \n #include <rte_eth_ctrl.h>\n #include <rte_time.h>\n+#include <rte_kvargs.h>\n \n #define I40E_VLAN_TAG_SIZE        4\n \n@@ -171,6 +172,10 @@ enum i40e_flxpld_layer_idx {\n #define I40E_QUEUE_ITR_INTERVAL_DEFAULT 32 /* 32 us */\n #define I40E_QUEUE_ITR_INTERVAL_MAX     8160 /* 8160 us */\n \n+/* Special FW support this floating VEB feature */\n+#define FLOATING_VEB_SUPPORTED_FW_MAJ 5\n+#define FLOATING_VEB_SUPPORTED_FW_MIN 0\n+\n struct i40e_adapter;\n \n /**\n@@ -398,6 +403,8 @@ struct i40e_mirror_rule {\n \n TAILQ_HEAD(i40e_mirror_rule_list, i40e_mirror_rule);\n \n+#define I40E_MAX_VF\t\t128\n+\n /*\n  * Structure to store private data specific for PF instance.\n  */\n@@ -450,6 +457,9 @@ struct i40e_pf {\n \tstruct i40e_fc_conf fc_conf; /* Flow control conf */\n \tstruct i40e_mirror_rule_list mirror_list;\n \tuint16_t nb_mirror_rule;   /* The number of mirror rules */\n+\tbool floating_veb; /* The flag to use the floating VEB */\n+\t/* The floating enable flag for the specific VF */\n+\tbool floating_veb_list[I40E_MAX_VF];\n };\n \n enum pending_msg {\n",
    "prefixes": [
        "dpdk-dev",
        "v14",
        "1/2"
    ]
}