get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77059,
    "url": "http://patches.dpdk.org/api/patches/77059/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200909140006.23788-6-hyonkim@cisco.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": "<20200909140006.23788-6-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200909140006.23788-6-hyonkim@cisco.com",
    "date": "2020-09-09T14:00:05",
    "name": "[5/6] net/enic: generate VXLAN source port if it is zero in template",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9bc059759c21eeea6bddac45856e2ba929a9f2cc",
    "submitter": {
        "id": 948,
        "url": "http://patches.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200909140006.23788-6-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 12058,
            "url": "http://patches.dpdk.org/api/series/12058/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12058",
            "date": "2020-09-09T14:00:00",
            "name": "net/enic: minor updates to flow implementation",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12058/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77059/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77059/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 63D42A04B5;\n\tWed,  9 Sep 2020 16:02:03 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4E7F11C0CD;\n\tWed,  9 Sep 2020 16:02:03 +0200 (CEST)",
            "from alln-iport-7.cisco.com (alln-iport-7.cisco.com [173.37.142.94])\n by dpdk.org (Postfix) with ESMTP id B4EB01B9B7;\n Wed,  9 Sep 2020 16:02:00 +0200 (CEST)",
            "from alln-core-6.cisco.com ([173.36.13.139])\n by alln-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 09 Sep 2020 14:01:59 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n by alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTP id 089E1xvV012577;\n Wed, 9 Sep 2020 14:01:59 GMT",
            "by cisco.com (Postfix, from userid 508933)\n id C18B420F2005; Wed,  9 Sep 2020 07:01:58 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=2279; q=dns/txt; s=iport;\n t=1599660121; x=1600869721;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=gJSLiwRa8pOE7CpiLnFsB41qEAeY5E0xq7amr+GNf88=;\n b=aYnNHtFZH00Xgdw20QDZ3aayhA6eT0lYk4TnZfM4KwljTUu4oVAoZbgI\n 90zMUWN6BC6ZaeG5FE/w2B+jwFZg7y2NpQ14QcqKg+zTYkpzRuibzjJI6\n OLcMlJgdoE/XtfqRFw0rFcaAP+hnhfRpnfdLJoItdjqbbRbtX6urV3yEM w=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.76,409,1592870400\"; d=\"scan'208\";a=\"539145372\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org,\n John Daley <johndale@cisco.com>",
        "Date": "Wed,  9 Sep 2020 07:00:05 -0700",
        "Message-Id": "<20200909140006.23788-6-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20200909140006.23788-1-hyonkim@cisco.com>",
        "References": "<20200909140006.23788-1-hyonkim@cisco.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-6.cisco.com",
        "Subject": "[dpdk-dev] [PATCH 5/6] net/enic: generate VXLAN source port if it\n\tis zero in template",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When VXLAN source port in the template is zero, the adapter is\nexpected to generate a value based on the inner packet flow, when it\nperforms encapsulation. Flow Manager in the VIC adapter currently\nlacks such ability. So, generate a random port when creating a flow if\nthe port is zero, to avoid transmitting packets with source port 0.\n\nFixes: ea7768b5bba8 (\"net/enic: add flow implementation based on Flow Manager API\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n drivers/net/enic/enic_fm_flow.c | 21 +++++++++++++++++++++\n 1 file changed, 21 insertions(+)",
    "diff": "diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c\nindex a350b29a3..7eec8e6eb 100644\n--- a/drivers/net/enic/enic_fm_flow.c\n+++ b/drivers/net/enic/enic_fm_flow.c\n@@ -978,6 +978,17 @@ enic_fm_copy_vxlan_decap(struct enic_flowman *fm,\n \treturn enic_fm_append_action_op(fm, &fm_op, error);\n }\n \n+/* Generate a reasonable source port number */\n+static uint16_t\n+gen_src_port(void)\n+{\n+\t/* Min/max below are the default values in OVS-DPDK and Linux */\n+\tuint16_t p = rte_rand();\n+\tp = RTE_MAX(p, 32768);\n+\tp = RTE_MIN(p, 61000);\n+\treturn rte_cpu_to_be_16(p);\n+}\n+\n /* VXLAN encap is done via flowman compound action */\n static int\n enic_fm_copy_vxlan_encap(struct enic_flowman *fm,\n@@ -986,6 +997,7 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm,\n {\n \tstruct fm_action_op fm_op;\n \tstruct rte_ether_hdr *eth;\n+\tstruct rte_udp_hdr *udp;\n \tuint16_t *ethertype;\n \tvoid *template;\n \tuint8_t off;\n@@ -1084,8 +1096,17 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm,\n \t\toff + offsetof(struct rte_udp_hdr, dgram_len);\n \tfm_op.encap.len2_delta =\n \t\tsizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr);\n+\tudp = (struct rte_udp_hdr *)template;\n \tappend_template(&template, &off, item->spec,\n \t\t\tsizeof(struct rte_udp_hdr));\n+\t/*\n+\t * Firmware does not hash/fill source port yet. Generate a\n+\t * random port, as there is *usually* one rte_flow for the\n+\t * given inner packet stream (i.e. a single stream has one\n+\t * random port).\n+\t */\n+\tif (udp->src_port == 0)\n+\t\tudp->src_port = gen_src_port();\n \titem++;\n \tflow_item_skip_void(&item);\n \n",
    "prefixes": [
        "5/6"
    ]
}