get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52693,
    "url": "http://patches.dpdk.org/api/patches/52693/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-10-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": "<20190412105105.24351-10-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190412105105.24351-10-g.singh@nxp.com",
    "date": "2019-04-12T11:01:43",
    "name": "[v3,09/13] net/enetc: add MTU update and jumbo frames support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f2c597d7325a30515315e21243d0095faa0f1054",
    "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@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-10-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 4280,
            "url": "http://patches.dpdk.org/api/series/4280/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4280",
            "date": "2019-04-12T11:01:11",
            "name": "ENETC PMD basic features and bug fixes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4280/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52693/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52693/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "X-BeenThere": "dev@dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "MIME-Version": "1.0",
        "X-MS-TNEF-Correlator": "",
        "Subject": "[dpdk-dev] [PATCH v3 09/13] net/enetc: add MTU update and jumbo\n\tframes support",
        "Message-ID": "<20190412105105.24351-10-g.singh@nxp.com>",
        "Accept-Language": "en-US",
        "received-spf": "None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "References": "<1555075598-4988-1-git-send-email-g.singh@nxp.com>\n\t<20190412105105.24351-1-g.singh@nxp.com>",
        "In-Reply-To": "<20190412105105.24351-1-g.singh@nxp.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VE1PR04MB6384",
        "X-MS-Exchange-CrossTenant-id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "CC": "Gagandeep Singh <G.Singh@nxp.com>",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(189003)(199004)(8676002)(8936002)(14454004)(186003)(446003)(478600001)(476003)(11346002)(72206003)(81166006)(81156014)(50226002)(2616005)(66066001)(4326008)(2501003)(26005)(305945005)(2906002)(5660300002)(3846002)(6116002)(486006)(386003)(6506007)(7736002)(102836004)(1076003)(68736007)(99286004)(76176011)(14444005)(86362001)(6486002)(25786009)(97736004)(110136005)(6436002)(316002)(52116002)(105586002)(6512007)(256004)(71200400001)(71190400001)(15650500001)(106356001)(53936002)(36756003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6384;\n\tH:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; MX:1; A:1; ",
        "Content-Transfer-Encoding": "base64",
        "Thread-Index": "AQHU8R8clQdNpkB6GE+OH0Uk50Z8+w==",
        "X-OriginatorOrg": "nxp.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "d72c96cf-cfd0-46c5-f0e1-08d6bf363f03",
        "Date": "Fri, 12 Apr 2019 11:01:43 +0000",
        "From": "Gagandeep Singh <G.Singh@nxp.com>",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "12 Apr 2019 11:01:43.1119\n\t(UTC)",
        "X-Mailman-Version": "2.1.15",
        "List-Post": "<mailto:dev@dpdk.org>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=c0sUSyOk2YB9znDYYcxBSni+ZQPHcrwTXI7aEEIeusg=;\n\tb=XJ5jqQSSO8KnKrcOW3904Uw/SjzpQA8CoZ930S6ILKyRRxCg3wELF/7HApYMsUJZxs4telhjcRhAh7ucl/QlwXAlcbRV3B57Nvf3iVhusoq2m3UEWaV5I5nFWHAwe6FIssyYM803+caZ56TFroIYImYGSQ65z5OZxSPS/+VLB8M=",
        "x-ms-exchange-senderadcheck": "1",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>, \"ferruh.yigit@intel.com\"\n\t<ferruh.yigit@intel.com>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 955B71B127;\n\tFri, 12 Apr 2019 13:01:54 +0200 (CEST)",
            "from EUR03-AM5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr30063.outbound.protection.outlook.com [40.107.3.63])\n\tby dpdk.org (Postfix) with ESMTP id 4EA6A1B10E\n\tfor <dev@dpdk.org>; Fri, 12 Apr 2019 13:01:44 +0200 (CEST)",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by\n\tVE1PR04MB6384.eurprd04.prod.outlook.com (20.179.232.15) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1792.18; Fri, 12 Apr 2019 11:01:43 +0000",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0]) by\n\tVE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1792.016;\n\tFri, 12 Apr 2019 11:01:43 +0000"
        ],
        "X-MS-Has-Attach": "",
        "x-microsoft-antispam-message-info": "WELBMVNDzbzAo2jEhvzYSDp0tHg4fSck3yZ1KDsQhWzDrlZ0wP+bRtLeMKSY0CwdOT7+tE6HDIjRodTcK2PDHqHXiH6cWdhoV3C6XSWkCStGhNMtFh2jYTQjjDQPYUtCZ5G00u976byX+ZDNgl7+RfLAClyaVkGQEiVNtfdCFZp/SNujEtKcAVUUrVyUQ1u6kutfXSZMdBFJgbRZT9BU7PBhKgfk3xDgNE1NCEzPxzeqwz8k25pSJmuWRY/lBYH5E+BBgaJ+4zIMEwSnAFsX045bWGu/P7noj1GxjFiqYLgijLvDHOlcNfSNWvhqqFqQIbdmu4xV2mN1x2GxGjQpN9v0ENhASfiuwYgbctqgkB/BdlR/Z6vK0Wn6zqmztIrdkHkLtkSctREZqCDicEcX72q3IuiNd/MpX22Cq/bp+VE=",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020);\n\tSRVR:VE1PR04MB6384; ",
        "Errors-To": "dev-bounces@dpdk.org",
        "x-clientproxiedby": "TYAPR01CA0204.jpnprd01.prod.outlook.com\n\t(2603:1096:404:29::24) To VE1PR04MB6365.eurprd04.prod.outlook.com\n\t(2603:10a6:803:12a::14)",
        "x-ms-traffictypediagnostic": "VE1PR04MB6384:",
        "x-originating-ip": "[92.120.1.68]",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org",
        "x-forefront-prvs": "0005B05917",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-antispam-prvs": "<VE1PR04MB638427786FC8BC46A6327236E1280@VE1PR04MB6384.eurprd04.prod.outlook.com>",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "x-mailer": "git-send-email 2.17.1",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=G.Singh@nxp.com; ",
        "Thread-Topic": "[PATCH v3 09/13] net/enetc: add MTU update and jumbo frames\n\tsupport",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Content-Language": "en-US",
        "x-ms-office365-filtering-correlation-id": "d72c96cf-cfd0-46c5-f0e1-08d6bf363f03",
        "Precedence": "list"
    },
    "content": "Enable the jumbo frames and mtu update feature.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\n---\n doc/guides/nics/enetc.rst          |  1 +\n doc/guides/nics/features/enetc.ini |  2 +\n drivers/net/enetc/base/enetc_hw.h  |  6 ++-\n drivers/net/enetc/enetc.h          |  5 +++\n drivers/net/enetc/enetc_ethdev.c   | 86 ++++++++++++++++++++++++++++++++++----\n 5 files changed, 91 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/enetc.rst b/doc/guides/nics/enetc.rst\r\nindex ab13211..eeb0752 100644\r\n--- a/doc/guides/nics/enetc.rst\r\n+++ b/doc/guides/nics/enetc.rst\r\n@@ -49,6 +49,7 @@ ENETC Features\r\n - Basic stats\r\n - Promiscuous\r\n - Multicast\r\n+- Jumbo packets\r\n \r\n NIC Driver (PMD)\r\n ~~~~~~~~~~~~~~~~\r\ndiff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini\r\nindex 6b7bbfb..0eed2cb 100644\r\n--- a/doc/guides/nics/features/enetc.ini\r\n+++ b/doc/guides/nics/features/enetc.ini\r\n@@ -9,6 +9,8 @@ Link status          = Y\r\n Basic stats          = Y\r\n Promiscuous mode     = Y\r\n Allmulticast mode    = Y\r\n+MTU update           = Y\r\n+Jumbo frame          = Y\r\n Linux VFIO           = Y\r\n ARMv8                = Y\r\n Usage doc            = Y\r\ndiff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h\r\nindex 90a383a..2eb1df3 100644\r\n--- a/drivers/net/enetc/base/enetc_hw.h\r\n+++ b/drivers/net/enetc/base/enetc_hw.h\r\n@@ -99,7 +99,11 @@\r\n #define ENETC_PM0_RX_EN\t\t\tBIT(1)\r\n \r\n #define ENETC_PM0_MAXFRM\t\t0x08014\r\n-#define ENETC_SET_MAXFRM(val)\t\t((val) << 16)\r\n+#define ENETC_SET_TX_MTU(val)\t\t((val) << 16)\r\n+#define ENETC_SET_MAXFRM(val)\t\t((val) & 0xffff)\r\n+#define ENETC_PTXMBAR\t\t\t0x0608\r\n+/* n = TC index [0..7] */\r\n+#define ENETC_PTCMSDUR(n)\t\t(0x2020 + (n) * 4)\r\n \r\n #define ENETC_PM0_STATUS\t\t0x08304\r\n #define ENETC_LINK_MODE\t\t\t0x0000000000080000ULL\r\ndiff --git a/drivers/net/enetc/enetc.h b/drivers/net/enetc/enetc.h\r\nindex 56454dc..e494eb8 100644\r\n--- a/drivers/net/enetc/enetc.h\r\n+++ b/drivers/net/enetc/enetc.h\r\n@@ -24,6 +24,11 @@\r\n /* BD ALIGN */\r\n #define BD_ALIGN       8\r\n \r\n+/* minimum frame size supported */\r\n+#define ENETC_MAC_MINFRM_SIZE\t68\r\n+/* maximum frame size supported */\r\n+#define ENETC_MAC_MAXFRM_SIZE\t9600\r\n+\r\n /*\r\n  * upper_32_bits - return bits 32-63 of a number\r\n  * @n: the number we're accessing\r\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\r\nindex a7dddc5..66cbf74 100644\r\n--- a/drivers/net/enetc/enetc_ethdev.c\r\n+++ b/drivers/net/enetc/enetc_ethdev.c\r\n@@ -11,13 +11,6 @@\r\n int enetc_logtype_pmd;\r\n \r\n static int\r\n-enetc_dev_configure(struct rte_eth_dev *dev __rte_unused)\r\n-{\r\n-\tPMD_INIT_FUNC_TRACE();\r\n-\treturn 0;\r\n-}\r\n-\r\n-static int\r\n enetc_dev_start(struct rte_eth_dev *dev)\r\n {\r\n \tstruct enetc_eth_hw *hw =\r\n@@ -168,7 +161,8 @@\r\n \t};\r\n \tdev_info->max_rx_queues = MAX_RX_RINGS;\r\n \tdev_info->max_tx_queues = MAX_TX_RINGS;\r\n-\tdev_info->max_rx_pktlen = 1500;\r\n+\tdev_info->max_rx_pktlen = ENETC_MAC_MAXFRM_SIZE;\r\n+\tdev_info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME;\r\n }\r\n \r\n static int\r\n@@ -597,6 +591,76 @@ int enetc_stats_get(struct rte_eth_dev *dev,\r\n \tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\r\n }\r\n \r\n+static int\r\n+enetc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\r\n+{\r\n+\tstruct enetc_eth_hw *hw =\r\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n+\tuint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;\r\n+\r\n+\t/* check that mtu is within the allowed range */\r\n+\tif (mtu < ENETC_MAC_MINFRM_SIZE || frame_size > ENETC_MAC_MAXFRM_SIZE)\r\n+\t\treturn -EINVAL;\r\n+\r\n+\t/*\r\n+\t * Refuse mtu that requires the support of scattered packets\r\n+\t * when this feature has not been enabled before.\r\n+\t */\r\n+\tif (dev->data->min_rx_buf_size &&\r\n+\t\t!dev->data->scattered_rx && frame_size >\r\n+\t\tdev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) {\r\n+\t\tENETC_PMD_ERR(\"SG not enabled, will not fit in one buffer\");\r\n+\t\treturn -EINVAL;\r\n+\t}\r\n+\r\n+\tif (frame_size > ETHER_MAX_LEN)\r\n+\t\tdev->data->dev_conf.rxmode.offloads &=\r\n+\t\t\t\t\t\tDEV_RX_OFFLOAD_JUMBO_FRAME;\r\n+\telse\r\n+\t\tdev->data->dev_conf.rxmode.offloads &=\r\n+\t\t\t\t\t\t~DEV_RX_OFFLOAD_JUMBO_FRAME;\r\n+\r\n+\tenetc_port_wr(enetc_hw, ENETC_PTCMSDUR(0), ENETC_MAC_MAXFRM_SIZE);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PTXMBAR, 2 * ENETC_MAC_MAXFRM_SIZE);\r\n+\r\n+\tdev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;\r\n+\r\n+\t/*setting the MTU*/\r\n+\tenetc_port_wr(enetc_hw, ENETC_PM0_MAXFRM, ENETC_SET_MAXFRM(frame_size) |\r\n+\t\t      ENETC_SET_TX_MTU(ENETC_MAC_MAXFRM_SIZE));\r\n+\r\n+\treturn 0;\r\n+}\r\n+\r\n+static int\r\n+enetc_dev_configure(struct rte_eth_dev *dev)\r\n+{\r\n+\tstruct rte_eth_conf *eth_conf = &dev->data->dev_conf;\r\n+\tuint64_t rx_offloads = eth_conf->rxmode.offloads;\r\n+\tstruct enetc_eth_hw *hw =\r\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n+\r\n+\tPMD_INIT_FUNC_TRACE();\r\n+\r\n+\tif (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {\r\n+\t\tuint32_t max_len;\r\n+\r\n+\t\tmax_len = dev->data->dev_conf.rxmode.max_rx_pkt_len;\r\n+\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM0_MAXFRM,\r\n+\t\t\t      ENETC_SET_MAXFRM(max_len));\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PTCMSDUR(0),\r\n+\t\t\t      ENETC_MAC_MAXFRM_SIZE);\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PTXMBAR,\r\n+\t\t\t      2 * ENETC_MAC_MAXFRM_SIZE);\r\n+\t\tdev->data->mtu = ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN;\r\n+\t}\r\n+\r\n+\treturn 0;\r\n+}\r\n+\r\n /*\r\n  * The set of PCI devices this driver supports\r\n  */\r\n@@ -620,6 +684,7 @@ int enetc_stats_get(struct rte_eth_dev *dev,\r\n \t.allmulticast_enable  = enetc_allmulticast_enable,\r\n \t.allmulticast_disable = enetc_allmulticast_disable,\r\n \t.dev_infos_get        = enetc_dev_infos_get,\r\n+\t.mtu_set              = enetc_mtu_set,\r\n \t.rx_queue_setup       = enetc_rx_queue_setup,\r\n \t.rx_queue_release     = enetc_rx_queue_release,\r\n \t.tx_queue_setup       = enetc_tx_queue_setup,\r\n@@ -674,6 +739,11 @@ int enetc_stats_get(struct rte_eth_dev *dev,\r\n \tether_addr_copy((struct ether_addr *)hw->mac.addr,\r\n \t\t\t&eth_dev->data->mac_addrs[0]);\r\n \r\n+\t/* Set MTU */\r\n+\tenetc_port_wr(&hw->hw, ENETC_PM0_MAXFRM,\r\n+\t\t      ENETC_SET_MAXFRM(ETHER_MAX_LEN));\r\n+\teth_dev->data->mtu = ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN;\r\n+\r\n \tENETC_PMD_DEBUG(\"port_id %d vendorID=0x%x deviceID=0x%x\",\r\n \t\t\teth_dev->data->port_id, pci_dev->id.vendor_id,\r\n \t\t\tpci_dev->id.device_id);\r\n",
    "prefixes": [
        "v3",
        "09/13"
    ]
}