get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21035,
    "url": "https://patches.dpdk.org/api/patches/21035/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488414008-162839-11-git-send-email-allain.legacy@windriver.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": "<1488414008-162839-11-git-send-email-allain.legacy@windriver.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488414008-162839-11-git-send-email-allain.legacy@windriver.com",
    "date": "2017-03-02T00:20:02",
    "name": "[dpdk-dev,v3,10/16] net/avp: queue setup and release",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2ee5a1a1031bec6bf1a6312bc138f58c74f0ff8c",
    "submitter": {
        "id": 679,
        "url": "https://patches.dpdk.org/api/people/679/?format=api",
        "name": "Allain Legacy",
        "email": "allain.legacy@windriver.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488414008-162839-11-git-send-email-allain.legacy@windriver.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21035/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/21035/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E5D84F95B;\n\tThu,  2 Mar 2017 01:21:45 +0100 (CET)",
            "from mail1.windriver.com (mail1.windriver.com [147.11.146.13])\n\tby dpdk.org (Postfix) with ESMTP id 7C7F02B9D\n\tfor <dev@dpdk.org>; Thu,  2 Mar 2017 01:20:41 +0100 (CET)",
            "from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com\n\t[147.11.189.40])\n\tby mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id v220Kaec014979\n\t(version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL);\n\tWed, 1 Mar 2017 16:20:36 -0800 (PST)",
            "from yow-cgts4-lx.wrs.com (128.224.145.137) by\n\tALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server\n\t(TLS) id 14.3.294.0; Wed, 1 Mar 2017 16:20:34 -0800"
        ],
        "From": "Allain Legacy <allain.legacy@windriver.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<ian.jolliffe@windriver.com>, <jerin.jacob@caviumnetworks.com>,\n\t<stephen@networkplumber.org>, <thomas.monjalon@6wind.com>, <dev@dpdk.org>",
        "Date": "Wed, 1 Mar 2017 19:20:02 -0500",
        "Message-ID": "<1488414008-162839-11-git-send-email-allain.legacy@windriver.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1488414008-162839-1-git-send-email-allain.legacy@windriver.com>",
        "References": "<1488136143-116389-1-git-send-email-allain.legacy@windriver.com>\n\t<1488414008-162839-1-git-send-email-allain.legacy@windriver.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[128.224.145.137]",
        "Subject": "[dpdk-dev] [PATCH v3 10/16] net/avp: queue setup and release",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "Adds queue management operations so that an appliation can setup and\nrelease the transmit and receive queues.\n\nSigned-off-by: Allain Legacy <allain.legacy@windriver.com>\nSigned-off-by: Matt Peters <matt.peters@windriver.com>\n---\n drivers/net/avp/avp_ethdev.c | 144 ++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 143 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c\nindex e9c67ce..b0c5ae4 100644\n--- a/drivers/net/avp/avp_ethdev.c\n+++ b/drivers/net/avp/avp_ethdev.c\n@@ -73,7 +73,21 @@ static void avp_dev_info_get(struct rte_eth_dev *dev,\n static void avp_vlan_offload_set(struct rte_eth_dev *dev, int mask);\n static int avp_dev_link_update(struct rte_eth_dev *dev,\n \t\t\t       __rte_unused int wait_to_complete);\n-\n+static int avp_dev_rx_queue_setup(struct rte_eth_dev *dev,\n+\t\t\t\t  uint16_t rx_queue_id,\n+\t\t\t\t  uint16_t nb_rx_desc,\n+\t\t\t\t  unsigned int socket_id,\n+\t\t\t\t  const struct rte_eth_rxconf *rx_conf,\n+\t\t\t\t  struct rte_mempool *pool);\n+\n+static int avp_dev_tx_queue_setup(struct rte_eth_dev *dev,\n+\t\t\t\t  uint16_t tx_queue_id,\n+\t\t\t\t  uint16_t nb_tx_desc,\n+\t\t\t\t  unsigned int socket_id,\n+\t\t\t\t  const struct rte_eth_txconf *tx_conf);\n+\n+static void avp_dev_rx_queue_release(void *rxq);\n+static void avp_dev_tx_queue_release(void *txq);\n #define AVP_DEV_TO_PCI(eth_dev) RTE_DEV_TO_PCI((eth_dev)->device)\n \n \n@@ -119,6 +133,10 @@ static int avp_dev_link_update(struct rte_eth_dev *dev,\n \t.dev_infos_get       = avp_dev_info_get,\n \t.vlan_offload_set    = avp_vlan_offload_set,\n \t.link_update         = avp_dev_link_update,\n+\t.rx_queue_setup      = avp_dev_rx_queue_setup,\n+\t.rx_queue_release    = avp_dev_rx_queue_release,\n+\t.tx_queue_setup      = avp_dev_tx_queue_setup,\n+\t.tx_queue_release    = avp_dev_tx_queue_release,\n };\n \n /**@{ AVP device flags */\n@@ -975,6 +993,130 @@ struct avp_queue {\n \n \n static int\n+avp_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,\n+\t\t       uint16_t rx_queue_id,\n+\t\t       uint16_t nb_rx_desc,\n+\t\t       unsigned int socket_id,\n+\t\t       const struct rte_eth_rxconf *rx_conf,\n+\t\t       struct rte_mempool *pool)\n+{\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tstruct rte_pktmbuf_pool_private *mbp_priv;\n+\tstruct avp_queue *rxq;\n+\n+\tif (rx_queue_id >= eth_dev->data->nb_rx_queues) {\n+\t\tPMD_DRV_LOG(ERR, \"RX queue id is out of range: rx_queue_id=%u, nb_rx_queues=%u\\n\",\n+\t\t\t    rx_queue_id, eth_dev->data->nb_rx_queues);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Save mbuf pool pointer */\n+\tavp->pool = pool;\n+\n+\t/* Save the local mbuf size */\n+\tmbp_priv = rte_mempool_get_priv(pool);\n+\tavp->guest_mbuf_size = (uint16_t)(mbp_priv->mbuf_data_room_size);\n+\tavp->guest_mbuf_size -= RTE_PKTMBUF_HEADROOM;\n+\n+\tPMD_DRV_LOG(DEBUG, \"AVP max_rx_pkt_len=(%u,%u) mbuf_size=(%u,%u)\\n\",\n+\t\t    avp->max_rx_pkt_len,\n+\t\t    eth_dev->data->dev_conf.rxmode.max_rx_pkt_len,\n+\t\t    avp->host_mbuf_size,\n+\t\t    avp->guest_mbuf_size);\n+\n+\t/* allocate a queue object */\n+\trxq = rte_zmalloc_socket(\"ethdev RX queue\", sizeof(struct avp_queue),\n+\t\t\t\t RTE_CACHE_LINE_SIZE, socket_id);\n+\tif (rxq == NULL) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to allocate new Rx queue object\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* save back pointers to AVP and Ethernet devices */\n+\trxq->avp = avp;\n+\trxq->dev_data = eth_dev->data;\n+\teth_dev->data->rx_queues[rx_queue_id] = (void *)rxq;\n+\n+\t/* setup the queue receive mapping for the current queue. */\n+\t_avp_set_rx_queue_mappings(eth_dev, rx_queue_id);\n+\n+\tPMD_DRV_LOG(DEBUG, \"Rx queue %u setup at %p\\n\", rx_queue_id, rxq);\n+\n+\t(void)nb_rx_desc;\n+\t(void)rx_conf;\n+\treturn 0;\n+}\n+\n+static int\n+avp_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,\n+\t\t       uint16_t tx_queue_id,\n+\t\t       uint16_t nb_tx_desc,\n+\t\t       unsigned int socket_id,\n+\t\t       const struct rte_eth_txconf *tx_conf)\n+{\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tstruct avp_queue *txq;\n+\n+\tif (tx_queue_id >= eth_dev->data->nb_tx_queues) {\n+\t\tPMD_DRV_LOG(ERR, \"TX queue id is out of range: tx_queue_id=%u, nb_tx_queues=%u\\n\",\n+\t\t\t    tx_queue_id, eth_dev->data->nb_tx_queues);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* allocate a queue object */\n+\ttxq = rte_zmalloc_socket(\"ethdev TX queue\", sizeof(struct avp_queue),\n+\t\t\t\t RTE_CACHE_LINE_SIZE, socket_id);\n+\tif (txq == NULL) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to allocate new Tx queue object\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* only the configured set of transmit queues are used */\n+\ttxq->queue_id = tx_queue_id;\n+\ttxq->queue_base = tx_queue_id;\n+\ttxq->queue_limit = tx_queue_id;\n+\n+\t/* save back pointers to AVP and Ethernet devices */\n+\ttxq->avp = avp;\n+\ttxq->dev_data = eth_dev->data;\n+\teth_dev->data->tx_queues[tx_queue_id] = (void *)txq;\n+\n+\tPMD_DRV_LOG(DEBUG, \"Tx queue %u setup at %p\\n\", tx_queue_id, txq);\n+\n+\t(void)nb_tx_desc;\n+\t(void)tx_conf;\n+\treturn 0;\n+}\n+\n+static void\n+avp_dev_rx_queue_release(void *rx_queue)\n+{\n+\tstruct avp_queue *rxq = (struct avp_queue *)rx_queue;\n+\tstruct avp_dev *avp = rxq->avp;\n+\tstruct rte_eth_dev_data *data = avp->dev_data;\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < avp->num_rx_queues; i++) {\n+\t\tif (data->rx_queues[i] == rxq)\n+\t\t\tdata->rx_queues[i] = NULL;\n+\t}\n+}\n+\n+static void\n+avp_dev_tx_queue_release(void *tx_queue)\n+{\n+\tstruct avp_queue *txq = (struct avp_queue *)tx_queue;\n+\tstruct avp_dev *avp = txq->avp;\n+\tstruct rte_eth_dev_data *data = avp->dev_data;\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < avp->num_tx_queues; i++) {\n+\t\tif (data->tx_queues[i] == txq)\n+\t\t\tdata->tx_queues[i] = NULL;\n+\t}\n+}\n+\n+static int\n avp_dev_configure(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pci_dev = AVP_DEV_TO_PCI(eth_dev);\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "10/16"
    ]
}