get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 33919,
    "url": "https://patches.dpdk.org/api/patches/33919/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1516190088-1540-1-git-send-email-radu.nicolau@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": "<1516190088-1540-1-git-send-email-radu.nicolau@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1516190088-1540-1-git-send-email-radu.nicolau@intel.com",
    "date": "2018-01-17T11:54:48",
    "name": "[dpdk-dev,v2] net/ixgbe: check if security capabilities are enabled by HW",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "48c78440f222931a2f17d6200ccd6812fa349aef",
    "submitter": {
        "id": 743,
        "url": "https://patches.dpdk.org/api/people/743/?format=api",
        "name": "Radu Nicolau",
        "email": "radu.nicolau@intel.com"
    },
    "delegate": {
        "id": 24,
        "url": "https://patches.dpdk.org/api/users/24/?format=api",
        "username": "helin_zhang",
        "first_name": "Helin",
        "last_name": "Zhang",
        "email": "helin.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1516190088-1540-1-git-send-email-radu.nicolau@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/33919/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/33919/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 4CFA91AEF1;\n\tWed, 17 Jan 2018 13:00:12 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id B6A16199B0\n\tfor <dev@dpdk.org>; Wed, 17 Jan 2018 13:00:10 +0100 (CET)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Jan 2018 04:00:09 -0800",
            "from silpixa00383879.ir.intel.com (HELO\n\tsilpixa00383879.ger.corp.intel.com) ([10.237.223.127])\n\tby fmsmga004.fm.intel.com with ESMTP; 17 Jan 2018 04:00:07 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,372,1511856000\"; d=\"scan'208\";a=\"22362982\"",
        "From": "Radu Nicolau <radu.nicolau@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, wenzhuo.lu@intel.com,\n\tkonstantin.ananyev@intel.com, \n\txinfengx.zhao@intel.com, pablo.de.lara.guarch@intel.com,\n\tRadu Nicolau <radu.nicolau@intel.com>",
        "Date": "Wed, 17 Jan 2018 11:54:48 +0000",
        "Message-Id": "<1516190088-1540-1-git-send-email-radu.nicolau@intel.com>",
        "X-Mailer": "git-send-email 2.7.5",
        "In-Reply-To": "<1516187946-30607-1-git-send-email-radu.nicolau@intel.com>",
        "References": "<1516187946-30607-1-git-send-email-radu.nicolau@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] net/ixgbe: check if security capabilities are\n\tenabled by HW",
        "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": "Check if the security enable bits are not fused before setting\noffload capabilities for security\n\nSigned-off-by: Radu Nicolau <radu.nicolau@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++++++---------\n drivers/net/ixgbe/ixgbe_ipsec.c  | 31 +++++++++++++++++++++++++------\n 2 files changed, 36 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 43e0132..67ce052 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -1141,13 +1141,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)\n \t\treturn 0;\n \t}\n \n-#ifdef RTE_LIBRTE_SECURITY\n-\t/* Initialize security_ctx only for primary process*/\n-\teth_dev->security_ctx = ixgbe_ipsec_ctx_create(eth_dev);\n-\tif (eth_dev->security_ctx == NULL)\n-\t\treturn -ENOMEM;\n-#endif\n-\n \trte_eth_copy_pci_info(eth_dev, pci_dev);\n \n \t/* Vendor and Device ID need to be set before init of shared code */\n@@ -1174,6 +1167,13 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)\n \t/* Unlock any pending hardware semaphore */\n \tixgbe_swfw_lock_reset(hw);\n \n+#ifdef RTE_LIBRTE_SECURITY\n+\t/* Initialize security_ctx only for primary process*/\n+\teth_dev->security_ctx = ixgbe_ipsec_ctx_create(eth_dev);\n+\tif (eth_dev->security_ctx == NULL)\n+\t\treturn -ENOMEM;\n+#endif\n+\n \t/* Initialize DCB configuration*/\n \tmemset(dcb_config, 0, sizeof(struct ixgbe_dcb_config));\n \tixgbe_dcb_init(hw, dcb_config);\n@@ -3685,8 +3685,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \t\tdev_info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;\n \n #ifdef RTE_LIBRTE_SECURITY\n-\tdev_info->rx_offload_capa |= DEV_RX_OFFLOAD_SECURITY;\n-\tdev_info->tx_offload_capa |= DEV_TX_OFFLOAD_SECURITY;\n+\tif (dev->security_ctx) {\n+\t\tdev_info->rx_offload_capa |= DEV_RX_OFFLOAD_SECURITY;\n+\t\tdev_info->tx_offload_capa |= DEV_TX_OFFLOAD_SECURITY;\n+\t}\n #endif\n \n \tdev_info->default_rxconf = (struct rte_eth_rxconf) {\ndiff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c\nindex 97f025a8..a9e501e 100644\n--- a/drivers/net/ixgbe/ixgbe_ipsec.c\n+++ b/drivers/net/ixgbe/ixgbe_ipsec.c\n@@ -694,15 +694,34 @@ static struct rte_security_ops ixgbe_security_ops = {\n \t.capabilities_get = ixgbe_crypto_capabilities_get\n };\n \n+static int\n+ixgbe_crypto_capable(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint32_t reg_i, reg, capable = 1;\n+\t/* test if rx crypto can be enabled and then write back initial value*/\n+\treg_i = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, 0);\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);\n+\tif (reg != 0)\n+\t\tcapable = 0;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, reg_i);\n+\treturn capable;\n+}\n+\n struct rte_security_ctx *\n ixgbe_ipsec_ctx_create(struct rte_eth_dev *dev)\n {\n-\tstruct rte_security_ctx *ctx = rte_malloc(\"rte_security_instances_ops\",\n-\t\t\t\t\tsizeof(struct rte_security_ctx), 0);\n-\tif (ctx) {\n-\t\tctx->device = (void *)dev;\n-\t\tctx->ops = &ixgbe_security_ops;\n-\t\tctx->sess_cnt = 0;\n+\tstruct rte_security_ctx *ctx = NULL;\n+\n+\tif (ixgbe_crypto_capable(dev)) {\n+\t\tctx = rte_malloc(\"rte_security_instances_ops\",\n+\t\t\t\t sizeof(struct rte_security_ctx), 0);\n+\t\tif (ctx) {\n+\t\t\tctx->device = (void *)dev;\n+\t\t\tctx->ops = &ixgbe_security_ops;\n+\t\t\tctx->sess_cnt = 0;\n+\t\t}\n \t}\n \treturn ctx;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}