get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 957179,
    "url": "http://patchwork.ozlabs.org/api/patches/957179/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1534185825-12451-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": "<1534185825-12451-4-git-send-email-shannon.nelson@oracle.com>",
    "list_archive_url": null,
    "date": "2018-08-13T18:43:40",
    "name": "[next-queue,3/8] ixgbe: add VF ipsec management",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "72a834175dfc0b6ad366b25df5a73dcf12750c26",
    "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-4-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/957179/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/957179/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\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=\"nJgb6QU9\"; 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 41q4Pt19vFz9s8k\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 14 Aug 2018 04:44:01 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 74F1B82705;\n\tMon, 13 Aug 2018 18:44:00 +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 Mo-lD43-+yQW; Mon, 13 Aug 2018 18:43:58 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 76E2B81E80;\n\tMon, 13 Aug 2018 18:43:58 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id CE1711C0574\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:43:56 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id B653E22E75\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:43:56 +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 CklnWgmTri3r for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:43:55 +0000 (UTC)",
            "from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86])\n\tby silver.osuosl.org (Postfix) with ESMTPS id B0F4D22E20\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Aug 2018 18:43:55 +0000 (UTC)",
            "from pps.filterd (userp2130.oracle.com [127.0.0.1])\n\tby userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id\n\tw7DIdRYg003370; Mon, 13 Aug 2018 18:43:54 GMT",
            "from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby userp2130.oracle.com with ESMTP id 2ksq7t5hy7-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 13 Aug 2018 18:43:53 +0000",
            "from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tw7DIhrVj027933\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 13 Aug 2018 18:43:53 GMT",
            "from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14])\n\tby aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tw7DIhrIA018399; Mon, 13 Aug 2018 18:43:53 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:52 -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=mpQaBYsVDTZHzeganv51JOyN+UEJdQhg2QyxOrUGIg4=;\n\tb=nJgb6QU9KEqH5VeV1wafP9m0jhIwcUMfMP5HrDfgKc6lWa43xzjiMqw1QtmYYw7AsVrU\n\tUdV+3G7CTiZK592IODK0nxFkzOFKiM7iFyWON63Jx90cfm6CYLLmFzssuNrPUOIbo11X\n\tFMw+JJjtS/d1CcUpLHGfetzfJUka+6QmWq4n0CTRjZ8XFg5J3NN0PLZK7716x+FSvdmx\n\tt0eJC886QEOQFBICMQQe4fPyDGYnDnIP1zkJPFXEpS4TC8ECeIMB4bPF3zvhghCsYx7w\n\tKhrP3GMWExscpoptpGHrjXA5BGmHQy5yzQCzvF9NvuPD4nTm1dyuUGorALhqAbZ4yYGQ\n\tXQ== ",
        "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:40 -0700",
        "Message-Id": "<1534185825-12451-4-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=0\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 3/8] ixgbe: add VF ipsec\n\tmanagement",
        "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 functions to translate VF IPsec offload add and delete requests\ninto something the existing code can work with.\n\nSigned-off-by: Shannon Nelson <shannon.nelson@oracle.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 256 ++++++++++++++++++++++++-\n drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h |  13 ++\n 2 files changed, 260 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\nindex 3afb1fe..80108e1 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n@@ -8,6 +8,8 @@\n #define IXGBE_IPSEC_KEY_BITS  160\n static const char aes_gcm_name[] = \"rfc4106(gcm(aes))\";\n \n+static void ixgbe_ipsec_del_sa(struct xfrm_state *xs);\n+\n /**\n  * ixgbe_ipsec_set_tx_sa - set the Tx SA registers\n  * @hw: hw specific details\n@@ -289,6 +291,13 @@ static void ixgbe_ipsec_start_engine(struct ixgbe_adapter *adapter)\n /**\n  * ixgbe_ipsec_restore - restore the ipsec HW settings after a reset\n  * @adapter: board private structure\n+ *\n+ * Reload the HW tables from the SW tables after they've been bashed\n+ * by a chip reset.\n+ *\n+ * Any VF entries are removed from the SW and HW tables since either\n+ * (a) the VF also gets reset on PF reset and will ask again for the\n+ * offloads, or (b) the VF has been removed by a change in the num_vfs.\n  **/\n void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter)\n {\n@@ -306,16 +315,24 @@ void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter)\n \n \t/* reload the Rx and Tx keys */\n \tfor (i = 0; i < IXGBE_IPSEC_MAX_SA_COUNT; i++) {\n-\t\tstruct rx_sa *rsa = &ipsec->rx_tbl[i];\n-\t\tstruct tx_sa *tsa = &ipsec->tx_tbl[i];\n-\n-\t\tif (rsa->used)\n-\t\t\tixgbe_ipsec_set_rx_sa(hw, i, rsa->xs->id.spi,\n-\t\t\t\t\t      rsa->key, rsa->salt,\n-\t\t\t\t\t      rsa->mode, rsa->iptbl_ind);\n+\t\tstruct rx_sa *r = &ipsec->rx_tbl[i];\n+\t\tstruct tx_sa *t = &ipsec->tx_tbl[i];\n+\n+\t\tif (r->used) {\n+\t\t\tif (r->mode & IXGBE_RXTXMOD_VF)\n+\t\t\t\tixgbe_ipsec_del_sa(r->xs);\n+\t\t\telse\n+\t\t\t\tixgbe_ipsec_set_rx_sa(hw, i, r->xs->id.spi,\n+\t\t\t\t\t\t      r->key, r->salt,\n+\t\t\t\t\t\t      r->mode, r->iptbl_ind);\n+\t\t}\n \n-\t\tif (tsa->used)\n-\t\t\tixgbe_ipsec_set_tx_sa(hw, i, tsa->key, tsa->salt);\n+\t\tif (t->used) {\n+\t\t\tif (t->mode & IXGBE_RXTXMOD_VF)\n+\t\t\t\tixgbe_ipsec_del_sa(t->xs);\n+\t\t\telse\n+\t\t\t\tixgbe_ipsec_set_tx_sa(hw, i, t->key, t->salt);\n+\t\t}\n \t}\n \n \t/* reload the IP addrs */\n@@ -381,6 +398,8 @@ static struct xfrm_state *ixgbe_ipsec_find_rx_state(struct ixgbe_ipsec *ipsec,\n \trcu_read_lock();\n \thash_for_each_possible_rcu(ipsec->rx_sa_list, rsa, hlist,\n \t\t\t\t   (__force u32)spi) {\n+\t\tif (rsa->mode & IXGBE_RXTXMOD_VF)\n+\t\t\tcontinue;\n \t\tif (spi == rsa->xs->id.spi &&\n \t\t    ((ip4 && *daddr == rsa->xs->id.daddr.a4) ||\n \t\t      (!ip4 && !memcmp(daddr, &rsa->xs->id.daddr.a6,\n@@ -809,6 +828,225 @@ static const struct xfrmdev_ops ixgbe_xfrmdev_ops = {\n };\n \n /**\n+ * ixgbe_ipsec_vf_clear - clear the tables of data for a VF\n+ * @adapter: board private structure\n+ * @vf: VF id to be removed\n+ **/\n+void ixgbe_ipsec_vf_clear(struct ixgbe_adapter *adapter, u32 vf)\n+{\n+\tstruct ixgbe_ipsec *ipsec = adapter->ipsec;\n+\tint i;\n+\n+\t/* search rx sa table */\n+\tfor (i = 0; i < IXGBE_IPSEC_MAX_SA_COUNT && ipsec->num_rx_sa; i++) {\n+\t\tif (!ipsec->rx_tbl[i].used)\n+\t\t\tcontinue;\n+\t\tif (ipsec->rx_tbl[i].mode & IXGBE_RXTXMOD_VF &&\n+\t\t    ipsec->rx_tbl[i].vf == vf)\n+\t\t\tixgbe_ipsec_del_sa(ipsec->rx_tbl[i].xs);\n+\t}\n+\n+\t/* search tx sa table */\n+\tfor (i = 0; i < IXGBE_IPSEC_MAX_SA_COUNT && ipsec->num_tx_sa; i++) {\n+\t\tif (!ipsec->tx_tbl[i].used)\n+\t\t\tcontinue;\n+\t\tif (ipsec->tx_tbl[i].mode & IXGBE_RXTXMOD_VF &&\n+\t\t    ipsec->tx_tbl[i].vf == vf)\n+\t\t\tixgbe_ipsec_del_sa(ipsec->tx_tbl[i].xs);\n+\t}\n+}\n+\n+/**\n+ * ixgbe_ipsec_vf_add_sa - translate VF request to SA add\n+ * @adapter: board private structure\n+ * @msgbuf: The message buffer\n+ * @vf: the VF index\n+ *\n+ * Make up a new xs and algorithm info from the data sent by the VF.\n+ * We only need to sketch in just enough to set up the HW offload.\n+ * Put the resulting offload_handle into the return message to the VF.\n+ *\n+ * Returns 0 or error value\n+ **/\n+int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)\n+{\n+\tstruct ixgbe_ipsec *ipsec = adapter->ipsec;\n+\tstruct xfrm_algo_desc *algo;\n+\tstruct sa_mbx_msg *sam;\n+\tstruct xfrm_state *xs;\n+\tsize_t aead_len;\n+\tu16 sa_idx;\n+\tu32 pfsa;\n+\tint err;\n+\n+\tsam = (struct sa_mbx_msg *)(&msgbuf[1]);\n+\tif (!adapter->vfinfo[vf].trusted) {\n+\t\te_warn(drv, \"VF %d attempted to add an IPsec SA\\n\", vf);\n+\t\terr = -EACCES;\n+\t\tgoto err_out;\n+\t}\n+\n+\t/* Tx IPsec offload doesn't seem to work on this\n+\t * device, so block these requests for now.\n+\t */\n+\tif (!(sam->flags & XFRM_OFFLOAD_INBOUND)) {\n+\t\terr = -ENXIO;\n+\t\tgoto err_out;\n+\t}\n+\n+\txs = kzalloc(sizeof(*xs), GFP_KERNEL);\n+\tif (unlikely(!xs)) {\n+\t\terr = -ENOMEM;\n+\t\tgoto err_out;\n+\t}\n+\n+\txs->xso.flags = sam->flags;\n+\txs->id.spi = sam->spi;\n+\txs->id.proto = sam->proto;\n+\txs->props.family = sam->family;\n+\tif (xs->props.family == AF_INET6)\n+\t\tmemcpy(&xs->id.daddr.a6, sam->addr, sizeof(xs->id.daddr.a6));\n+\telse\n+\t\tmemcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4));\n+\txs->xso.dev = adapter->netdev;\n+\n+\talgo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);\n+\tif (unlikely(!algo)) {\n+\t\terr = -ENOENT;\n+\t\tgoto err_xs;\n+\t}\n+\n+\taead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8;\n+\txs->aead = kzalloc(aead_len, GFP_KERNEL);\n+\tif (unlikely(!xs->aead)) {\n+\t\terr = -ENOMEM;\n+\t\tgoto err_xs;\n+\t}\n+\n+\txs->props.ealgo = algo->desc.sadb_alg_id;\n+\txs->geniv = algo->uinfo.aead.geniv;\n+\txs->aead->alg_icv_len = IXGBE_IPSEC_AUTH_BITS;\n+\txs->aead->alg_key_len = IXGBE_IPSEC_KEY_BITS;\n+\tmemcpy(xs->aead->alg_key, sam->key, sizeof(sam->key));\n+\tmemcpy(xs->aead->alg_name, aes_gcm_name, sizeof(aes_gcm_name));\n+\n+\t/* set up the HW offload */\n+\terr = ixgbe_ipsec_add_sa(xs);\n+\tif (err)\n+\t\tgoto err_aead;\n+\n+\tpfsa = xs->xso.offload_handle;\n+\tif (pfsa < IXGBE_IPSEC_BASE_TX_INDEX) {\n+\t\tsa_idx = pfsa - IXGBE_IPSEC_BASE_RX_INDEX;\n+\t\tipsec->rx_tbl[sa_idx].vf = vf;\n+\t\tipsec->rx_tbl[sa_idx].mode |= IXGBE_RXTXMOD_VF;\n+\t} else {\n+\t\tsa_idx = pfsa - IXGBE_IPSEC_BASE_TX_INDEX;\n+\t\tipsec->tx_tbl[sa_idx].vf = vf;\n+\t\tipsec->tx_tbl[sa_idx].mode |= IXGBE_RXTXMOD_VF;\n+\t}\n+\n+\tmsgbuf[1] = xs->xso.offload_handle;\n+\n+\treturn 0;\n+\n+err_aead:\n+\tmemset(xs->aead, 0, sizeof(*xs->aead));\n+\tkfree(xs->aead);\n+err_xs:\n+\tmemset(xs, 0, sizeof(*xs));\n+\tkfree(xs);\n+err_out:\n+\tmsgbuf[1] = err;\n+\treturn err;\n+}\n+\n+/**\n+ * ixgbe_ipsec_vf_del_sa - translate VF request to SA delete\n+ * @adapter: board private structure\n+ * @msgbuf: The message buffer\n+ * @vf: the VF index\n+ *\n+ * Given the offload_handle sent by the VF, look for the related SA table\n+ * entry and use its xs field to call for a delete of the SA.\n+ *\n+ * Note: We silently ignore requests to delete entries that are already\n+ *       set to unused because when a VF is set to \"DOWN\", the PF first\n+ *       gets a reset and clears all the VF's entries; then the VF's\n+ *       XFRM stack sends individual deletes for each entry, which the\n+ *       reset already removed.  In the future it might be good to try to\n+ *       optimize this so not so many unnecessary delete messages are sent.\n+ *\n+ * Returns 0 or error value\n+ **/\n+int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)\n+{\n+\tstruct ixgbe_ipsec *ipsec = adapter->ipsec;\n+\tstruct xfrm_state *xs;\n+\tu32 pfsa = msgbuf[1];\n+\tu16 sa_idx;\n+\n+\tif (!adapter->vfinfo[vf].trusted) {\n+\t\te_err(drv, \"vf %d attempted to delete an SA\\n\", vf);\n+\t\treturn -EPERM;\n+\t}\n+\n+\tif (pfsa < IXGBE_IPSEC_BASE_TX_INDEX) {\n+\t\tstruct rx_sa *rsa;\n+\n+\t\tsa_idx = pfsa - IXGBE_IPSEC_BASE_RX_INDEX;\n+\t\tif (sa_idx >= IXGBE_IPSEC_MAX_SA_COUNT) {\n+\t\t\te_err(drv, \"vf %d SA index %d out of range\\n\",\n+\t\t\t      vf, sa_idx);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\trsa = &ipsec->rx_tbl[sa_idx];\n+\n+\t\tif (!rsa->used)\n+\t\t\treturn 0;\n+\n+\t\tif (!(rsa->mode & IXGBE_RXTXMOD_VF) ||\n+\t\t    rsa->vf != vf) {\n+\t\t\te_err(drv, \"vf %d bad Rx SA index %d\\n\", vf, sa_idx);\n+\t\t\treturn -ENOENT;\n+\t\t}\n+\n+\t\txs = ipsec->rx_tbl[sa_idx].xs;\n+\t} else {\n+\t\tstruct tx_sa *tsa;\n+\n+\t\tsa_idx = pfsa - IXGBE_IPSEC_BASE_TX_INDEX;\n+\t\tif (sa_idx >= IXGBE_IPSEC_MAX_SA_COUNT) {\n+\t\t\te_err(drv, \"vf %d SA index %d out of range\\n\",\n+\t\t\t      vf, sa_idx);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\ttsa = &ipsec->tx_tbl[sa_idx];\n+\n+\t\tif (!tsa->used)\n+\t\t\treturn 0;\n+\n+\t\tif (!(tsa->mode & IXGBE_RXTXMOD_VF) ||\n+\t\t    tsa->vf != vf) {\n+\t\t\te_err(drv, \"vf %d bad Tx SA index %d\\n\", vf, sa_idx);\n+\t\t\treturn -ENOENT;\n+\t\t}\n+\n+\t\txs = ipsec->tx_tbl[sa_idx].xs;\n+\t}\n+\n+\tixgbe_ipsec_del_sa(xs);\n+\n+\t/* remove the xs that was made-up in the add request */\n+\tmemset(xs, 0, sizeof(*xs));\n+\tkfree(xs);\n+\n+\treturn 0;\n+}\n+\n+/**\n  * ixgbe_ipsec_tx - setup Tx flags for ipsec offload\n  * @tx_ring: outgoing context\n  * @first: current data packet\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h\nindex 9ef7faa..d2b64ff 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h\n@@ -26,6 +26,7 @@ enum ixgbe_ipsec_tbl_sel {\n #define IXGBE_RXMOD_PROTO_ESP\t\t0x00000004\n #define IXGBE_RXMOD_DECRYPT\t\t0x00000008\n #define IXGBE_RXMOD_IPV6\t\t0x00000010\n+#define IXGBE_RXTXMOD_VF\t\t0x00000020\n \n struct rx_sa {\n \tstruct hlist_node hlist;\n@@ -37,6 +38,7 @@ struct rx_sa {\n \tu8  iptbl_ind;\n \tbool used;\n \tbool decrypt;\n+\tu32 vf;\n };\n \n struct rx_ip_sa {\n@@ -49,8 +51,10 @@ struct tx_sa {\n \tstruct xfrm_state *xs;\n \tu32 key[4];\n \tu32 salt;\n+\tu32 mode;\n \tbool encrypt;\n \tbool used;\n+\tu32 vf;\n };\n \n struct ixgbe_ipsec_tx_data {\n@@ -67,4 +71,13 @@ struct ixgbe_ipsec {\n \tstruct tx_sa *tx_tbl;\n \tDECLARE_HASHTABLE(rx_sa_list, 10);\n };\n+\n+struct sa_mbx_msg {\n+\t__be32 spi;\n+\tu8 flags;\n+\tu8 proto;\n+\tu16 family;\n+\t__be32 addr[4];\n+\tu32 key[5];\n+};\n #endif /* _IXGBE_IPSEC_H_ */\n",
    "prefixes": [
        "next-queue",
        "3/8"
    ]
}