get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 83961,
    "url": "http://patches.dpdk.org/api/patches/83961/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201111064936.768604-10-jiawenwu@trustnetic.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": "<20201111064936.768604-10-jiawenwu@trustnetic.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201111064936.768604-10-jiawenwu@trustnetic.com",
    "date": "2020-11-11T06:49:08",
    "name": "[v2,09/37] net/txgbe: add L2 tunnel filter init and uninit",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e24d29e8dba21688b4593decdaa5eafe93ae6760",
    "submitter": {
        "id": 1932,
        "url": "http://patches.dpdk.org/api/people/1932/?format=api",
        "name": "Jiawen Wu",
        "email": "jiawenwu@trustnetic.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201111064936.768604-10-jiawenwu@trustnetic.com/mbox/",
    "series": [
        {
            "id": 13798,
            "url": "http://patches.dpdk.org/api/series/13798/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13798",
            "date": "2020-11-11T06:49:00",
            "name": "net: add txgbe PMD part 2",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/13798/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/83961/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/83961/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 69864A09D2;\n\tWed, 11 Nov 2020 07:54:08 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E43F8BE59;\n\tWed, 11 Nov 2020 07:48:04 +0100 (CET)",
            "from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128])\n by dpdk.org (Postfix) with ESMTP id 0312E72EE\n for <dev@dpdk.org>; Wed, 11 Nov 2020 07:47:47 +0100 (CET)",
            "from localhost.localdomain.com (unknown [183.129.236.74])\n by esmtp10.qq.com (ESMTP) with\n id ; Wed, 11 Nov 2020 14:47:31 +0800 (CST)"
        ],
        "X-QQ-mid": "bizesmtp27t1605077252t3ag56s7",
        "X-QQ-SSF": "01400000000000C0C000B00A0000000",
        "X-QQ-FEAT": "da60yr+1N74whPdb9pVzOSTK6BUrEHF4kqtUJ/5hgczDEtukw4lnEYWlooWSQ\n yIaU3qwYTLEjgHhS0OzaG6pEvygsrhzFx6NLrXJBtSHntPY2lLQe9wWfKbBnprtvH0YK10e\n bIhd3LNkPjibIz6u2f6en18aQ5INDRV1l6K/8ugzFT/ARpZjI5jGM7/ezV7FFZUEtE6qviH\n F8KFXcw0aw8DPAmfQXl3K9ej5R4RsrBnMFMXj0oSiXArC3DILRZspBBaF7qNwG8uRicpHno\n BAUun77VoEMJG4wLnDBAsDMKm8snWpcyQBXRn2Jj2smRESCFwAs1PSJdj4HyZfa8FQgL8Q8\n TYjo6gCW/5ZjcHi/OJaH2FsV8zUSg==",
        "X-QQ-GoodBg": "2",
        "From": "Jiawen Wu <jiawenwu@trustnetic.com>",
        "To": "dev@dpdk.org",
        "Cc": "Jiawen Wu <jiawenwu@trustnetic.com>",
        "Date": "Wed, 11 Nov 2020 14:49:08 +0800",
        "Message-Id": "<20201111064936.768604-10-jiawenwu@trustnetic.com>",
        "X-Mailer": "git-send-email 2.18.4",
        "In-Reply-To": "<20201111064936.768604-1-jiawenwu@trustnetic.com>",
        "References": "<20201111064936.768604-1-jiawenwu@trustnetic.com>",
        "X-QQ-SENDSIZE": "520",
        "Feedback-ID": "bizesmtp:trustnetic.com:qybgforeign:qybgforeign6",
        "X-QQ-Bgrelay": "1",
        "Subject": "[dpdk-dev] [PATCH v2 09/37] net/txgbe: add L2 tunnel filter init\n\tand uninit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add L2 tunnel filter init and uninit.\n\nSigned-off-by: Jiawen Wu <jiawenwu@trustnetic.com>\n---\n drivers/net/txgbe/txgbe_ethdev.c | 65 ++++++++++++++++++++++++++++++++\n drivers/net/txgbe/txgbe_ethdev.h | 32 ++++++++++++++++\n 2 files changed, 97 insertions(+)",
    "diff": "diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c\nindex e5b56d60e..3418841b6 100644\n--- a/drivers/net/txgbe/txgbe_ethdev.c\n+++ b/drivers/net/txgbe/txgbe_ethdev.c\n@@ -88,6 +88,8 @@ static const struct reg_info *txgbe_regs_others[] = {\n \t\t\t\ttxgbe_regs_diagnostic,\n \t\t\t\tNULL};\n \n+static int txgbe_l2_tn_filter_init(struct rte_eth_dev *eth_dev);\n+static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev);\n static int  txgbe_dev_set_link_up(struct rte_eth_dev *dev);\n static int  txgbe_dev_set_link_down(struct rte_eth_dev *dev);\n static int txgbe_dev_close(struct rte_eth_dev *dev);\n@@ -687,6 +689,9 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \t/* initialize 5tuple filter list */\n \tTAILQ_INIT(&filter_info->fivetuple_list);\n \n+\t/* initialize l2 tunnel filter list & hash */\n+\ttxgbe_l2_tn_filter_init(eth_dev);\n+\n \t/* initialize bandwidth configuration info */\n \tmemset(bw_conf, 0, sizeof(struct txgbe_bw_conf));\n \n@@ -723,6 +728,63 @@ static int txgbe_ntuple_filter_uninit(struct rte_eth_dev *eth_dev)\n \treturn 0;\n }\n \n+static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct txgbe_l2_tn_info *l2_tn_info = TXGBE_DEV_L2_TN(eth_dev);\n+\tstruct txgbe_l2_tn_filter *l2_tn_filter;\n+\n+\tif (l2_tn_info->hash_map)\n+\t\trte_free(l2_tn_info->hash_map);\n+\tif (l2_tn_info->hash_handle)\n+\t\trte_hash_free(l2_tn_info->hash_handle);\n+\n+\twhile ((l2_tn_filter = TAILQ_FIRST(&l2_tn_info->l2_tn_list))) {\n+\t\tTAILQ_REMOVE(&l2_tn_info->l2_tn_list,\n+\t\t\t     l2_tn_filter,\n+\t\t\t     entries);\n+\t\trte_free(l2_tn_filter);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int txgbe_l2_tn_filter_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct txgbe_l2_tn_info *l2_tn_info = TXGBE_DEV_L2_TN(eth_dev);\n+\tchar l2_tn_hash_name[RTE_HASH_NAMESIZE];\n+\tstruct rte_hash_parameters l2_tn_hash_params = {\n+\t\t.name = l2_tn_hash_name,\n+\t\t.entries = TXGBE_MAX_L2_TN_FILTER_NUM,\n+\t\t.key_len = sizeof(struct txgbe_l2_tn_key),\n+\t\t.hash_func = rte_hash_crc,\n+\t\t.hash_func_init_val = 0,\n+\t\t.socket_id = rte_socket_id(),\n+\t};\n+\n+\tTAILQ_INIT(&l2_tn_info->l2_tn_list);\n+\tsnprintf(l2_tn_hash_name, RTE_HASH_NAMESIZE,\n+\t\t \"l2_tn_%s\", TDEV_NAME(eth_dev));\n+\tl2_tn_info->hash_handle = rte_hash_create(&l2_tn_hash_params);\n+\tif (!l2_tn_info->hash_handle) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to create L2 TN hash table!\");\n+\t\treturn -EINVAL;\n+\t}\n+\tl2_tn_info->hash_map = rte_zmalloc(\"txgbe\",\n+\t\t\t\t   sizeof(struct txgbe_l2_tn_filter *) *\n+\t\t\t\t   TXGBE_MAX_L2_TN_FILTER_NUM,\n+\t\t\t\t   0);\n+\tif (!l2_tn_info->hash_map) {\n+\t\tPMD_INIT_LOG(ERR,\n+\t\t\t\"Failed to allocate memory for L2 TN hash map!\");\n+\t\treturn -ENOMEM;\n+\t}\n+\tl2_tn_info->e_tag_en = FALSE;\n+\tl2_tn_info->e_tag_fwd_en = FALSE;\n+\tl2_tn_info->e_tag_ether_type = RTE_ETHER_TYPE_ETAG;\n+\n+\treturn 0;\n+}\n+\n static int\n eth_txgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tstruct rte_pci_device *pci_dev)\n@@ -1802,6 +1864,9 @@ txgbe_dev_close(struct rte_eth_dev *dev)\n \trte_free(dev->data->hash_mac_addrs);\n \tdev->data->hash_mac_addrs = NULL;\n \n+\t/* remove all the L2 tunnel filters & hash */\n+\ttxgbe_l2_tn_filter_uninit(dev);\n+\n \t/* Remove all ntuple filters of the device */\n \ttxgbe_ntuple_filter_uninit(dev);\n \ndiff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h\nindex d510e8c78..d6487beb0 100644\n--- a/drivers/net/txgbe/txgbe_ethdev.h\n+++ b/drivers/net/txgbe/txgbe_ethdev.h\n@@ -9,7 +9,10 @@\n \n #include \"base/txgbe.h\"\n #include \"txgbe_ptypes.h\"\n+#include <rte_flow.h>\n #include <rte_time.h>\n+#include <rte_hash.h>\n+#include <rte_hash_crc.h>\n \n /* need update link, bit flag */\n #define TXGBE_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0)\n@@ -56,6 +59,8 @@\n #define TXGBE_MISC_VEC_ID               RTE_INTR_VEC_ZERO_OFFSET\n #define TXGBE_RX_VEC_START              RTE_INTR_VEC_RXTX_OFFSET\n \n+#define TXGBE_MAX_L2_TN_FILTER_NUM      128\n+\n /* structure for interrupt relative data */\n struct txgbe_interrupt {\n \tuint32_t flags;\n@@ -168,6 +173,28 @@ struct txgbe_filter_info {\n \tuint32_t syn_info;\n };\n \n+struct txgbe_l2_tn_key {\n+\tenum rte_eth_tunnel_type          l2_tn_type;\n+\tuint32_t                          tn_id;\n+};\n+\n+struct txgbe_l2_tn_filter {\n+\tTAILQ_ENTRY(txgbe_l2_tn_filter)    entries;\n+\tstruct txgbe_l2_tn_key             key;\n+\tuint32_t                           pool;\n+};\n+\n+TAILQ_HEAD(txgbe_l2_tn_filter_list, txgbe_l2_tn_filter);\n+\n+struct txgbe_l2_tn_info {\n+\tstruct txgbe_l2_tn_filter_list      l2_tn_list;\n+\tstruct txgbe_l2_tn_filter         **hash_map;\n+\tstruct rte_hash                    *hash_handle;\n+\tbool e_tag_en; /* e-tag enabled */\n+\tbool e_tag_fwd_en; /* e-tag based forwarding enabled */\n+\tuint16_t e_tag_ether_type; /* ether type for e-tag */\n+};\n+\n /* The configuration of bandwidth */\n struct txgbe_bw_conf {\n \tuint8_t tc_num; /* Number of TCs. */\n@@ -188,6 +215,7 @@ struct txgbe_adapter {\n \tstruct txgbe_vf_info        *vfdata;\n \tstruct txgbe_uta_info       uta_info;\n \tstruct txgbe_filter_info    filter;\n+\tstruct txgbe_l2_tn_info     l2_tn;\n \tstruct txgbe_bw_conf        bw_conf;\n \tbool rx_bulk_alloc_allowed;\n \tstruct rte_timecounter      systime_tc;\n@@ -233,6 +261,10 @@ struct txgbe_adapter {\n \n #define TXGBE_DEV_FILTER(dev) \\\n \t(&((struct txgbe_adapter *)(dev)->data->dev_private)->filter)\n+\n+#define TXGBE_DEV_L2_TN(dev) \\\n+\t(&((struct txgbe_adapter *)(dev)->data->dev_private)->l2_tn)\n+\n #define TXGBE_DEV_BW_CONF(dev) \\\n \t(&((struct txgbe_adapter *)(dev)->data->dev_private)->bw_conf)\n \n",
    "prefixes": [
        "v2",
        "09/37"
    ]
}