get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 34911,
    "url": "http://patches.dpdk.org/api/patches/34911/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/86269c17d76550025a5eb1a60202c7052f8e6ddf.1517685185.git.rahul.lakkireddy@chelsio.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": "<86269c17d76550025a5eb1a60202c7052f8e6ddf.1517685185.git.rahul.lakkireddy@chelsio.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/86269c17d76550025a5eb1a60202c7052f8e6ddf.1517685185.git.rahul.lakkireddy@chelsio.com",
    "date": "2018-02-04T06:06:06",
    "name": "[dpdk-dev,1/7] cxgbe: fix secondary process initialization",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "05e05fbd04d85677711c0b839eff48b3d6d2043d",
    "submitter": {
        "id": 241,
        "url": "http://patches.dpdk.org/api/people/241/?format=api",
        "name": "Rahul Lakkireddy",
        "email": "rahul.lakkireddy@chelsio.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/86269c17d76550025a5eb1a60202c7052f8e6ddf.1517685185.git.rahul.lakkireddy@chelsio.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/34911/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/34911/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 4748971B3;\n\tSun,  4 Feb 2018 07:06:40 +0100 (CET)",
            "from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8])\n\tby dpdk.org (Postfix) with ESMTP id 8DE22567E\n\tfor <dev@dpdk.org>; Sun,  4 Feb 2018 07:06:38 +0100 (CET)",
            "from localhost (scalar.blr.asicdesigners.com [10.193.185.94])\n\tby stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w1466YBU030177; \n\tSat, 3 Feb 2018 22:06:35 -0800"
        ],
        "From": "Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>",
        "To": "dev@dpdk.org",
        "Cc": "kumaras@chelsio.com, surendra@chelsio.com, nirranjan@chelsio.com,\n\tindranil@chelsio.com",
        "Date": "Sun,  4 Feb 2018 11:36:06 +0530",
        "Message-Id": "<86269c17d76550025a5eb1a60202c7052f8e6ddf.1517685185.git.rahul.lakkireddy@chelsio.com>",
        "X-Mailer": "git-send-email 2.5.3",
        "In-Reply-To": [
            "<cover.1517685185.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1517685185.git.rahul.lakkireddy@chelsio.com>"
        ],
        "References": [
            "<cover.1517685185.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1517685185.git.rahul.lakkireddy@chelsio.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 1/7] cxgbe: fix secondary process initialization",
        "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://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": "<https://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": "From: Kumar Sanghvi <kumaras@chelsio.com>\n\nrte_eth_dev_allocate already assigns the eth_dev_data. So,\ndon't allocate it separately as part of probe function. And we\nsave this eth_dev_data as part of txq structure.\n\nAttach to rte_eth_dev devices allocated by Primary process for\nPorts other than Port-0 in the secondary process.\n\nFixes: 8318984927ff (\"cxgbe: add pmd skeleton\")\nSigned-off-by: Kumar Sanghvi <kumaras@chelsio.com>\nSigned-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>\n---\n doc/guides/nics/features/cxgbe.ini |  1 +\n drivers/net/cxgbe/base/adapter.h   |  1 +\n drivers/net/cxgbe/cxgbe_ethdev.c   | 28 +++++++++++++++++++++++-----\n drivers/net/cxgbe/cxgbe_main.c     | 11 ++---------\n drivers/net/cxgbe/sge.c            |  5 +++--\n 5 files changed, 30 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/features/cxgbe.ini b/doc/guides/nics/features/cxgbe.ini\nindex 3d0fde2fd..1b9d81ffb 100644\n--- a/doc/guides/nics/features/cxgbe.ini\n+++ b/doc/guides/nics/features/cxgbe.ini\n@@ -24,6 +24,7 @@ Basic stats          = Y\n Stats per queue      = Y\n EEPROM dump          = Y\n Registers dump       = Y\n+Multiprocess aware   = Y\n BSD nic_uio          = Y\n Linux UIO            = Y\n Linux VFIO           = Y\ndiff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h\nindex f2057af14..0c1a1be25 100644\n--- a/drivers/net/cxgbe/base/adapter.h\n+++ b/drivers/net/cxgbe/base/adapter.h\n@@ -267,6 +267,7 @@ struct sge_eth_tx_stats {\t/* Ethernet tx queue statistics */\n struct sge_eth_txq {                   /* state for an SGE Ethernet Tx queue */\n \tstruct sge_txq q;\n \tstruct rte_eth_dev *eth_dev;   /* port that this queue belongs to */\n+\tstruct rte_eth_dev_data *data;\n \tstruct sge_eth_tx_stats stats; /* queue statistics */\n \trte_spinlock_t txq_lock;\n \ndiff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c\nindex 5cd260f48..6d56f3c1b 100644\n--- a/drivers/net/cxgbe/cxgbe_ethdev.c\n+++ b/drivers/net/cxgbe/cxgbe_ethdev.c\n@@ -1004,14 +1004,32 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)\n \teth_dev->dev_ops = &cxgbe_eth_dev_ops;\n \teth_dev->rx_pkt_burst = &cxgbe_recv_pkts;\n \teth_dev->tx_pkt_burst = &cxgbe_xmit_pkts;\n+\tpci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n \n-\t/* for secondary processes, we don't initialise any further as primary\n-\t * has already done this work.\n+\t/* for secondary processes, we attach to ethdevs allocated by primary\n+\t * and do minimal initialization.\n \t */\n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\tint i;\n+\n+\t\tfor (i = 1; i < MAX_NPORTS; i++) {\n+\t\t\tstruct rte_eth_dev *rest_eth_dev;\n+\t\t\tchar namei[RTE_ETH_NAME_MAX_LEN];\n+\n+\t\t\tsnprintf(namei, sizeof(namei), \"cxgbe%d\", i);\n+\t\t\trest_eth_dev = rte_eth_dev_attach_secondary(namei);\n+\t\t\tif (rest_eth_dev) {\n+\t\t\t\trest_eth_dev->device = &pci_dev->device;\n+\t\t\t\trest_eth_dev->dev_ops =\n+\t\t\t\t\teth_dev->dev_ops;\n+\t\t\t\trest_eth_dev->rx_pkt_burst =\n+\t\t\t\t\teth_dev->rx_pkt_burst;\n+\t\t\t\trest_eth_dev->tx_pkt_burst =\n+\t\t\t\t\teth_dev->tx_pkt_burst;\n+\t\t\t}\n+\t\t}\n \t\treturn 0;\n-\n-\tpci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\t}\n \n \tsnprintf(name, sizeof(name), \"cxgbeadapter%d\", eth_dev->data->port_id);\n \tadapter = rte_zmalloc(name, sizeof(*adapter), 0);\ndiff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c\nindex 28db6c061..c502fadf7 100644\n--- a/drivers/net/cxgbe/cxgbe_main.c\n+++ b/drivers/net/cxgbe/cxgbe_main.c\n@@ -1266,8 +1266,6 @@ int cxgbe_probe(struct adapter *adapter)\n \n \tfor_each_port(adapter, i) {\n \t\tchar name[RTE_ETH_NAME_MAX_LEN];\n-\t\tstruct rte_eth_dev_data *data = NULL;\n-\t\tconst unsigned int numa_node = rte_socket_id();\n \n \t\tpi = &adapter->port[i];\n \t\tpi->adapter = adapter;\n@@ -1293,13 +1291,8 @@ int cxgbe_probe(struct adapter *adapter)\n \t\tif (!pi->eth_dev)\n \t\t\tgoto out_free;\n \n-\t\tdata = rte_zmalloc_socket(name, sizeof(*data), 0, numa_node);\n-\t\tif (!data)\n-\t\t\tgoto out_free;\n-\n-\t\tdata->port_id = adapter->eth_dev->data->port_id + i;\n-\n-\t\tpi->eth_dev->data = data;\n+\t\tpi->eth_dev->data->port_id =\n+\t\t\tadapter->eth_dev->data->port_id + i;\n \n allocate_mac:\n \t\tpi->eth_dev->device = &adapter->pdev->device;\ndiff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c\nindex 3d5aa596f..6ff8bc46b 100644\n--- a/drivers/net/cxgbe/sge.c\n+++ b/drivers/net/cxgbe/sge.c\n@@ -1095,7 +1095,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,\n \tu32 wr_mid;\n \tu64 cntrl, *end;\n \tbool v6;\n-\tu32 max_pkt_len = txq->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;\n+\tu32 max_pkt_len = txq->data->dev_conf.rxmode.max_rx_pkt_len;\n \n \t/* Reject xmit if queue is stopped */\n \tif (unlikely(txq->flags & EQ_STOPPED))\n@@ -1115,7 +1115,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,\n \t    (unlikely(m->pkt_len > max_pkt_len)))\n \t\tgoto out_free;\n \n-\tpi = (struct port_info *)txq->eth_dev->data->dev_private;\n+\tpi = (struct port_info *)txq->data->dev_private;\n \tadap = pi->adapter;\n \n \tcntrl = F_TXPKT_L4CSUM_DIS | F_TXPKT_IPCSUM_DIS;\n@@ -1997,6 +1997,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,\n \ttxq->stats.mapping_err = 0;\n \ttxq->flags |= EQ_STOPPED;\n \ttxq->eth_dev = eth_dev;\n+\ttxq->data = eth_dev->data;\n \tt4_os_lock_init(&txq->txq_lock);\n \treturn 0;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "1/7"
    ]
}