get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1276,
    "url": "https://patches.dpdk.org/api/patches/1276/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415984609-2484-7-git-send-email-olivier.matz@6wind.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": "<1415984609-2484-7-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415984609-2484-7-git-send-email-olivier.matz@6wind.com",
    "date": "2014-11-14T17:03:22",
    "name": "[dpdk-dev,v2,06/13] mbuf: add functions to get the name of an ol_flag",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ca37db077762eb5bb7e88cb1a7fb8b3b937fec4a",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415984609-2484-7-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1276/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1276/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 562837FCA;\n\tFri, 14 Nov 2014 17:54:07 +0100 (CET)",
            "from mail-wi0-f181.google.com (mail-wi0-f181.google.com\n\t[209.85.212.181]) by dpdk.org (Postfix) with ESMTP id CDA497F89\n\tfor <dev@dpdk.org>; Fri, 14 Nov 2014 17:53:51 +0100 (CET)",
            "by mail-wi0-f181.google.com with SMTP id n3so3306225wiv.14\n\tfor <dev@dpdk.org>; Fri, 14 Nov 2014 09:03:55 -0800 (PST)",
            "from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by mx.google.com with ESMTPSA id\n\tcu9sm40352554wjb.0.2014.11.14.09.03.54 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 14 Nov 2014 09:03:55 -0800 (PST)"
        ],
        "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:in-reply-to\n\t:references;\n\tbh=2yxNXxt6V3TwHun3IpLdpCbw/BX0ohzFaJxkGq4L60k=;\n\tb=WC96+wPofoRUIlLVtsapkKMR3NKLDsUHf9sbEz4Aa7LDIzxlExNXVmOX7C4kw9Qmrn\n\te1PiIZCSgtSXq7OkhhLr1EqBIPiq8n4wiF+utTY0zWz8LM0GJtuevO0EtW92TtRNNK9B\n\tCsbjCajV+dEbKuh5yaJMci0N61ac25LOeaYH2NtznNd1Q7l+ynNVK3N3YAHt0EVHLRMr\n\t/SP28dnNve4IaI0QBFQSU5LKPPcenbxcT9jgn9kOXIrb+tXs78cBvrFh1Am7fk85Qgd9\n\tTtRjQ2530l/SEAiyOrB+RLXoz8nXat+fKvxLmkU2NpUdbAe6Di3LMwIrtC4KHHpeRLmv\n\ty23w==",
        "X-Gm-Message-State": "ALoCoQn8VbIJosQmgESbsGnt8V4c7BfvqGqCxWAhgHZz6pz08obiG1h8x7nXni9/i3mr9VjbTOeU",
        "X-Received": "by 10.195.13.14 with SMTP id eu14mr15172628wjd.31.1415984635704; \n\tFri, 14 Nov 2014 09:03:55 -0800 (PST)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 14 Nov 2014 18:03:22 +0100",
        "Message-Id": "<1415984609-2484-7-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1415984609-2484-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1415635166-1364-1-git-send-email-olivier.matz@6wind.com>\n\t<1415984609-2484-1-git-send-email-olivier.matz@6wind.com>",
        "Cc": "jigsaw@gmail.com",
        "Subject": "[dpdk-dev] [PATCH v2 06/13] mbuf: add functions to get the name of\n\tan ol_flag",
        "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": "In test-pmd (rxonly.c), the code is able to dump the list of ol_flags.\nThe issue is that the list of flags in the application has to be\nsynchronized with the flags defined in rte_mbuf.h.\n\nThis patch introduces 2 new functions rte_get_rx_ol_flag_name()\nand rte_get_tx_ol_flag_name() that returns the name of a flag from\nits mask. It also fixes rxonly.c to use this new functions and to\ndisplay the proper flags.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/rxonly.c      | 36 ++++++++++--------------------------\n lib/librte_mbuf/rte_mbuf.c | 45 +++++++++++++++++++++++++++++++++++++++++++++\n lib/librte_mbuf/rte_mbuf.h | 22 ++++++++++++++++++++++\n 3 files changed, 77 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\nindex 9ad1df6..51a530a 100644\n--- a/app/test-pmd/rxonly.c\n+++ b/app/test-pmd/rxonly.c\n@@ -71,26 +71,6 @@\n \n #include \"testpmd.h\"\n \n-#define MAX_PKT_RX_FLAGS 13\n-static const char *pkt_rx_flag_names[MAX_PKT_RX_FLAGS] = {\n-\t\"VLAN_PKT\",\n-\t\"RSS_HASH\",\n-\t\"PKT_RX_FDIR\",\n-\t\"IP_CKSUM\",\n-\t\"IP_CKSUM_BAD\",\n-\n-\t\"IPV4_HDR\",\n-\t\"IPV4_HDR_EXT\",\n-\t\"IPV6_HDR\",\n-\t\"IPV6_HDR_EXT\",\n-\n-\t\"IEEE1588_PTP\",\n-\t\"IEEE1588_TMST\",\n-\n-\t\"TUNNEL_IPV4_HDR\",\n-\t\"TUNNEL_IPV6_HDR\",\n-};\n-\n static inline void\n print_ether_addr(const char *what, struct ether_addr *eth_addr)\n {\n@@ -214,12 +194,16 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t\tprintf(\" - Receive queue=0x%x\", (unsigned) fs->rx_queue);\n \t\tprintf(\"\\n\");\n \t\tif (ol_flags != 0) {\n-\t\t\tint rxf;\n-\n-\t\t\tfor (rxf = 0; rxf < MAX_PKT_RX_FLAGS; rxf++) {\n-\t\t\t\tif (ol_flags & (1 << rxf))\n-\t\t\t\t\tprintf(\"  PKT_RX_%s\\n\",\n-\t\t\t\t\t       pkt_rx_flag_names[rxf]);\n+\t\t\tunsigned rxf;\n+\t\t\tconst char *name;\n+\n+\t\t\tfor (rxf = 0; rxf < sizeof(mb->ol_flags) * 8; rxf++) {\n+\t\t\t\tif ((ol_flags & (1ULL << rxf)) == 0)\n+\t\t\t\t\tcontinue;\n+\t\t\t\tname = rte_get_rx_ol_flag_name(1ULL << rxf);\n+\t\t\t\tif (name == NULL)\n+\t\t\t\t\tcontinue;\n+\t\t\t\tprintf(\"  %s\\n\", name);\n \t\t\t}\n \t\t}\n \t\trte_pktmbuf_free(mb);\ndiff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\nindex 52e7574..5cd9137 100644\n--- a/lib/librte_mbuf/rte_mbuf.c\n+++ b/lib/librte_mbuf/rte_mbuf.c\n@@ -196,3 +196,48 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\n \t\tnb_segs --;\n \t}\n }\n+\n+/*\n+ * Get the name of a RX offload flag\n+ */\n+const char *rte_get_rx_ol_flag_name(uint64_t mask)\n+{\n+\tswitch (mask) {\n+\tcase PKT_RX_VLAN_PKT: return \"PKT_RX_VLAN_PKT\";\n+\tcase PKT_RX_RSS_HASH: return \"PKT_RX_RSS_HASH\";\n+\tcase PKT_RX_FDIR: return \"PKT_RX_FDIR\";\n+\tcase PKT_RX_L4_CKSUM_BAD: return \"PKT_RX_L4_CKSUM_BAD\";\n+\tcase PKT_RX_IP_CKSUM_BAD: return \"PKT_RX_IP_CKSUM_BAD\";\n+\t/* case PKT_RX_EIP_CKSUM_BAD: return \"PKT_RX_EIP_CKSUM_BAD\"; */\n+\t/* case PKT_RX_OVERSIZE: return \"PKT_RX_OVERSIZE\"; */\n+\t/* case PKT_RX_HBUF_OVERFLOW: return \"PKT_RX_HBUF_OVERFLOW\"; */\n+\t/* case PKT_RX_RECIP_ERR: return \"PKT_RX_RECIP_ERR\"; */\n+\t/* case PKT_RX_MAC_ERR: return \"PKT_RX_MAC_ERR\"; */\n+\tcase PKT_RX_IPV4_HDR: return \"PKT_RX_IPV4_HDR\";\n+\tcase PKT_RX_IPV4_HDR_EXT: return \"PKT_RX_IPV4_HDR_EXT\";\n+\tcase PKT_RX_IPV6_HDR: return \"PKT_RX_IPV6_HDR\";\n+\tcase PKT_RX_IPV6_HDR_EXT: return \"PKT_RX_IPV6_HDR_EXT\";\n+\tcase PKT_RX_IEEE1588_PTP: return \"PKT_RX_IEEE1588_PTP\";\n+\tcase PKT_RX_IEEE1588_TMST: return \"PKT_RX_IEEE1588_TMST\";\n+\tcase PKT_RX_TUNNEL_IPV4_HDR: return \"PKT_RX_TUNNEL_IPV4_HDR\";\n+\tcase PKT_RX_TUNNEL_IPV6_HDR: return \"PKT_RX_TUNNEL_IPV6_HDR\";\n+\tdefault: return NULL;\n+\t}\n+}\n+\n+/*\n+ * Get the name of a TX offload flag\n+ */\n+const char *rte_get_tx_ol_flag_name(uint64_t mask)\n+{\n+\tswitch (mask) {\n+\tcase PKT_TX_VLAN_PKT: return \"PKT_TX_VLAN_PKT\";\n+\tcase PKT_TX_IP_CKSUM: return \"PKT_TX_IP_CKSUM\";\n+\tcase PKT_TX_TCP_CKSUM: return \"PKT_TX_TCP_CKSUM\";\n+\tcase PKT_TX_SCTP_CKSUM: return \"PKT_TX_SCTP_CKSUM\";\n+\tcase PKT_TX_UDP_CKSUM: return \"PKT_TX_UDP_CKSUM\";\n+\tcase PKT_TX_IEEE1588_TMST: return \"PKT_TX_IEEE1588_TMST\";\n+\tcase PKT_TX_VXLAN_CKSUM: return \"PKT_TX_VXLAN_CKSUM\";\n+\tdefault: return NULL;\n+\t}\n+}\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex 68fb988..e76617f 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -129,6 +129,28 @@ extern \"C\" {\n /* Use final bit of flags to indicate a control mbuf */\n #define CTRL_MBUF_FLAG       (1ULL << 63) /**< Mbuf contains control data */\n \n+/**\n+ * Get the name of a RX offload flag\n+ *\n+ * @param mask\n+ *   The mask describing the flag.\n+ * @return\n+ *   The name of this flag, or NULL if it's not a valid RX flag.\n+ */\n+const char *rte_get_rx_ol_flag_name(uint64_t mask);\n+\n+/**\n+ * Get the name of a TX offload flag\n+ *\n+ * @param mask\n+ *   The mask describing the flag. Usually only one bit must be set.\n+ *   Several bits can be given if they belong to the same mask.\n+ *   Ex: PKT_TX_L4_MASK.\n+ * @return\n+ *   The name of this flag, or NULL if it's not a valid TX flag.\n+ */\n+const char *rte_get_tx_ol_flag_name(uint64_t mask);\n+\n /* define a set of marker types that can be used to refer to set points in the\n  * mbuf */\n typedef void    *MARKER[0];   /**< generic marker for a point in a structure */\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "06/13"
    ]
}