get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52695,
    "url": "http://patches.dpdk.org/api/patches/52695/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-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": "<20190412105105.24351-12-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190412105105.24351-12-g.singh@nxp.com",
    "date": "2019-04-12T11:01:50",
    "name": "[v3,11/13] net/enetc: enable CRC offload feature",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a514e476b999093bb7effa28c73d92e54e8af12f",
    "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-12-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/52695/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52695/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 11/13] net/enetc: enable CRC offload feature",
        "Message-ID": "<20190412105105.24351-12-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)(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": "AQHU8R8hnJ0kBD1a6UuXA7meUEk/YQ==",
        "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": "63ffbc65-ed6b-4f2c-316a-08d6bf364323",
        "Date": "Fri, 12 Apr 2019 11:01:50 +0000",
        "From": "Gagandeep Singh <G.Singh@nxp.com>",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "12 Apr 2019 11:01:50.3258\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=GRszbgTBblG2qUsNml0WJOLvK1uH2a8lEuvGp7EUVFs=;\n\tb=vbibkuyOFZ9/Jxluou4FoFiaoBAsQJKYvhdWGdP3IovJUXKtq6CPLy6j6hj9979p69z14oJa7eEAnMl386JlZReH//aYuK8fkcSkPkBCfmSw0bbDKsI5Px9aBSxTEmXKQFMjRrWL6jE2wK856Fw4a3PSYk0ibhAkTAU/YO9amQ0=",
        "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 707081B131;\n\tFri, 12 Apr 2019 13:02:02 +0200 (CEST)",
            "from EUR03-VE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr50044.outbound.protection.outlook.com [40.107.5.44])\n\tby dpdk.org (Postfix) with ESMTP id BF4895F34\n\tfor <dev@dpdk.org>; Fri, 12 Apr 2019 13:01:51 +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:50 +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:50 +0000"
        ],
        "X-MS-Has-Attach": "",
        "x-microsoft-antispam-message-info": "RnxOGA5cZFfXObt1O4Xhr3LXvlf/mcSYLsThVmQt7RwRXslgGPE2JjxdXMQERJxdM66rXLAihmCH++E/DsbRl2HExJAMHe+/RwPjwBypYIvcHiXtHZKFeG/5C7HxxF43g9q12YEhEHcVpytqAZx8d/g1dwuXhMul/LvkC9e3bO5zAGqryjEuUHdlf/xGBwQ7ObK3+liM2ts1WXI3XHaBQmXNQOWjnpXZMYY9a7KrIw6kRLtgQdqdbKGladsWKI0ELHyz8aFh4UPOnENiwZsfx+kyty3ki0UvGJGLBLM6o/uhwNJg7ra4GZlFOLYOAo95HxohdRUG6Tc8TCI0XmAuXDix+K+wIXDd7IdVcSuuK6aHsBzk94vK36Ewa/yv7gsKZtujO0/7TmDh8WJpmv2LKwV0/ohF686jfsNp7bYoM9w=",
        "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": "<VE1PR04MB63843AEABDE4D89BD6C581AFE1280@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 11/13] net/enetc: enable CRC offload feature",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Content-Language": "en-US",
        "x-ms-office365-filtering-correlation-id": "63ffbc65-ed6b-4f2c-316a-08d6bf364323",
        "Precedence": "list"
    },
    "content": "CRC offload keep feature supported\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 |  1 +\n drivers/net/enetc/base/enetc_hw.h  |  1 +\n drivers/net/enetc/enetc.h          |  1 +\n drivers/net/enetc/enetc_ethdev.c   | 20 +++++++++++++++++---\n drivers/net/enetc/enetc_rxtx.c     |  6 ++++--\n 6 files changed, 25 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/enetc.rst b/doc/guides/nics/enetc.rst\r\nindex 26d61f6..2620460 100644\r\n--- a/doc/guides/nics/enetc.rst\r\n+++ b/doc/guides/nics/enetc.rst\r\n@@ -52,6 +52,7 @@ ENETC Features\r\n - Jumbo packets\r\n - Queue Start/Stop\r\n - Deferred Queue Start\r\n+- CRC offload\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 bd901fa..101dc0a 100644\r\n--- a/doc/guides/nics/features/enetc.ini\r\n+++ b/doc/guides/nics/features/enetc.ini\r\n@@ -12,6 +12,7 @@ Allmulticast mode    = Y\r\n MTU update           = Y\r\n Jumbo frame          = Y\r\n Queue start/stop     = Y\r\n+CRC offload          = 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 2eb1df3..261ad15 100644\r\n--- a/drivers/net/enetc/base/enetc_hw.h\r\n+++ b/drivers/net/enetc/base/enetc_hw.h\r\n@@ -97,6 +97,7 @@\r\n #define ENETC_PM0_CMD_CFG\t\t0x08008\r\n #define ENETC_PM0_TX_EN\t\t\tBIT(0)\r\n #define ENETC_PM0_RX_EN\t\t\tBIT(1)\r\n+#define ENETC_PM0_CRC\t\t\tBIT(6)\r\n \r\n #define ENETC_PM0_MAXFRM\t\t0x08014\r\n #define ENETC_SET_TX_MTU(val)\t\t((val) << 16)\r\ndiff --git a/drivers/net/enetc/enetc.h b/drivers/net/enetc/enetc.h\r\nindex e494eb8..8c830a5 100644\r\n--- a/drivers/net/enetc/enetc.h\r\n+++ b/drivers/net/enetc/enetc.h\r\n@@ -69,6 +69,7 @@ struct enetc_bdr {\r\n \t\tvoid *tcisr; /* Tx */\r\n \t\tint next_to_alloc; /* Rx */\r\n \t};\r\n+\tuint8_t\tcrc_len; /* 0 if CRC stripped, 4 otherwise */\r\n };\r\n \r\n /*\r\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\r\nindex ff9301e..ffae8ae 100644\r\n--- a/drivers/net/enetc/enetc_ethdev.c\r\n+++ b/drivers/net/enetc/enetc_ethdev.c\r\n@@ -162,7 +162,9 @@\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 = ENETC_MAC_MAXFRM_SIZE;\r\n-\tdev_info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME;\r\n+\tdev_info->rx_offload_capa =\r\n+\t\t(DEV_RX_OFFLOAD_KEEP_CRC |\r\n+\t\t DEV_RX_OFFLOAD_JUMBO_FRAME);\r\n }\r\n \r\n static int\r\n@@ -378,6 +380,7 @@\r\n \tstruct rte_eth_dev_data *data =  dev->data;\r\n \tstruct enetc_eth_adapter *adapter =\r\n \t\t\tENETC_DEV_PRIVATE(data->dev_private);\r\n+\tuint64_t rx_offloads = data->dev_conf.rxmode.offloads;\r\n \r\n \tPMD_INIT_FUNC_TRACE();\r\n \tif (nb_rx_desc > MAX_BD_COUNT)\r\n@@ -410,6 +413,9 @@\r\n \t\t\t       RTE_ETH_QUEUE_STATE_STOPPED;\r\n \t}\r\n \r\n+\trx_ring->crc_len = (uint8_t)((rx_offloads & DEV_RX_OFFLOAD_KEEP_CRC) ?\r\n+\t\t\t\t     ETHER_CRC_LEN : 0);\r\n+\r\n \treturn 0;\r\n fail:\r\n \trte_free(rx_ring);\r\n@@ -625,11 +631,11 @@ int enetc_stats_get(struct rte_eth_dev *dev,\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+\tstruct rte_eth_conf *eth_conf = &dev->data->dev_conf;\r\n+\tuint64_t rx_offloads = eth_conf->rxmode.offloads;\r\n \r\n \tPMD_INIT_FUNC_TRACE();\r\n \r\n@@ -647,6 +653,14 @@ int enetc_stats_get(struct rte_eth_dev *dev,\r\n \t\tdev->data->mtu = ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN;\r\n \t}\r\n \r\n+\tif (rx_offloads & DEV_RX_OFFLOAD_KEEP_CRC) {\r\n+\t\tint config;\r\n+\r\n+\t\tconfig = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);\r\n+\t\tconfig |= ENETC_PM0_CRC;\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG, config);\r\n+\t}\r\n+\r\n \treturn 0;\r\n }\r\n \r\ndiff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c\r\nindex 42f16ca..4a758d2 100644\r\n--- a/drivers/net/enetc/enetc_rxtx.c\r\n+++ b/drivers/net/enetc/enetc_rxtx.c\r\n@@ -208,8 +208,10 @@ static inline void __attribute__((hot))\r\n \t\tif (!bd_status)\r\n \t\t\tbreak;\r\n \r\n-\t\trx_swbd->buffer_addr->pkt_len = rxbd->r.buf_len;\r\n-\t\trx_swbd->buffer_addr->data_len = rxbd->r.buf_len;\r\n+\t\trx_swbd->buffer_addr->pkt_len = rxbd->r.buf_len -\r\n+\t\t\t\t\t\trx_ring->crc_len;\r\n+\t\trx_swbd->buffer_addr->data_len = rxbd->r.buf_len -\r\n+\t\t\t\t\t\t rx_ring->crc_len;\r\n \t\trx_swbd->buffer_addr->hash.rss = rxbd->r.rss_hash;\r\n \t\trx_swbd->buffer_addr->ol_flags = 0;\r\n \t\tenetc_dev_rx_parse(rx_swbd->buffer_addr,\r\n",
    "prefixes": [
        "v3",
        "11/13"
    ]
}