get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7361,
    "url": "https://patches.dpdk.org/api/patches/7361/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/318fc8559675b1157e7f049a6a955a6a2059bac7.1443704150.git.rahul.lakkireddy@chelsio.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": "<318fc8559675b1157e7f049a6a955a6a2059bac7.1443704150.git.rahul.lakkireddy@chelsio.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/318fc8559675b1157e7f049a6a955a6a2059bac7.1443704150.git.rahul.lakkireddy@chelsio.com",
    "date": "2015-10-02T11:16:50",
    "name": "[dpdk-dev,1/6] cxgbe: Optimize forwarding performance for 40G",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2d92d1a83098ffa62cf4de489df7beb74c4bba47",
    "submitter": {
        "id": 241,
        "url": "https://patches.dpdk.org/api/people/241/?format=api",
        "name": "Rahul Lakkireddy",
        "email": "rahul.lakkireddy@chelsio.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/318fc8559675b1157e7f049a6a955a6a2059bac7.1443704150.git.rahul.lakkireddy@chelsio.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7361/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7361/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 ACA548E70;\n\tFri,  2 Oct 2015 13:17:32 +0200 (CEST)",
            "from stargate3.asicdesigners.com (stargate.chelsio.com\n\t[67.207.112.58]) by dpdk.org (Postfix) with ESMTP id 6511C8E6E\n\tfor <dev@dpdk.org>; Fri,  2 Oct 2015 13:17:31 +0200 (CEST)",
            "from localhost (scalar.blr.asicdesigners.com [10.193.185.94])\n\tby stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id\n\tt92BHS3r005241; Fri, 2 Oct 2015 04:17:29 -0700"
        ],
        "From": "Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  2 Oct 2015 16:46:50 +0530",
        "Message-Id": "<318fc8559675b1157e7f049a6a955a6a2059bac7.1443704150.git.rahul.lakkireddy@chelsio.com>",
        "X-Mailer": "git-send-email 2.5.3",
        "In-Reply-To": [
            "<cover.1443704150.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1443704150.git.rahul.lakkireddy@chelsio.com>"
        ],
        "References": [
            "<cover.1443704150.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1443704150.git.rahul.lakkireddy@chelsio.com>"
        ],
        "Cc": "Kumar Sanghvi <kumaras@chelsio.com>, Felix Marti <felix@chelsio.com>,\n\tNirranjan Kirubaharan <nirranjan@chelsio.com>",
        "Subject": "[dpdk-dev] [PATCH 1/6] cxgbe: Optimize forwarding performance for\n\t40G",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "Update sge initialization with respect to free-list manager configuration\nand ingress arbiter. Also update refill logic to refill mbufs only after\na certain threshold for rx.  Optimize tx packet prefetch and free.\n\nApprox. 4 MPPS improvement seen in forwarding performance after the\noptimization.\n\nSigned-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>\nSigned-off-by: Kumar Sanghvi <kumaras@chelsio.com>\n---\n drivers/net/cxgbe/base/t4_regs.h | 16 ++++++++++++++++\n drivers/net/cxgbe/cxgbe_main.c   |  7 +++++++\n drivers/net/cxgbe/sge.c          | 17 ++++++++++++-----\n 3 files changed, 35 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/cxgbe/base/t4_regs.h b/drivers/net/cxgbe/base/t4_regs.h\nindex cd28b59..9057e40 100644\n--- a/drivers/net/cxgbe/base/t4_regs.h\n+++ b/drivers/net/cxgbe/base/t4_regs.h\n@@ -266,6 +266,18 @@\n #define A_SGE_FL_BUFFER_SIZE2 0x104c\n #define A_SGE_FL_BUFFER_SIZE3 0x1050\n \n+#define A_SGE_FLM_CFG 0x1090\n+\n+#define S_CREDITCNT    4\n+#define M_CREDITCNT    0x3U\n+#define V_CREDITCNT(x) ((x) << S_CREDITCNT)\n+#define G_CREDITCNT(x) (((x) >> S_CREDITCNT) & M_CREDITCNT)\n+\n+#define S_CREDITCNTPACKING    2\n+#define M_CREDITCNTPACKING    0x3U\n+#define V_CREDITCNTPACKING(x) ((x) << S_CREDITCNTPACKING)\n+#define G_CREDITCNTPACKING(x) (((x) >> S_CREDITCNTPACKING) & M_CREDITCNTPACKING)\n+\n #define A_SGE_CONM_CTRL 0x1094\n \n #define S_EGRTHRESHOLD    8\n@@ -361,6 +373,10 @@\n \n #define A_SGE_CONTROL2 0x1124\n \n+#define S_IDMAARBROUNDROBIN    19\n+#define V_IDMAARBROUNDROBIN(x) ((x) << S_IDMAARBROUNDROBIN)\n+#define F_IDMAARBROUNDROBIN    V_IDMAARBROUNDROBIN(1U)\n+\n #define S_INGPACKBOUNDARY    16\n #define M_INGPACKBOUNDARY    0x7U\n #define V_INGPACKBOUNDARY(x) ((x) << S_INGPACKBOUNDARY)\ndiff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c\nindex 3755444..316b87d 100644\n--- a/drivers/net/cxgbe/cxgbe_main.c\n+++ b/drivers/net/cxgbe/cxgbe_main.c\n@@ -422,6 +422,13 @@ static int adap_init0_tweaks(struct adapter *adapter)\n \tt4_set_reg_field(adapter, A_SGE_CONTROL, V_PKTSHIFT(M_PKTSHIFT),\n \t\t\t V_PKTSHIFT(rx_dma_offset));\n \n+\tt4_set_reg_field(adapter, A_SGE_FLM_CFG,\n+\t\t\t V_CREDITCNT(M_CREDITCNT) | M_CREDITCNTPACKING,\n+\t\t\t V_CREDITCNT(3) | V_CREDITCNTPACKING(1));\n+\n+\tt4_set_reg_field(adapter, A_SGE_CONTROL2, V_IDMAARBROUNDROBIN(1U),\n+\t\t\t V_IDMAARBROUNDROBIN(1U));\n+\n \t/*\n \t * Don't include the \"IP Pseudo Header\" in CPL_RX_PKT checksums: Linux\n \t * adds the pseudo header itself.\ndiff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c\nindex 6eb1244..e540881 100644\n--- a/drivers/net/cxgbe/sge.c\n+++ b/drivers/net/cxgbe/sge.c\n@@ -286,8 +286,7 @@ static void unmap_rx_buf(struct sge_fl *q)\n \n static inline void ring_fl_db(struct adapter *adap, struct sge_fl *q)\n {\n-\t/* see if we have exceeded q->size / 4 */\n-\tif (q->pend_cred >= (q->size / 4)) {\n+\tif (q->pend_cred >= 64) {\n \t\tu32 val = adap->params.arch.sge_fl_db;\n \n \t\tif (is_t4(adap->params.chip))\n@@ -995,7 +994,14 @@ static inline int tx_do_packet_coalesce(struct sge_eth_txq *txq,\n \t\t\tint i;\n \n \t\t\tfor (i = 0; i < sd->coalesce.idx; i++) {\n-\t\t\t\trte_pktmbuf_free(sd->coalesce.mbuf[i]);\n+\t\t\t\tstruct rte_mbuf *tmp = sd->coalesce.mbuf[i];\n+\n+\t\t\t\tdo {\n+\t\t\t\t\tstruct rte_mbuf *next = tmp->next;\n+\n+\t\t\t\t\trte_pktmbuf_free_seg(tmp);\n+\t\t\t\t\ttmp = next;\n+\t\t\t\t} while (tmp);\n \t\t\t\tsd->coalesce.mbuf[i] = NULL;\n \t\t\t}\n \t\t}\n@@ -1054,7 +1060,6 @@ out_free:\n \t\treturn 0;\n \t}\n \n-\trte_prefetch0(&((&txq->q)->sdesc->mbuf->pool));\n \tpi = (struct port_info *)txq->eth_dev->data->dev_private;\n \tadap = pi->adapter;\n \n@@ -1070,6 +1075,7 @@ out_free:\n \t\t\t\ttxq->stats.mapping_err++;\n \t\t\t\tgoto out_free;\n \t\t\t}\n+\t\t\trte_prefetch0((volatile void *)addr);\n \t\t\treturn tx_do_packet_coalesce(txq, mbuf, cflits, adap,\n \t\t\t\t\t\t     pi, addr);\n \t\t} else {\n@@ -1454,7 +1460,8 @@ static int process_responses(struct sge_rspq *q, int budget,\n \t\t\tunsigned int params;\n \t\t\tu32 val;\n \n-\t\t\t__refill_fl(q->adapter, &rxq->fl);\n+\t\t\tif (fl_cap(&rxq->fl) - rxq->fl.avail >= 64)\n+\t\t\t\t__refill_fl(q->adapter, &rxq->fl);\n \t\t\tparams = V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX);\n \t\t\tq->next_intr_params = params;\n \t\t\tval = V_CIDXINC(cidx_inc) | V_SEINTARM(params);\n",
    "prefixes": [
        "dpdk-dev",
        "1/6"
    ]
}