get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50748,
    "url": "http://patches.dpdk.org/api/patches/50748/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-3-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": "<20190302104251.32565-3-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190302104251.32565-3-hyonkim@cisco.com",
    "date": "2019-03-02T10:42:40",
    "name": "[v2,02/13] net/enic: fix flow director SCTP matching",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e9c21176ac78843c6f0f6a4a6ff709aa50974495",
    "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/20190302104251.32565-3-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 3613,
            "url": "http://patches.dpdk.org/api/series/3613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3613",
            "date": "2019-03-02T10:42:38",
            "name": "net/enic: 19.05 updates",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/3613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50748/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50748/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8BF4C44BE;\n\tSat,  2 Mar 2019 11:43:30 +0100 (CET)",
            "from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73])\n\tby dpdk.org (Postfix) with ESMTP id 7A28A378E;\n\tSat,  2 Mar 2019 11:43:28 +0100 (CET)",
            "from alln-core-11.cisco.com ([173.36.13.133])\n\tby rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Mar 2019 10:43:27 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id\n\tx22AhRDk002222; Sat, 2 Mar 2019 10:43:27 GMT",
            "by cisco.com (Postfix, from userid 508933)\n\tid 215A720F2001; Sat,  2 Mar 2019 02:43:27 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=6263; q=dns/txt; s=iport;\n\tt=1551523408; x=1552733008;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=ZPsKdvLdQAH0HwTkrCbDfh/BDdqYIfPt3+eD8Mf5Jzk=;\n\tb=BEEMCfmwMg/aZ56ViEQ1tnItfwbpUPibt19r4/ywQo63a/x7VpiCGjPd\n\talHOV/K6P2lCkq1ohhcT8dSsYR7hZvPPiUI/60WtZwZ2HXYEvJdSIiswr\n\tB1NrGjeCzHb8LMYCObadOIKknudBFzCtPZfZ9+WJmr3tW7CPvR8U7BuJ2 A=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,431,1544486400\"; d=\"scan'208\";a=\"530643007\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, John Daley <johndale@cisco.com>,\n\tHyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org",
        "Date": "Sat,  2 Mar 2019 02:42:40 -0800",
        "Message-Id": "<20190302104251.32565-3-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.16.2",
        "In-Reply-To": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "References": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-11.cisco.com",
        "Subject": "[dpdk-dev] [PATCH v2 02/13] net/enic: fix flow director SCTP\n\tmatching",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The firmware filter API does not have flags indicating \"match SCTP\npacket\". Instead, the driver needs to explicitly add an IP match and\nset the protocol number (132 for SCTP) in the IP header.\n\nThe existing code (copy_fltr_v2) has two bugs.\n\n1. It sets the protocol number (132) in the match value, but not the\nmask. The mask remains 0, so the match becomes a wildcard match. The\nNIC ends up matching all protocol numbers (i.e. thinks non-SCTP\npackets are SCTP).\n\n2. It modifies the input argument (rte_eth_fdir_input). The driver\ntracks filters using rte_hash_{add,del}_key(input). So, addding\n(RTE_ETH_FILTER_ADD) and deleting (RTE_ETH_FILTER_DELETE) must use the\nsame input argument for the same filter. But, overwriting the protocol\nnumber while adding the filter breaks this assumption, and causes\ndelete operation to fail.\n\nSo, set the mask as well as protocol value. Do not modify the input\nargument, and use const in function signatures to make the intention\nclear. Also move a couple function declarations to enic_clsf.c from\nenic.h as they are strictly local.\n\nFixes: dfbd6a9cb504 (\"net/enic: extend flow director support for 1300 series\")\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.h      |  8 ++------\n drivers/net/enic/enic_clsf.c | 38 ++++++++++++++++++++++++++------------\n 2 files changed, 28 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex 6c497e9a2..fa4d5590e 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -76,8 +76,8 @@ struct enic_fdir {\n \tu32 modes;\n \tu32 types_mask;\n \tvoid (*copy_fltr_fn)(struct filter_v2 *filt,\n-\t\t\t     struct rte_eth_fdir_input *input,\n-\t\t\t     struct rte_eth_fdir_masks *masks);\n+\t\t\t     const struct rte_eth_fdir_input *input,\n+\t\t\t     const struct rte_eth_fdir_masks *masks);\n };\n \n struct enic_soft_stats {\n@@ -342,9 +342,5 @@ int enic_link_update(struct enic *enic);\n bool enic_use_vector_rx_handler(struct enic *enic);\n void enic_fdir_info(struct enic *enic);\n void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats);\n-void copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n-\t\t  struct rte_eth_fdir_masks *masks);\n-void copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n-\t\t  struct rte_eth_fdir_masks *masks);\n extern const struct rte_flow_ops enic_flow_ops;\n #endif /* _ENIC_H_ */\ndiff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c\nindex 9e9e548c2..48c8e6264 100644\n--- a/drivers/net/enic/enic_clsf.c\n+++ b/drivers/net/enic/enic_clsf.c\n@@ -36,6 +36,13 @@\n \n #define ENICPMD_CLSF_HASH_ENTRIES       ENICPMD_FDIR_MAX\n \n+static void copy_fltr_v1(struct filter_v2 *fltr,\n+\t\tconst struct rte_eth_fdir_input *input,\n+\t\tconst struct rte_eth_fdir_masks *masks);\n+static void copy_fltr_v2(struct filter_v2 *fltr,\n+\t\tconst struct rte_eth_fdir_input *input,\n+\t\tconst struct rte_eth_fdir_masks *masks);\n+\n void enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *stats)\n {\n \t*stats = enic->fdir.stats;\n@@ -79,9 +86,9 @@ enic_set_layer(struct filter_generic_1 *gp, unsigned int flag,\n /* Copy Flow Director filter to a VIC ipv4 filter (for Cisco VICs\n  * without advanced filter support.\n  */\n-void\n-copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n-\t     __rte_unused struct rte_eth_fdir_masks *masks)\n+static void\n+copy_fltr_v1(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,\n+\t     __rte_unused const struct rte_eth_fdir_masks *masks)\n {\n \tfltr->type = FILTER_IPV4_5TUPLE;\n \tfltr->u.ipv4.src_addr = rte_be_to_cpu_32(\n@@ -104,9 +111,9 @@ copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n /* Copy Flow Director filter to a VIC generic filter (requires advanced\n  * filter support.\n  */\n-void\n-copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n-\t     struct rte_eth_fdir_masks *masks)\n+static void\n+copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,\n+\t     const struct rte_eth_fdir_masks *masks)\n {\n \tstruct filter_generic_1 *gp = &fltr->u.generic_1;\n \n@@ -163,9 +170,11 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n \t\t\tsctp_val.tag = input->flow.sctp4_flow.verify_tag;\n \t\t}\n \n-\t\t/* v4 proto should be 132, override ip4_flow.proto */\n-\t\tinput->flow.ip4_flow.proto = 132;\n-\n+\t\t/*\n+\t\t * Unlike UDP/TCP (FILTER_GENERIC_1_{UDP,TCP}), the firmware\n+\t\t * has no \"packet is SCTP\" flag. Use flag=0 (generic L4) and\n+\t\t * manually set proto_id=sctp below.\n+\t\t */\n \t\tenic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,\n \t\t\t       &sctp_val, sizeof(struct sctp_hdr));\n \t}\n@@ -189,6 +198,10 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n \t\tif (input->flow.ip4_flow.proto) {\n \t\t\tip4_mask.next_proto_id = masks->ipv4_mask.proto;\n \t\t\tip4_val.next_proto_id = input->flow.ip4_flow.proto;\n+\t\t} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) {\n+\t\t\t/* Explicitly match the SCTP protocol number */\n+\t\t\tip4_mask.next_proto_id = 0xff;\n+\t\t\tip4_val.next_proto_id = IPPROTO_SCTP;\n \t\t}\n \t\tif (input->flow.ip4_flow.src_ip) {\n \t\t\tip4_mask.src_addr =  masks->ipv4_mask.src_ip;\n@@ -251,9 +264,6 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n \t\t\tsctp_val.tag = input->flow.sctp6_flow.verify_tag;\n \t\t}\n \n-\t\t/* v4 proto should be 132, override ipv6_flow.proto */\n-\t\tinput->flow.ipv6_flow.proto = 132;\n-\n \t\tenic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,\n \t\t\t       &sctp_val, sizeof(struct sctp_hdr));\n \t}\n@@ -269,6 +279,10 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,\n \t\tif (input->flow.ipv6_flow.proto) {\n \t\t\tipv6_mask.proto = masks->ipv6_mask.proto;\n \t\t\tipv6_val.proto = input->flow.ipv6_flow.proto;\n+\t\t} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) {\n+\t\t\t/* See comments for IPv4 SCTP above. */\n+\t\t\tipv6_mask.proto = 0xff;\n+\t\t\tipv6_val.proto = IPPROTO_SCTP;\n \t\t}\n \t\tmemcpy(ipv6_mask.src_addr, masks->ipv6_mask.src_ip,\n \t\t       sizeof(ipv6_mask.src_addr));\n",
    "prefixes": [
        "v2",
        "02/13"
    ]
}