Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/847677/?format=api
{ "id": 847677, "url": "http://patchwork.ozlabs.org/api/patches/847677/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1513121823-27944-4-git-send-email-shannon.nelson@oracle.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": "<1513121823-27944-4-git-send-email-shannon.nelson@oracle.com>", "list_archive_url": null, "date": "2017-12-12T23:36:56", "name": "[v2,next-queue,03/10] ixgbe: add ipsec engine start and stop routines", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "22e1e5a59870d82dc2a58d7e2bac9f58664a15c0", "submitter": { "id": 70766, "url": "http://patchwork.ozlabs.org/api/people/70766/?format=api", "name": "Shannon Nelson", "email": "shannon.nelson@oracle.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/1513121823-27944-4-git-send-email-shannon.nelson@oracle.com/mbox/", "series": [ { "id": 18198, "url": "http://patchwork.ozlabs.org/api/series/18198/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=18198", "date": "2017-12-12T23:36:53", "name": "ixgbe: Add ipsec offload", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/18198/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/847677/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/847677/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.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=oracle.com header.i=@oracle.com\n\theader.b=\"CJ0ggusp\"; dkim-atps=neutral" ], "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 3yxGTD5xHBz9t3M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Dec 2017 10:37:36 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id DDAFB87F98;\n\tTue, 12 Dec 2017 23:37:34 +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 RWrDYLBgbgYz; Tue, 12 Dec 2017 23:37:32 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4822E87F8B;\n\tTue, 12 Dec 2017 23:37:32 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8B3761BF54B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Dec 2017 23:37:30 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 82D3D87F65\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Dec 2017 23:37:30 +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 hEphealS8aE6 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Dec 2017 23:37:22 +0000 (UTC)", "from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 8DE3887F45\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Dec 2017 23:37:21 +0000 (UTC)", "from pps.filterd (userp2130.oracle.com [127.0.0.1])\n\tby userp2130.oracle.com (8.16.0.21/8.16.0.21) with SMTP id\n\tvBCNUKbq182945; Tue, 12 Dec 2017 23:37:18 GMT", "from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])\n\tby userp2130.oracle.com with ESMTP id 2etrug80pt-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 12 Dec 2017 23:37:18 +0000", "from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])\n\tby aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vBCNbHO4016261\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 12 Dec 2017 23:37:17 GMT", "from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7])\n\tby userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vBCNbG9L006396; \n\tTue, 12 Dec 2017 23:37:16 GMT", "from slnelson-mint18.us.oracle.com (/10.159.225.160)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Tue, 12 Dec 2017 15:37:15 -0800" ], "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=relaxed/relaxed; d=oracle.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references;\n\ts=corp-2017-10-26; \n\tbh=KoGtDmJJ6ihdGwY20StKOPxqcEcHaePzC5l2Uvkkbfw=;\n\tb=CJ0gguspwTbtiaEqu2lu0cEfoEq3K7ujWF2RFXMX8ebgr9BAjv2vQgNTYQRXsWWFU1gP\n\tq2KeRDv1rs8B6yPAf1xTvX7hpuKjXNWmo7DHkq6PFQB4M8JbEZ4QLLy1ehqXpAg0yAOm\n\tR/phwy9IqCFwZAct7LjLa4+3tJXwCmtQ461CdwuYdW6fbq8ez+XelL1A+7dqSoCpHA6i\n\tWYL7M3txoQwtY/umb7cu2967JYyvfWdYAdBi9rcTWpEkFZ5RJHGaLHMF2QyvxBnzhEv7\n\tT4XEyrckR6WJ2s0FqdQ3bLoEnnNSJ2WHU77+2bVx1p3qK1dT535XfX6q3HdV5UxO2xwz\n\tRA== ", "From": "Shannon Nelson <shannon.nelson@oracle.com>", "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com", "Date": "Tue, 12 Dec 2017 15:36:56 -0800", "Message-Id": "<1513121823-27944-4-git-send-email-shannon.nelson@oracle.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1513121823-27944-1-git-send-email-shannon.nelson@oracle.com>", "References": "<1513121823-27944-1-git-send-email-shannon.nelson@oracle.com>", "X-Proofpoint-Virus-Version": "vendor=nai engine=5900 definitions=8743\n\tsignatures=668646", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 suspectscore=0\n\tmalwarescore=0\n\tphishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=639\n\tadultscore=0 classifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1711220000 definitions=main-1712120331", "Subject": "[Intel-wired-lan] [PATCH v2 next-queue 03/10] ixgbe: add ipsec\n\tengine start and stop routines", "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>", "Cc": "steffen.klassert@secunet.com, netdev@vger.kernel.org,\n\tsowmini.varadhan@oracle.com", "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": "Add in the code for running and stopping the hardware ipsec\nencryption/decryption engine. It is good to keep the engine\noff when not in use in order to save on the power draw.\n\nSigned-off-by: Shannon Nelson <shannon.nelson@oracle.com>\n---\nv2: add limiter to do-while loop waiting for paths to drain\n\n drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 142 +++++++++++++++++++++++++\n 1 file changed, 142 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\nindex 4d71517..a45e6b7 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n@@ -152,10 +152,152 @@ void ixgbe_ipsec_clear_hw_tables(struct ixgbe_adapter *adapter)\n }\n \n /**\n+ * ixgbe_ipsec_stop_data\n+ * @adapter: board private structure\n+ **/\n+static void ixgbe_ipsec_stop_data(struct ixgbe_adapter *adapter)\n+{\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\tbool link = adapter->link_up;\n+\tu32 t_rdy, r_rdy;\n+\tu32 limit;\n+\tu32 reg;\n+\n+\t/* halt data paths */\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL);\n+\treg |= IXGBE_SECTXCTRL_TX_DIS;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, reg);\n+\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);\n+\treg |= IXGBE_SECRXCTRL_RX_DIS;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, reg);\n+\n+\tIXGBE_WRITE_FLUSH(hw);\n+\n+\t/* If the tx fifo doesn't have link, but still has data,\n+\t * we can't clear the tx sec block. Set the MAC loopback\n+\t * before block clear\n+\t */\n+\tif (!link) {\n+\t\treg = IXGBE_READ_REG(hw, IXGBE_MACC);\n+\t\treg |= IXGBE_MACC_FLU;\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_MACC, reg);\n+\n+\t\treg = IXGBE_READ_REG(hw, IXGBE_HLREG0);\n+\t\treg |= IXGBE_HLREG0_LPBK;\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_HLREG0, reg);\n+\n+\t\tIXGBE_WRITE_FLUSH(hw);\n+\t\tmdelay(3);\n+\t}\n+\n+\t/* wait for the paths to empty */\n+\tlimit = 20;\n+\tdo {\n+\t\tmdelay(10);\n+\t\tt_rdy = IXGBE_READ_REG(hw, IXGBE_SECTXSTAT) &\n+\t\t\tIXGBE_SECTXSTAT_SECTX_RDY;\n+\t\tr_rdy = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT) &\n+\t\t\tIXGBE_SECRXSTAT_SECRX_RDY;\n+\t} while (!t_rdy && !r_rdy && limit--);\n+\n+\t/* undo loopback if we played with it earlier */\n+\tif (!link) {\n+\t\treg = IXGBE_READ_REG(hw, IXGBE_MACC);\n+\t\treg &= ~IXGBE_MACC_FLU;\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_MACC, reg);\n+\n+\t\treg = IXGBE_READ_REG(hw, IXGBE_HLREG0);\n+\t\treg &= ~IXGBE_HLREG0_LPBK;\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_HLREG0, reg);\n+\n+\t\tIXGBE_WRITE_FLUSH(hw);\n+\t}\n+}\n+\n+/**\n+ * ixgbe_ipsec_stop_engine\n+ * @adapter: board private structure\n+ **/\n+static void ixgbe_ipsec_stop_engine(struct ixgbe_adapter *adapter)\n+{\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\tu32 reg;\n+\n+\tixgbe_ipsec_stop_data(adapter);\n+\n+\t/* disable Rx and Tx SA lookup */\n+\tIXGBE_WRITE_REG(hw, IXGBE_IPSTXIDX, 0);\n+\tIXGBE_WRITE_REG(hw, IXGBE_IPSRXIDX, 0);\n+\n+\t/* disable the Rx and Tx engines and full packet store-n-forward */\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL);\n+\treg |= IXGBE_SECTXCTRL_SECTX_DIS;\n+\treg &= ~IXGBE_SECTXCTRL_STORE_FORWARD;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, reg);\n+\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);\n+\treg |= IXGBE_SECRXCTRL_SECRX_DIS;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, reg);\n+\n+\t/* restore the \"tx security buffer almost full threshold\" to 0x250 */\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXBUFFAF, 0x250);\n+\n+\t/* Set minimum IFG between packets back to the default 0x1 */\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG);\n+\treg = (reg & 0xfffffff0) | 0x1;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, reg);\n+\n+\t/* final set for normal (no ipsec offload) processing */\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, IXGBE_SECTXCTRL_SECTX_DIS);\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, IXGBE_SECRXCTRL_SECRX_DIS);\n+\n+\tIXGBE_WRITE_FLUSH(hw);\n+}\n+\n+/**\n+ * ixgbe_ipsec_start_engine\n+ * @adapter: board private structure\n+ *\n+ * NOTE: this increases power consumption whether being used or not\n+ **/\n+static void ixgbe_ipsec_start_engine(struct ixgbe_adapter *adapter)\n+{\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\tu32 reg;\n+\n+\tixgbe_ipsec_stop_data(adapter);\n+\n+\t/* Set minimum IFG between packets to 3 */\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG);\n+\treg = (reg & 0xfffffff0) | 0x3;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, reg);\n+\n+\t/* Set \"tx security buffer almost full threshold\" to 0x15 so that the\n+\t * almost full indication is generated only after buffer contains at\n+\t * least an entire jumbo packet.\n+\t */\n+\treg = IXGBE_READ_REG(hw, IXGBE_SECTXBUFFAF);\n+\treg = (reg & 0xfffffc00) | 0x15;\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXBUFFAF, reg);\n+\n+\t/* restart the data paths by clearing the DISABLE bits */\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, 0);\n+\tIXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, IXGBE_SECTXCTRL_STORE_FORWARD);\n+\n+\t/* enable Rx and Tx SA lookup */\n+\tIXGBE_WRITE_REG(hw, IXGBE_IPSTXIDX, IXGBE_RXTXIDX_IPS_EN);\n+\tIXGBE_WRITE_REG(hw, IXGBE_IPSRXIDX, IXGBE_RXTXIDX_IPS_EN);\n+\n+\tIXGBE_WRITE_FLUSH(hw);\n+}\n+\n+/**\n * ixgbe_init_ipsec_offload - initialize security registers for IPSec operation\n * @adapter: board private structure\n **/\n void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)\n {\n \tixgbe_ipsec_clear_hw_tables(adapter);\n+\tixgbe_ipsec_stop_engine(adapter);\n }\n", "prefixes": [ "v2", "next-queue", "03/10" ] }