get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806313,
    "url": "http://patchwork.ozlabs.org/api/patches/806313/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170828001603.75876-8-jeffrey.t.kirsher@intel.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170828001603.75876-8-jeffrey.t.kirsher@intel.com>",
    "list_archive_url": null,
    "date": "2017-08-28T00:15:55",
    "name": "[net-next,07/15] i40e/i40evf: support for VF VLAN tag stripping control",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9e0d3af856d037ef80fb18f374ad5f0e6b05802b",
    "submitter": {
        "id": 473,
        "url": "http://patchwork.ozlabs.org/api/people/473/?format=api",
        "name": "Kirsher, Jeffrey T",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170828001603.75876-8-jeffrey.t.kirsher@intel.com/mbox/",
    "series": [
        {
            "id": 52,
            "url": "http://patchwork.ozlabs.org/api/series/52/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=52",
            "date": "2017-08-28T00:15:49",
            "name": "40GbE Intel Wired LAN Driver Updates 2017-08-27",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/52/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806313/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806313/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xgXPX03sKz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 10:16:32 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751728AbdH1AQW (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 27 Aug 2017 20:16:22 -0400",
            "from mga14.intel.com ([192.55.52.115]:47467 \"EHLO mga14.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751670AbdH1AQT (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 27 Aug 2017 20:16:19 -0400",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Aug 2017 17:16:19 -0700",
            "from davidpwo-mobl1.amr.corp.intel.com (HELO\n\tjtkirshe-DESK.amr.corp.intel.com.com) ([10.254.22.134])\n\tby fmsmga004.fm.intel.com with ESMTP; 27 Aug 2017 17:16:19 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.41,439,1498546800\"; d=\"scan'208\";a=\"304981077\"",
        "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "To": "davem@davemloft.net",
        "Cc": "Mariusz Stachura <mariusz.stachura@intel.com>,\n\tnetdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,\n\tjogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "Subject": "[net-next 07/15] i40e/i40evf: support for VF VLAN tag stripping\n\tcontrol",
        "Date": "Sun, 27 Aug 2017 17:15:55 -0700",
        "Message-Id": "<20170828001603.75876-8-jeffrey.t.kirsher@intel.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170828001603.75876-1-jeffrey.t.kirsher@intel.com>",
        "References": "<20170828001603.75876-1-jeffrey.t.kirsher@intel.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Mariusz Stachura <mariusz.stachura@intel.com>\n\nThis patch gives VF capability to control VLAN tag stripping via\nethtool. As rx-vlan-offload was fixed before, now the VF is able to\nchange it using \"ethtool --offload <IF> rxvlan on/off\" settings.\n\nSigned-off-by: Mariusz Stachura <mariusz.stachura@intel.com>\nSigned-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 60 ++++++++++++++++++++++\n drivers/net/ethernet/intel/i40evf/i40evf.h         |  4 ++\n drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 33 ++++++++++++\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    | 40 +++++++++++++++\n include/linux/avf/virtchnl.h                       |  5 ++\n 5 files changed, 142 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 27d87bef4ba3..4d1e670f490e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -2529,6 +2529,60 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \treturn i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_SET_RSS_HENA, aq_ret);\n }\n \n+/**\n+ * i40e_vc_enable_vlan_stripping\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ * @msglen: msg length\n+ *\n+ * Enable vlan header stripping for the VF\n+ **/\n+static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg,\n+\t\t\t\t\t u16 msglen)\n+{\n+\tstruct i40e_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx];\n+\ti40e_status aq_ret = 0;\n+\n+\tif (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\ti40e_vlan_stripping_enable(vsi);\n+\n+\t/* send the response to the VF */\n+err:\n+\treturn i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING,\n+\t\t\t\t       aq_ret);\n+}\n+\n+/**\n+ * i40e_vc_disable_vlan_stripping\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ * @msglen: msg length\n+ *\n+ * Disable vlan header stripping for the VF\n+ **/\n+static int i40e_vc_disable_vlan_stripping(struct i40e_vf *vf, u8 *msg,\n+\t\t\t\t\t  u16 msglen)\n+{\n+\tstruct i40e_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx];\n+\ti40e_status aq_ret = 0;\n+\n+\tif (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\ti40e_vlan_stripping_disable(vsi);\n+\n+\t/* send the response to the VF */\n+err:\n+\treturn i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING,\n+\t\t\t\t       aq_ret);\n+}\n+\n /**\n  * i40e_vc_process_vf_msg\n  * @pf: pointer to the PF structure\n@@ -2648,6 +2702,12 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,\n \tcase VIRTCHNL_OP_SET_RSS_HENA:\n \t\tret = i40e_vc_set_rss_hena(vf, msg, msglen);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:\n+\t\tret = i40e_vc_enable_vlan_stripping(vf, msg, msglen);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:\n+\t\tret = i40e_vc_disable_vlan_stripping(vf, msg, msglen);\n+\t\tbreak;\n \n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex e5293d35fb6a..82f69031e5cd 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -261,6 +261,8 @@ struct i40evf_adapter {\n #define I40EVF_FLAG_AQ_RELEASE_PROMISC\t\tBIT(16)\n #define I40EVF_FLAG_AQ_REQUEST_ALLMULTI\t\tBIT(17)\n #define I40EVF_FLAG_AQ_RELEASE_ALLMULTI\t\tBIT(18)\n+#define I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING\tBIT(19)\n+#define I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING\tBIT(20)\n \n \t/* OS defined structs */\n \tstruct net_device *netdev;\n@@ -358,6 +360,8 @@ void i40evf_get_hena(struct i40evf_adapter *adapter);\n void i40evf_set_hena(struct i40evf_adapter *adapter);\n void i40evf_set_rss_key(struct i40evf_adapter *adapter);\n void i40evf_set_rss_lut(struct i40evf_adapter *adapter);\n+void i40evf_enable_vlan_stripping(struct i40evf_adapter *adapter);\n+void i40evf_disable_vlan_stripping(struct i40evf_adapter *adapter);\n void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,\n \t\t\t\tenum virtchnl_ops v_opcode,\n \t\t\t\ti40e_status v_retval, u8 *msg, u16 msglen);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 258e8e27068b..9ee277e87f10 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -1676,6 +1676,16 @@ static void i40evf_watchdog_task(struct work_struct *work)\n \t\tgoto watchdog_done;\n \t}\n \n+\tif (adapter->aq_required & I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING) {\n+\t\ti40evf_enable_vlan_stripping(adapter);\n+\t\tgoto watchdog_done;\n+\t}\n+\n+\tif (adapter->aq_required & I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING) {\n+\t\ti40evf_disable_vlan_stripping(adapter);\n+\t\tgoto watchdog_done;\n+\t}\n+\n \tif (adapter->aq_required & I40EVF_FLAG_AQ_CONFIGURE_QUEUES) {\n \t\ti40evf_configure_queues(adapter);\n \t\tgoto watchdog_done;\n@@ -2293,6 +2303,28 @@ static int i40evf_change_mtu(struct net_device *netdev, int new_mtu)\n \treturn 0;\n }\n \n+/**\n+ * i40e_set_features - set the netdev feature flags\n+ * @netdev: ptr to the netdev being adjusted\n+ * @features: the feature set that the stack is suggesting\n+ * Note: expects to be called while under rtnl_lock()\n+ **/\n+static int i40evf_set_features(struct net_device *netdev,\n+\t\t\t       netdev_features_t features)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n+\n+\tif (!VLAN_ALLOWED(adapter))\n+\t\treturn -EINVAL;\n+\n+\tif (features & NETIF_F_HW_VLAN_CTAG_RX)\n+\t\tadapter->aq_required |= I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;\n+\telse\n+\t\tadapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;\n+\n+\treturn 0;\n+}\n+\n /**\n  * i40evf_features_check - Validate encapsulated packet conforms to limits\n  * @skb: skb buff\n@@ -2386,6 +2418,7 @@ static const struct net_device_ops i40evf_netdev_ops = {\n \t.ndo_vlan_rx_kill_vid\t= i40evf_vlan_rx_kill_vid,\n \t.ndo_features_check\t= i40evf_features_check,\n \t.ndo_fix_features\t= i40evf_fix_features,\n+\t.ndo_set_features\t= i40evf_set_features,\n #ifdef CONFIG_NET_POLL_CONTROLLER\n \t.ndo_poll_controller\t= i40evf_netpoll,\n #endif\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex 6c403bf1bbb8..85876f4fb1fb 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -820,6 +820,46 @@ void i40evf_set_rss_lut(struct i40evf_adapter *adapter)\n \tkfree(vrl);\n }\n \n+/**\n+ * i40evf_enable_vlan_stripping\n+ * @adapter: adapter structure\n+ *\n+ * Request VLAN header stripping to be enabled\n+ **/\n+void i40evf_enable_vlan_stripping(struct i40evf_adapter *adapter)\n+{\n+\tif (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {\n+\t\t/* bail because we already have a command pending */\n+\t\tdev_err(&adapter->pdev->dev, \"Cannot enable stripping, command %d pending\\n\",\n+\t\t\tadapter->current_op);\n+\t\treturn;\n+\t}\n+\tadapter->current_op = VIRTCHNL_OP_ENABLE_VLAN_STRIPPING;\n+\tadapter->aq_required &= ~I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;\n+\ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING,\n+\t\t\t   NULL, 0);\n+}\n+\n+/**\n+ * i40evf_disable_vlan_stripping\n+ * @adapter: adapter structure\n+ *\n+ * Request VLAN header stripping to be disabled\n+ **/\n+void i40evf_disable_vlan_stripping(struct i40evf_adapter *adapter)\n+{\n+\tif (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {\n+\t\t/* bail because we already have a command pending */\n+\t\tdev_err(&adapter->pdev->dev, \"Cannot disable stripping, command %d pending\\n\",\n+\t\t\tadapter->current_op);\n+\t\treturn;\n+\t}\n+\tadapter->current_op = VIRTCHNL_OP_DISABLE_VLAN_STRIPPING;\n+\tadapter->aq_required &= ~I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;\n+\ti40evf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING,\n+\t\t\t   NULL, 0);\n+}\n+\n /**\n  * i40evf_print_link_message - print link up or down\n  * @adapter: adapter structure\ndiff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h\nindex becfca2ae94e..2b038442c352 100644\n--- a/include/linux/avf/virtchnl.h\n+++ b/include/linux/avf/virtchnl.h\n@@ -133,6 +133,8 @@ enum virtchnl_ops {\n \tVIRTCHNL_OP_CONFIG_RSS_LUT = 24,\n \tVIRTCHNL_OP_GET_RSS_HENA_CAPS = 25,\n \tVIRTCHNL_OP_SET_RSS_HENA = 26,\n+\tVIRTCHNL_OP_ENABLE_VLAN_STRIPPING = 27,\n+\tVIRTCHNL_OP_DISABLE_VLAN_STRIPPING = 28,\n };\n \n /* This macro is used to generate a compilation error if a structure\n@@ -686,6 +688,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\n \tcase VIRTCHNL_OP_SET_RSS_HENA:\n \t\tvalid_len = sizeof(struct virtchnl_rss_hena);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:\n+\t\tbreak;\n \t/* These are always errors coming from the VF. */\n \tcase VIRTCHNL_OP_EVENT:\n \tcase VIRTCHNL_OP_UNKNOWN:\n",
    "prefixes": [
        "net-next",
        "07/15"
    ]
}