Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12932/?format=api
https://patches.dpdk.org/api/patches/12932/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1463771054-16861-11-git-send-email-johndale@cisco.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": "<1463771054-16861-11-git-send-email-johndale@cisco.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1463771054-16861-11-git-send-email-johndale@cisco.com", "date": "2016-05-20T19:04:14", "name": "[dpdk-dev,11/11] enic: add ENIC_ASSERT macro", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f8f9afa2e5e0a2b577697645ccfdab78f073301d", "submitter": { "id": 359, "url": "https://patches.dpdk.org/api/people/359/?format=api", "name": "John Daley (johndale)", "email": "johndale@cisco.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1463771054-16861-11-git-send-email-johndale@cisco.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/12932/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/12932/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 BF6ACC344;\n\tFri, 20 May 2016 21:05:20 +0200 (CEST)", "from alln-iport-3.cisco.com (alln-iport-3.cisco.com\n\t[173.37.142.90]) by dpdk.org (Postfix) with ESMTP id 883C3C316\n\tfor <dev@dpdk.org>; Fri, 20 May 2016 21:05:15 +0200 (CEST)", "from rcdn-core-8.cisco.com ([173.37.93.144])\n\tby alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 May 2016 19:05:14 +0000", "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby rcdn-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id u4KJ5Etw028048;\n\tFri, 20 May 2016 19:05:14 GMT", "by cisco.com (Postfix, from userid 392789)\n\tid 2626B20F2004; Fri, 20 May 2016 12:05:14 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=1614; q=dns/txt; s=iport;\n\tt=1463771115; x=1464980715;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=Elaof3qsOFnaJv8XEHm8pM8sQ5JR+ftqXTngW0GfVak=;\n\tb=MXWUfOreIhw/Jv1Frn622upKLp/TeARqm3zACmqKjBusDmowpSV2HILz\n\t1KtzErKq7+121qgqCvRPPfjvYFYG+QKFVkHSR9xcWeqGHjIXFAGkR399Q\n\thTm4IMHBUCZAcxKietLc3OPZj6sKwWnphD2G+pGQFOnCm/pi+XfG3IKgF A=;", "X-IronPort-AV": "E=Sophos;i=\"5.26,340,1459814400\"; d=\"scan'208\";a=\"275374977\"", "From": "John Daley <johndale@cisco.com>", "To": "dev@dpdk.org", "Cc": "John Daley <johndale@cisco.com>", "Date": "Fri, 20 May 2016 12:04:14 -0700", "Message-Id": "<1463771054-16861-11-git-send-email-johndale@cisco.com>", "X-Mailer": "git-send-email 2.7.0", "In-Reply-To": "<1463771054-16861-1-git-send-email-johndale@cisco.com>", "References": "<1463771054-16861-1-git-send-email-johndale@cisco.com>", "Subject": "[dpdk-dev] [PATCH 11/11] enic: add ENIC_ASSERT macro", "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": "Add an ASSERT macro for the enic driver which is enabled when the log\nlevel is >= RTE_LOG_DEBUG. Assert that number of mbufs to return to\nthe pool in the Tx function is never greater than the max allowed.\n\nSigned-off-by: John Daley <johndale@cisco.com>\n---\n drivers/net/enic/enic.h | 12 ++++++++++++\n drivers/net/enic/enic_rxtx.c | 1 +\n 2 files changed, 13 insertions(+)", "diff": "diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex 4eb28ee..4b76e6d 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -187,6 +187,18 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx)\n \treturn idx;\n }\n \n+#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG\n+#define ENIC_ASSERT(cond)\t\t\t\t\\\n+\tdo {\t\t\t\t\t\t\t\t\\\n+\t\tif (unlikely(!(cond))) {\t\t\t\t\\\n+\t\t\trte_panic(\"line %d\\tassert \\\"\" #cond \"\\\"\"\t\\\n+\t\t\t\t\t\"failed\\n\", __LINE__);\t\t\\\n+\t\t}\t\t\t\t\t\t\t\\\n+\t} while (0)\n+#else\n+#define ENIC_ASSERT(cond) do {} while (0)\n+#endif\n+\n extern void enic_fdir_stats_get(struct enic *enic,\n \tstruct rte_eth_fdir_stats *stats);\n extern int enic_fdir_add_fltr(struct enic *enic,\ndiff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c\nindex 821053e..2d522e4 100644\n--- a/drivers/net/enic/enic_rxtx.c\n+++ b/drivers/net/enic/enic_rxtx.c\n@@ -349,6 +349,7 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)\n \t\tbuf = &wq->bufs[tail_idx];\n \t\tm = (struct rte_mbuf *)(buf->mb);\n \t\tif (likely(m->pool == pool)) {\n+\t\t\tENIC_ASSERT(nb_free < ENIC_MAX_WQ_DESCS);\n \t\t\tfree[nb_free++] = m;\n \t\t} else {\n \t\t\trte_mempool_put_bulk(pool, (void *)free, nb_free);\n", "prefixes": [ "dpdk-dev", "11/11" ] }{ "id": 12932, "url": "