Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/15587/?format=api
http://patches.dpdk.org/api/patches/15587/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1472793906-5699-1-git-send-email-slayercat.subscription@gmail.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": "<1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com", "date": "2016-09-02T05:25:06", "name": "[dpdk-dev] mbuf: fix atomic refcnt update synchronization", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "f87167e50cd41da43cb34c08d1ad4a60c664ffe1", "submitter": { "id": 554, "url": "http://patches.dpdk.org/api/people/554/?format=api", "name": "lilinzhe", "email": "slayercat.subscription@gmail.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/15587/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/15587/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 6296437B4;\n\tFri, 2 Sep 2016 07:25:15 +0200 (CEST)", "from mail-pa0-f68.google.com (mail-pa0-f68.google.com\n\t[209.85.220.68]) by dpdk.org (Postfix) with ESMTP id 8DFC137AA\n\tfor <dev@dpdk.org>; Fri, 2 Sep 2016 07:25:14 +0200 (CEST)", "by mail-pa0-f68.google.com with SMTP id hm5so582151pac.1\n\tfor <dev@dpdk.org>; Thu, 01 Sep 2016 22:25:14 -0700 (PDT)", "from localhost.localdomain\n\t(2607-8700-0101-a4c2-ca35-dc2d-6794-aee9.16clouds.com.\n\t[2607:8700:101:a4c2:ca35:dc2d:6794:aee9])\n\tby smtp.googlemail.com with ESMTPSA id\n\to80sm11300825pfa.67.2016.09.01.22.25.12\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 01 Sep 2016 22:25:13 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Kq0BRQxbXKNMOdtflvqjLlCPMddeiNrXI2izzVd3MvY=;\n\tb=S36Hr76IXzz8VWShJEK9j5bTV1hOOMdD17jgWXT2zvRuccpEvdTvPulNF0QYMyhrIx\n\tuvDZsSPB/vFVuqFtio5wd8Qo3iRrl15qJHYUnzGxqQMSRJ4K5x6NlZAH8OFVqOPHlec4\n\t/6/90wFrGNiSj9x9Bwco/4Fdi0fvfZvn2lbw8gP6wYpMYizznuLAaUZxtI222Rjo48jr\n\to3xJZ5qjVdoqoEwapsM8x5IJWZorcI3+qkwcl3SnGz2zu4nDD1DQEqHVcNwu0VgPLrgp\n\tuBvtjP8SbEfdVyQATmqjhTtCvKZkmkaShSz/cFfBpOwKuNeQb5UdbGM/HsAeoHWs9xt5\n\trfVA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Kq0BRQxbXKNMOdtflvqjLlCPMddeiNrXI2izzVd3MvY=;\n\tb=MUtF6m2x9o3tRtXPy1SbKbWhcQcunvd2J/00+OwExlpwJhCptCWzc23IZi0L0b7BPa\n\tH6H95/yzauVUVMW2LO/kf3YJVHOi01tK/902FBOIRphpZr2x0+HnhV8UdtGocS9sqawX\n\tRjRc4nrFDwk4M+IgU9ICVc/pPhGKkcLlJA7V2W4t4dJwM3h+9x2p02s9Ft9fBY4+OaiL\n\t0ahk4SZOzqryxNRS3CXNjxk0H4fPndH5Dz/DWJLjYhAxaUFO1V9YGof1EaXsuapTOmLu\n\tJQvWILJW3lR3LG0xQw6Xp91Lijd81WdA+XIku9gA1dxtdEJ86wbyzggiW49WC3wSVsfW\n\t6JIg==", "X-Gm-Message-State": "AE9vXwO0BYC18oUAZgYa8/8lc/PhFWf2iyQgi+fBh58BwTbwkpzDzAZr/TIJPZI6/DSA1w==", "X-Received": "by 10.66.242.201 with SMTP id ws9mr33035674pac.7.1472793913530; \n\tThu, 01 Sep 2016 22:25:13 -0700 (PDT)", "From": "lilinzhe <slayercat.subscription@gmail.com>", "To": "dev@dpdk.org", "Cc": "=?UTF-8?q?=E6=9D=8E=E6=9E=97=E5=93=B2?= <lilinzhe@ijinshan.com>", "Date": "Fri, 2 Sep 2016 13:25:06 +0800", "Message-Id": "<1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com>", "X-Mailer": "git-send-email 2.7.0.rc2", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH] mbuf: fix atomic refcnt update synchronization", "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": "From: 李林哲 <lilinzhe@ijinshan.com>\n\nchagne atomic ref update to always call atomic_add\n\nwhen mbuf is allocated by cpu1 and freed by cpu2. cpu1 cache may not be updated by such a set operation.\ncauses refcnt reads incorrect values.\n---\n lib/librte_mbuf/rte_mbuf.h | 16 ++++++----------\n 1 file changed, 6 insertions(+), 10 deletions(-)", "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex 7ea66ed..63e6588 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -786,7 +786,7 @@ struct rte_mbuf {\n \t */\n \tunion {\n \t\trte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */\n-\t\tuint16_t refcnt; /**< Non-atomically accessed refcnt */\n+\t\tvolatile uint16_t refcnt; /**< Non-atomically accessed refcnt */\n \t};\n \tuint8_t nb_segs; /**< Number of segments. */\n \tuint8_t port; /**< Input port. */\n@@ -1060,16 +1060,12 @@ static inline uint16_t\n rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)\n {\n \t/*\n-\t * The atomic_add is an expensive operation, so we don't want to\n-\t * call it in the case where we know we are the uniq holder of\n-\t * this mbuf (i.e. ref_cnt == 1). Otherwise, an atomic\n-\t * operation has to be used because concurrent accesses on the\n-\t * reference counter can occur.\n+\t * This shell always call atomic_add\n+\t *\n+\t * when mbuf is allocated by cpu1 and freed by cpu2. cpu1 cache may not be updated by such a set operation.\n+\t * causes refcnt reads incorrect values\n+\t * \n \t */\n-\tif (likely(rte_mbuf_refcnt_read(m) == 1)) {\n-\t\trte_mbuf_refcnt_set(m, 1 + value);\n-\t\treturn 1 + value;\n-\t}\n \n \treturn (uint16_t)(rte_atomic16_add_return(&m->refcnt_atomic, value));\n }\n", "prefixes": [ "dpdk-dev" ] }{ "id": 15587, "url": "