get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 16322,
    "url": "http://patches.dpdk.org/api/patches/16322/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1475250308-5498-3-git-send-email-bernard.iremonger@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1475250308-5498-3-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1475250308-5498-3-git-send-email-bernard.iremonger@intel.com",
    "date": "2016-09-30T15:45:08",
    "name": "[dpdk-dev,v3,2/2] net/ixgbe: add callback to user app on VF to PF mbox msg",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6eab453dd4355afda011c387b6370c41306ab4be",
    "submitter": {
        "id": 91,
        "url": "http://patches.dpdk.org/api/people/91/?format=api",
        "name": "Iremonger, Bernard",
        "email": "bernard.iremonger@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1475250308-5498-3-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/16322/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/16322/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 9B43A592F;\n\tFri, 30 Sep 2016 17:45:26 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id D2649590B\n\tfor <dev@dpdk.org>; Fri, 30 Sep 2016 17:45:21 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP; 30 Sep 2016 08:45:22 -0700",
            "from sivswdev01.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.45])\n\tby orsmga001.jf.intel.com with ESMTP; 30 Sep 2016 08:45:20 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.31,273,1473145200\"; d=\"scan'208\";\n\ta=\"1038691376\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org, rahul.r.shah@intel.com, wenzhuo.lu@intel.com,\n\taz5157@att.com, jerin.jacob@caviumnetworks.com",
        "Cc": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "Date": "Fri, 30 Sep 2016 16:45:08 +0100",
        "Message-Id": "<1475250308-5498-3-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1475250308-5498-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<1475250308-5498-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/2] net/ixgbe: add callback to user app on VF\n\tto PF mbox msg",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "call _rte_eth_dev_callback_process_vf from ixgbe_rcv_msg_from_vf function.\n\nThe callback asks the user application if it is allowed to perform\nthe function.\nIf the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,\nif 0, do nothing and send ACK to VF\nif > 1, do nothing and send NAK to VF.\n\nSigned-off-by: Alex Zelezniak <az5157@att.com>\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/ixgbe/ixgbe_pf.c      | 42 +++++++++++++++++++++++++++++++++------\n drivers/net/ixgbe/rte_pmd_ixgbe.h | 11 ++++++++++\n 2 files changed, 47 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c\nindex 56393ff..3c5bf38 100644\n--- a/drivers/net/ixgbe/ixgbe_pf.c\n+++ b/drivers/net/ixgbe/ixgbe_pf.c\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -51,6 +51,7 @@\n \n #include \"base/ixgbe_common.h\"\n #include \"ixgbe_ethdev.h\"\n+#include \"rte_pmd_ixgbe.h\"\n \n #define IXGBE_MAX_VFTA     (128)\n #define IXGBE_VF_MSG_SIZE_DEFAULT 1\n@@ -660,6 +661,7 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct ixgbe_vf_info *vfinfo =\n \t\t*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);\n+\tstruct rte_eth_mb_event_param cb_param;\n \n \tretval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);\n \tif (retval) {\n@@ -674,27 +676,54 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)\n \t/* flush the ack before we write any messages back */\n \tIXGBE_WRITE_FLUSH(hw);\n \n+\t/**\n+\t * initialise structure to send to user application\n+\t * will return response from user in retval field\n+\t */\n+\tcb_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;\n+\tcb_param.vfid = vf;\n+\tcb_param.msg_type = msgbuf[0] & 0xFFFF;\n+\tcb_param.userdata = (void *)msgbuf;\n+\n \t/* perform VF reset */\n \tif (msgbuf[0] == IXGBE_VF_RESET) {\n \t\tint ret = ixgbe_vf_reset(dev, vf, msgbuf);\n \n \t\tvfinfo[vf].clear_to_send = true;\n+\n+\t\t/* notify application about VF reset */\n+\t\t_rte_eth_dev_callback_process_vf(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);\n \t\treturn ret;\n \t}\n \n+\t/**\n+\t * ask user application if we allowed to perform those functions\n+\t * if we get cb_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED then business\n+\t * as usual,\n+\t * if 0, do nothing and send ACK to VF\n+\t * if cb_param.retval > 1, do nothing and send NAK to VF\n+\t */\n+\t_rte_eth_dev_callback_process_vf(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);\n+\n+\tretval = cb_param.retval;\n+\n \t/* check & process VF to PF mailbox message */\n \tswitch ((msgbuf[0] & 0xFFFF)) {\n \tcase IXGBE_VF_SET_MAC_ADDR:\n-\t\tretval = ixgbe_vf_set_mac_addr(dev, vf, msgbuf);\n+\t\tif (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)\n+\t\t\tretval = ixgbe_vf_set_mac_addr(dev, vf, msgbuf);\n \t\tbreak;\n \tcase IXGBE_VF_SET_MULTICAST:\n-\t\tretval = ixgbe_vf_set_multicast(dev, vf, msgbuf);\n+\t\tif (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)\n+\t\t\tretval = ixgbe_vf_set_multicast(dev, vf, msgbuf);\n \t\tbreak;\n \tcase IXGBE_VF_SET_LPE:\n-\t\tretval = ixgbe_set_vf_lpe(dev, vf, msgbuf);\n+\t\tif (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)\n+\t\t\tretval = ixgbe_set_vf_lpe(dev, vf, msgbuf);\n \t\tbreak;\n \tcase IXGBE_VF_SET_VLAN:\n-\t\tretval = ixgbe_vf_set_vlan(dev, vf, msgbuf);\n+\t\tif (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)\n+\t\t\tretval = ixgbe_vf_set_vlan(dev, vf, msgbuf);\n \t\tbreak;\n \tcase IXGBE_VF_API_NEGOTIATE:\n \t\tretval = ixgbe_negotiate_vf_api(dev, vf, msgbuf);\n@@ -704,7 +733,8 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)\n \t\tmsg_size = IXGBE_VF_GET_QUEUE_MSG_SIZE;\n \t\tbreak;\n \tcase IXGBE_VF_UPDATE_XCAST_MODE:\n-\t\tretval = ixgbe_set_vf_mc_promisc(dev, vf, msgbuf);\n+\t\tif (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)\n+\t\t\tretval = ixgbe_set_vf_mc_promisc(dev, vf, msgbuf);\n \t\tbreak;\n \tdefault:\n \t\tPMD_DRV_LOG(DEBUG, \"Unhandled Msg %8.8x\", (unsigned)msgbuf[0]);\ndiff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h\nindex 33b5b2d..212cc5d 100644\n--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h\n+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h\n@@ -181,4 +181,15 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);\n  */\n int\n rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);\n+\n+/**\n+ * Response sent back to ixgbe driver from user app after callback\n+ */\n+enum rte_pmd_ixgbe_mb_event_rsp {\n+\tRTE_PMD_IXGBE_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */\n+\tRTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */\n+\tRTE_PMD_IXGBE_MB_EVENT_PROCEED,  /**< proceed with mbox request  */\n+\tRTE_PMD_IXGBE_MB_EVENT_MAX       /**< max value of this enum */\n+};\n+\n #endif /* _PMD_IXGBE_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "2/2"
    ]
}