get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122662,
    "url": "http://patches.dpdk.org/api/patches/122662/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230130080916.77274-1-ke1x.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230130080916.77274-1-ke1x.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230130080916.77274-1-ke1x.zhang@intel.com",
    "date": "2023-01-30T08:09:16",
    "name": "[v2] net/i40e: support enabling/disabling source pruning",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "fedde265fbed51060bf8c9b56e4ba5c2193cf22b",
    "submitter": {
        "id": 2503,
        "url": "http://patches.dpdk.org/api/people/2503/?format=api",
        "name": "Zhang, Ke1X",
        "email": "ke1x.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230130080916.77274-1-ke1x.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 26686,
            "url": "http://patches.dpdk.org/api/series/26686/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26686",
            "date": "2023-01-30T08:09:16",
            "name": "[v2] net/i40e: support enabling/disabling source pruning",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/26686/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/122662/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/122662/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6C44E424BD;\n\tMon, 30 Jan 2023 09:22:55 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0FD7740EDE;\n\tMon, 30 Jan 2023 09:22:55 +0100 (CET)",
            "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 4FAE340C35\n for <dev@dpdk.org>; Mon, 30 Jan 2023 09:22:53 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Jan 2023 00:22:52 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.252.104])\n by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Jan 2023 00:22:49 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1675066973; x=1706602973;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=6T1GjPIiGBRZsytNVGG+GrO5JDO1wL/mEQeavb3NJ6k=;\n b=IT7fwgLgYwAmlwge8w4RuPlcNyUyZXR5G47Ujh90/aUpgL9Cmd8Ci/sU\n ue8jmJqQ5zDSqFxuSs1oI0rn3c6Ljs3MFDj13eyt1GStafolruQ+3SmM6\n T6IX6FwjedvQ+u912Ds7pO30gion+D+Ry4AU6v+5z9TlgJvTd40CC0zIz\n ostEcGWX7X4LOvC1aIPEio/vPN8NCpUB9+3XdStmDg/FHrioGvEDwBR/S\n pvB7nkkx/IcnPQN4NVqtd0O8LMmdC/bylhLdaAR9GafrCTSHelcaez0Hx\n pOChY09Itz712rbiLu3ArgEKR2yF3fpXe7FSYMxPrlOMYhUX6hLjvq/PS A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10605\"; a=\"389872813\"",
            "E=Sophos;i=\"5.97,257,1669104000\"; d=\"scan'208\";a=\"389872813\"",
            "E=McAfee;i=\"6500,9779,10605\"; a=\"727412978\"",
            "E=Sophos;i=\"5.97,257,1669104000\"; d=\"scan'208\";a=\"727412978\""
        ],
        "From": "Ke Zhang <ke1x.zhang@intel.com>",
        "To": "dev@dpdk.org, mb@smartsharesystems.com, thomas@monjalon.net,\n ferruh.yigit@amd.com, olivier.matz@6wind.com, Yuying.Zhang@intel.com,\n beilei.xing@intel.com",
        "Cc": "Ke Zhang <ke1x.zhang@intel.com>",
        "Subject": "[PATCH v2] net/i40e: support enabling/disabling source pruning",
        "Date": "Mon, 30 Jan 2023 16:09:16 +0800",
        "Message-Id": "<20230130080916.77274-1-ke1x.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230109022027.190627-1-ke1x.zhang@intel.com>",
        "References": "<20230109022027.190627-1-ke1x.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "VRRP advertisement packets are dropped on i40e PF devices because\nwhen a MAC address is added to a device, packets originating from\nthat MAC address are dropped.\n\nThis patch adds a PMD specific API to enable/disable source\npruning to fix above issue.\n\nBugzilla ID: 648\n\nSigned-off-by: Ke Zhang <ke1x.zhang@intel.com>\n---\n app/test-pmd/cmdline.c          | 84 +++++++++++++++++++++++++++++++++\n drivers/net/i40e/i40e_ethdev.c  | 43 +++++++++++++++++\n drivers/net/i40e/i40e_ethdev.h  |  1 +\n drivers/net/i40e/rte_pmd_i40e.c | 20 ++++++++\n drivers/net/i40e/rte_pmd_i40e.h | 16 +++++++\n 5 files changed, 164 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex cb8c174020..76a574affd 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -776,6 +776,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \n \t\t\t\"port cleanup (port_id) txq (queue_id) (free_cnt)\\n\"\n \t\t\t\"    Cleanup txq mbufs for a specific Tx queue\\n\\n\"\n+\n+\t\t\t\"port config (port_id|all) src_prune (on|off)\\n\"\n+\t\t\t\"    Set source prune on port_id, or all.\\n\\n\"\n \t\t);\n \t}\n \n@@ -1619,6 +1622,84 @@ static cmdline_parse_inst_t cmd_config_loopback_specific = {\n \t},\n };\n \n+/* *** configure source prune for port *** */\n+struct cmd_config_src_prune_result {\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t keyword;\n+\tcmdline_fixed_string_t port_all; /* valid if \"allports\" argument == 1 */\n+\tuint16_t port_num;               /* valid if \"allports\" argument == 0 */\n+\tcmdline_fixed_string_t item;\n+\tcmdline_fixed_string_t enable;\n+};\n+\n+static void cmd_config_src_prune_parsed(void *parsed_result,\n+\t\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t\tvoid *allports)\n+{\n+\tstruct cmd_config_src_prune_result *res = parsed_result;\n+\tint enable;\n+\tportid_t i;\n+\n+\tif (!strcmp(res->enable, \"on\"))\n+\t\tenable = 1;\n+\telse\n+\t\tenable = 0;\n+\n+\t/* all ports */\n+\tif (allports) {\n+\t\tRTE_ETH_FOREACH_DEV(i)\n+\t\t\trte_pmd_i40e_set_src_prune(i, enable);\n+\t} else {\n+\t\trte_pmd_i40e_set_src_prune(res->port_num, enable);\n+\t}\n+}\n+\n+static cmdline_parse_token_string_t cmd_config_src_prune_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_src_prune_result, port, \"port\");\n+static cmdline_parse_token_string_t cmd_config_src_prune_keyword =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_src_prune_result, keyword,\n+\t\t\t\t \"config\");\n+static cmdline_parse_token_string_t cmd_config_src_prune_portall =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_src_prune_result, port_all,\n+\t\t\t\t \"all\");\n+static cmdline_parse_token_num_t cmd_config_src_prune_portnum =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_config_src_prune_result, port_num,\n+\t\t\t      RTE_UINT16);\n+static cmdline_parse_token_string_t cmd_config_src_prune_item =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_src_prune_result,\n+\t\t\titem, \"src_prune\");\n+static cmdline_parse_token_string_t cmd_config_src_prune_enable =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_src_prune_result, enable,\n+\t\t\t\t \"on#off\");\n+\n+static cmdline_parse_inst_t cmd_config_src_prune_all = {\n+\t.f = cmd_config_src_prune_parsed,\n+\t.data = (void *)1,\n+\t.help_str = \"port config all src_prune (on|off): Set source prune on all ports.\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_src_prune_port,\n+\t\t(void *)&cmd_config_src_prune_keyword,\n+\t\t(void *)&cmd_config_src_prune_portall,\n+\t\t(void *)&cmd_config_src_prune_item,\n+\t\t(void *)&cmd_config_src_prune_enable,\n+\t\tNULL,\n+\t},\n+};\n+\n+static cmdline_parse_inst_t cmd_config_src_prune_specific = {\n+\t.f = cmd_config_src_prune_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"port config all src_prune (on|off): Set source prune on specific port.\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_src_prune_port,\n+\t\t(void *)&cmd_config_src_prune_keyword,\n+\t\t(void *)&cmd_config_src_prune_portnum,\n+\t\t(void *)&cmd_config_src_prune_item,\n+\t\t(void *)&cmd_config_src_prune_enable,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** configure txq/rxq, txd/rxd *** */\n struct cmd_config_rx_tx {\n \tcmdline_fixed_string_t port;\n@@ -12731,6 +12812,8 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_config_speed_specific,\n \t(cmdline_parse_inst_t *)&cmd_config_loopback_all,\n \t(cmdline_parse_inst_t *)&cmd_config_loopback_specific,\n+\t(cmdline_parse_inst_t *)&cmd_config_src_prune_all,\n+\t(cmdline_parse_inst_t *)&cmd_config_src_prune_specific,\n \t(cmdline_parse_inst_t *)&cmd_config_rx_tx,\n \t(cmdline_parse_inst_t *)&cmd_config_mtu,\n \t(cmdline_parse_inst_t *)&cmd_config_max_pkt_len,\n@@ -12850,6 +12933,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_operate_bpf_unld_parse,\n #endif\n \t(cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,\n+\n \t(cmdline_parse_inst_t *)&cmd_show_tx_metadata,\n \t(cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status,\n \t(cmdline_parse_inst_t *)&cmd_show_rx_queue_desc_used_count,\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 7726a89d99..0f993b958e 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -5634,6 +5634,46 @@ i40e_enable_pf_lb(struct i40e_pf *pf)\n \t\t\t    hw->aq.asq_last_status);\n }\n \n+/* i40e_set_pf_source_prune\n+ * @pf: pointer to the pf structure\n+ * @on: Enable/disable source prune\n+ *\n+ * set source prune on pf\n+ */\n+int\n+i40e_set_pf_source_prune(struct i40e_pf *pf, int on)\n+{\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(pf);\n+\tstruct i40e_vsi_context ctxt;\n+\tint ret;\n+\n+\tmemset(&ctxt, 0, sizeof(ctxt));\n+\tctxt.seid = pf->main_vsi_seid;\n+\tctxt.pf_num = hw->pf_id;\n+\tret = i40e_aq_get_vsi_params(hw, &ctxt, NULL);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"cannot get pf vsi config, err %d, aq_err %d\",\n+\t\t\t    ret, hw->aq.asq_last_status);\n+\t\treturn ret;\n+\t}\n+\tctxt.flags = I40E_AQ_VSI_TYPE_PF;\n+\tctxt.info.valid_sections =\n+\t\trte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID);\n+\tif (on)\n+\t\tctxt.info.switch_id &=\n+\t\t\t~rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB);\n+\telse\n+\t\tctxt.info.switch_id |=\n+\t\t\trte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB);\n+\n+\tret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR, \"update vsi switch failed, aq_err=%d\",\n+\t\t\t    hw->aq.asq_last_status);\n+\n+\treturn ret;\n+}\n+\n /* Setup a VSI */\n struct i40e_vsi *\n i40e_vsi_setup(struct i40e_pf *pf,\n@@ -5691,6 +5731,9 @@ i40e_vsi_setup(struct i40e_pf *pf,\n \t\t}\n \t}\n \n+\t/* source prune is disabled to support VRRP in default*/\n+\ti40e_set_pf_source_prune(pf, 0);\n+\n \tvsi = rte_zmalloc(\"i40e_vsi\", sizeof(struct i40e_vsi), 0);\n \tif (!vsi) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to allocate memory for vsi\");\ndiff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex 7c4cc44a27..df1591584b 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -1427,6 +1427,7 @@ int i40e_pf_calc_configured_queues_num(struct i40e_pf *pf);\n int i40e_pf_reset_rss_reta(struct i40e_pf *pf);\n int i40e_pf_reset_rss_key(struct i40e_pf *pf);\n int i40e_pf_config_rss(struct i40e_pf *pf);\n+int i40e_set_pf_source_prune(struct i40e_pf *pf, int on);\n int i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len);\n int i40e_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size);\n int i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params);\ndiff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c\nindex 35829a1eea..b9fc3c24a1 100644\n--- a/drivers/net/i40e/rte_pmd_i40e.c\n+++ b/drivers/net/i40e/rte_pmd_i40e.c\n@@ -445,6 +445,26 @@ rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on)\n \treturn ret;\n }\n \n+int\n+rte_pmd_i40e_set_src_prune(uint16_t port, uint8_t on)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct i40e_pf *pf;\n+\tint ret;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port];\n+\n+\tif (!is_i40e_supported(dev))\n+\t\treturn -ENOTSUP;\n+\n+\tpf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tret = i40e_set_pf_source_prune(pf, on);\n+\treturn ret;\n+}\n+\n int\n rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on)\n {\ndiff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h\nindex 4cb21c3713..76c9296413 100644\n--- a/drivers/net/i40e/rte_pmd_i40e.h\n+++ b/drivers/net/i40e/rte_pmd_i40e.h\n@@ -400,6 +400,22 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port,\n int rte_pmd_i40e_set_tx_loopback(uint16_t port,\n \t\t\t\t uint8_t on);\n \n+/**\n+ * Enable/Disable source prune on all the PF.\n+ *\n+ * @param port\n+ *    The port identifier of the Ethernet device.\n+ * @param on\n+ *    1 - Enable source prune.\n+ *    0 - Disable source prune.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if *port* invalid.\n+ *   - (-EINVAL) if bad parameter.\n+ */\n+int rte_pmd_i40e_set_src_prune(uint16_t port,\n+\t\t\t\t uint8_t on);\n+\n /**\n  * Enable/Disable VF unicast promiscuous mode.\n  *\n",
    "prefixes": [
        "v2"
    ]
}