get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60322,
    "url": "http://patches.dpdk.org/api/patches/60322/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191001110209.6047-12-g.singh@nxp.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": "<20191001110209.6047-12-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191001110209.6047-12-g.singh@nxp.com",
    "date": "2019-10-01T11:02:06",
    "name": "[v3,11/14] net/ppfe: add MTU and MAC address set operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "45b011cd1d40e68983af4b0efa6b851925112bf8",
    "submitter": {
        "id": 1068,
        "url": "http://patches.dpdk.org/api/people/1068/?format=api",
        "name": "Gagandeep Singh",
        "email": "g.singh@nxp.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/20191001110209.6047-12-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 6647,
            "url": "http://patches.dpdk.org/api/series/6647/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6647",
            "date": "2019-10-01T11:01:55",
            "name": "introduces ppfe network PMD",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/6647/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/60322/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/60322/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 11C0D1BECE;\n\tTue,  1 Oct 2019 13:17:49 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n\tby dpdk.org (Postfix) with ESMTP id 124031BE8B\n\tfor <dev@dpdk.org>; Tue,  1 Oct 2019 13:17:38 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n\tby inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E141C200540;\n\tTue,  1 Oct 2019 13:17:37 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n\t[165.114.16.14])\n\tby inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7B2FA2001C2;\n\tTue,  1 Oct 2019 13:17:35 +0200 (CEST)",
            "from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179])\n\tby invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EFBE540313;\n\tTue,  1 Oct 2019 19:17:31 +0800 (SGT)"
        ],
        "From": "Gagandeep Singh <g.singh@nxp.com>",
        "To": "dev@dpdk.org,\n\tferruh.yigit@intel.com",
        "Cc": "thomas@monjalon.net,\n\tGagandeep Singh <g.singh@nxp.com>",
        "Date": "Tue,  1 Oct 2019 16:32:06 +0530",
        "Message-Id": "<20191001110209.6047-12-g.singh@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191001110209.6047-1-g.singh@nxp.com>",
        "References": "<20190826130246.30485-1-g.singh@nxp.com>\n\t<20191001110209.6047-1-g.singh@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v3 11/14] net/ppfe: add MTU and MAC address set\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": "To update MAC address or MTU, operations are\nadded to the driver.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\nAcked-by: Nipun Gupta <nipun.gupta@nxp.com>\nAcked-by: Akhil Goyal <akhil.goyal@nxp.com>\n---\n doc/guides/nics/features/ppfe.ini |  1 +\n doc/guides/nics/ppfe.rst          |  1 +\n drivers/net/ppfe/ppfe_ethdev.c    | 63 +++++++++++++++++++++++++++++++\n 3 files changed, 65 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/ppfe.ini b/doc/guides/nics/features/ppfe.ini\nindex 9184539c1..e0406a97f 100644\n--- a/doc/guides/nics/features/ppfe.ini\n+++ b/doc/guides/nics/features/ppfe.ini\n@@ -8,6 +8,7 @@ L3 checksum offload  = Y\n L4 checksum offload  = Y\n Packet type parsing  = Y\n Basic stats          = Y\n+MTU update           = Y\n Linux VFIO           = Y\n ARMv8                = Y\n Usage doc            = Y\ndiff --git a/doc/guides/nics/ppfe.rst b/doc/guides/nics/ppfe.rst\nindex a91585112..1ab0a5859 100644\n--- a/doc/guides/nics/ppfe.rst\n+++ b/doc/guides/nics/ppfe.rst\n@@ -96,6 +96,7 @@ PPFE Features\n - L3/L4 checksum offload\n - Packet type parsing\n - Basic stats\n+- MTU update\n - ARMv8\n \n Supported PPFE SoCs\ndiff --git a/drivers/net/ppfe/ppfe_ethdev.c b/drivers/net/ppfe/ppfe_ethdev.c\nindex bf40ee402..0097454c9 100644\n--- a/drivers/net/ppfe/ppfe_ethdev.c\n+++ b/drivers/net/ppfe/ppfe_ethdev.c\n@@ -6,6 +6,7 @@\n #include <rte_kvargs.h>\n #include <rte_ethdev_vdev.h>\n #include <rte_bus_vdev.h>\n+#include <rte_ether.h>\n #include <dpaa_of.h>\n \n #include \"pfe_logs.h\"\n@@ -539,6 +540,59 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev)\n \treturn NULL;\n }\n \n+static int\n+pfe_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n+{\n+\tint ret;\n+\tstruct pfe_eth_priv_s *priv = dev->data->dev_private;\n+\tuint16_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;\n+\n+\t/*TODO Support VLAN*/\n+\tret = gemac_set_rx(priv->EMAC_baseaddr, frame_size);\n+\tif (!ret)\n+\t\tdev->data->mtu = mtu;\n+\n+\treturn ret;\n+}\n+\n+/* pfe_eth_enet_addr_byte_mac\n+ */\n+static int\n+pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr,\n+\t\t\t   struct pfe_mac_addr *enet_addr)\n+{\n+\tif (!enet_byte_addr || !enet_addr) {\n+\t\treturn -1;\n+\n+\t} else {\n+\t\tenet_addr->bottom = enet_byte_addr[0] |\n+\t\t\t(enet_byte_addr[1] << 8) |\n+\t\t\t(enet_byte_addr[2] << 16) |\n+\t\t\t(enet_byte_addr[3] << 24);\n+\t\tenet_addr->top = enet_byte_addr[4] |\n+\t\t\t(enet_byte_addr[5] << 8);\n+\t\treturn 0;\n+\t}\n+}\n+\n+static int\n+pfe_dev_set_mac_addr(struct rte_eth_dev *dev,\n+\t\t       struct rte_ether_addr *addr)\n+{\n+\tstruct pfe_eth_priv_s *priv = dev->data->dev_private;\n+\tstruct pfe_mac_addr spec_addr;\n+\tint ret;\n+\n+\tret = pfe_eth_enet_addr_byte_mac(addr->addr_bytes, &spec_addr);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tgemac_set_laddrN(priv->EMAC_baseaddr,\n+\t\t\t (struct pfe_mac_addr *)&spec_addr, 1);\n+\trte_ether_addr_copy(addr, &dev->data->mac_addrs[0]);\n+\treturn 0;\n+}\n+\n static int\n pfe_stats_get(struct rte_eth_dev *dev,\n \t      struct rte_eth_stats *stats)\n@@ -570,6 +624,8 @@ static const struct eth_dev_ops ops = {\n \t.tx_queue_setup = pfe_tx_queue_setup,\n \t.tx_queue_release  = pfe_tx_queue_release,\n \t.dev_supported_ptypes_get = pfe_supported_ptypes_get,\n+\t.mtu_set              = pfe_mtu_set,\n+\t.mac_addr_set\t      = pfe_dev_set_mac_addr,\n \t.stats_get            = pfe_stats_get,\n };\n \n@@ -580,6 +636,7 @@ pfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id)\n \tstruct pfe_eth_priv_s *priv = NULL;\n \tstruct ls1012a_eth_platform_data *einfo;\n \tstruct ls1012a_pfe_platform_data *pfe_info;\n+\tstruct rte_ether_addr addr;\n \tint err;\n \n \teth_dev = rte_eth_vdev_allocate(vdev, sizeof(*priv));\n@@ -632,6 +689,12 @@ pfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id)\n \t\tgoto err0;\n \t}\n \n+\tmemcpy(addr.addr_bytes, priv->einfo->mac_addr,\n+\t\t       ETH_ALEN);\n+\n+\tpfe_dev_set_mac_addr(eth_dev, &addr);\n+\trte_ether_addr_copy(&addr, &eth_dev->data->mac_addrs[0]);\n+\n \teth_dev->data->mtu = 1500;\n \teth_dev->dev_ops = &ops;\n \tpfe_eth_stop(eth_dev);\n",
    "prefixes": [
        "v3",
        "11/14"
    ]
}