get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54075,
    "url": "http://patches.dpdk.org/api/patches/54075/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190602152434.23996-20-jerinj@marvell.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": "<20190602152434.23996-20-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190602152434.23996-20-jerinj@marvell.com",
    "date": "2019-06-02T15:23:55",
    "name": "[v1,19/58] net/octeontx2: handle port reconfigure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "70f88703b4afc22ffc6f4ef0d116b2ca24d37a22",
    "submitter": {
        "id": 1188,
        "url": "http://patches.dpdk.org/api/people/1188/?format=api",
        "name": "Jerin Jacob Kollanukkaran",
        "email": "jerinj@marvell.com"
    },
    "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/20190602152434.23996-20-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 4848,
            "url": "http://patches.dpdk.org/api/series/4848/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4848",
            "date": "2019-06-02T15:23:36",
            "name": "OCTEON TX2 Ethdev driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4848/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54075/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54075/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 6C4DF1B9D0;\n\tSun,  2 Jun 2019 17:25:38 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 962AD1B9DC\n\tfor <dev@dpdk.org>; Sun,  2 Jun 2019 17:25:36 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx52FKK4d020364; Sun, 2 Jun 2019 08:25:36 -0700",
            "from sc-exch03.marvell.com ([199.233.58.183])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2survk4944-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tSun, 02 Jun 2019 08:25:35 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tSun, 2 Jun 2019 08:25:34 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Sun, 2 Jun 2019 08:25:34 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n\tby maili.marvell.com (Postfix) with ESMTP id DC0D23F703F;\n\tSun,  2 Jun 2019 08:25:32 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=/oOWJepU5UtLYYd4xeubYpSbzzmFx3IkEW/3nBzYjYM=;\n\tb=J6WiUaHptKzZFUJmGB63x707eeAzoP1B1RLi98xcPOGytYq69xU8tEZPly0HhC8m83Cj\n\tjoMOEWju/WrULcEJDH4fuCfoYQRuXGgCU6pkcWoMOu0rLPG/zL5EGl87Mhb1kpvV+Fq5\n\tELPuJepq0wJ2Kxe0GNGAWHgntC5v8FQ9d0I/9pcdVUKZ1E9bDUt0LAY/Gb+UN7muGRFN\n\t4XtvMW2Y2ditrueJuIH1Q5SNsiR8p/qspp0/O8XcV6rtj7fgowNcjLGqwPmXrfiocdzu\n\tlNZziTOafrHANWEsv70XkLgvDfSXRqVK3UcTtIeii3EHUw1hcv6LPuNtOELIIOMyOpnv\n\tPw== ",
        "From": "<jerinj@marvell.com>",
        "To": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram\n\t<ndabilpuram@marvell.com>, Kiran Kumar K <kirankumark@marvell.com>",
        "CC": "<ferruh.yigit@intel.com>, Vamsi Attunuru <vattunuru@marvell.com>",
        "Date": "Sun, 2 Jun 2019 20:53:55 +0530",
        "Message-ID": "<20190602152434.23996-20-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190602152434.23996-1-jerinj@marvell.com>",
        "References": "<20190602152434.23996-1-jerinj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-02_09:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH v1 19/58] net/octeontx2: handle port reconfigure",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Vamsi Attunuru <vattunuru@marvell.com>\n\nsetup tx & rx queues with the previous configuration during\nport reconfig, it handles cases like port reconfigure without\nreconfiguring tx & rx queues.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\n drivers/net/octeontx2/otx2_ethdev.c | 180 ++++++++++++++++++++++++++++\n drivers/net/octeontx2/otx2_ethdev.h |   2 +\n 2 files changed, 182 insertions(+)",
    "diff": "diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c\nindex b501ba865..6e14e12f0 100644\n--- a/drivers/net/octeontx2/otx2_ethdev.c\n+++ b/drivers/net/octeontx2/otx2_ethdev.c\n@@ -787,6 +787,172 @@ otx2_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t sq,\n \treturn rc;\n }\n \n+static int\n+nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);\n+\tstruct otx2_eth_qconf *tx_qconf = NULL;\n+\tstruct otx2_eth_qconf *rx_qconf = NULL;\n+\tstruct otx2_eth_txq **txq;\n+\tstruct otx2_eth_rxq **rxq;\n+\tint i, nb_rxq, nb_txq;\n+\n+\tnb_rxq = RTE_MIN(dev->configured_nb_rx_qs, eth_dev->data->nb_rx_queues);\n+\tnb_txq = RTE_MIN(dev->configured_nb_tx_qs, eth_dev->data->nb_tx_queues);\n+\n+\ttx_qconf = malloc(nb_txq * sizeof(*tx_qconf));\n+\tif (tx_qconf == NULL) {\n+\t\totx2_err(\"Failed to allocate memory for tx_qconf\");\n+\t\tgoto fail;\n+\t}\n+\n+\trx_qconf = malloc(nb_rxq * sizeof(*rx_qconf));\n+\tif (rx_qconf == NULL) {\n+\t\totx2_err(\"Failed to allocate memory for rx_qconf\");\n+\t\tgoto fail;\n+\t}\n+\n+\ttxq = (struct otx2_eth_txq **)eth_dev->data->tx_queues;\n+\tfor (i = 0; i < nb_txq; i++) {\n+\t\tif (txq[i] == NULL) {\n+\t\t\totx2_err(\"txq[%d] is already released\", i);\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tmemcpy(&tx_qconf[i], &txq[i]->qconf, sizeof(*tx_qconf));\n+\t\totx2_nix_tx_queue_release(txq[i]);\n+\t\teth_dev->data->tx_queues[i] = NULL;\n+\t}\n+\n+\trxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues;\n+\tfor (i = 0; i < nb_rxq; i++) {\n+\t\tif (rxq[i] == NULL) {\n+\t\t\totx2_err(\"rxq[%d] is already released\", i);\n+\t\t\tgoto fail;\n+\t\t}\n+\t\tmemcpy(&rx_qconf[i], &rxq[i]->qconf, sizeof(*rx_qconf));\n+\t\totx2_nix_rx_queue_release(rxq[i]);\n+\t\teth_dev->data->rx_queues[i] = NULL;\n+\t}\n+\n+\tdev->tx_qconf = tx_qconf;\n+\tdev->rx_qconf = rx_qconf;\n+\treturn 0;\n+\n+fail:\n+\tif (tx_qconf)\n+\t\tfree(tx_qconf);\n+\tif (rx_qconf)\n+\t\tfree(rx_qconf);\n+\n+\treturn -ENOMEM;\n+}\n+\n+static int\n+nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);\n+\tstruct otx2_eth_qconf *tx_qconf = dev->tx_qconf;\n+\tstruct otx2_eth_qconf *rx_qconf = dev->rx_qconf;\n+\tstruct otx2_eth_txq **txq;\n+\tstruct otx2_eth_rxq **rxq;\n+\tint rc, i, nb_rxq, nb_txq;\n+\n+\tnb_rxq = RTE_MIN(dev->configured_nb_rx_qs, eth_dev->data->nb_rx_queues);\n+\tnb_txq = RTE_MIN(dev->configured_nb_tx_qs, eth_dev->data->nb_tx_queues);\n+\n+\trc = -ENOMEM;\n+\t/* Setup tx & rx queues with previous configuration so\n+\t * that the queues can be functional in cases like ports\n+\t * are started without re configuring queues.\n+\t *\n+\t * Usual re config sequence is like below:\n+\t * port_configure() {\n+\t *      if(reconfigure) {\n+\t *              queue_release()\n+\t *              queue_setup()\n+\t *      }\n+\t *      queue_configure() {\n+\t *              queue_release()\n+\t *              queue_setup()\n+\t *      }\n+\t * }\n+\t * port_start()\n+\t *\n+\t * In some application's control path, queue_configure() would\n+\t * NOT be invoked for TXQs/RXQs in port_configure().\n+\t * In such cases, queues can be functional after start as the\n+\t * queues are already setup in port_configure().\n+\t */\n+\tfor (i = 0; i < nb_txq; i++) {\n+\t\trc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc,\n+\t\t\t\t\t     tx_qconf[i].socket_id,\n+\t\t\t\t\t     &tx_qconf[i].conf.tx);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to setup tx queue rc=%d\", rc);\n+\t\t\ttxq = (struct otx2_eth_txq **)eth_dev->data->tx_queues;\n+\t\t\tfor (i -= 1; i >= 0; i--)\n+\t\t\t\totx2_nix_tx_queue_release(txq[i]);\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\tfree(tx_qconf); tx_qconf = NULL;\n+\n+\tfor (i = 0; i < nb_rxq; i++) {\n+\t\trc = otx2_nix_rx_queue_setup(eth_dev, i, rx_qconf[i].nb_desc,\n+\t\t\t\t\t     rx_qconf[i].socket_id,\n+\t\t\t\t\t     &rx_qconf[i].conf.rx,\n+\t\t\t\t\t     rx_qconf[i].mempool);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to setup rx queue rc=%d\", rc);\n+\t\t\trxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues;\n+\t\t\tfor (i -= 1; i >= 0; i--)\n+\t\t\t\totx2_nix_rx_queue_release(rxq[i]);\n+\t\t\tgoto release_tx_queues;\n+\t\t}\n+\t}\n+\n+\tfree(rx_qconf); rx_qconf = NULL;\n+\n+\treturn 0;\n+\n+release_tx_queues:\n+\ttxq = (struct otx2_eth_txq **)eth_dev->data->tx_queues;\n+\tfor (i = 0; i < eth_dev->data->nb_tx_queues; i++)\n+\t\totx2_nix_tx_queue_release(txq[i]);\n+fail:\n+\tif (tx_qconf)\n+\t\tfree(tx_qconf);\n+\tif (rx_qconf)\n+\t\tfree(rx_qconf);\n+\n+\treturn rc;\n+}\n+\n+static uint16_t\n+nix_eth_nop_burst(void *queue, struct rte_mbuf **mbufs, uint16_t pkts)\n+{\n+\tRTE_SET_USED(queue);\n+\tRTE_SET_USED(mbufs);\n+\tRTE_SET_USED(pkts);\n+\n+\treturn 0;\n+}\n+\n+static void\n+nix_set_nop_rxtx_function(struct rte_eth_dev *eth_dev)\n+{\n+\t/* These dummy functions are required for supporting\n+\t * some applications which reconfigure queues without\n+\t * stopping tx burst and rx burst threads(eg kni app)\n+\t * When the queues context is saved, txq/rxqs are released\n+\t * which caused app crash since rx/tx burst is still\n+\t * on different lcores\n+\t */\n+\teth_dev->tx_pkt_burst = nix_eth_nop_burst;\n+\teth_dev->rx_pkt_burst = nix_eth_nop_burst;\n+\trte_mb();\n+}\n \n static int\n otx2_nix_configure(struct rte_eth_dev *eth_dev)\n@@ -843,6 +1009,10 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)\n \t/* Free the resources allocated from the previous configure */\n \tif (dev->configured == 1) {\n \t\toxt2_nix_unregister_queue_irqs(eth_dev);\n+\t\tnix_set_nop_rxtx_function(eth_dev);\n+\t\trc = nix_store_queue_cfg_and_then_release(eth_dev);\n+\t\tif (rc)\n+\t\t\tgoto fail;\n \t\tnix_lf_free(dev);\n \t}\n \n@@ -883,6 +1053,16 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)\n \t\tgoto free_nix_lf;\n \t}\n \n+\t/*\n+\t * Restore queue config when reconfigure followed by\n+\t * reconfigure and no queue configure invoked from application case.\n+\t */\n+\tif (dev->configured == 1) {\n+\t\trc = nix_restore_queue_cfg(eth_dev);\n+\t\tif (rc)\n+\t\t\tgoto free_nix_lf;\n+\t}\n+\n \t/* Update the mac address */\n \tea = eth_dev->data->mac_addrs;\n \tmemcpy(ea, dev->mac_addr, RTE_ETHER_ADDR_LEN);\ndiff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h\nindex 4ec950100..c0568dcd1 100644\n--- a/drivers/net/octeontx2/otx2_ethdev.h\n+++ b/drivers/net/octeontx2/otx2_ethdev.h\n@@ -185,6 +185,8 @@ struct otx2_eth_dev {\n \tuint32_t txmap[RTE_ETHDEV_QUEUE_STAT_CNTRS];\n \tuint32_t rxmap[RTE_ETHDEV_QUEUE_STAT_CNTRS];\n \tstruct otx2_npc_flow_info npc_flow;\n+\tstruct otx2_eth_qconf *tx_qconf;\n+\tstruct otx2_eth_qconf *rx_qconf;\n \tstruct rte_eth_dev *eth_dev;\n } __rte_cache_aligned;\n \n",
    "prefixes": [
        "v1",
        "19/58"
    ]
}