Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/886999/?format=api
{ "id": 886999, "url": "http://patchwork.ozlabs.org/api/patches/886999/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180316082637.49915-3-alice.michael@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": "<20180316082637.49915-3-alice.michael@intel.com>", "list_archive_url": null, "date": "2018-03-16T08:26:32", "name": "[next,S89,3/8] i40e: move AUTO_DISABLED flags into the state field", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0a3a751b94650d92a21a35c694e194ef049c8c3d", "submitter": { "id": 71123, "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api", "name": "Michael, Alice", "email": "alice.michael@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/20180316082637.49915-3-alice.michael@intel.com/mbox/", "series": [ { "id": 34226, "url": "http://patchwork.ozlabs.org/api/series/34226/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=34226", "date": "2018-03-16T08:26:33", "name": "[next,S89,1/8] i40e: move I40E_FLAG_FILTER_SYNC to a state bit", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/34226/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/886999/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/886999/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com" ], "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 402rfF5KTjz9sLw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 17 Mar 2018 03:35:01 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 53C753048E;\n\tFri, 16 Mar 2018 16:35:00 +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 ORvDpBfMb4ws; Fri, 16 Mar 2018 16:34:56 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 361CD30494;\n\tFri, 16 Mar 2018 16:34:56 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id A45B11CF0A4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:53 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A0BFA220CD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:53 +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 CPNICzRT0hrj for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:52 +0000 (UTC)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 62FEC30475\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:52 +0000 (UTC)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Mar 2018 09:34:47 -0700", "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby fmsmga008.fm.intel.com with ESMTP; 16 Mar 2018 09:34:47 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.48,316,1517904000\"; d=\"scan'208\";a=\"25113532\"", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Fri, 16 Mar 2018 01:26:32 -0700", "Message-Id": "<20180316082637.49915-3-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.9.5", "In-Reply-To": "<20180316082637.49915-1-alice.michael@intel.com>", "References": "<20180316082637.49915-1-alice.michael@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S89 3/8] i40e: move AUTO_DISABLED\n\tflags into the state field", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nThe two Flow Directory auto disable flags are used at run time to mark\nwhen the flow director features needed to be disabled. Thus the flags\ncould change even when the RTNL lock is not held.\n\nThey also have some code constructions which really should be\ntest_and_set or test_and_clear using atomic bit operations.\n\nCreate new state fields to mark this, and stop including them in\npf->flags.\n\nThis is part of a larger effort to remove the need for cmpxchg64 in\ni40e_set_priv_flags().\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 5 +++--\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 ++--\n drivers/net/ethernet/intel/i40e/i40e_main.c | 23 +++++++++--------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 21 +++++++++++++--------\n 4 files changed, 27 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex ff309501..c41d99b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -159,6 +159,8 @@ enum i40e_state_t {\n \t__I40E_BAD_EEPROM,\n \t__I40E_DOWN_REQUESTED,\n \t__I40E_FD_FLUSH_REQUESTED,\n+\t__I40E_FD_ATR_AUTO_DISABLED,\n+\t__I40E_FD_SB_AUTO_DISABLED,\n \t__I40E_RESET_FAILED,\n \t__I40E_PORT_SUSPENDED,\n \t__I40E_VF_DISABLE,\n@@ -524,8 +526,7 @@ struct i40e_pf {\n #define I40E_FLAG_DCB_ENABLED\t\t\tBIT_ULL(8)\n #define I40E_FLAG_FD_SB_ENABLED\t\t\tBIT_ULL(9)\n #define I40E_FLAG_FD_ATR_ENABLED\t\tBIT_ULL(10)\n-#define I40E_FLAG_FD_SB_AUTO_DISABLED\t\tBIT_ULL(11)\n-#define I40E_FLAG_FD_ATR_AUTO_DISABLED\t\tBIT_ULL(12)\n+/* Gap for BIT_ULL(11) and BIT_ULL(12) */\n #define I40E_FLAG_MFP_ENABLED\t\t\tBIT_ULL(13)\n /* Gap for BIT_ULL(14) */\n #define I40E_FLAG_HW_ATR_EVICT_ENABLED\t\tBIT_ULL(15)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 722eb6b..031bc7c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -3951,7 +3951,7 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,\n \tif (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))\n \t\treturn -EOPNOTSUPP;\n \n-\tif (pf->flags & I40E_FLAG_FD_SB_AUTO_DISABLED)\n+\tif (test_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state))\n \t\treturn -ENOSPC;\n \n \tif (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||\n@@ -4460,7 +4460,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)\n \t/* Flush current ATR settings if ATR was disabled */\n \tif ((changed_flags & I40E_FLAG_FD_ATR_ENABLED) &&\n \t !(pf->flags & I40E_FLAG_FD_ATR_ENABLED)) {\n-\t\tpf->flags |= I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\t\tset_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);\n \t\tset_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex a24f99a..44d15cf 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -1083,13 +1083,13 @@ static void i40e_update_pf_stats(struct i40e_pf *pf)\n \t\t\t &osd->rx_lpi_count, &nsd->rx_lpi_count);\n \n \tif (pf->flags & I40E_FLAG_FD_SB_ENABLED &&\n-\t !(pf->flags & I40E_FLAG_FD_SB_AUTO_DISABLED))\n+\t !test_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state))\n \t\tnsd->fd_sb_status = true;\n \telse\n \t\tnsd->fd_sb_status = false;\n \n \tif (pf->flags & I40E_FLAG_FD_ATR_ENABLED &&\n-\t !(pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED))\n+\t !test_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state))\n \t\tnsd->fd_atr_status = true;\n \telse\n \t\tnsd->fd_atr_status = false;\n@@ -8144,12 +8144,10 @@ u32 i40e_get_global_fd_count(struct i40e_pf *pf)\n **/\n static void i40e_reenable_fdir_sb(struct i40e_pf *pf)\n {\n-\tif (pf->flags & I40E_FLAG_FD_SB_AUTO_DISABLED) {\n-\t\tpf->flags &= ~I40E_FLAG_FD_SB_AUTO_DISABLED;\n+\tif (test_and_clear_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state))\n \t\tif ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&\n \t\t (I40E_DEBUG_FD & pf->hw.debug_mask))\n \t\t\tdev_info(&pf->pdev->dev, \"FD Sideband/ntuple is being enabled since we have space in the table now\\n\");\n-\t}\n }\n \n /**\n@@ -8158,7 +8156,7 @@ static void i40e_reenable_fdir_sb(struct i40e_pf *pf)\n **/\n static void i40e_reenable_fdir_atr(struct i40e_pf *pf)\n {\n-\tif (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED) {\n+\tif (test_and_clear_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state)) {\n \t\t/* ATR uses the same filtering logic as SB rules. It only\n \t\t * functions properly if the input set mask is at the default\n \t\t * settings. It is safe to restore the default input set\n@@ -8168,7 +8166,6 @@ static void i40e_reenable_fdir_atr(struct i40e_pf *pf)\n \t\t\t\t\tI40E_L3_SRC_MASK | I40E_L3_DST_MASK |\n \t\t\t\t\tI40E_L4_SRC_MASK | I40E_L4_DST_MASK);\n \n-\t\tpf->flags &= ~I40E_FLAG_FD_ATR_AUTO_DISABLED;\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, \"ATR is being enabled since we have space in the table and there are no conflicting ntuple rules\\n\");\n@@ -8291,7 +8288,7 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)\n \t}\n \n \tpf->fd_flush_timestamp = jiffies;\n-\tpf->flags |= I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\tset_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);\n \t/* flush all filters */\n \twr32(&pf->hw, I40E_PFQF_CTL_1,\n \t I40E_PFQF_CTL_1_CLEARFDTABLE_MASK);\n@@ -8311,7 +8308,7 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)\n \t\t/* replay sideband filters */\n \t\ti40e_fdir_filter_restore(pf->vsi[pf->lan_vsi]);\n \t\tif (!disable_atr && !pf->fd_tcp4_filter_cnt)\n-\t\t\tpf->flags &= ~I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\t\t\tclear_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);\n \t\tclear_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);\n \t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n \t\t\tdev_info(&pf->pdev->dev, \"FD Filter table flushed and FD-SB replayed.\\n\");\n@@ -11291,20 +11288,18 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)\n \t\t\tneed_reset = true;\n \t\t\ti40e_fdir_filter_exit(pf);\n \t\t}\n-\t\tpf->flags &= ~(I40E_FLAG_FD_SB_ENABLED |\n-\t\t\t I40E_FLAG_FD_SB_AUTO_DISABLED);\n+\t\tpf->flags &= ~I40E_FLAG_FD_SB_ENABLED;\n+\t\tclear_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state);\n \t\tpf->flags |= I40E_FLAG_FD_SB_INACTIVE;\n \n \t\t/* reset fd counters */\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_AUTO_DISABLED) {\n-\t\t\tpf->flags &= ~I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\t\tif (test_and_clear_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state))\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.\\n\");\n-\t\t}\n \t}\n \treturn need_reset;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 91dfe1c..c6972bd 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -336,7 +336,7 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,\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->flags |= I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\t\tset_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);\n \t} else {\n \t\tpf->fd_tcp4_filter_cnt--;\n \t}\n@@ -594,8 +594,14 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,\n \t\tpf->fd_atr_cnt = i40e_get_current_atr_cnt(pf);\n \n \t\tif ((rx_desc->wb.qword0.hi_dword.fd_id == 0) &&\n-\t\t pf->flags & I40E_FLAG_FD_SB_AUTO_DISABLED) {\n-\t\t\tpf->flags |= I40E_FLAG_FD_ATR_AUTO_DISABLED;\n+\t\t test_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state)) {\n+\t\t\t/* These set_bit() calls aren't atomic with the\n+\t\t\t * test_bit() here, but worse case we potentially\n+\t\t\t * disable ATR and queue a flush right after SB\n+\t\t\t * support is re-enabled. That shouldn't cause an\n+\t\t\t * issue in practice\n+\t\t\t */\n+\t\t\tset_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);\n \t\t\tset_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);\n \t\t}\n \n@@ -608,11 +614,10 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,\n \t\t */\n \t\tif (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {\n \t\t\tif ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&\n-\t\t\t !(pf->flags & I40E_FLAG_FD_SB_AUTO_DISABLED)) {\n-\t\t\t\tpf->flags |= I40E_FLAG_FD_SB_AUTO_DISABLED;\n+\t\t\t !test_and_set_bit(__I40E_FD_SB_AUTO_DISABLED,\n+\t\t\t\t\t pf->state))\n \t\t\t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n \t\t\t\t\tdev_warn(&pdev->dev, \"FD filter space full, new ntuple rules will not be added\\n\");\n-\t\t\t}\n \t\t}\n \t} else if (error == BIT(I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) {\n \t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n@@ -2647,7 +2652,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tif (!(pf->flags & I40E_FLAG_FD_ATR_ENABLED))\n \t\treturn;\n \n-\tif (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED)\n+\tif (test_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state))\n \t\treturn;\n \n \t/* if sampling is disabled do nothing */\n@@ -2687,7 +2692,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tth = (struct tcphdr *)(hdr.network + hlen);\n \n \t/* Due to lack of space, no more new filters can be programmed */\n-\tif (th->syn && (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED))\n+\tif (th->syn && test_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state))\n \t\treturn;\n \tif (pf->flags & I40E_FLAG_HW_ATR_EVICT_ENABLED) {\n \t\t/* HW ATR eviction will take care of removing filters on FIN\n", "prefixes": [ "next", "S89", "3/8" ] }