get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 724782,
    "url": "http://patchwork.ozlabs.org/api/patches/724782/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206223846.31052-10-jacob.e.keller@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170206223846.31052-10-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2017-02-06T22:38:46",
    "name": "[PART1,09/11] i40e: add counters for UDP/IPv4 and IPv4 filters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9e4e5ccd610d8de10e86062957dd692a199c8cbf",
    "submitter": {
        "id": 9784,
        "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api",
        "name": "Jacob Keller",
        "email": "jacob.e.keller@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206223846.31052-10-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/724782/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/724782/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vHMpN4l5vz9s1y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  7 Feb 2017 09:39:08 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2FF9330A56;\n\tMon,  6 Feb 2017 22:39:07 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id hnLogjqLhKgs; Mon,  6 Feb 2017 22:39:04 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 53E2630A83;\n\tMon,  6 Feb 2017 22:38:56 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 534971BFF07\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:52 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4FDBA89EF2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:52 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id vg+c4mVn75sj for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:50 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id F24538A351\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:49 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga102.jf.intel.com with ESMTP; 06 Feb 2017 14:38:49 -0800",
            "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.174])\n\tby fmsmga006.fm.intel.com with ESMTP; 06 Feb 2017 14:38:49 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.33,342,1477983600\"; d=\"scan'208\";a=\"62577461\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Mon,  6 Feb 2017 14:38:46 -0800",
        "Message-Id": "<20170206223846.31052-10-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.12.0.rc0.151.g8a5726c42288",
        "In-Reply-To": "<20170206223846.31052-1-jacob.e.keller@intel.com>",
        "References": "<20170206223846.31052-1-jacob.e.keller@intel.com>",
        "Subject": "[Intel-wired-lan] [PART1 PATCH 09/11] i40e: add counters for\n\tUDP/IPv4 and IPv4 filters",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "In preparation for adding code to properly check the mask values, we\nwill need to know the number of active filters for each type. Add\ncounters for each filter type. Rename the already existing fd_tcp_rule\nto fd_tcp4_filter_cnt to match the style of other names. To avoid style\nwarnings, avoid assigning multiple parameters at once, and fix up one\nother case where we did so previously.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h      |  9 ++++++++-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++++------\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 17 +++++++++++++----\n 3 files changed, 34 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex e4ac2b782d80..9957eca8f71d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -290,7 +290,14 @@ struct i40e_pf {\n \tu32 fd_flush_cnt;\n \tu32 fd_add_err;\n \tu32 fd_atr_cnt;\n-\tu32 fd_tcp_rule;\n+\n+\t/* Book-keeping of side-band filter count per flow-type.\n+\t * This is used to detect and handle input set changes for\n+\t * respective flow-type.\n+\t */\n+\tu16 fd_tcp4_filter_cnt;\n+\tu16 fd_udp4_filter_cnt;\n+\tu16 fd_ip4_filter_cnt;\n \n \tstruct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];\n \tu16 pending_udp_bitmap;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex e06c7b785fd8..c188559fc4ed 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -3321,7 +3321,9 @@ static void i40e_fdir_filter_restore(struct i40e_vsi *vsi)\n \t\treturn;\n \n \t/* Reset FDir counters as we're replaying all existing filters */\n-\tpf->fd_tcp_rule = 0;\n+\tpf->fd_tcp4_filter_cnt = 0;\n+\tpf->fd_udp4_filter_cnt = 0;\n+\tpf->fd_ip4_filter_cnt = 0;\n \n \thlist_for_each_entry_safe(filter, node,\n \t\t\t\t  &pf->fdir_filter_list, fdir_node) {\n@@ -5610,7 +5612,8 @@ static int i40e_up_complete(struct i40e_vsi *vsi)\n \t/* replay FDIR SB filters */\n \tif (vsi->type == I40E_VSI_FDIR) {\n \t\t/* reset fd counters */\n-\t\tpf->fd_add_err = pf->fd_atr_cnt = 0;\n+\t\tpf->fd_add_err = 0;\n+\t\tpf->fd_atr_cnt = 0;\n \t\ti40e_fdir_filter_restore(vsi);\n \t}\n \n@@ -5892,7 +5895,11 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)\n \t\thlist_del(&filter->fdir_node);\n \t\tkfree(filter);\n \t}\n+\n \tpf->fdir_pf_active_filters = 0;\n+\tpf->fd_tcp4_filter_cnt = 0;\n+\tpf->fd_udp4_filter_cnt = 0;\n+\tpf->fd_ip4_filter_cnt = 0;\n }\n \n /**\n@@ -6297,7 +6304,7 @@ void i40e_fdir_check_and_reenable(struct i40e_pf *pf)\n \tif (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM * 2)) {\n \t\tif ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&\n \t\t    (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED) &&\n-\t\t    (pf->fd_tcp_rule == 0)) {\n+\t\t    (pf->fd_tcp4_filter_cnt == 0)) {\n \t\t\tpf->auto_disable_flags &= ~I40E_FLAG_FD_ATR_ENABLED;\n \t\t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n \t\t\t\tdev_info(&pf->pdev->dev, \"ATR is being enabled since we have space in the table and there are no conflicting ntuple rules\\n\");\n@@ -6369,7 +6376,7 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)\n \t} else {\n \t\t/* replay sideband filters */\n \t\ti40e_fdir_filter_restore(pf->vsi[pf->lan_vsi]);\n-\t\tif (!disable_atr && !pf->fd_tcp_rule)\n+\t\tif (!disable_atr && !pf->fd_tcp4_filter_cnt)\n \t\t\tpf->auto_disable_flags &= ~I40E_FLAG_FD_ATR_ENABLED;\n \t\tclear_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state);\n \t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n@@ -9124,8 +9131,8 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)\n \t\tpf->flags &= ~I40E_FLAG_FD_SB_ENABLED;\n \t\tpf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED;\n \t\t/* reset fd counters */\n-\t\tpf->fd_add_err = pf->fd_atr_cnt = pf->fd_tcp_rule = 0;\n-\t\tpf->fdir_pf_active_filters = 0;\n+\t\tpf->fd_add_err = 0;\n+\t\tpf->fd_atr_cnt = 0;\n \t\t/* if ATR was auto disabled it can be re-enabled. */\n \t\tif ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&\n \t\t    (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED)) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 5756139636ff..55ac87c1e40b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -244,6 +244,11 @@ static int i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,\n \t\t\t\t fd_data->pctype, fd_data->fd_id);\n \t}\n \n+\tif (add)\n+\t\tpf->fd_udp4_filter_cnt++;\n+\telse\n+\t\tpf->fd_udp4_filter_cnt--;\n+\n \treturn 0;\n }\n \n@@ -305,15 +310,14 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,\n \t}\n \n \tif (add) {\n-\t\tpf->fd_tcp_rule++;\n+\t\tpf->fd_tcp4_filter_cnt++;\n \t\tif ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&\n \t\t    I40E_DEBUG_FD & pf->hw.debug_mask)\n \t\t\tdev_info(&pf->pdev->dev, \"Forcing ATR off, sideband rules for TCP/IPv4 flow being applied\\n\");\n \t\tpf->auto_disable_flags |= I40E_FLAG_FD_ATR_ENABLED;\n \t} else {\n-\t\tpf->fd_tcp_rule = (pf->fd_tcp_rule > 0) ?\n-\t\t\t\t  (pf->fd_tcp_rule - 1) : 0;\n-\t\tif (pf->fd_tcp_rule == 0) {\n+\t\tpf->fd_tcp4_filter_cnt--;\n+\t\tif (pf->fd_tcp4_filter_cnt == 0) {\n \t\t\tif ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&\n \t\t\t    I40E_DEBUG_FD & pf->hw.debug_mask)\n \t\t\t\tdev_info(&pf->pdev->dev, \"ATR re-enabled due to no sideband TCP/IPv4 rules\\n\");\n@@ -382,6 +386,11 @@ static int i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi,\n \t\t}\n \t}\n \n+\tif (add)\n+\t\tpf->fd_ip4_filter_cnt++;\n+\telse\n+\t\tpf->fd_ip4_filter_cnt--;\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "PART1",
        "09/11"
    ]
}