Show a patch.

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

{
    "id": 451,
    "url": "http://patches.dpdk.org/api/patches/451/",
    "web_url": "http://patches.dpdk.org/patch/451/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1411442991-15386-6-git-send-email-jijiang.liu@intel.com>",
    "date": "2014-09-23T03:29:51",
    "name": "[dpdk-dev,5/5] testpmd:test VF MACVLAN filter for i40e",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b2cd7b14a1238aa844d16d2d6b0ba3d80968e7d9",
    "submitter": {
        "id": 52,
        "url": "http://patches.dpdk.org/api/people/52/",
        "name": "Jijiang Liu",
        "email": "jijiang.liu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/451/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/451/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/451/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1411442991-15386-1-git-send-email-jijiang.liu@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,577,1406617200\"; d=\"scan'208\";a=\"606922184\"",
        "Date": "Tue, 23 Sep 2014 11:29:51 +0800",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1411442991-15386-6-git-send-email-jijiang.liu@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2175FB3AA;\n\tTue, 23 Sep 2014 05:24:05 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 135F8AFCA\n\tfor <dev@dpdk.org>; Tue, 23 Sep 2014 05:24:02 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP; 22 Sep 2014 20:23:55 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 22 Sep 2014 20:30:08 -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 s8N3U64U010979;\n\tTue, 23 Sep 2014 11:30:06 +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 s8N3U4ON015490; Tue, 23 Sep 2014 11:30:06 +0800",
            "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8N3U4gG015486; \n\tTue, 23 Sep 2014 11:30:04 +0800"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 5/5]testpmd:test VF MACVLAN filter for i40e",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "Precedence": "list",
        "From": "Jijiang Liu <jijiang.liu@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1411442991-15386-1-git-send-email-jijiang.liu@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Add a test command in testpmd to test VF MACVLAN filter feature.\n\nSigned-off-by: Jijiang Liu <jijiang.liu@intel.com>\nAcked-by: Helin Zhang <helin.zhang@intel.com>\nAcked-by: Jingjing Wu <jingjing.wu@intel.com>\nAcked-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n app/test-pmd/cmdline.c |  115 ++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 112 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex b04a4e8..bfdf265 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -351,9 +351,14 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"    e.g., 'set stat_qmap rx 0 2 5' sets rx queue 2\"\n \t\t\t\" on port 0 to mapping 5.\\n\\n\"\n \n-\t\t\t\"set port (port_id) vf (vf_id) rx|tx on|off \\n\"\n+\t\t\t\"set port (port_id) vf (vf_id) rx|tx on|off\\n\"\n \t\t\t\"    Enable/Disable a VF receive/tranmit from a port\\n\\n\"\n \n+\t\t\t\"set port (port_id) vf (vf_id) (mac_addr)\"\n+\t\t\t\" (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\\n\"\n+\t\t\t\"   Add/Remove unicast or multicast MAC addr filter\"\n+\t\t\t\" for a VF.\\n\\n\"\n+\n \t\t\t\"set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM\"\n \t\t\t\"|MPE) (on|off)\\n\"\n \t\t\t\"    AUPE:accepts untagged VLAN;\"\n@@ -5795,6 +5800,108 @@ cmdline_parse_inst_t cmd_set_uc_all_hash_filter = {\n \t},\n };\n \n+/* *** CONFIGURE MACVLAN FILTER FOR VF(s) *** */\n+struct cmd_set_vf_macvlan_filter {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tuint8_t port_id;\n+\tcmdline_fixed_string_t vf;\n+\tuint8_t vf_id;\n+\tstruct ether_addr address;\n+\tcmdline_fixed_string_t filter_type;\n+\tcmdline_fixed_string_t mode;\n+};\n+\n+static void\n+cmd_set_vf_macvlan_parsed(void *parsed_result,\n+\t\t       __attribute__((unused)) struct cmdline *cl,\n+\t\t       __attribute__((unused)) void *data)\n+{\n+\tint is_on, ret = 0;\n+\tstruct cmd_set_vf_macvlan_filter *res = parsed_result;\n+\tstruct rte_eth_mac_filter filter;\n+\n+\tmemset(&filter, 0, sizeof(struct rte_eth_mac_filter));\n+\n+\t(void)rte_memcpy(&filter.mac_addr, &res->address, ETHER_ADDR_LEN);\n+\tfilter.id = res->vf_id;\n+\tfilter.pf_vf_flag = 0;\n+\n+\tif (!strcmp(res->filter_type, \"exact-mac\"))\n+\t\tfilter.filter_type = RTE_MAC_PERFECT_MATCH;\n+\telse if (!strcmp(res->filter_type, \"exact-mac-vlan\"))\n+\t\tfilter.filter_type = RTE_MACVLAN_PERFECT_MATCH;\n+\telse if (!strcmp(res->filter_type, \"hashmac\"))\n+\t\tfilter.filter_type = RTE_MAC_HASH_MATCH;\n+\telse if (!strcmp(res->filter_type, \"hashmac-vlan\"))\n+\t\tfilter.filter_type = RTE_MACVLAN_HASH_MATCH;\n+\n+\tis_on = (strcmp(res->mode, \"on\") == 0) ? 1 : 0;\n+\n+\tif (is_on)\n+\t\tret = rte_eth_dev_filter_ctrl(res->port_id,\n+\t\t\t\t\tRTE_ETH_FILTER_MACVLAN,\n+\t\t\t\t\tRTE_ETH_FILTER_OP_ADD,\n+\t\t\t\t\t &filter);\n+\telse\n+\t\tret = rte_eth_dev_filter_ctrl(res->port_id,\n+\t\t\t\t\tRTE_ETH_FILTER_MACVLAN,\n+\t\t\t\t\tRTE_ETH_FILTER_OP_DELETE,\n+\t\t\t\t\t&filter);\n+\n+\tif (ret < 0)\n+\t\tprintf(\"bad set MAC hash parameter, return code = %d\\n\", ret);\n+\n+}\n+\n+cmdline_parse_token_string_t cmd_set_vf_macvlan_set =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\t set, \"set\");\n+cmdline_parse_token_string_t cmd_set_vf_macvlan_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\t port, \"port\");\n+cmdline_parse_token_num_t cmd_set_vf_macvlan_portid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t      port_id, UINT8);\n+cmdline_parse_token_string_t cmd_set_vf_macvlan_vf =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\t vf, \"vf\");\n+cmdline_parse_token_num_t cmd_set_vf_macvlan_vf_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\tvf_id, UINT8);\n+cmdline_parse_token_etheraddr_t cmd_set_vf_macvlan_mac =\n+\tTOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\taddress);\n+cmdline_parse_token_string_t cmd_set_vf_macvlan_filter_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\tfilter_type, \"exact-mac#exact-mac-vlan\"\n+\t\t\t\t\"#hashmac#hashmac-vlan\");\n+cmdline_parse_token_string_t cmd_set_vf_macvlan_mode =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter,\n+\t\t\t\t mode, \"on#off\");\n+\n+cmdline_parse_inst_t cmd_set_vf_macvlan_filter = {\n+\t.f = cmd_set_vf_macvlan_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set port (portid) vf (vfid) (mac-addr) \"\n+\t\t\t\"(exact-mac|exact-mac-vlan|hashmac|hashmac-vlan) \"\n+\t\t\t\"on|off\\n\"\n+\t\t\t\"exact match rule:exact match of MAC or MAC and VLAN; \"\n+\t\t\t\"hash match rule: hash match of MAC and exact match \"\n+\t\t\t\"of VLAN\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_vf_macvlan_set,\n+\t\t(void *)&cmd_set_vf_macvlan_port,\n+\t\t(void *)&cmd_set_vf_macvlan_portid,\n+\t\t(void *)&cmd_set_vf_macvlan_vf,\n+\t\t(void *)&cmd_set_vf_macvlan_vf_id,\n+\t\t(void *)&cmd_set_vf_macvlan_mac,\n+\t\t(void *)&cmd_set_vf_macvlan_filter_type,\n+\t\t(void *)&cmd_set_vf_macvlan_mode,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** CONFIGURE VF TRAFFIC CONTROL *** */\n struct cmd_set_vf_traffic {\n \tcmdline_fixed_string_t set;\n@@ -5843,7 +5950,8 @@ cmdline_parse_token_string_t cmd_setvf_traffic_mode =\n cmdline_parse_inst_t cmd_set_vf_traffic = {\n \t.f = cmd_set_vf_traffic_parsed,\n \t.data = NULL,\n-\t.help_str = \"set port X vf Y rx|tx on|off (X = port number,Y = vf id)\",\n+\t.help_str = \"set port X vf Y rx|tx on|off\"\n+\t\t\t\"(X = port number,Y = vf id)\",\n \t.tokens = {\n \t\t(void *)&cmd_setvf_traffic_set,\n \t\t(void *)&cmd_setvf_traffic_port,\n@@ -7501,7 +7609,8 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_set_vf_rxmode,\n \t(cmdline_parse_inst_t *)&cmd_set_uc_hash_filter,\n \t(cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter,\n-\t(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter ,\n+\t(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter,\n \t(cmdline_parse_inst_t *)&cmd_set_vf_traffic,\n \t(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,\n \t(cmdline_parse_inst_t *)&cmd_queue_rate_limit,\n",
    "prefixes": [
        "dpdk-dev",
        "5/5"
    ]
}