get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86825,
    "url": "http://patches.dpdk.org/api/patches/86825/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210118203508.1332-6-aboyer@pensando.io/",
    "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": "<20210118203508.1332-6-aboyer@pensando.io>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210118203508.1332-6-aboyer@pensando.io",
    "date": "2021-01-18T20:35:00",
    "name": "[05/13] net/ionic: query firmware for supported queue versions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "95eb25cf0477145746766a86e0ac6a7f01cc4ce8",
    "submitter": {
        "id": 2036,
        "url": "http://patches.dpdk.org/api/people/2036/?format=api",
        "name": "Andrew Boyer",
        "email": "aboyer@pensando.io"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210118203508.1332-6-aboyer@pensando.io/mbox/",
    "series": [
        {
            "id": 14820,
            "url": "http://patches.dpdk.org/api/series/14820/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14820",
            "date": "2021-01-18T20:34:55",
            "name": "net/ionic: fixes and optimizations",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/14820/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/86825/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/86825/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 336F8A0A03;\n\tMon, 18 Jan 2021 21:36:10 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EAED1140E52;\n\tMon, 18 Jan 2021 21:35:45 +0100 (CET)",
            "from mail-pl1-f175.google.com (mail-pl1-f175.google.com\n [209.85.214.175])\n by mails.dpdk.org (Postfix) with ESMTP id DCA0E140E45\n for <dev@dpdk.org>; Mon, 18 Jan 2021 21:35:42 +0100 (CET)",
            "by mail-pl1-f175.google.com with SMTP id be12so9251549plb.4\n for <dev@dpdk.org>; Mon, 18 Jan 2021 12:35:42 -0800 (PST)",
            "from driver-dev1.pensando.io ([12.226.153.42])\n by smtp.gmail.com with ESMTPSA id g201sm795160pfb.81.2021.01.18.12.35.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 18 Jan 2021 12:35:41 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=rbeGXakVOyArx4Pub4V5+kfSdWUNGvX+0y/H638l8Ws=;\n b=wb0nPQbxslejtJBhh2e7tg2zYBsb/qawKLCgaIs69DF7bbTV6FdKRNZyCZ85dIr6pk\n UV5TFdPlFCU9ZbhftAzRI9mBZyTvpkwJ9udeAaUS/ylXpZMYBBoO8haGEXH1sNxB+9vi\n mMmY+wsNuvVfBwJ6Nay4LppiZYjMY0cTBOjgzcJSo0h6IrbCWTNUJR1167rkwzpVVV3t\n CjduTLyzq47OyWFQtyKEJqnmIF7kcti2xO+gyF3BW7pnoIieZ9UanAhPT+uUjDifL+2r\n 92HFdHrAVQNLiOb2AtC1sWhLTkI6WX53r58ebhB+Zx94iqpUU5kSbl0FGflf0oxPdBIF\n 7oZg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=rbeGXakVOyArx4Pub4V5+kfSdWUNGvX+0y/H638l8Ws=;\n b=oZFonT87qdR3pN5QXSjvjaZX8TDVSshgDP/m6B4lHHE6KTHBJiJPy69xHXDiL95IGK\n QINRlluP5eQo5WUcsv+AUrPP8eg+GLFcykAGmFnlmRZ3JSOe+2/qN1T7X5XeLDWB5MIQ\n Z63EogLkV3rKJwlgOcm8fapx4oesVGv+9ZEzJYnX3UuUURDVT8ICyCLQY9XlfDILj/+l\n WlhiZceZ6ouKTe4gR/g+yEtd+maYgdqNXpXBw8CWtgQsT1qldLnZStyeCxWc+Dsw/UK+\n 09uT4aLGtYDatfAhq8k1b4yMcYcvaKIeriA96L+NJounJKC1m4ErBLGE8A+f1PUxO0f8\n uNpA==",
        "X-Gm-Message-State": "AOAM530aVjNaryUrJ49AhCvs9TbX1owkMTe3/Bnp+u7S0ixgyfQRweSk\n hOpcEPFhtPZFTZdjOqCWqzgd0btT/IIHKg==",
        "X-Google-Smtp-Source": "\n ABdhPJyRvhsxUXS+H7OTawgBPsMcU8tiVEWr42BhnK9tFh8Y0e9Ur3GvY4GDxtHbDOKQE0lPeNpKvA==",
        "X-Received": "by 2002:a17:90b:60c:: with SMTP id\n gb12mr1126125pjb.125.1611002141928;\n Mon, 18 Jan 2021 12:35:41 -0800 (PST)",
        "From": "Andrew Boyer <aboyer@pensando.io>",
        "To": "dev@dpdk.org",
        "Cc": "Alfredo Cardigliano <cardigliano@ntop.org>,\n Andrew Boyer <aboyer@pensando.io>, Shannon Nelson <shannon@pensando.io>",
        "Date": "Mon, 18 Jan 2021 12:35:00 -0800",
        "Message-Id": "<20210118203508.1332-6-aboyer@pensando.io>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210118203508.1332-1-aboyer@pensando.io>",
        "References": "<20210118203508.1332-1-aboyer@pensando.io>",
        "Subject": "[dpdk-dev] [PATCH 05/13] net/ionic: query firmware for supported\n queue versions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "This allows the PMD to better support FW changes.\n\nSigned-off-by: Andrew Boyer <aboyer@pensando.io>\nSigned-off-by: Shannon Nelson <shannon@pensando.io>\n---\n drivers/net/ionic/ionic_dev.c | 15 ++++++\n drivers/net/ionic/ionic_dev.h |  3 ++\n drivers/net/ionic/ionic_lif.c | 95 +++++++++++++++++++++++++++++++++++\n drivers/net/ionic/ionic_lif.h | 15 ++++++\n 4 files changed, 128 insertions(+)",
    "diff": "diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c\nindex c4e871187d..eef015686f 100644\n--- a/drivers/net/ionic/ionic_dev.c\n+++ b/drivers/net/ionic/ionic_dev.c\n@@ -273,6 +273,20 @@ ionic_dev_cmd_port_loopback(struct ionic_dev *idev, uint8_t loopback_mode)\n \n /* LIF commands */\n \n+void\n+ionic_dev_cmd_queue_identify(struct ionic_dev *idev,\n+\t\tuint16_t lif_type, uint8_t qtype, uint8_t qver)\n+{\n+\tunion ionic_dev_cmd cmd = {\n+\t\t.q_identify.opcode = IONIC_CMD_Q_IDENTIFY,\n+\t\t.q_identify.lif_type = rte_cpu_to_le_16(lif_type),\n+\t\t.q_identify.type = qtype,\n+\t\t.q_identify.ver = qver,\n+\t};\n+\n+\tionic_dev_cmd_go(idev, &cmd);\n+}\n+\n void\n ionic_dev_cmd_lif_identify(struct ionic_dev *idev, uint8_t type, uint8_t ver)\n {\n@@ -329,6 +343,7 @@ ionic_dev_cmd_adminq_init(struct ionic_dev *idev, struct ionic_qcq *qcq)\n \tunion ionic_dev_cmd cmd = {\n \t\t.q_init.opcode = IONIC_CMD_Q_INIT,\n \t\t.q_init.type = q->type,\n+\t\t.q_init.ver = qcq->lif->qtype_info[q->type].version,\n \t\t.q_init.index = rte_cpu_to_le_32(q->index),\n \t\t.q_init.flags = rte_cpu_to_le_16(IONIC_QINIT_F_ENA),\n \t\t.q_init.intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE),\ndiff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h\nindex 6ee2918959..6931930543 100644\n--- a/drivers/net/ionic/ionic_dev.h\n+++ b/drivers/net/ionic/ionic_dev.h\n@@ -227,6 +227,9 @@ void ionic_dev_cmd_port_pause(struct ionic_dev *idev, uint8_t pause_type);\n void ionic_dev_cmd_port_loopback(struct ionic_dev *idev,\n \tuint8_t loopback_mode);\n \n+void ionic_dev_cmd_queue_identify(struct ionic_dev *idev,\n+\tuint16_t lif_type, uint8_t qtype, uint8_t qver);\n+\n void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, uint8_t type,\n \tuint8_t ver);\n void ionic_dev_cmd_lif_init(struct ionic_dev *idev, rte_iova_t addr);\ndiff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c\nindex df8832f908..0d2b3d56a7 100644\n--- a/drivers/net/ionic/ionic_lif.c\n+++ b/drivers/net/ionic/ionic_lif.c\n@@ -12,6 +12,21 @@\n #include \"ionic_rx_filter.h\"\n #include \"ionic_rxtx.h\"\n \n+/* queuetype support level */\n+static const uint8_t ionic_qtype_vers[IONIC_QTYPE_MAX] = {\n+\t[IONIC_QTYPE_ADMINQ]  = 0,   /* 0 = Base version with CQ support */\n+\t[IONIC_QTYPE_NOTIFYQ] = 0,   /* 0 = Base version */\n+\t[IONIC_QTYPE_RXQ]     = 2,   /* 0 = Base version with CQ+SG support\n+\t\t\t\t      * 1 =       ... with EQ\n+\t\t\t\t      * 2 =       ... with CMB\n+\t\t\t\t      */\n+\t[IONIC_QTYPE_TXQ]     = 3,   /* 0 = Base version with CQ+SG support\n+\t\t\t\t      * 1 =   ... with Tx SG version 1\n+\t\t\t\t      * 2 =       ... with EQ\n+\t\t\t\t      * 3 =       ... with CMB\n+\t\t\t\t      */\n+};\n+\n static int ionic_lif_addr_add(struct ionic_lif *lif, const uint8_t *addr);\n static int ionic_lif_addr_del(struct ionic_lif *lif, const uint8_t *addr);\n \n@@ -818,6 +833,81 @@ ionic_bus_map_dbpage(struct ionic_adapter *adapter, int page_num)\n \treturn (void *)&vaddr[page_num << PAGE_SHIFT];\n }\n \n+static void\n+ionic_lif_queue_identify(struct ionic_lif *lif)\n+{\n+\tstruct ionic_adapter *adapter = lif->adapter;\n+\tstruct ionic_dev *idev = &adapter->idev;\n+\tunion ionic_q_identity *q_ident = &adapter->ident.txq;\n+\tuint32_t q_words = IONIC_ARRAY_SIZE(q_ident->words);\n+\tuint32_t cmd_words = IONIC_ARRAY_SIZE(idev->dev_cmd->data);\n+\tuint32_t i, nwords, qtype;\n+\tint err;\n+\n+\tfor (qtype = 0; qtype < IONIC_ARRAY_SIZE(ionic_qtype_vers); qtype++) {\n+\t\tstruct ionic_qtype_info *qti = &lif->qtype_info[qtype];\n+\n+\t\t/* Filter out the types this driver knows about */\n+\t\tswitch (qtype) {\n+\t\tcase IONIC_QTYPE_ADMINQ:\n+\t\tcase IONIC_QTYPE_NOTIFYQ:\n+\t\tcase IONIC_QTYPE_RXQ:\n+\t\tcase IONIC_QTYPE_TXQ:\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tmemset(qti, 0, sizeof(*qti));\n+\n+\t\tionic_dev_cmd_queue_identify(idev, IONIC_LIF_TYPE_CLASSIC,\n+\t\t\tqtype, ionic_qtype_vers[qtype]);\n+\t\terr = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);\n+\t\tif (err == -EINVAL) {\n+\t\t\tIONIC_PRINT(ERR, \"qtype %d not supported\\n\", qtype);\n+\t\t\tcontinue;\n+\t\t} else if (err == -EIO) {\n+\t\t\tIONIC_PRINT(ERR, \"q_ident failed, older FW\\n\");\n+\t\t\treturn;\n+\t\t} else if (err) {\n+\t\t\tIONIC_PRINT(ERR, \"q_ident failed, qtype %d: %d\\n\",\n+\t\t\t\tqtype, err);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tnwords = RTE_MIN(q_words, cmd_words);\n+\t\tfor (i = 0; i < nwords; i++)\n+\t\t\tq_ident->words[i] = ioread32(&idev->dev_cmd->data[i]);\n+\n+\t\tqti->version   = q_ident->version;\n+\t\tqti->supported = q_ident->supported;\n+\t\tqti->features  = rte_le_to_cpu_64(q_ident->features);\n+\t\tqti->desc_sz   = rte_le_to_cpu_16(q_ident->desc_sz);\n+\t\tqti->comp_sz   = rte_le_to_cpu_16(q_ident->comp_sz);\n+\t\tqti->sg_desc_sz   = rte_le_to_cpu_16(q_ident->sg_desc_sz);\n+\t\tqti->max_sg_elems = rte_le_to_cpu_16(q_ident->max_sg_elems);\n+\t\tqti->sg_desc_stride =\n+\t\t\trte_le_to_cpu_16(q_ident->sg_desc_stride);\n+\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].version = %d\",\n+\t\t\tqtype, qti->version);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].supported = %#x\",\n+\t\t\tqtype, qti->supported);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].features = %#jx\",\n+\t\t\tqtype, qti->features);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].desc_sz = %d\",\n+\t\t\tqtype, qti->desc_sz);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].comp_sz = %d\",\n+\t\t\tqtype, qti->comp_sz);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].sg_desc_sz = %d\",\n+\t\t\tqtype, qti->sg_desc_sz);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].max_sg_elems = %d\",\n+\t\t\tqtype, qti->max_sg_elems);\n+\t\tIONIC_PRINT(DEBUG, \" qtype[%d].sg_desc_stride = %d\",\n+\t\t\tqtype, qti->sg_desc_stride);\n+\t}\n+}\n+\n int\n ionic_lif_alloc(struct ionic_lif *lif)\n {\n@@ -833,6 +923,8 @@ ionic_lif_alloc(struct ionic_lif *lif)\n \n \tIONIC_PRINT(DEBUG, \"LIF: %s\", lif->name);\n \n+\tionic_lif_queue_identify(lif);\n+\n \tIONIC_PRINT(DEBUG, \"Allocating Lif Info\");\n \n \trte_spinlock_init(&lif->adminq_lock);\n@@ -1261,6 +1353,7 @@ ionic_lif_notifyq_init(struct ionic_lif *lif)\n \t\t.cmd.q_init = {\n \t\t\t.opcode = IONIC_CMD_Q_INIT,\n \t\t\t.type = q->type,\n+\t\t\t.ver = lif->qtype_info[q->type].version,\n \t\t\t.index = rte_cpu_to_le_32(q->index),\n \t\t\t.intr_index = rte_cpu_to_le_16(qcq->intr.index),\n \t\t\t.flags = rte_cpu_to_le_16(IONIC_QINIT_F_IRQ |\n@@ -1365,6 +1458,7 @@ ionic_lif_txq_init(struct ionic_qcq *qcq)\n \t\t.cmd.q_init = {\n \t\t\t.opcode = IONIC_CMD_Q_INIT,\n \t\t\t.type = q->type,\n+\t\t\t.ver = lif->qtype_info[q->type].version,\n \t\t\t.index = rte_cpu_to_le_32(q->index),\n \t\t\t.flags = rte_cpu_to_le_16(IONIC_QINIT_F_SG |\n \t\t\t\t\t\tIONIC_QINIT_F_ENA),\n@@ -1411,6 +1505,7 @@ ionic_lif_rxq_init(struct ionic_qcq *qcq)\n \t\t.cmd.q_init = {\n \t\t\t.opcode = IONIC_CMD_Q_INIT,\n \t\t\t.type = q->type,\n+\t\t\t.ver = lif->qtype_info[q->type].version,\n \t\t\t.index = rte_cpu_to_le_32(q->index),\n \t\t\t.flags = rte_cpu_to_le_16(IONIC_QINIT_F_SG |\n \t\t\t\t\t\tIONIC_QINIT_F_ENA),\ndiff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h\nindex d245c6da01..bf5637afce 100644\n--- a/drivers/net/ionic/ionic_lif.h\n+++ b/drivers/net/ionic/ionic_lif.h\n@@ -73,6 +73,17 @@ struct ionic_qcq {\n #define IONIC_Q_TO_TX_STATS(q)\t(&IONIC_Q_TO_QCQ(q)->stats.tx)\n #define IONIC_Q_TO_RX_STATS(q)\t(&IONIC_Q_TO_QCQ(q)->stats.rx)\n \n+struct ionic_qtype_info {\n+\tuint8_t  version;\n+\tuint8_t  supported;\n+\tuint64_t features;\n+\tuint16_t desc_sz;\n+\tuint16_t comp_sz;\n+\tuint16_t sg_desc_sz;\n+\tuint16_t max_sg_elems;\n+\tuint16_t sg_desc_stride;\n+};\n+\n #define IONIC_LIF_F_INITED\t\tBIT(0)\n #define IONIC_LIF_F_LINK_CHECK_NEEDED\tBIT(1)\n #define IONIC_LIF_F_UP\t\t\tBIT(2)\n@@ -112,6 +123,10 @@ struct ionic_lif {\n \tstruct ionic_lif_info *info;\n \trte_iova_t info_pa;\n \tconst struct rte_memzone *info_z;\n+\n+\tstruct ionic_qtype_info qtype_info[IONIC_QTYPE_MAX];\n+\tuint8_t qtype_ver[IONIC_QTYPE_MAX];\n+\n \tstruct rte_eth_stats stats_base;\n \tstruct ionic_lif_stats lif_stats_base;\n };\n",
    "prefixes": [
        "05/13"
    ]
}