Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/957188/?format=api
{ "id": 957188, "url": "http://patchwork.ozlabs.org/api/patches/957188/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1534185825-12451-9-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": "<1534185825-12451-9-git-send-email-shannon.nelson@oracle.com>", "list_archive_url": null, "date": "2018-08-13T18:43:45", "name": "[next-queue,8/8] ixgbevf: enable VF ipsec offload operations", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a3248de366daf36cbf170fc507659f2ad98b2cde", "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/1534185825-12451-9-git-send-email-shannon.nelson@oracle.com/mbox/", "series": [ { "id": 60595, "url": "http://patchwork.ozlabs.org/api/series/60595/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=60595", "date": "2018-08-13T18:43:38", "name": "ixgbe/ixgbevf: IPsec offload support for VFs", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/60595/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/957188/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/957188/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.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=oracle.com", "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=\"yuf8q7XH\"; dkim-atps=neutral" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 41q4Q062GVz9s9N\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 14 Aug 2018 04:44:08 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 478018486F;\n\tMon, 13 Aug 2018 18:44:07 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id JTzuxm0fiGgv; Mon, 13 Aug 2018 18:44:06 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 31BE684742;\n\tMon, 13 Aug 2018 18:44:06 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id E462F1CF35C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:44:03 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E1C2482CBF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:44:03 +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 f4ymHC7ItJ5D for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:44:00 +0000 (UTC)", "from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id F270082462\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:43:58 +0000 (UTC)", "from pps.filterd (aserp2130.oracle.com [127.0.0.1])\n\tby aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id\n\tw7DIdPh8019922; Mon, 13 Aug 2018 18:43:57 GMT", "from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby aserp2130.oracle.com with ESMTP id 2ksnacwpnj-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 13 Aug 2018 18:43:57 +0000", "from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7DIhuWU028125\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 13 Aug 2018 18:43:56 GMT", "from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tw7DIhuAX008068; Mon, 13 Aug 2018 18:43:56 GMT", "from slnelson-mint18.us.oracle.com (/10.159.144.11)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Mon, 13 Aug 2018 11:43:56 -0700" ], "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-2018-07-02; \n\tbh=94pXnNNmXJc4zNtUiHPKoHQgHIy+GB3N0SA67xVNBC4=;\n\tb=yuf8q7XH8cTGWuy52UOnICHvD92+XIP557OmGFJ6NqNoKnl2fm67wiHnyEadcQj6HD0f\n\tpKJd7YKvKdtOlyydYLer8qgbkWJq6ecvOp0oZnJQlbeomPo9ntklJLFfBI1RS+zYhM4t\n\t7rUWV3zGiZSPl6Xia0dUYoxxQ2dQBfmLZhO2i/zu8S1KmzsOVuLdQ6EVbP9qmbdlz8N6\n\trj+TlvVU3/3omzXE70TzwSLr3PmkZVyoQQ1G1I+CwzMy1Uy1hnzOprMCD0aZ0utw2FgB\n\tzvUiVkyddXo8SAY7nNJVg5JOuqPH6pQxl0dS+vK+BqxSkzR/SuxxBI8ZHFEcfdFTOfMa\n\tzw== ", "From": "Shannon Nelson <shannon.nelson@oracle.com>", "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com", "Date": "Mon, 13 Aug 2018 11:43:45 -0700", "Message-Id": "<1534185825-12451-9-git-send-email-shannon.nelson@oracle.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1534185825-12451-1-git-send-email-shannon.nelson@oracle.com>", "References": "<1534185825-12451-1-git-send-email-shannon.nelson@oracle.com>", "X-Proofpoint-Virus-Version": "vendor=nai engine=5900 definitions=8984\n\tsignatures=668707", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 suspectscore=2\n\tmalwarescore=0\n\tphishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999\n\tadultscore=0 classifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1807170000 definitions=main-1808130188", "Subject": "[Intel-wired-lan] [PATCH next-queue 8/8] ixgbevf: enable VF ipsec\n\toffload operations", "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", "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 the ipsec initialization into the driver startup and\nadd the Rx and Tx processing hooks.\n\nSigned-off-by: Shannon Nelson <shannon.nelson@oracle.com>\n---\n drivers/net/ethernet/intel/ixgbevf/defines.h | 2 +-\n drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 +\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 25 ++++++++\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 74 +++++++++++++++++------\n drivers/net/ethernet/intel/ixgbevf/vf.c | 4 ++\n 5 files changed, 86 insertions(+), 21 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/defines.h b/drivers/net/ethernet/intel/ixgbevf/defines.h\nindex 8b627b6..6c3d6bf 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/defines.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/defines.h\n@@ -234,7 +234,7 @@ union ixgbe_adv_rx_desc {\n /* Context descriptors */\n struct ixgbe_adv_tx_context_desc {\n \t__le32 vlan_macip_lens;\n-\t__le32 seqnum_seed;\n+\t__le32 fceof_saidx;\n \t__le32 type_tucmd_mlhl;\n \t__le32 mss_l4len_idx;\n };\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\nindex 631c910..5399787 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n@@ -55,6 +55,8 @@ static struct ixgbe_stats ixgbevf_gstrings_stats[] = {\n \tIXGBEVF_STAT(\"alloc_rx_page\", alloc_rx_page),\n \tIXGBEVF_STAT(\"alloc_rx_page_failed\", alloc_rx_page_failed),\n \tIXGBEVF_STAT(\"alloc_rx_buff_failed\", alloc_rx_buff_failed),\n+\tIXGBEVF_STAT(\"tx_ipsec\", tx_ipsec),\n+\tIXGBEVF_STAT(\"rx_ipsec\", rx_ipsec),\n };\n \n #define IXGBEVF_QUEUE_STATS_LEN ( \\\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex 172637e..e399e1c 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -459,6 +459,31 @@ int ethtool_ioctl(struct ifreq *ifr);\n \n extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector);\n \n+#ifdef CONFIG_XFRM_OFFLOAD\n+void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter);\n+void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter);\n+void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter);\n+void ixgbevf_ipsec_rx(struct ixgbevf_ring *rx_ring,\n+\t\t union ixgbe_adv_rx_desc *rx_desc,\n+\t\t struct sk_buff *skb);\n+int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,\n+\t\t struct ixgbevf_tx_buffer *first,\n+\t\t struct ixgbevf_ipsec_tx_data *itd);\n+#else\n+static inline void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter)\n+{ }\n+static inline void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter)\n+{ }\n+static inline void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter) { }\n+static inline void ixgbevf_ipsec_rx(struct ixgbevf_ring *rx_ring,\n+\t\t\t\t union ixgbe_adv_rx_desc *rx_desc,\n+\t\t\t\t struct sk_buff *skb) { }\n+static inline int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,\n+\t\t\t\t struct ixgbevf_tx_buffer *first,\n+\t\t\t\t struct ixgbevf_ipsec_tx_data *itd)\n+{ return 0; }\n+#endif /* CONFIG_XFRM_OFFLOAD */\n+\n void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter);\n void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex d86446d..f745a52 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -40,7 +40,7 @@ static const char ixgbevf_driver_string[] =\n #define DRV_VERSION \"4.1.0-k\"\n const char ixgbevf_driver_version[] = DRV_VERSION;\n static char ixgbevf_copyright[] =\n-\t\"Copyright (c) 2009 - 2015 Intel Corporation.\";\n+\t\"Copyright (c) 2009 - 2018 Intel Corporation.\";\n \n static const struct ixgbevf_info *ixgbevf_info_tbl[] = {\n \t[board_82599_vf]\t= &ixgbevf_82599_vf_info,\n@@ -268,7 +268,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,\n \tstruct ixgbevf_adapter *adapter = q_vector->adapter;\n \tstruct ixgbevf_tx_buffer *tx_buffer;\n \tunion ixgbe_adv_tx_desc *tx_desc;\n-\tunsigned int total_bytes = 0, total_packets = 0;\n+\tunsigned int total_bytes = 0, total_packets = 0, total_ipsec = 0;\n \tunsigned int budget = tx_ring->count / 2;\n \tunsigned int i = tx_ring->next_to_clean;\n \n@@ -299,6 +299,8 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,\n \t\t/* update the statistics for this packet */\n \t\ttotal_bytes += tx_buffer->bytecount;\n \t\ttotal_packets += tx_buffer->gso_segs;\n+\t\tif (tx_buffer->tx_flags & IXGBE_TX_FLAGS_IPSEC)\n+\t\t\ttotal_ipsec++;\n \n \t\t/* free the skb */\n \t\tif (ring_is_xdp(tx_ring))\n@@ -361,6 +363,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,\n \tu64_stats_update_end(&tx_ring->syncp);\n \tq_vector->tx.total_bytes += total_bytes;\n \tq_vector->tx.total_packets += total_packets;\n+\tadapter->tx_ipsec += total_ipsec;\n \n \tif (check_for_tx_hang(tx_ring) && ixgbevf_check_tx_hang(tx_ring)) {\n \t\tstruct ixgbe_hw *hw = &adapter->hw;\n@@ -516,6 +519,9 @@ static void ixgbevf_process_skb_fields(struct ixgbevf_ring *rx_ring,\n \t\t\t__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);\n \t}\n \n+\tif (ixgbevf_test_staterr(rx_desc, IXGBE_RXDADV_STAT_SECP))\n+\t\tixgbevf_ipsec_rx(rx_ring, rx_desc, skb);\n+\n \tskb->protocol = eth_type_trans(skb, rx_ring->netdev);\n }\n \n@@ -1012,7 +1018,7 @@ static int ixgbevf_xmit_xdp_ring(struct ixgbevf_ring *ring,\n \t\tcontext_desc = IXGBEVF_TX_CTXTDESC(ring, 0);\n \t\tcontext_desc->vlan_macip_lens\t=\n \t\t\tcpu_to_le32(ETH_HLEN << IXGBE_ADVTXD_MACLEN_SHIFT);\n-\t\tcontext_desc->seqnum_seed\t= 0;\n+\t\tcontext_desc->fceof_saidx\t= 0;\n \t\tcontext_desc->type_tucmd_mlhl\t=\n \t\t\tcpu_to_le32(IXGBE_TXD_CMD_DEXT |\n \t\t\t\t IXGBE_ADVTXD_DTYP_CTXT);\n@@ -2200,6 +2206,7 @@ static void ixgbevf_configure(struct ixgbevf_adapter *adapter)\n \tixgbevf_set_rx_mode(adapter->netdev);\n \n \tixgbevf_restore_vlan(adapter);\n+\tixgbevf_ipsec_restore(adapter);\n \n \tixgbevf_configure_tx(adapter);\n \tixgbevf_configure_rx(adapter);\n@@ -2246,7 +2253,8 @@ static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter)\n static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n-\tint api[] = { ixgbe_mbox_api_13,\n+\tint api[] = { ixgbe_mbox_api_14,\n+\t\t ixgbe_mbox_api_13,\n \t\t ixgbe_mbox_api_12,\n \t\t ixgbe_mbox_api_11,\n \t\t ixgbe_mbox_api_10,\n@@ -2605,6 +2613,7 @@ static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter)\n \t\tcase ixgbe_mbox_api_11:\n \t\tcase ixgbe_mbox_api_12:\n \t\tcase ixgbe_mbox_api_13:\n+\t\tcase ixgbe_mbox_api_14:\n \t\t\tif (adapter->xdp_prog &&\n \t\t\t hw->mac.max_tx_queues == rss)\n \t\t\t\trss = rss > 3 ? 2 : 1;\n@@ -3700,8 +3709,8 @@ static void ixgbevf_queue_reset_subtask(struct ixgbevf_adapter *adapter)\n }\n \n static void ixgbevf_tx_ctxtdesc(struct ixgbevf_ring *tx_ring,\n-\t\t\t\tu32 vlan_macip_lens, u32 type_tucmd,\n-\t\t\t\tu32 mss_l4len_idx)\n+\t\t\t\tu32 vlan_macip_lens, u32 fceof_saidx,\n+\t\t\t\tu32 type_tucmd, u32 mss_l4len_idx)\n {\n \tstruct ixgbe_adv_tx_context_desc *context_desc;\n \tu16 i = tx_ring->next_to_use;\n@@ -3715,14 +3724,15 @@ static void ixgbevf_tx_ctxtdesc(struct ixgbevf_ring *tx_ring,\n \ttype_tucmd |= IXGBE_TXD_CMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT;\n \n \tcontext_desc->vlan_macip_lens\t= cpu_to_le32(vlan_macip_lens);\n-\tcontext_desc->seqnum_seed\t= 0;\n+\tcontext_desc->fceof_saidx\t= cpu_to_le32(fceof_saidx);\n \tcontext_desc->type_tucmd_mlhl\t= cpu_to_le32(type_tucmd);\n \tcontext_desc->mss_l4len_idx\t= cpu_to_le32(mss_l4len_idx);\n }\n \n static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \t\t struct ixgbevf_tx_buffer *first,\n-\t\t u8 *hdr_len)\n+\t\t u8 *hdr_len,\n+\t\t struct ixgbevf_ipsec_tx_data *itd)\n {\n \tu32 vlan_macip_lens, type_tucmd, mss_l4len_idx;\n \tstruct sk_buff *skb = first->skb;\n@@ -3736,6 +3746,7 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \t\tunsigned char *hdr;\n \t} l4;\n \tu32 paylen, l4_offset;\n+\tu32 fceof_saidx = 0;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -3761,13 +3772,15 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \tif (ip.v4->version == 4) {\n \t\tunsigned char *csum_start = skb_checksum_start(skb);\n \t\tunsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);\n+\t\tint len = csum_start - trans_start;\n \n \t\t/* IP header will have to cancel out any data that\n-\t\t * is not a part of the outer IP header\n+\t\t * is not a part of the outer IP header, so set to\n+\t\t * a reverse csum if needed, else init check to 0.\n \t\t */\n-\t\tip.v4->check = csum_fold(csum_partial(trans_start,\n-\t\t\t\t\t\t csum_start - trans_start,\n-\t\t\t\t\t\t 0));\n+\t\tip.v4->check = (skb_shinfo(skb)->gso_type & SKB_GSO_PARTIAL) ?\n+\t\t\t\t\t csum_fold(csum_partial(trans_start,\n+\t\t\t\t\t\t\t\t len, 0)) : 0;\n \t\ttype_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;\n \n \t\tip.v4->tot_len = 0;\n@@ -3799,13 +3812,16 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \tmss_l4len_idx |= skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT;\n \tmss_l4len_idx |= (1u << IXGBE_ADVTXD_IDX_SHIFT);\n \n+\tfceof_saidx |= itd->pfsa;\n+\ttype_tucmd |= itd->flags | itd->trailer_len;\n+\n \t/* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */\n \tvlan_macip_lens = l4.hdr - ip.hdr;\n \tvlan_macip_lens |= (ip.hdr - skb->data) << IXGBE_ADVTXD_MACLEN_SHIFT;\n \tvlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;\n \n-\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens,\n-\t\t\t type_tucmd, mss_l4len_idx);\n+\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens, fceof_saidx, type_tucmd,\n+\t\t\t mss_l4len_idx);\n \n \treturn 1;\n }\n@@ -3820,10 +3836,12 @@ static inline bool ixgbevf_ipv6_csum_is_sctp(struct sk_buff *skb)\n }\n \n static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,\n-\t\t\t struct ixgbevf_tx_buffer *first)\n+\t\t\t struct ixgbevf_tx_buffer *first,\n+\t\t\t struct ixgbevf_ipsec_tx_data *itd)\n {\n \tstruct sk_buff *skb = first->skb;\n \tu32 vlan_macip_lens = 0;\n+\tu32 fceof_saidx = 0;\n \tu32 type_tucmd = 0;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -3858,7 +3876,11 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,\n \tvlan_macip_lens |= skb_network_offset(skb) << IXGBE_ADVTXD_MACLEN_SHIFT;\n \tvlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;\n \n-\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0);\n+\tfceof_saidx |= itd->pfsa;\n+\ttype_tucmd |= itd->flags | itd->trailer_len;\n+\n+\tixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens,\n+\t\t\t fceof_saidx, type_tucmd, 0);\n }\n \n static __le32 ixgbevf_tx_cmd_type(u32 tx_flags)\n@@ -3892,8 +3914,12 @@ static void ixgbevf_tx_olinfo_status(union ixgbe_adv_tx_desc *tx_desc,\n \tif (tx_flags & IXGBE_TX_FLAGS_IPV4)\n \t\tolinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM);\n \n-\t/* use index 1 context for TSO/FSO/FCOE */\n-\tif (tx_flags & IXGBE_TX_FLAGS_TSO)\n+\t/* enable IPsec */\n+\tif (tx_flags & IXGBE_TX_FLAGS_IPSEC)\n+\t\tolinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IPSEC);\n+\n+\t/* use index 1 context for TSO/FSO/FCOE/IPSEC */\n+\tif (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_IPSEC))\n \t\tolinfo_status |= cpu_to_le32(1u << IXGBE_ADVTXD_IDX_SHIFT);\n \n \t/* Check Context must be set if Tx switch is enabled, which it\n@@ -4075,6 +4101,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,\n \tint tso;\n \tu32 tx_flags = 0;\n \tu16 count = TXD_USE_COUNT(skb_headlen(skb));\n+\tstruct ixgbevf_ipsec_tx_data ipsec_tx = { 0 };\n #if PAGE_SIZE > IXGBE_MAX_DATA_PER_TXD\n \tunsigned short f;\n #endif\n@@ -4119,11 +4146,15 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,\n \tfirst->tx_flags = tx_flags;\n \tfirst->protocol = vlan_get_protocol(skb);\n \n-\ttso = ixgbevf_tso(tx_ring, first, &hdr_len);\n+#ifdef CONFIG_XFRM_OFFLOAD\n+\tif (skb->sp && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx))\n+\t\tgoto out_drop;\n+#endif\n+\ttso = ixgbevf_tso(tx_ring, first, &hdr_len, &ipsec_tx);\n \tif (tso < 0)\n \t\tgoto out_drop;\n \telse if (!tso)\n-\t\tixgbevf_tx_csum(tx_ring, first);\n+\t\tixgbevf_tx_csum(tx_ring, first, &ipsec_tx);\n \n \tixgbevf_tx_map(tx_ring, first, hdr_len);\n \n@@ -4634,6 +4665,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tcase ixgbe_mbox_api_11:\n \tcase ixgbe_mbox_api_12:\n \tcase ixgbe_mbox_api_13:\n+\tcase ixgbe_mbox_api_14:\n \t\tnetdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE -\n \t\t\t\t (ETH_HLEN + ETH_FCS_LEN);\n \t\tbreak;\n@@ -4669,6 +4701,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \n \tpci_set_drvdata(pdev, netdev);\n \tnetif_carrier_off(netdev);\n+\tixgbevf_init_ipsec_offload(adapter);\n \n \tixgbevf_init_last_counter_stats(adapter);\n \n@@ -4735,6 +4768,7 @@ static void ixgbevf_remove(struct pci_dev *pdev)\n \tif (netdev->reg_state == NETREG_REGISTERED)\n \t\tunregister_netdev(netdev);\n \n+\tixgbevf_stop_ipsec_offload(adapter);\n \tixgbevf_clear_interrupt_scheme(adapter);\n \tixgbevf_reset_interrupt_capability(adapter);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c\nindex bf0577e..cd3b813 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/vf.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c\n@@ -309,6 +309,7 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues)\n \t * is not supported for this device type.\n \t */\n \tswitch (hw->api_version) {\n+\tcase ixgbe_mbox_api_14:\n \tcase ixgbe_mbox_api_13:\n \tcase ixgbe_mbox_api_12:\n \t\tif (hw->mac.type < ixgbe_mac_X550_vf)\n@@ -376,6 +377,7 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key)\n \t * or if the operation is not supported for this device type.\n \t */\n \tswitch (hw->api_version) {\n+\tcase ixgbe_mbox_api_14:\n \tcase ixgbe_mbox_api_13:\n \tcase ixgbe_mbox_api_12:\n \t\tif (hw->mac.type < ixgbe_mac_X550_vf)\n@@ -540,6 +542,7 @@ static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)\n \t\tif (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)\n \t\t\treturn -EOPNOTSUPP;\n \t\t/* Fall threw */\n+\tcase ixgbe_mbox_api_14:\n \tcase ixgbe_mbox_api_13:\n \t\tbreak;\n \tdefault:\n@@ -890,6 +893,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,\n \tcase ixgbe_mbox_api_11:\n \tcase ixgbe_mbox_api_12:\n \tcase ixgbe_mbox_api_13:\n+\tcase ixgbe_mbox_api_14:\n \t\tbreak;\n \tdefault:\n \t\treturn 0;\n", "prefixes": [ "next-queue", "8/8" ] }