get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63090,
    "url": "https://patches.dpdk.org/api/patches/63090/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191118222343.45282-2-yahui.cao@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": "<20191118222343.45282-2-yahui.cao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191118222343.45282-2-yahui.cao@intel.com",
    "date": "2019-11-18T22:23:42",
    "name": "[v2,1/2] net/ice: fix FDIR programming status check issue",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a07aeba1d04e04d3f548669b89bc358db692b9d5",
    "submitter": {
        "id": 1176,
        "url": "https://patches.dpdk.org/api/people/1176/?format=api",
        "name": "Cao, Yahui",
        "email": "yahui.cao@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "https://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191118222343.45282-2-yahui.cao@intel.com/mbox/",
    "series": [
        {
            "id": 7504,
            "url": "https://patches.dpdk.org/api/series/7504/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=7504",
            "date": "2019-11-18T22:23:41",
            "name": "fix testpmd quit error after FDIR rule created",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/7504/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/63090/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/63090/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1D513A0350;\n\tMon, 18 Nov 2019 15:40:01 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 45A4F2B8E;\n\tMon, 18 Nov 2019 15:39:54 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id 647729E4\n for <dev@dpdk.org>; Mon, 18 Nov 2019 15:39:50 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 18 Nov 2019 06:39:50 -0800",
            "from dpdk-yahui-skylake.sh.intel.com ([10.67.119.16])\n by orsmga005.jf.intel.com with ESMTP; 18 Nov 2019 06:39:48 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,320,1569308400\"; d=\"scan'208\";a=\"380674941\"",
        "From": "Yahui Cao <yahui.cao@intel.com>",
        "To": "Qiming Yang <qiming.yang@intel.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Yahui Cao <yahui.cao@intel.com>, Xiaolong Ye <xiaolong.ye@intel.com>,\n Beilei Xing <beilei.xing@intel.com>",
        "Date": "Tue, 19 Nov 2019 06:23:42 +0800",
        "Message-Id": "<20191118222343.45282-2-yahui.cao@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191118222343.45282-1-yahui.cao@intel.com>",
        "References": "<20191113160921.90573-1-yahui.cao@intel.com>\n <20191118222343.45282-1-yahui.cao@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] net/ice: fix FDIR programming status\n\tcheck issue",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "To make sure if FDIR programming succeed or fail, legacy programming\nstatus descriptor WB format is enabled and FDIR queue irq is opened.\n\nFixes: 84dc7a95a2d3 (\"net/ice: enable flow director engine\")\nCc: beilei.xing@intel.com\n\nSigned-off-by: Yahui Cao <yahui.cao@intel.com>\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n drivers/net/ice/ice_ethdev.c |  1 +\n drivers/net/ice/ice_rxtx.c   | 93 +++++++++++++++++++++++++++++++++---\n 2 files changed, 88 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 837a26fd9..2e919c579 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -2730,6 +2730,7 @@ ice_rxq_intr_setup(struct rte_eth_dev *dev)\n \n \t/* Enable FDIR MSIX interrupt */\n \tif (pf->fdir.fdir_vsi) {\n+\t\tpf->fdir.fdir_vsi->nb_used_qps = 1;\n \t\tice_vsi_queues_bind_intr(pf->fdir.fdir_vsi);\n \t\tice_vsi_enable_queues_intr(pf->fdir.fdir_vsi);\n \t}\ndiff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c\nindex 18c02979e..2db174456 100644\n--- a/drivers/net/ice/ice_rxtx.c\n+++ b/drivers/net/ice/ice_rxtx.c\n@@ -535,7 +535,7 @@ ice_fdir_program_hw_rx_queue(struct ice_rx_queue *rxq)\n {\n \tstruct ice_vsi *vsi = rxq->vsi;\n \tstruct ice_hw *hw = ICE_VSI_TO_HW(vsi);\n-\tuint32_t rxdid = ICE_RXDID_COMMS_GENERIC;\n+\tuint32_t rxdid = ICE_RXDID_LEGACY_1;\n \tstruct ice_rlan_ctx rx_ctx;\n \tenum ice_status err;\n \tuint32_t regval;\n@@ -550,9 +550,7 @@ ice_fdir_program_hw_rx_queue(struct ice_rx_queue *rxq)\n \trx_ctx.dbuf = rxq->rx_buf_len >> ICE_RLAN_CTX_DBUF_S;\n \trx_ctx.hbuf = rxq->rx_hdr_len >> ICE_RLAN_CTX_HBUF_S;\n \trx_ctx.dtype = 0; /* No Header Split mode */\n-#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC\n \trx_ctx.dsize = 1; /* 32B descriptors */\n-#endif\n \trx_ctx.rxmax = RTE_ETHER_MAX_LEN;\n \t/* TPH: Transaction Layer Packet (TLP) processing hints */\n \trx_ctx.tphrdesc_ena = 1;\n@@ -2077,7 +2075,7 @@ ice_fdir_setup_rx_resources(struct ice_pf *pf)\n \t}\n \n \t/* Allocate RX hardware ring descriptors. */\n-\tring_size = sizeof(union ice_rx_flex_desc) * ICE_FDIR_NUM_RX_DESC;\n+\tring_size = sizeof(union ice_32byte_rx_desc) * ICE_FDIR_NUM_RX_DESC;\n \tring_size = RTE_ALIGN(ring_size, ICE_DMA_MEM_ALIGN);\n \n \trz = rte_eth_dma_zone_reserve(dev, \"fdir_rx_ring\",\n@@ -2096,7 +2094,7 @@ ice_fdir_setup_rx_resources(struct ice_pf *pf)\n \n \trxq->rx_ring_dma = rz->iova;\n \tmemset(rz->addr, 0, ICE_FDIR_NUM_RX_DESC *\n-\t       sizeof(union ice_rx_flex_desc));\n+\t       sizeof(union ice_32byte_rx_desc));\n \trxq->rx_ring = (union ice_rx_flex_desc *)rz->addr;\n \n \t/*\n@@ -3607,12 +3605,81 @@ ice_set_default_ptype_table(struct rte_eth_dev *dev)\n \t\tad->ptype_tbl[i] = ice_get_default_pkt_type(i);\n }\n \n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_PROGID_S\t1\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_PROGID_M\t\\\n+\t\t\t(0x3UL << ICE_RX_PROG_STATUS_DESC_WB_QW1_PROGID_S)\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_PROG_ADD 0\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_PROG_DEL 0x1\n+\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_S\t4\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_M\t\\\n+\t(1 << ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_S)\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_PROF_S\t5\n+#define ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_PROF_M\t\\\n+\t(1 << ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_PROF_S)\n+\n+/*\n+ * check the programming status descriptor in rx queue.\n+ * done after Programming Flow Director is programmed on\n+ * tx queue\n+ */\n+static inline int\n+ice_check_fdir_programming_status(struct ice_rx_queue *rxq)\n+{\n+\tvolatile union ice_32byte_rx_desc *rxdp;\n+\tuint64_t qword1;\n+\tuint32_t rx_status;\n+\tuint32_t error;\n+\tuint32_t id;\n+\tint ret = -EAGAIN;\n+\n+\trxdp = (volatile union ice_32byte_rx_desc *)\n+\t\t(&rxq->rx_ring[rxq->rx_tail]);\n+\tqword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len);\n+\trx_status = (qword1 & ICE_RXD_QW1_STATUS_M)\n+\t\t\t>> ICE_RXD_QW1_STATUS_S;\n+\n+\tif (rx_status & (1 << ICE_RX_DESC_STATUS_DD_S)) {\n+\t\tret = 0;\n+\t\terror = (qword1 & ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_M) >>\n+\t\t\tICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_S;\n+\t\tid = (qword1 & ICE_RX_PROG_STATUS_DESC_WB_QW1_PROGID_M) >>\n+\t\t\tICE_RX_PROG_STATUS_DESC_WB_QW1_PROGID_S;\n+\t\tif (error) {\n+\t\t\tif (id == ICE_RX_PROG_STATUS_DESC_WB_QW1_PROG_ADD)\n+\t\t\t\tPMD_DRV_LOG(ERR, \"Failed to add FDIR rule.\");\n+\t\t\telse if (id == ICE_RX_PROG_STATUS_DESC_WB_QW1_PROG_DEL)\n+\t\t\t\tPMD_DRV_LOG(ERR, \"Failed to remove FDIR rule.\");\n+\t\t\tret = -EINVAL;\n+\t\t\tgoto err;\n+\t\t}\n+\t\terror = (qword1 & ICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_PROF_M) >>\n+\t\t\tICE_RX_PROG_STATUS_DESC_WB_QW1_FAIL_PROF_S;\n+\t\tif (error) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Failed to create FDIR profile.\");\n+\t\t\tret = -EINVAL;\n+\t\t}\n+err:\n+\t\trxdp->wb.qword1.status_error_len = 0;\n+\t\trxq->rx_tail++;\n+\t\tif (unlikely(rxq->rx_tail == rxq->nb_rx_desc))\n+\t\t\trxq->rx_tail = 0;\n+\t\tif (rxq->rx_tail == 0)\n+\t\t\tICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);\n+\t\telse\n+\t\t\tICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1);\n+\t}\n+\n+\treturn ret;\n+}\n+\n #define ICE_FDIR_MAX_WAIT_US 10000\n \n int\n ice_fdir_programming(struct ice_pf *pf, struct ice_fltr_desc *fdir_desc)\n {\n \tstruct ice_tx_queue *txq = pf->fdir.txq;\n+\tstruct ice_rx_queue *rxq = pf->fdir.rxq;\n \tvolatile struct ice_fltr_desc *fdirdp;\n \tvolatile struct ice_tx_desc *txdp;\n \tuint32_t td_cmd;\n@@ -3650,5 +3717,19 @@ ice_fdir_programming(struct ice_pf *pf, struct ice_fltr_desc *fdir_desc)\n \t\treturn -ETIMEDOUT;\n \t}\n \n-\treturn 0;\n+\tfor (; i < ICE_FDIR_MAX_WAIT_US; i++) {\n+\t\tint ret;\n+\n+\t\tret = ice_check_fdir_programming_status(rxq);\n+\t\tif (ret == -EAGAIN)\n+\t\t\trte_delay_us(1);\n+\t\telse\n+\t\t\treturn ret;\n+\t}\n+\n+\tPMD_DRV_LOG(ERR,\n+\t\t    \"Failed to program FDIR filter: programming status reported.\");\n+\treturn -ETIMEDOUT;\n+\n+\n }\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}