get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 738799,
    "url": "http://patchwork.ozlabs.org/api/patches/738799/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1489511727-10959-5-git-send-email-bimmy.pujari@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": "<1489511727-10959-5-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2017-03-14T17:15:26",
    "name": "[next,S63,5/6] i40e/i40evf: Add legacy-rx private flag to allow fallback to old Rx flow",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0ea99f3cf297666410b10301c32c419ba7620e50",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@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/1489511727-10959-5-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/738799/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/738799/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3vjKdr4L4lz9rxm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 15 Mar 2017 03:17:52 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id EC26389644;\n\tTue, 14 Mar 2017 16:17:50 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id MUCJcKw-b6bR; Tue, 14 Mar 2017 16:17:46 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4A09F897A9;\n\tTue, 14 Mar 2017 16:17:41 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id EB3121BFEBB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:40 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E3D3689670\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:40 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 71xZ+2ZU4569 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:36 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id A5DAF89644\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 Mar 2017 16:17:36 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Mar 2017 09:17:35 -0700",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([10.166.35.87])\n\tby orsmga001.jf.intel.com with ESMTP; 14 Mar 2017 09:17:35 -0700"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"SMjAamih\"; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1489508256; x=1521044256;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=Ft6ZWnpGorlWTMrJnNFWSy2cpXDu1rWvD1FA+j9D+zs=;\n\tb=SMjAamihmryIyg2Ol6GT3a1TtS2Z1Howa3/dTwkCYzebsa1hoZCHcr6n\n\t4kCEJeIKB4ev/pvrfcq6TznhqCdpAg==;",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.36,164,1486454400\"; d=\"scan'208\";\n\ta=\"1108362405\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 14 Mar 2017 10:15:26 -0700",
        "Message-Id": "<1489511727-10959-5-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1489511727-10959-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1489511727-10959-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S63 5/6] i40e/i40evf: Add legacy-rx\n\tprivate flag to allow fallback to old Rx flow",
        "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": "From: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThis patch adds a control which will allow us to toggle into and out of the\nlegacy Rx mode.  The legacy Rx mode is what we currently do when performing\nRx.  As I make further changes what should happen is that the driver will\nfall back to the behavior for Rx as of this patch should the \"legacy-rx\"\nflag be set to on.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\nChange-ID: I0342998849bbb31351cce05f6e182c99174e7751\n---\nTesting Hints:\n        This flag should not appear on kernels prior to 4.10.\n        On kernels 4.10 and later the \"legacy-rx\" flag should appear\n        and can be toggled between on and off. As we add more features the\n        behavior of the driver should change when this value is toggled.\n\n        Toggling this for now will only cause a reset of the interface.\n\n        For the VF we are specifically replacing the define that was\n        stripping the code for the flag needed for the \"legacy-rx\" flag\n        since it doesn't make sense to have the interface defined when\n        there are no flags present.  In the case of a kernel build the\n        #ifdefs should be stripped and the code will remain.\n\n drivers/net/ethernet/intel/i40e/i40e.h             |   1 +\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   5 +-\n drivers/net/ethernet/intel/i40evf/i40evf.h         |   2 +\n drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 104 +++++++++++++++++++++\n 4 files changed, 111 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex dcba258..561fe1f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -430,6 +430,7 @@ struct i40e_pf {\n #define I40E_FLAG_TEMP_LINK_POLLING\t\tBIT_ULL(55)\n #define I40E_FLAG_CLIENT_L2_CHANGE\t\tBIT_ULL(56)\n #define I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE\t\tBIT_ULL(57)\n+#define I40E_FLAG_LEGACY_RX\t\t\tBIT_ULL(57)\n \n        /* Tracks features that are disabled due to hw limitations.\n \t* If a bit is set here, it means that the corresponding\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 56dccf8..0db6b36 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -226,6 +226,7 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = {\n \tI40E_PRIV_FLAG(\"flow-director-atr\", I40E_FLAG_FD_ATR_ENABLED, 0),\n \tI40E_PRIV_FLAG(\"veb-stats\", I40E_FLAG_VEB_STATS_ENABLED, 0),\n \tI40E_PRIV_FLAG(\"hw-atr-eviction\", I40E_FLAG_HW_ATR_EVICT_CAPABLE, 0),\n+\tI40E_PRIV_FLAG(\"legacy-rx\", I40E_FLAG_LEGACY_RX, 0),\n };\n \n #define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_gstrings_priv_flags)\n@@ -4048,6 +4049,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)\n \t}\n \n flags_complete:\n+\t/* check for flags that changed */\n \tchanged_flags ^= pf->flags;\n \n \t/* Process any additional changes needed as a result of flag changes.\n@@ -4088,7 +4090,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)\n \t/* Issue reset to cause things to take effect, as additional bits\n \t * are added we will need to create a mask of bits requiring reset\n \t */\n-\tif (changed_flags & I40E_FLAG_VEB_STATS_ENABLED)\n+\tif ((changed_flags & I40E_FLAG_VEB_STATS_ENABLED) ||\n+\t    ((changed_flags & I40E_FLAG_LEGACY_RX) && netif_running(dev)))\n \t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));\n \n \treturn 0;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex b2b4851..e60cbfa 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -222,6 +222,7 @@ struct i40evf_adapter {\n #define I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS\tBIT(17)\n #define I40EVF_FLAG_PROMISC_ON\t\t\tBIT(18)\n #define I40EVF_FLAG_ALLMULTI_ON\t\t\tBIT(19)\n+#define I40EVF_FLAG_LEGACY_RX\t\t\tBIT(20)\n /* duplicates for common code */\n #define I40E_FLAG_FDIR_ATR_ENABLED\t\t0\n #define I40E_FLAG_DCB_ENABLED\t\t\t0\n@@ -229,6 +230,7 @@ struct i40evf_adapter {\n #define I40E_FLAG_RX_CSUM_ENABLED\t\tI40EVF_FLAG_RX_CSUM_ENABLED\n #define I40E_FLAG_WB_ON_ITR_CAPABLE\t\tI40EVF_FLAG_WB_ON_ITR_CAPABLE\n #define I40E_FLAG_OUTER_UDP_CSUM_CAPABLE\tI40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE\n+#define I40E_FLAG_LEGACY_RX\t\t\tI40EVF_FLAG_LEGACY_RX\n \t/* flags for admin queue service task */\n \tu32 aq_required;\n #define I40EVF_FLAG_AQ_ENABLE_QUEUES\t\tBIT(0)\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\nindex 122efbd..9bb2cc7 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n@@ -63,6 +63,29 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {\n #define I40EVF_STATS_LEN(_dev) \\\n \t(I40EVF_GLOBAL_STATS_LEN + I40EVF_QUEUE_STATS_LEN(_dev))\n \n+/* For now we have one and only one private flag and it is only defined\n+ * when we have support for the SKIP_CPU_SYNC DMA attribute.  Instead\n+ * of leaving all this code sitting around empty we will strip it unless\n+ * our one private flag is actually available.\n+ */\n+struct i40evf_priv_flags {\n+\tchar flag_string[ETH_GSTRING_LEN];\n+\tu32 flag;\n+\tbool read_only;\n+};\n+\n+#define I40EVF_PRIV_FLAG(_name, _flag, _read_only) { \\\n+\t.flag_string = _name, \\\n+\t.flag = _flag, \\\n+\t.read_only = _read_only, \\\n+}\n+\n+static const struct i40evf_priv_flags i40evf_gstrings_priv_flags[] = {\n+\tI40EVF_PRIV_FLAG(\"legacy-rx\", I40EVF_FLAG_LEGACY_RX, 0),\n+};\n+\n+#define I40EVF_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40evf_gstrings_priv_flags)\n+\n /**\n  * i40evf_get_link_ksettings - Get Link Speed and Duplex settings\n  * @netdev: network interface device structure\n@@ -124,6 +147,8 @@ static int i40evf_get_sset_count(struct net_device *netdev, int sset)\n {\n \tif (sset == ETH_SS_STATS)\n \t\treturn I40EVF_STATS_LEN(netdev);\n+\telse if (sset == ETH_SS_PRIV_FLAGS)\n+\t\treturn I40EVF_PRIV_FLAGS_STR_LEN;\n \telse\n \t\treturn -EINVAL;\n }\n@@ -189,7 +214,83 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)\n \t\t\tsnprintf(p, ETH_GSTRING_LEN, \"rx-%u.bytes\", i);\n \t\t\tp += ETH_GSTRING_LEN;\n \t\t}\n+\t} else if (sset == ETH_SS_PRIV_FLAGS) {\n+\t\tfor (i = 0; i < I40EVF_PRIV_FLAGS_STR_LEN; i++) {\n+\t\t\tsnprintf(p, ETH_GSTRING_LEN, \"%s\",\n+\t\t\t\t i40evf_gstrings_priv_flags[i].flag_string);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t}\n+\t}\n+}\n+\n+/**\n+ * i40evf_get_priv_flags - report device private flags\n+ * @dev: network interface device structure\n+ *\n+ * The get string set count and the string set should be matched for each\n+ * flag returned.  Add new strings for each flag to the i40e_gstrings_priv_flags\n+ * array.\n+ *\n+ * Returns a u32 bitmap of flags.\n+ **/\n+static u32 i40evf_get_priv_flags(struct net_device *netdev)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n+\tu32 i, ret_flags = 0;\n+\n+\tfor (i = 0; i < I40EVF_PRIV_FLAGS_STR_LEN; i++) {\n+\t\tconst struct i40evf_priv_flags *priv_flags;\n+\n+\t\tpriv_flags = &i40evf_gstrings_priv_flags[i];\n+\n+\t\tif (priv_flags->flag & adapter->flags)\n+\t\t\tret_flags |= BIT(i);\n+\t}\n+\n+\treturn ret_flags;\n+}\n+\n+/**\n+ * i40evf_set_priv_flags - set private flags\n+ * @dev: network interface device structure\n+ * @flags: bit flags to be set\n+ **/\n+static int i40evf_set_priv_flags(struct net_device *netdev, u32 flags)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n+\tu64 changed_flags;\n+\tu32 i;\n+\n+\tchanged_flags = adapter->flags;\n+\n+\tfor (i = 0; i < I40EVF_PRIV_FLAGS_STR_LEN; i++) {\n+\t\tconst struct i40evf_priv_flags *priv_flags;\n+\n+\t\tpriv_flags = &i40evf_gstrings_priv_flags[i];\n+\n+\t\tif (priv_flags->read_only)\n+\t\t\tcontinue;\n+\n+\t\tif (flags & BIT(i))\n+\t\t\tadapter->flags |= priv_flags->flag;\n+\t\telse\n+\t\t\tadapter->flags &= ~(priv_flags->flag);\n+\t}\n+\n+\t/* check for flags that changed */\n+\tchanged_flags ^= adapter->flags;\n+\n+\t/* Process any additional changes needed as a result of flag changes. */\n+\n+\t/* issue a reset to force legacy-rx change to take effect */\n+\tif (changed_flags & I40EVF_FLAG_LEGACY_RX) {\n+\t\tif (netif_running(netdev)) {\n+\t\t\tadapter->flags |= I40EVF_FLAG_RESET_NEEDED;\n+\t\t\tschedule_work(&adapter->reset_task);\n+\t\t}\n \t}\n+\n+\treturn 0;\n }\n \n /**\n@@ -238,6 +339,7 @@ static void i40evf_get_drvinfo(struct net_device *netdev,\n \tstrlcpy(drvinfo->version, i40evf_driver_version, 32);\n \tstrlcpy(drvinfo->fw_version, \"N/A\", 4);\n \tstrlcpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);\n+\tdrvinfo->n_priv_flags = I40EVF_PRIV_FLAGS_STR_LEN;\n }\n \n /**\n@@ -649,6 +751,8 @@ static const struct ethtool_ops i40evf_ethtool_ops = {\n \t.get_strings\t\t= i40evf_get_strings,\n \t.get_ethtool_stats\t= i40evf_get_ethtool_stats,\n \t.get_sset_count\t\t= i40evf_get_sset_count,\n+\t.get_priv_flags\t\t= i40evf_get_priv_flags,\n+\t.set_priv_flags\t\t= i40evf_set_priv_flags,\n \t.get_msglevel\t\t= i40evf_get_msglevel,\n \t.set_msglevel\t\t= i40evf_set_msglevel,\n \t.get_coalesce\t\t= i40evf_get_coalesce,\n",
    "prefixes": [
        "next",
        "S63",
        "5/6"
    ]
}