get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 59884,
    "url": "http://patches.dpdk.org/api/patches/59884/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1569506528-60464-9-git-send-email-xavier.huwei@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": "<1569506528-60464-9-git-send-email-xavier.huwei@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1569506528-60464-9-git-send-email-xavier.huwei@huawei.com",
    "date": "2019-09-26T14:01:54",
    "name": "[v3,08/22] net/hns3: add support for some misc operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2bed309096b5996b115741e95c82796745ac9219",
    "submitter": {
        "id": 1405,
        "url": "http://patches.dpdk.org/api/people/1405/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "xavier.huwei@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/1569506528-60464-9-git-send-email-xavier.huwei@huawei.com/mbox/",
    "series": [
        {
            "id": 6552,
            "url": "http://patches.dpdk.org/api/series/6552/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6552",
            "date": "2019-09-26T14:01:47",
            "name": "add hns3 ethernet PMD driver",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/6552/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/59884/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/59884/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 DC8441BEA6;\n\tThu, 26 Sep 2019 16:04:58 +0200 (CEST)",
            "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n\tby dpdk.org (Postfix) with ESMTP id 52E601BE99\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 16:04:54 +0200 (CEST)",
            "from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58])\n\tby Forcepoint Email with ESMTP id 6FDAA78FDC25A34C788A;\n\tThu, 26 Sep 2019 22:04:53 +0800 (CST)",
            "from localhost.localdomain (10.67.212.132) by\n\tDGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP\n\tServer id 14.3.439.0; Thu, 26 Sep 2019 22:04:44 +0800"
        ],
        "From": "\"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<linuxarm@huawei.com>, <xavier_huwei@163.com>, <xavier.huwei@tom.com>,\n\t<forest.zhouchang@huawei.com>",
        "Date": "Thu, 26 Sep 2019 22:01:54 +0800",
        "Message-ID": "<1569506528-60464-9-git-send-email-xavier.huwei@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1569506528-60464-1-git-send-email-xavier.huwei@huawei.com>",
        "References": "<1569506528-60464-1-git-send-email-xavier.huwei@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.212.132]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v3 08/22] net/hns3: add support for some misc\n\toperations",
        "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": "This patch adds the following operations defined in struct eth_dev_ops:\nmtu_set, infos_get and fw_version_get for hns3 PMD driver.\n\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chunsong Feng <fengchunsong@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nSigned-off-by: Hao Chen <chenhao164@huawei.com>\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\n---\nv1 -> v2:\n\tAddress Ferruh Yigit's comments as follows:\n\thttps://inbox.dpdk.org/dev/2543572c-6fbc-af20-1807-fbd7ab4135f7@intel.com\n---\n doc/guides/nics/features/hns3.ini |   2 +\n drivers/net/hns3/hns3_ethdev.c    | 108 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 110 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini\nindex 43ade8c..2eb78d0 100644\n--- a/doc/guides/nics/features/hns3.ini\n+++ b/doc/guides/nics/features/hns3.ini\n@@ -4,8 +4,10 @@\n ; Refer to default.ini for the full list of available PMD features.\n ;\n [Features]\n+MTU update           = Y\n Unicast MAC filter   = Y\n Multicast MAC filter = Y\n+FW version           = Y\n Linux UIO            = Y\n Linux VFIO           = Y\n ARMv8                = Y\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 277db4a..918a386 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -945,6 +945,111 @@ hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)\n }\n \n static int\n+hns3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n+{\n+\tstruct hns3_adapter *hns = dev->data->dev_private;\n+\tuint32_t frame_size = mtu + HNS3_ETH_OVERHEAD;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\tbool is_jumbo_frame;\n+\tint ret;\n+\n+\tif (dev->data->dev_started) {\n+\t\thns3_err(hw, \"Failed to set mtu, port %u must be stopped \"\n+\t\t\t \"before configuration\", dev->data->port_id);\n+\t\treturn -EBUSY;\n+\t}\n+\n+\trte_spinlock_lock(&hw->lock);\n+\tis_jumbo_frame = frame_size > RTE_ETHER_MAX_LEN ? true : false;\n+\tframe_size = RTE_MAX(frame_size, HNS3_DEFAULT_FRAME_LEN);\n+\n+\t/*\n+\t * Maximum value of frame_size is HNS3_MAX_FRAME_LEN, so it can safely\n+\t * assign to \"uint16_t\" type variable.\n+\t */\n+\tret = hns3_config_mtu(hw, (uint16_t)frame_size);\n+\tif (ret) {\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\thns3_err(hw, \"Failed to set mtu, port %u mtu %u: %d\",\n+\t\t\t dev->data->port_id, mtu, ret);\n+\t\treturn ret;\n+\t}\n+\thns->pf.mps = (uint16_t)frame_size;\n+\tif (is_jumbo_frame)\n+\t\tdev->data->dev_conf.rxmode.offloads |=\n+\t\t\t\t\t\tDEV_RX_OFFLOAD_JUMBO_FRAME;\n+\telse\n+\t\tdev->data->dev_conf.rxmode.offloads &=\n+\t\t\t\t\t\t~DEV_RX_OFFLOAD_JUMBO_FRAME;\n+\tdev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;\n+\trte_spinlock_unlock(&hw->lock);\n+\n+\treturn 0;\n+}\n+\n+static int\n+hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)\n+{\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\n+\tinfo->max_rx_queues = hw->tqps_num;\n+\tinfo->max_tx_queues = hw->tqps_num;\n+\tinfo->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */\n+\tinfo->min_rx_bufsize = hw->rx_buf_len;\n+\tinfo->max_mac_addrs = HNS3_UC_MACADDR_NUM;\n+\tinfo->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;\n+\tinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_TCP_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_SCTP_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_OUTER_UDP_CKSUM |\n+\t\t\t\t DEV_RX_OFFLOAD_KEEP_CRC |\n+\t\t\t\t DEV_RX_OFFLOAD_SCATTER |\n+\t\t\t\t DEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\t\t\t DEV_RX_OFFLOAD_QINQ_STRIP |\n+\t\t\t\t DEV_RX_OFFLOAD_VLAN_FILTER |\n+\t\t\t\t DEV_RX_OFFLOAD_VLAN_EXTEND |\n+\t\t\t\t DEV_RX_OFFLOAD_JUMBO_FRAME);\n+\tinfo->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;\n+\tinfo->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\t\t\t DEV_TX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\t DEV_TX_OFFLOAD_TCP_CKSUM |\n+\t\t\t\t DEV_TX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\t DEV_TX_OFFLOAD_SCTP_CKSUM |\n+\t\t\t\t DEV_TX_OFFLOAD_VLAN_INSERT |\n+\t\t\t\t DEV_TX_OFFLOAD_QINQ_INSERT |\n+\t\t\t\t DEV_TX_OFFLOAD_MULTI_SEGS |\n+\t\t\t\t info->tx_queue_offload_capa);\n+\n+\tinfo->vmdq_queue_num = 0;\n+\n+\tinfo->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;\n+\tinfo->default_txportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;\n+\tinfo->default_rxportconf.nb_queues = HNS3_DEFAULT_PORT_CONF_QUEUES_NUM;\n+\tinfo->default_txportconf.nb_queues = HNS3_DEFAULT_PORT_CONF_QUEUES_NUM;\n+\n+\treturn 0;\n+}\n+\n+static int\n+hns3_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version,\n+\t\t    size_t fw_size)\n+{\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\tint ret;\n+\n+\tret = snprintf(fw_version, fw_size, \"0x%08x\", hw->fw_version);\n+\tret += 1; /* add the size of '\\0' */\n+\tif (fw_size < (uint32_t)ret)\n+\t\treturn ret;\n+\telse\n+\t\treturn 0;\n+}\n+\n+static int\n hns3_parse_func_status(struct hns3_hw *hw, struct hns3_func_status_cmd *status)\n {\n \tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n@@ -2338,6 +2443,9 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)\n \n static const struct eth_dev_ops hns3_eth_dev_ops = {\n \t.dev_close          = hns3_dev_close,\n+\t.mtu_set            = hns3_dev_mtu_set,\n+\t.dev_infos_get          = hns3_dev_infos_get,\n+\t.fw_version_get         = hns3_fw_version_get,\n \t.mac_addr_add           = hns3_add_mac_addr,\n \t.mac_addr_remove        = hns3_remove_mac_addr,\n \t.mac_addr_set           = hns3_set_default_mac_addr,\n",
    "prefixes": [
        "v3",
        "08/22"
    ]
}