get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 62395,
    "url": "http://patches.dpdk.org/api/patches/62395/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191104202747.12897-5-lance.richardson@broadcom.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": "<20191104202747.12897-5-lance.richardson@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191104202747.12897-5-lance.richardson@broadcom.com",
    "date": "2019-11-04T20:27:47",
    "name": "[4/4] net/bnxt: fix rxq start/stop for Thor based NICs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8299529e4e4f2d8c6c43f32c2144415fe90f9094",
    "submitter": {
        "id": 1323,
        "url": "http://patches.dpdk.org/api/people/1323/?format=api",
        "name": "Lance Richardson",
        "email": "lance.richardson@broadcom.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191104202747.12897-5-lance.richardson@broadcom.com/mbox/",
    "series": [
        {
            "id": 7227,
            "url": "http://patches.dpdk.org/api/series/7227/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7227",
            "date": "2019-11-04T20:27:43",
            "name": "net/bnxt: rxq stop/start fixes",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7227/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/62395/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/62395/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 0B887A0352;\n\tMon,  4 Nov 2019 21:28:29 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 671D74C8E;\n\tMon,  4 Nov 2019 21:28:11 +0100 (CET)",
            "from mail-wr1-f65.google.com (mail-wr1-f65.google.com\n [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 388D0322C\n for <dev@dpdk.org>; Mon,  4 Nov 2019 21:28:10 +0100 (CET)",
            "by mail-wr1-f65.google.com with SMTP id o28so18634058wro.7\n for <dev@dpdk.org>; Mon, 04 Nov 2019 12:28:10 -0800 (PST)",
            "from lrichardson-VirtualBox.dhcp.broadcom.net ([192.19.231.250])\n by smtp.gmail.com with ESMTPSA id i3sm17995365wrw.69.2019.11.04.12.28.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 04 Nov 2019 12:28:08 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=uwdslJjRLdVn1N1xxSV2QD2YnG9fSmHaZLsjcuGS1vw=;\n b=NpzscMxShosk/HLyNWVBNx98ued71b82YxXMP7rsEf+Wpfx6ITU95qtSr8Zjv/PGF3\n 42HTGsUUIy1v7kEuO7hKj1pA42LkifkLMlrfkG0uPxoscEIMxy5Gcff93kGHcfoGgyRm\n adR6YXVL+xqvyN1btXyDvd2QgoFtBF3Wbk9LQ=",
        "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=uwdslJjRLdVn1N1xxSV2QD2YnG9fSmHaZLsjcuGS1vw=;\n b=PR+kgYiL/0Br6DntL8pVHIcH+wdR0rRdLCgfr6iL7Sk4SLdQ2CKdHLbmx43trwyCmY\n tMi6N/aDNAyoSVSBxgZFXQT/l1t2nV3hqzHQyznc2AOnFH1uLhjw/5qelKDyLHSqb7hU\n WgMPQh4PHdh5A2GqJeO508XOcB9ioh1qQR+aSJZoZ9zAIx3FlLGxOWqjKA57Z9i/Ce/V\n ujNuo01qVWbHD3C2KPaW7if3ZE7fantsF48pwbX0jmDO1TjDkV5BOuLKm47oZwVlWjea\n CZBg2BakGiRf16MwASpu4NnEJZ9iOlW6MP0rA1b0DpC/Ky/VoF2o3x/ofZSpzX115AdN\n A68g==",
        "X-Gm-Message-State": "APjAAAVldT/pRk9LOV0NdC67wyjF+wr2KyK/wUEOmLQiuLfHN0+ozyva\n smUGgnkqobfNJkvjsICby3QUL7Qi61kE0R8iQ5wGYVO1FWAhu6yFhmWZehsFulEUEzu3J082nXl\n xv1mVeb/jNVzrrQB0BM6V7n5ckeuEkedDgsFSx10by1U8t3P4jZVl9GRRQ33l8xT0",
        "X-Google-Smtp-Source": "\n APXvYqz6122X5EJk13E7H79az7Q6mBQJ1D+jl+w4razNIh8/gHksFi5B6tns/ozpSPz0cWc7HhubpQ==",
        "X-Received": "by 2002:a5d:4c83:: with SMTP id z3mr25181717wrs.92.1572899289447;\n Mon, 04 Nov 2019 12:28:09 -0800 (PST)",
        "From": "Lance Richardson <lance.richardson@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ajit.khaparde@broadcom.com, ferruh.yigit@intel.com,\n Lance Richardson <lance.richardson@broadcom.com>, stable@dpdk.org",
        "Date": "Mon,  4 Nov 2019 15:27:47 -0500",
        "Message-Id": "<20191104202747.12897-5-lance.richardson@broadcom.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191104202747.12897-1-lance.richardson@broadcom.com>",
        "References": "<20191104202747.12897-1-lance.richardson@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 4/4] net/bnxt: fix rxq start/stop for Thor based\n\tNICs",
        "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": "Controller-specific handling is required for Thor-based NICs when\nstopping or starting a receive queue, otherwise packet reception\nmay not be reliably resumed when a stopped receive queue is\nrestarted:\n  - The VNIC default receive ring needs to be recomputed when a\n    receive queue is stopped or started.\n  - When stopping the last (or only) receive queue for a given\n    VNIC, ensure that no packets can reach the default receive\n    ring by temporarily setting the VNIC MRU to zero.\n\nFixes: f8168ca0e690 (\"net/bnxt: support thor controller\")\nCc: stable@dpdk.org\n\nSigned-off-by: Lance Richardson <lance.richardson@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 27 +++++++++++++++++++++----\n drivers/net/bnxt/bnxt_rxq.c  | 38 +++++++++++++++++++++++++++++++++---\n 2 files changed, 58 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex bb4dcf4b2..2cba007ea 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -1696,10 +1696,29 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n \tHWRM_PREP(req, VNIC_CFG, BNXT_USE_CHIMP_MB);\n \n \tif (BNXT_CHIP_THOR(bp)) {\n-\t\tstruct bnxt_rx_queue *rxq =\n-\t\t\tbp->eth_dev->data->rx_queues[vnic->start_grp_id];\n-\t\tstruct bnxt_rx_ring_info *rxr = rxq->rx_ring;\n-\t\tstruct bnxt_cp_ring_info *cpr = rxq->cp_ring;\n+\t\tint dflt_rxq = vnic->start_grp_id;\n+\t\tstruct bnxt_rx_ring_info *rxr;\n+\t\tstruct bnxt_cp_ring_info *cpr;\n+\t\tstruct bnxt_rx_queue *rxq;\n+\t\tint i;\n+\n+\t\t/*\n+\t\t * The first active receive ring is used as the VNIC\n+\t\t * default receive ring. If there are no active receive\n+\t\t * rings (all corresponding receive queues are stopped),\n+\t\t * the first receive ring is used.\n+\t\t */\n+\t\tfor (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) {\n+\t\t\trxq = bp->eth_dev->data->rx_queues[i];\n+\t\t\tif (rxq->rx_started) {\n+\t\t\t\tdflt_rxq = i;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\trxq = bp->eth_dev->data->rx_queues[dflt_rxq];\n+\t\trxr = rxq->rx_ring;\n+\t\tcpr = rxq->cp_ring;\n \n \t\treq.default_rx_ring_id =\n \t\t\trte_cpu_to_le_16(rxr->rx_ring_struct->fw_ring_id);\ndiff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c\nindex e82eda9d7..e7c012f68 100644\n--- a/drivers/net/bnxt/bnxt_rxq.c\n+++ b/drivers/net/bnxt/bnxt_rxq.c\n@@ -451,6 +451,10 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \tif (rc)\n \t\treturn rc;\n \n+\tif (BNXT_CHIP_THOR(bp)) {\n+\t\t/* Reconfigure default receive ring and MRU. */\n+\t\tbnxt_hwrm_vnic_cfg(bp, rxq->vnic);\n+\t}\n \tPMD_DRV_LOG(INFO, \"Rx queue started %d\\n\", rx_queue_id);\n \n \tif (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {\n@@ -491,7 +495,8 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \tstruct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;\n \tstruct bnxt_vnic_info *vnic = NULL;\n \tstruct bnxt_rx_queue *rxq = NULL;\n-\tint rc = 0;\n+\tint active_queue_cnt = 0;\n+\tint i, rc = 0;\n \n \trc = is_bnxt_in_error(bp);\n \tif (rc)\n@@ -507,8 +512,9 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t}\n \n \trxq = bp->rx_queues[rx_queue_id];\n+\tvnic = rxq->vnic;\n \n-\tif (rxq == NULL) {\n+\tif (!rxq || !vnic) {\n \t\tPMD_DRV_LOG(ERR, \"Invalid Rx queue %d\\n\", rx_queue_id);\n \t\treturn -EINVAL;\n \t}\n@@ -518,7 +524,6 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \tPMD_DRV_LOG(DEBUG, \"Rx queue stopped\\n\");\n \n \tif (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {\n-\t\tvnic = rxq->vnic;\n \t\tif (BNXT_HAS_RING_GRPS(bp))\n \t\t\tvnic->fw_grp_ids[rx_queue_id] = INVALID_HW_RING_ID;\n \n@@ -526,6 +531,33 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t\trc = bnxt_vnic_rss_configure(bp, vnic);\n \t}\n \n+\tif (BNXT_CHIP_THOR(bp)) {\n+\t\t/* Compute current number of active receive queues. */\n+\t\tfor (i = vnic->start_grp_id; i < vnic->end_grp_id; i++)\n+\t\t\tif (bp->rx_queues[i]->rx_started)\n+\t\t\t\tactive_queue_cnt++;\n+\n+\t\t/*\n+\t\t * For Thor, we need to ensure that the VNIC default receive\n+\t\t * ring corresponds to an active receive queue. When no queue\n+\t\t * is active, we need to temporarily set the MRU to zero so\n+\t\t * that packets are dropped early in the receive pipeline in\n+\t\t * order to prevent the VNIC default receive ring from being\n+\t\t * accessed.\n+\t\t */\n+\t\tif (active_queue_cnt == 0) {\n+\t\t\tuint16_t saved_mru = vnic->mru;\n+\n+\t\t\tvnic->mru = 0;\n+\t\t\t/* Reconfigure default receive ring and MRU. */\n+\t\t\tbnxt_hwrm_vnic_cfg(bp, vnic);\n+\t\t\tvnic->mru = saved_mru;\n+\t\t} else {\n+\t\t\t/* Reconfigure default receive ring. */\n+\t\t\tbnxt_hwrm_vnic_cfg(bp, vnic);\n+\t\t}\n+\t}\n+\n \tif (rc == 0)\n \t\tbnxt_rx_queue_release_mbufs(rxq);\n \n",
    "prefixes": [
        "4/4"
    ]
}