get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60192,
    "url": "http://patches.dpdk.org/api/patches/60192/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/b9e7acf6a7fa57f33bc1629f9a2277b1bb87c1db.1569850827.git.cloud.wangxiaoyun@huawei.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": "<b9e7acf6a7fa57f33bc1629f9a2277b1bb87c1db.1569850827.git.cloud.wangxiaoyun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/b9e7acf6a7fa57f33bc1629f9a2277b1bb87c1db.1569850827.git.cloud.wangxiaoyun@huawei.com",
    "date": "2019-09-30T14:00:43",
    "name": "[v3,05/19] net/hinic: add allmulticast mode and MTU set",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "dd4b1b62ae410aa9b9c7a4332d249d601e0ad0ee",
    "submitter": {
        "id": 1446,
        "url": "http://patches.dpdk.org/api/people/1446/?format=api",
        "name": "Wangxiaoyun (Cloud)",
        "email": "cloud.wangxiaoyun@huawei.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/b9e7acf6a7fa57f33bc1629f9a2277b1bb87c1db.1569850827.git.cloud.wangxiaoyun@huawei.com/mbox/",
    "series": [
        {
            "id": 6622,
            "url": "http://patches.dpdk.org/api/series/6622/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6622",
            "date": "2019-09-30T14:00:38",
            "name": "Add advanced features for Huawei hinic pmd",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/6622/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/60192/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/60192/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 180747CBC;\n\tMon, 30 Sep 2019 15:47:50 +0200 (CEST)",
            "from huawei.com (szxga04-in.huawei.com [45.249.212.190])\n\tby dpdk.org (Postfix) with ESMTP id 08D191B948\n\tfor <dev@dpdk.org>; Mon, 30 Sep 2019 15:47:49 +0200 (CEST)",
            "from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60])\n\tby Forcepoint Email with ESMTP id 69091256D268B8180CC3\n\tfor <dev@dpdk.org>; Mon, 30 Sep 2019 21:47:47 +0800 (CST)",
            "from tester.localdomain (10.175.119.39) by\n\tDGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP\n\tServer id 14.3.439.0; Mon, 30 Sep 2019 21:47:40 +0800"
        ],
        "From": "Xiaoyun wang <cloud.wangxiaoyun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <xuanziyang2@huawei.com>, <shahar.belkar@huawei.com>,\n\t<luoxianjun@huawei.com>, <tanya.brokhman@huawei.com>,\n\t<zhouguoyang@huawei.com>, <wulike1@huawei.com>, Xiaoyun wang\n\t<cloud.wangxiaoyun@huawei.com>",
        "Date": "Mon, 30 Sep 2019 22:00:43 +0800",
        "Message-ID": "<b9e7acf6a7fa57f33bc1629f9a2277b1bb87c1db.1569850827.git.cloud.wangxiaoyun@huawei.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<cover.1569850826.git.cloud.wangxiaoyun@huawei.com>",
        "References": "<cover.1569850826.git.cloud.wangxiaoyun@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.175.119.39]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v3 05/19] net/hinic: add allmulticast mode and\n\tMTU set",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When enable allmulticast mode, all multicast packets\ncan be received. This patch also adds support for mtu set,\nthe range of MTU is from 256 to 9600.\n\nSigned-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>\n---\n doc/guides/nics/features/hinic.ini   |   4 +-\n doc/guides/nics/hinic.rst            |   2 +\n drivers/net/hinic/hinic_pmd_ethdev.c | 110 ++++++++++++++++++++++++++++++++++-\n drivers/net/hinic/hinic_pmd_ethdev.h |   3 -\n 4 files changed, 114 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/features/hinic.ini b/doc/guides/nics/features/hinic.ini\nindex 8b09509..1f9d62c 100644\n--- a/doc/guides/nics/features/hinic.ini\n+++ b/doc/guides/nics/features/hinic.ini\n@@ -9,10 +9,12 @@ Link status          = Y\n Link status event    = Y\n Free Tx mbuf on demand = Y\n Queue start/stop     = Y\n-Jumbo frame          = N\n+MTU update           = Y\n+Jumbo frame          = Y\n Scattered Rx         = Y\n TSO                  = Y\n Promiscuous mode     = Y\n+Allmulticast mode    = Y\n Unicast MAC filter   = Y\n Multicast MAC filter = Y\n RSS hash             = Y\ndiff --git a/doc/guides/nics/hinic.rst b/doc/guides/nics/hinic.rst\nindex 881075a..681519c 100644\n--- a/doc/guides/nics/hinic.rst\n+++ b/doc/guides/nics/hinic.rst\n@@ -26,6 +26,8 @@ Features\n - Scattered and gather for TX and RX\n - SR-IOV - Partially supported at this point, VFIO only\n - VLAN filter and VLAN offload\n+- Allmulticast mode\n+- MTU update\n \n Prerequisites\n -------------\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c\nindex 4e2a69c..96967a3 100644\n--- a/drivers/net/hinic/hinic_pmd_ethdev.c\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.c\n@@ -64,6 +64,12 @@\n \n #define HINIC_VLAN_FILTER_EN\t\t(1U << 0)\n \n+#define HINIC_MTU_TO_PKTLEN(mtu)\t\\\n+\t((mtu) + ETH_HLEN + ETH_CRC_LEN)\n+\n+#define HINIC_PKTLEN_TO_MTU(pktlen)\t\\\n+\t((pktlen) - (ETH_HLEN + ETH_CRC_LEN))\n+\n /* Driver-specific log messages type */\n int hinic_logtype;\n \n@@ -711,6 +717,8 @@ static void hinic_get_speed_capa(struct rte_eth_dev *dev, uint32_t *speed_capa)\n \tinfo->min_rx_bufsize = HINIC_MIN_RX_BUF_SIZE;\n \tinfo->max_rx_pktlen  = HINIC_MAX_JUMBO_FRAME_SIZE;\n \tinfo->max_mac_addrs  = HINIC_MAX_MAC_ADDRS;\n+\tinfo->min_mtu = HINIC_MIN_MTU_SIZE;\n+\tinfo->max_mtu = HINIC_MAX_MTU_SIZE;\n \n \thinic_get_speed_capa(dev, &info->speed_capa);\n \tinfo->rx_queue_offload_capa = 0;\n@@ -718,7 +726,9 @@ static void hinic_get_speed_capa(struct rte_eth_dev *dev, uint32_t *speed_capa)\n \t\t\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n \t\t\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n \t\t\t\tDEV_RX_OFFLOAD_TCP_CKSUM |\n-\t\t\t\tDEV_RX_OFFLOAD_VLAN_FILTER;\n+\t\t\t\tDEV_RX_OFFLOAD_VLAN_FILTER |\n+\t\t\t\tDEV_RX_OFFLOAD_SCATTER |\n+\t\t\t\tDEV_RX_OFFLOAD_JUMBO_FRAME;\n \n \tinfo->tx_queue_offload_capa = 0;\n \tinfo->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |\n@@ -1376,6 +1386,33 @@ static void hinic_deinit_mac_addr(struct rte_eth_dev *eth_dev)\n \t\t\t    eth_dev->data->name);\n }\n \n+static int hinic_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)\n+{\n+\tint ret = 0;\n+\tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tPMD_DRV_LOG(INFO, \"Set port mtu, port_id: %d, mtu: %d, max_pkt_len: %d\",\n+\t\t\tdev->data->port_id, mtu, HINIC_MTU_TO_PKTLEN(mtu));\n+\n+\tif (mtu < HINIC_MIN_MTU_SIZE || mtu > HINIC_MAX_MTU_SIZE) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid mtu: %d, must between %d and %d\",\n+\t\t\t\tmtu, HINIC_MIN_MTU_SIZE, HINIC_MAX_MTU_SIZE);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tret = hinic_set_port_mtu(nic_dev->hwdev, mtu);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Set port mtu failed, ret: %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* update max frame size */\n+\tdev->data->dev_conf.rxmode.max_rx_pkt_len = HINIC_MTU_TO_PKTLEN(mtu);\n+\tnic_dev->mtu_size = mtu;\n+\n+\treturn ret;\n+}\n+\n static void hinic_store_vlan_filter(struct hinic_nic_dev *nic_dev,\n \t\t\t\t\tu16 vlan_id, bool on)\n {\n@@ -1540,6 +1577,71 @@ static void hinic_remove_all_vlanid(struct rte_eth_dev *eth_dev)\n \t}\n }\n \n+static int hinic_set_dev_allmulticast(struct hinic_nic_dev *nic_dev,\n+\t\t\t\tbool enable)\n+{\n+\tu32 rx_mode_ctrl = nic_dev->rx_mode_status;\n+\n+\tif (enable)\n+\t\trx_mode_ctrl |= HINIC_RX_MODE_MC_ALL;\n+\telse\n+\t\trx_mode_ctrl &= (~HINIC_RX_MODE_MC_ALL);\n+\n+\treturn hinic_config_rx_mode(nic_dev, rx_mode_ctrl);\n+}\n+\n+/**\n+ * DPDK callback to enable allmulticast mode.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success,\n+ *   negative error value otherwise.\n+ */\n+static int hinic_dev_allmulticast_enable(struct rte_eth_dev *dev)\n+{\n+\tint ret = HINIC_OK;\n+\tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tret = hinic_set_dev_allmulticast(nic_dev, true);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Enable allmulticast failed, error: %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tPMD_DRV_LOG(INFO, \"Enable allmulticast succeed, nic_dev: %s, port_id: %d\",\n+\t\tnic_dev->proc_dev_name, dev->data->port_id);\n+\treturn 0;\n+}\n+\n+/**\n+ * DPDK callback to disable allmulticast mode.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ *\n+ * @return\n+ *   0 on success,\n+ *   negative error value otherwise.\n+ */\n+static int hinic_dev_allmulticast_disable(struct rte_eth_dev *dev)\n+{\n+\tint ret = HINIC_OK;\n+\tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tret = hinic_set_dev_allmulticast(nic_dev, false);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Disable allmulticast failed, error: %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tPMD_DRV_LOG(INFO, \"Disable allmulticast succeed, nic_dev: %s, port_id: %d\",\n+\t\tnic_dev->proc_dev_name, dev->data->port_id);\n+\treturn 0;\n+}\n+\n /**\n  * DPDK callback to enable promiscuous mode.\n  *\n@@ -2421,8 +2523,11 @@ static void hinic_dev_close(struct rte_eth_dev *dev)\n \t.tx_queue_release              = hinic_tx_queue_release,\n \t.dev_stop                      = hinic_dev_stop,\n \t.dev_close                     = hinic_dev_close,\n+\t.mtu_set                       = hinic_dev_set_mtu,\n \t.vlan_filter_set               = hinic_vlan_filter_set,\n \t.vlan_offload_set              = hinic_vlan_offload_set,\n+\t.allmulticast_enable           = hinic_dev_allmulticast_enable,\n+\t.allmulticast_disable          = hinic_dev_allmulticast_disable,\n \t.promiscuous_enable            = hinic_dev_promiscuous_enable,\n \t.promiscuous_disable           = hinic_dev_promiscuous_disable,\n \t.rss_hash_update               = hinic_rss_hash_update,\n@@ -2447,8 +2552,11 @@ static void hinic_dev_close(struct rte_eth_dev *dev)\n \t.tx_queue_release              = hinic_tx_queue_release,\n \t.dev_stop                      = hinic_dev_stop,\n \t.dev_close                     = hinic_dev_close,\n+\t.mtu_set                       = hinic_dev_set_mtu,\n \t.vlan_filter_set               = hinic_vlan_filter_set,\n \t.vlan_offload_set              = hinic_vlan_offload_set,\n+\t.allmulticast_enable           = hinic_dev_allmulticast_enable,\n+\t.allmulticast_disable          = hinic_dev_allmulticast_disable,\n \t.rss_hash_update               = hinic_rss_hash_update,\n \t.rss_hash_conf_get             = hinic_rss_conf_get,\n \t.reta_update                   = hinic_rss_indirtbl_update,\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h\nindex 66eaf20..f7a1167 100644\n--- a/drivers/net/hinic/hinic_pmd_ethdev.h\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.h\n@@ -20,9 +20,6 @@\n \n #define SIZE_8BYTES(size)\t(ALIGN((u32)(size), 8) >> 3)\n \n-#define HINIC_PKTLEN_TO_MTU(pktlen)\t\\\n-\t((pktlen) - (ETH_HLEN + ETH_CRC_LEN))\n-\n #define HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev) \\\n \t((struct hinic_nic_dev *)(dev)->data->dev_private)\n \n",
    "prefixes": [
        "v3",
        "05/19"
    ]
}