Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/789872/?format=api
{ "id": 789872, "url": "http://patchwork.ozlabs.org/api/patches/789872/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170718050945.69999-1-jeffrey.t.kirsher@intel.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": "<20170718050945.69999-1-jeffrey.t.kirsher@intel.com>", "list_archive_url": null, "date": "2017-07-18T05:09:45", "name": "[next,S75-v4,10/11] i40e/i40evf: support for VF VLAN tag stripping control", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "94124aba5eead3fc55a6db7cb4795f50a5263460", "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": 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/20170718050945.69999-1-jeffrey.t.kirsher@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/789872/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/789872/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>)", "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 3xBSs23bwzz9s1h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 18 Jul 2017 15:09:56 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1E730842B1;\n\tTue, 18 Jul 2017 05:09:55 +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 NtB5j2VR-ypN; Tue, 18 Jul 2017 05:09:54 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1ABFB83E6F;\n\tTue, 18 Jul 2017 05:09:54 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 609521C11CB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jul 2017 05:09:53 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 581D92F3A6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jul 2017 05:09:53 +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 MCfeoCo54Nly for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jul 2017 05:09:52 +0000 (UTC)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 533E32C91C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 18 Jul 2017 05:09:52 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga104.jf.intel.com with ESMTP; 17 Jul 2017 22:09:51 -0700", "from bscott1-mobl4.amr.corp.intel.com (HELO\n\tjtkirshe-DESK.amr.corp.intel.com.com) ([10.252.132.8])\n\tby orsmga001.jf.intel.com with ESMTP; 17 Jul 2017 22:09:51 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.40,376,1496127600\"; d=\"scan'208\";\n\ta=\"1152566646\"", "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 17 Jul 2017 22:09:45 -0700", "Message-Id": "<20170718050945.69999-1-jeffrey.t.kirsher@intel.com>", "X-Mailer": "git-send-email 2.13.2", "Cc": "Mariusz Stachura <mariusz.stachura@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S75-v4 10/11] i40e/i40evf: support\n\tfor VF VLAN tag stripping control", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.18-1", "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>", "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": "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>\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@@ -2530,6 +2530,60 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg, u16 msglen)\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 * @vf_id: source VF id\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 83e430b8a815..a1af9b1c3d15 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 0abdf304f917..a1b603dacd25 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@@ -2295,6 +2305,28 @@ static int i40evf_change_mtu(struct net_device *netdev, int new_mtu)\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 * @netdev: This physical port's netdev\n@@ -2387,6 +2419,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@@ -821,6 +821,46 @@ void i40evf_set_rss_lut(struct i40evf_adapter *adapter)\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\n *\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": [ "next", "S75-v4", "10/11" ] }