get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 39271,
    "url": "https://patches.dpdk.org/api/patches/39271/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1525311040-26694-1-git-send-email-wei.dai@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1525311040-26694-1-git-send-email-wei.dai@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1525311040-26694-1-git-send-email-wei.dai@intel.com",
    "date": "2018-05-03T01:30:40",
    "name": "[dpdk-dev,v6] ethdev: check Rx/Tx offloads",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "32ec48638be97a278a7e0ac76f724d6006448ca0",
    "submitter": {
        "id": 490,
        "url": "https://patches.dpdk.org/api/people/490/?format=api",
        "name": "Wei Dai",
        "email": "wei.dai@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1525311040-26694-1-git-send-email-wei.dai@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/39271/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/39271/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 460B82B94;\n\tThu,  3 May 2018 03:49:53 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id B48B92B94\n\tfor <dev@dpdk.org>; Thu,  3 May 2018 03:49:51 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 May 2018 18:49:49 -0700",
            "from dpdk6.bj.intel.com ([172.16.182.201])\n\tby orsmga007.jf.intel.com with ESMTP; 02 May 2018 18:49:47 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,356,1520924400\"; d=\"scan'208\";a=\"38009226\"",
        "From": "Wei Dai <wei.dai@intel.com>",
        "To": "thomas@monjalon.net,\n\tferruh.yigit@intel.com,\n\tqi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org,\n\tWei Dai <wei.dai@intel.com>",
        "Date": "Thu,  3 May 2018 09:30:40 +0800",
        "Message-Id": "<1525311040-26694-1-git-send-email-wei.dai@intel.com>",
        "X-Mailer": "git-send-email 2.7.5",
        "In-Reply-To": "<1524753466-17021-1-git-send-email-wei.dai@intel.com>",
        "References": "<1524753466-17021-1-git-send-email-wei.dai@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6] ethdev: check Rx/Tx offloads",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/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 check if a input requested offloading is valid or not.\nAny reuqested offloading must be supported in the device capabilities.\nAny offloading is disabled by default if it is not set in the parameter\ndev_conf->[rt]xmode.offloads to rte_eth_dev_configure( ) and\n[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().\nFrom application, a pure per-port offloading can only be enabled in\nrte_eth_dev_configure().\nOnly supported per queue offloading can be sent to\nrte_eth_[rt]x_queue_setup( ). A per queue offloading is\nenabled only if it is enabled in rte_eth_dev_configure( ) OR\nif it is enabled in rte_eth_[rt]x_queue_setup( ).\nIf a per queue offloading is enabled in rte_eth_dev_configure(),\nit can't be disabled in rte_eth_[rt]x_queue_setup( ).\nIf a per queue offloading is disabled in rte_eth_dev_configure( ),\nit can be enabled or disabled( ) in rte_eth_[rt]x_queue_setup( ).\n\nThis patch can make above such checking in a common way in rte_ethdev\nlayer to avoid same checking in underlying PMD.\n\nSigned-off-by: Wei Dai <wei.dai@intel.com>\n\n---\nv6:\nNo need enable an offload in queue_setup( ) if it has already\nbeen enabled in dev_configure( )\n\nv5:\nkeep offload settings sent to PMD same as those from application\n\nv4:\nfix a wrong description in git log message.\n\nv3:\nrework according to dicision of offloading API in community\n\nv2:\nadd offloads checking in rte_eth_dev_configure( ).\ncheck if a requested offloading is supported.\n---\n lib/librte_ether/rte_ethdev.c | 70 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 70 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex f0f53d4..39a0f0e 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1196,6 +1196,28 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \t\t\t\t\t\t\tETHER_MAX_LEN;\n \t}\n \n+\t/* Any requested offload must be within its device capability */\n+\tif ((local_conf.rxmode.offloads & dev_info.rx_offload_capa) !=\n+\t     local_conf.rxmode.offloads) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"ethdev port_id=%d requested Rx offloads \"\n+\t\t\t\t    \"0x%\" PRIx64 \" doesn't match Rx offloads \"\n+\t\t\t\t    \"capability 0x%\" PRIx64 \"\\n\",\n+\t\t\t\t    port_id,\n+\t\t\t\t    local_conf.rxmode.offloads,\n+\t\t\t\t    dev_info.rx_offload_capa);\n+\t\treturn -EINVAL;\n+\t}\n+\tif ((local_conf.txmode.offloads & dev_info.tx_offload_capa) !=\n+\t     local_conf.txmode.offloads) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"ethdev port_id=%d requested Tx offloads \"\n+\t\t\t\t    \"0x%\" PRIx64 \" doesn't match Tx offloads \"\n+\t\t\t\t    \"capability 0x%\" PRIx64 \"\\n\",\n+\t\t\t\t    port_id,\n+\t\t\t\t    local_conf.txmode.offloads,\n+\t\t\t\t    dev_info.tx_offload_capa);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/*\n \t * Setup new number of RX/TX queues and reconfigure device.\n \t */\n@@ -1547,6 +1569,30 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \t\t\t\t\t\t    &local_conf.offloads);\n \t}\n \n+\t/*\n+\t * Only per-queue offload can be enabled from application.\n+\t * If any other offload is sent to this function, return -EINVAL\n+\t */\n+\tif ((local_conf.offloads & dev_info.rx_queue_offload_capa) !=\n+\t     local_conf.offloads) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Ethdev port_id=%d rx_queue_id=%d \"\n+\t\t\t\t    \"Requested offload 0x%\" PRIx64 \"doesn't \"\n+\t\t\t\t    \"match per-queue capability 0x%\" PRIx64\n+\t\t\t\t    \" in %s\\n\",\n+\t\t\t\t    port_id,\n+\t\t\t\t    rx_queue_id,\n+\t\t\t\t    local_conf.offloads,\n+\t\t\t\t    dev_info.rx_queue_offload_capa,\n+\t\t\t\t    __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/*\n+\t * If an offload has already been enabled in rte_eth_dev_configure(),\n+\t * there is no need to enable it again in queue level.\n+\t */\n+\tlocal_conf.offloads &= ~dev->data->dev_conf.rxmode.offloads;\n+\n \tret = (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id, nb_rx_desc,\n \t\t\t\t\t      socket_id, &local_conf, mp);\n \tif (!ret) {\n@@ -1681,6 +1727,30 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,\n \t\t\t\t\t  &local_conf.offloads);\n \t}\n \n+\t/*\n+\t * Only per-queue offload can be enabled from applcation.\n+\t * If any other offload is sent to this function, return -EINVAL\n+\t */\n+\tif ((local_conf.offloads & dev_info.tx_queue_offload_capa) !=\n+\t     local_conf.offloads) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Ethdev port_id=%d tx_queue_id=%d \"\n+\t\t\t\t    \"Requested offload 0x%\" PRIx64 \"doesn't \"\n+\t\t\t\t    \"match per-queue capability 0x%\" PRIx64\n+\t\t\t\t    \" in %s\\n\",\n+\t\t\t\t    port_id,\n+\t\t\t\t    tx_queue_id,\n+\t\t\t\t    local_conf.offloads,\n+\t\t\t\t    dev_info.tx_queue_offload_capa,\n+\t\t\t\t    __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/*\n+\t * If an offload has already be enabled in rte_eth_dev_configure,\n+\t * there is no need to enable it in queue level again\n+\t */\n+\tlocal_conf.offloads &= ~dev->data->dev_conf.txmode.offloads;\n+\n \treturn eth_err(port_id, (*dev->dev_ops->tx_queue_setup)(dev,\n \t\t       tx_queue_id, nb_tx_desc, socket_id, &local_conf));\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v6"
    ]
}