Show a patch.

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

{
    "id": 382,
    "url": "http://patches.dpdk.org/api/patches/382/",
    "web_url": "http://patches.dpdk.org/patch/382/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1410809031-19114-2-git-send-email-nhorman@tuxdriver.com>",
    "date": "2014-09-15T19:23:48",
    "name": "[dpdk-dev,1/4] compat: Add infrastructure to support symbol versioning",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9630c3816a0c7dd7b67f9678a6d187fe3db7b152",
    "submitter": {
        "id": 32,
        "url": "http://patches.dpdk.org/api/people/32/",
        "name": "Neil Horman",
        "email": "nhorman@tuxdriver.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/382/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/382/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/382/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1410809031-19114-1-git-send-email-nhorman@tuxdriver.com>",
        "X-Mailman-Version": "2.1.15",
        "Date": "Mon, 15 Sep 2014 15:23:48 -0400",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1410809031-19114-2-git-send-email-nhorman@tuxdriver.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 95825AF7F;\n\tMon, 15 Sep 2014 21:18:48 +0200 (CEST)",
            "from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58])\n\tby dpdk.org (Postfix) with ESMTP id 34310ADC4\n\tfor <dev@dpdk.org>; Mon, 15 Sep 2014 21:18:47 +0200 (CEST)",
            "from hmsreliant.think-freely.org\n\t([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost)\n\tby smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63)\n\t(envelope-from <nhorman@tuxdriver.com>)\n\tid 1XTbsg-0000nz-G2; Mon, 15 Sep 2014 15:24:17 -0400"
        ],
        "X-Mailer": "git-send-email 1.9.3",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol\n\tversioning",
        "Precedence": "list",
        "From": "Neil Horman <nhorman@tuxdriver.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Spam-Score": "-2.9 (--)",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Spam-Status": "No",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1410809031-19114-1-git-send-email-nhorman@tuxdriver.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "Add initial pass header files to support symbol versioning.\n\nSigned-off-by: Neil Horman <nhorman@tuxdriver.com>\nCC: Thomas Monjalon <thomas.monjalon@6wind.com>\nCC: \"Richardson, Bruce\" <bruce.richardson@intel.com>\n---\n lib/Makefile                   |  1 +\n lib/librte_compat/Makefile     | 38 +++++++++++++++++++\n lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++\n mk/rte.lib.mk                  |  6 +++\n 4 files changed, 131 insertions(+)\n create mode 100644 lib/librte_compat/Makefile\n create mode 100644 lib/librte_compat/rte_compat.h",
    "diff": "diff --git a/lib/Makefile b/lib/Makefile\nindex 10c5bb3..a85b55b 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -32,6 +32,7 @@\n include $(RTE_SDK)/mk/rte.vars.mk\n \n DIRS-$(CONFIG_RTE_LIBC) += libc\n+DIRS-y += librte_compat\n DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal\n DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc\n DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring\ndiff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile\nnew file mode 100644\nindex 0000000..a61511a\n--- /dev/null\n+++ b/lib/librte_compat/Makefile\n@@ -0,0 +1,38 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\n+#     * Redistributions of source code must retain the above copyright\n+#       notice, this list of conditions and the following disclaimer.\n+#     * Redistributions in binary form must reproduce the above copyright\n+#       notice, this list of conditions and the following disclaimer in\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of Intel Corporation nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+\n+# install includes\n+SYMLINK-y-include := rte_compat.h\n+\n+include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h\nnew file mode 100644\nindex 0000000..6d65a53\n--- /dev/null\n+++ b/lib/librte_compat/rte_compat.h\n@@ -0,0 +1,86 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _RTE_COMPAT_H_\n+#define _RTE_COMPAT_H_\n+\n+/*\n+ * This is just a stringification macro for use below.\n+ */\n+#define SA(x) #x\n+\n+#ifdef RTE_SYMBOL_VERSIONING\n+\n+/*\n+ * Provides backwards compatibility when updating exported functions.\n+ * When a symol is exported from a library to provide an API, it also provides a\n+ * calling convention (ABI) that is embodied in its name, return type,\n+ * arguments, etc.  On occasion that function may need to change to accomodate\n+ * new functionality, behavior, etc.  When that occurs, it is desireable to\n+ * allow for backwards compatibility for a time with older binaries that are\n+ * dynamically linked to the dpdk.  to support that the __vsym and\n+ * VERSION_SYMBOL macros are created.  They, in conjunction with the\n+ * <library>_version.map file for a given library allow for multiple versions of\n+ * a symbol to exist in a shared library so that older binaries need not be\n+ * immediately recompiled. Their use is outlined in the following example:\n+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)\n+ *              DPDK 1.(X+1) needs to change foo to be int foo(int index)\n+ *\n+ * To accomplish this:\n+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which\n+ * foo is exported as a global symbol\n+ *\n+ * 2) rename the existing function int foo(char *string) to \n+ * \tint __vsym foo_v18(char *string)\n+ *\n+ * 3) Add this macro immediately below the function\n+ * \tVERSION_SYMBOL(foo, _v18, 1.8);\n+ *\n+ */\n+#define VERSION_SYMBOL(b, e, v) __asm__(\".symver \" SA(b) SA(e) \", \"SA(b)\"@DPDK_\"SA(v))\n+#define __vsym __attribute__((used))\n+\n+#else\n+/*\n+ * No symbol versioning in use\n+ */\n+#define VERSION_SYMBOL(b, e, v)\n+#define __vsym\n+\n+/*\n+ * RTE_SYMBOL_VERSIONING\n+ */\n+#endif\n+\n+\n+#endif /* _RTE_COMPAT_H_ */\ndiff --git a/mk/rte.lib.mk b/mk/rte.lib.mk\nindex f458258..82ac309 100644\n--- a/mk/rte.lib.mk\n+++ b/mk/rte.lib.mk\n@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)\n \n ifeq ($(RTE_BUILD_SHARED_LIB),y)\n LIB := $(patsubst %.a,%.so,$(LIB))\n+\n+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)\n+\n endif\n \n+\n _BUILD = $(LIB)\n _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)\n _CLEAN = doclean\n@@ -160,7 +164,9 @@ endif\n $(RTE_OUTPUT)/lib/$(LIB): $(LIB)\n \t@echo \"  INSTALL-LIB $(LIB)\"\n \t@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib\n+ifneq ($(LIB),)\n \t$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib\n+endif\n \n #\n # Clean all generated files\n",
    "prefixes": [
        "dpdk-dev",
        "1/4"
    ]
}