get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122984,
    "url": "http://patches.dpdk.org/api/patches/122984/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230203020207.99778-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": "<20230203020207.99778-1-ke1x.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230203020207.99778-1-ke1x.zhang@intel.com",
    "date": "2023-02-03T02:02:07",
    "name": "[v4] net/ice: add devargs for disabling default mac",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "3530fd63b62dd663bdd738608f6d1481d9b30f3a",
    "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/20230203020207.99778-1-ke1x.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 26772,
            "url": "http://patches.dpdk.org/api/series/26772/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26772",
            "date": "2023-02-03T02:02:07",
            "name": "[v4] net/ice: add devargs for disabling default mac",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/26772/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/122984/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/122984/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 A6F5841BB4;\n\tFri,  3 Feb 2023 03:16:14 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 81DAC4014F;\n\tFri,  3 Feb 2023 03:16:14 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 5F4F340141\n for <dev@dpdk.org>; Fri,  3 Feb 2023 03:16:12 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Feb 2023 18:16:11 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.252.104])\n by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Feb 2023 18:16:09 -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=1675390573; x=1706926573;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=xAXEbY/Nt66EDotpE5bvyb4DqjrMGBi8MPcbZ3XdlhU=;\n b=SFdaooKeV9ulP+wGFwHtsovUHkHSIc/pCzxFs0ORfGdIDujf7f4wBQfE\n PZvB7glwdBrR3QnT1NI6p2H68gbYLo/elt5CJqmEP6TFefrmOYwEinlEJ\n RqCOCDFf2+dgklhZQJ10BRD53uF8i8r2AeHU2W81MkXoG8mIhgTR80X1r\n K7pkPtDSjEhMgwhYoIZWXf+5zcRVItLLVml+diPCgQhSEfqYkUOR3MN4/\n daG21vos0JjAxilDRSztcR9TtDBStGP/yoVNPCYDj4Z0UwkoE6SCkpmit\n PGs611jF0oO2BuvY0YN+FsqSt57ocD8UpcjbH998lBUig+jkokKTxMO4v Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10609\"; a=\"312287719\"",
            "E=Sophos;i=\"5.97,269,1669104000\"; d=\"scan'208\";a=\"312287719\"",
            "E=McAfee;i=\"6500,9779,10609\"; a=\"643109743\"",
            "E=Sophos;i=\"5.97,269,1669104000\"; d=\"scan'208\";a=\"643109743\""
        ],
        "From": "Ke Zhang <ke1x.zhang@intel.com>",
        "To": "qi.z.zhang@intel.com, yuying.zhang@intel.com, yong.liu@intel.com,\n dev@dpdk.org",
        "Cc": "\"ke1x.zhang\" <ke1x.zhang@intel.com>",
        "Subject": "[PATCH v4] net/ice: add devargs for disabling default mac",
        "Date": "Fri,  3 Feb 2023 10:02:07 +0800",
        "Message-Id": "<20230203020207.99778-1-ke1x.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230112075538.206709-1-ke1x.zhang@intel.com>",
        "References": "<20230112075538.206709-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": "From: \"ke1x.zhang\" <ke1x.zhang@intel.com>\n\nThere is a requirement that if a flow rule is created, received\npacket is permitted to pass if rule matching, or else drop.\nBut in default, a mac filter will be created and the default mac\nwill be added into lookup table during driver initialization,\nit makes drop action impossilbe.\n\nAdd the feature that support to disable default mac which\nwill be used by ice driver when setting dpdk_devargs config\nfield.\n\nDefault mac is not disabled in default, user can\nchoose to disable the default mac\nby setting ``devargs`` parameter ``default-mac-disable``,\n\nfor example::\n     -a 80:00.0,default-mac-disable=1\n\nSigned-off-by: Ke Zhang <ke1x.zhang@intel.com>\n---\nv4: explain what's the typical usage with this feature in general\nv3: rename the feature name\n        remove some unecessary codes.\n---\n doc/guides/nics/ice.rst      | 16 ++++++++++++++++\n drivers/net/ice/ice_ethdev.c | 21 ++++++++++++++++++---\n drivers/net/ice/ice_ethdev.h |  1 +\n 3 files changed, 35 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst\nindex 335b558338..24bbd5b145 100644\n--- a/doc/guides/nics/ice.rst\n+++ b/doc/guides/nics/ice.rst\n@@ -107,6 +107,22 @@ Runtime Config Options\n \n     -a 80:00.0,pipeline-mode-support=1\n \n+- ``Default Mac Disable`` (default ``0``)\n+\n+  There is a requirement that if a flow rule is created, received packet is permitted\n+  to pass if rule matching, or else drop.\n+  But in default, a mac filter will be created and the default mac will be added into\n+  lookup table during driver initialization, it makes drop action impossilbe.\n+\n+  Add the feature that support to disable default mac which will be used by ice driver\n+  when setting dpdk_devargs config field.\n+\n+  Default mac is not disabled in default, user can choose to disable the default mac\n+  by setting ``devargs`` parameter ``default-mac-disable``,\n+  for example::\n+\n+    -a 80:00.0,default-mac-disable=1\n+\n - ``Protocol extraction for per queue``\n \n   Configure the RX queues to do protocol extraction into mbuf for protocol\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 0bc739daf0..0d011bbffa 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -28,6 +28,7 @@\n /* devargs */\n #define ICE_SAFE_MODE_SUPPORT_ARG \"safe-mode-support\"\n #define ICE_PIPELINE_MODE_SUPPORT_ARG  \"pipeline-mode-support\"\n+#define ICE_DEFAULT_MAC_DISABLE   \"default-mac-disable\"\n #define ICE_PROTO_XTR_ARG         \"proto_xtr\"\n #define ICE_FIELD_OFFS_ARG\t\t  \"field_offs\"\n #define ICE_FIELD_NAME_ARG\t\t  \"field_name\"\n@@ -49,6 +50,7 @@ static const char * const ice_valid_args[] = {\n \tICE_HW_DEBUG_MASK_ARG,\n \tICE_ONE_PPS_OUT_ARG,\n \tICE_RX_LOW_LATENCY_ARG,\n+\tICE_DEFAULT_MAC_DISABLE,\n \tNULL\n };\n \n@@ -916,6 +918,7 @@ static int\n ice_init_mac_address(struct rte_eth_dev *dev)\n {\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ice_adapter *ad = (struct ice_adapter *)hw->back;\n \n \tif (!rte_is_unicast_ether_addr\n \t\t((struct rte_ether_addr *)hw->port_info[0].mac.lan_addr)) {\n@@ -935,9 +938,9 @@ ice_init_mac_address(struct rte_eth_dev *dev)\n \t\treturn -ENOMEM;\n \t}\n \t/* store it to dev data */\n-\trte_ether_addr_copy(\n-\t\t(struct rte_ether_addr *)hw->port_info[0].mac.perm_addr,\n-\t\t&dev->data->mac_addrs[0]);\n+\tif (ad->devargs.default_mac_disable != 1)\n+\t\trte_ether_addr_copy((struct rte_ether_addr *)hw->port_info[0].mac.perm_addr,\n+\t\t\t&dev->data->mac_addrs[0]);\n \treturn 0;\n }\n \n@@ -962,8 +965,14 @@ ice_add_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *mac_addr)\n \tstruct ice_mac_filter *f;\n \tstruct LIST_HEAD_TYPE list_head;\n \tstruct ice_hw *hw = ICE_VSI_TO_HW(vsi);\n+\tstruct ice_adapter *ad = (struct ice_adapter *)hw->back;\n \tint ret = 0;\n \n+\tif (ad->devargs.default_mac_disable == 1 && rte_is_same_ether_addr(mac_addr,\n+\t\t\t(struct rte_ether_addr *)hw->port_info[0].mac.perm_addr)) {\n+\t\tPMD_DRV_LOG(ERR, \"This Default MAC filter is disabled.\");\n+\t\treturn 0;\n+\t}\n \t/* If it's added and configured, return */\n \tf = ice_find_mac_filter(vsi, mac_addr);\n \tif (f) {\n@@ -2075,6 +2084,11 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)\n \tif (ret)\n \t\tgoto bail;\n \n+\tret = rte_kvargs_process(kvlist, ICE_DEFAULT_MAC_DISABLE,\n+\t\t\t\t&parse_bool, &ad->devargs.default_mac_disable);\n+\tif (ret)\n+\t\tgoto bail;\n+\n \tret = rte_kvargs_process(kvlist, ICE_HW_DEBUG_MASK_ARG,\n \t\t\t\t &parse_u64, &ad->hw.debug_mask);\n \tif (ret)\n@@ -6050,6 +6064,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,\n \t\t\t      ICE_PROTO_XTR_ARG \"=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>\"\n \t\t\t      ICE_SAFE_MODE_SUPPORT_ARG \"=<0|1>\"\n \t\t\t      ICE_PIPELINE_MODE_SUPPORT_ARG \"=<0|1>\"\n+\t\t\t      ICE_DEFAULT_MAC_DISABLE \"=<0|1>\"\n \t\t\t      ICE_RX_LOW_LATENCY_ARG \"=<0|1>\");\n \n RTE_LOG_REGISTER_SUFFIX(ice_logtype_init, init, NOTICE);\ndiff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex c8311be179..9140f3af79 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -563,6 +563,7 @@ struct ice_devargs {\n \tint safe_mode_support;\n \tuint8_t proto_xtr_dflt;\n \tint pipe_mode_support;\n+\tuint8_t default_mac_disable;\n \tuint8_t proto_xtr[ICE_MAX_QUEUE_NUM];\n \tuint8_t pin_idx;\n \tuint8_t pps_out_ena;\n",
    "prefixes": [
        "v4"
    ]
}