Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/613804/?format=api
{ "id": 613804, "url": "http://patchwork.ozlabs.org/api/patches/613804/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160422171826.11019.16994.stgit@ahduyck-xeon-server/", "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": "<20160422171826.11019.16994.stgit@ahduyck-xeon-server>", "list_archive_url": null, "date": "2016-04-22T17:18:26", "name": "ixgbevf: Use mac_ops instead of trying to identify NIC type", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "546f67d89132ae764e512a756377e4548646a200", "submitter": { "id": 67293, "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api", "name": "Alexander Duyck", "email": "aduyck@mirantis.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/20160422171826.11019.16994.stgit@ahduyck-xeon-server/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/613804/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/613804/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 3qs2QZ3mhqz9t3v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Apr 2016 03:18:44 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1A73B887AF;\n\tFri, 22 Apr 2016 17:18:44 +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 mCYeDm5AqIXt; Fri, 22 Apr 2016 17:18:42 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8BA728863E;\n\tFri, 22 Apr 2016 17:18:42 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9C94B1C1ED0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 22 Apr 2016 17:18:41 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 976C49601F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 22 Apr 2016 17:18:41 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 1JC1qBqApgkR for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 22 Apr 2016 17:18:37 +0000 (UTC)", "from mail-pf0-f169.google.com (mail-pf0-f169.google.com\n\t[209.85.192.169])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 923A895FCC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 22 Apr 2016 17:18:37 +0000 (UTC)", "by mail-pf0-f169.google.com with SMTP id n1so43244361pfn.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 22 Apr 2016 10:18:37 -0700 (PDT)", "from [192.168.1.143] (static-50-53-29-36.bvtn.or.frontiernet.net.\n\t[50.53.29.36]) by smtp.gmail.com with ESMTPSA id\n\tr5sm9669924pfi.67.2016.04.22.10.18.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 22 Apr 2016 10:18:36 -0700 (PDT)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=fe/qLu3k; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:date:message-id:user-agent:mime-version\n\t:content-transfer-encoding;\n\tbh=vD6/SdtesFGWs1BoMmGOqrL98G40MyI4RDISU7HiiMA=;\n\tb=fe/qLu3kVYUwOZCpi6axMdfzYNXY6qybDjCgaAzkNcxOlrFqafF90EeQsoWjEvmTJs\n\tY9+NtW6retl8HiEyg0bjClTBKI4S39ir5KArBzZmhokDZgj9WfaJw0WJ8Gol1psNgkyZ\n\tZBKk9qwhChgplTXZUzbj07luldMrvIbd9dKDc=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:date:message-id:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=vD6/SdtesFGWs1BoMmGOqrL98G40MyI4RDISU7HiiMA=;\n\tb=NcZOjvc7rGT/q5fPj6/1qHopgVGKQQUAQyOmO/6bUdertlw6bDA/oh317Nc8XYE7cA\n\tpXlMagkp/sqM6uFsX6WmZUBo5MNqdMMz2q1AjsXoxmnE76pKtQep4E1KCfwO5lh7MDiW\n\tbbHX29hM8wC0CXraMfCO1B5RZfUpnsWEV762n+NUZ2eI/UVgDjF7c9j21GwNDKiTXuxm\n\tmXqGh7MixjVnFnMMo+3nuS1dyzdccsHfokGf6eLI3J9zcjO/ZUmFArwQDf6lkyDvrWMh\n\tTiZQ5h4rBjP7On5Qug4OP0E2FHMcoQGiXNNI7+C1KDRqgVY+aCtB6kLL5mB2mOLfeHQL\n\tpF6A==", "X-Gm-Message-State": "AOPr4FVxeKrllkMBzZ1QnfWS3614NxyVrBUUhPvR4NS6Aqv1Y6jGHf3BjGf5bjgM6YHX3146", "X-Received": "by 10.98.19.151 with SMTP id 23mr20220597pft.62.1461345517167;\n\tFri, 22 Apr 2016 10:18:37 -0700 (PDT)", "From": "Alexander Duyck <aduyck@mirantis.com>", "To": "kys@microsoft.com, intel-wired-lan@lists.osuosl.org,\n\tjeffrey.t.kirsher@intel.com", "Date": "Fri, 22 Apr 2016 13:18:26 -0400", "Message-ID": "<20160422171826.11019.16994.stgit@ahduyck-xeon-server>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH] ixgbevf: Use mac_ops instead of trying to\n\tidentify NIC type", "X-BeenThere": "intel-wired-lan@lists.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.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "This change makes it so that we can just use function pointers instead of\nhaving to identify if a given VF is running on a Linux or Windows PF. By\ndoing this we can avoid having to pull too much information out of the\nlower layers and can instead just make use of the mac_ops pointers since\nthey should differ between the two types of VFs anyway.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 1 -\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 15 +++------------\n drivers/net/ethernet/intel/ixgbevf/vf.c | 20 +++++++++-----------\n drivers/net/ethernet/intel/ixgbevf/vf.h | 4 +---\n 4 files changed, 13 insertions(+), 27 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex b82f19e1d770..ee95242fb56f 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -495,7 +495,6 @@ void ixgbevf_free_rx_resources(struct ixgbevf_ring *);\n void ixgbevf_free_tx_resources(struct ixgbevf_ring *);\n void ixgbevf_update_stats(struct ixgbevf_adapter *adapter);\n int ethtool_ioctl(struct ifreq *ifr);\n-bool ixgbevf_on_hyperv(struct ixgbe_hw *hw);\n \n extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex 14d4729e7519..ba17a6193034 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -1809,10 +1809,7 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter)\n \t\tixgbevf_setup_vfmrqc(adapter);\n \n \t/* notify the PF of our intent to use this size of frame */\n-\tif (!ixgbevf_on_hyperv(hw))\n-\t\tixgbevf_rlpml_set_vf(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN);\n-\telse\n-\t\tixgbevf_hv_rlpml_set_vf(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN);\n+\thw->mac.ops.set_rlpml(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN);\n \n \t/* Setup the HW Rx Head and Tail Descriptor Pointers and\n \t * the Base and Length of the Rx Descriptor Ring\n@@ -2073,10 +2070,7 @@ static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter)\n \tspin_lock_bh(&adapter->mbx_lock);\n \n \twhile (api[idx] != ixgbe_mbox_api_unknown) {\n-\t\tif (!ixgbevf_on_hyperv(hw))\n-\t\t\terr = hw->mac.ops.negotiate_api_version(hw, api[idx]);\n-\t\telse\n-\t\t\terr = ixgbevf_hv_negotiate_api_version(hw, api[idx]);\n+\t\terr = hw->mac.ops.negotiate_api_version(hw, api[idx]);\n \t\tif (!err)\n \t\t\tbreak;\n \t\tidx++;\n@@ -3760,10 +3754,7 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)\n \tnetdev->mtu = new_mtu;\n \n \t/* notify the PF of our intent to use this size of frame */\n-\tif (!ixgbevf_on_hyperv(hw))\n-\t\tixgbevf_rlpml_set_vf(hw, max_frame);\n-\telse\n-\t\tixgbevf_hv_rlpml_set_vf(hw, max_frame);\n+\thw->mac.ops.set_rlpml(hw, max_frame);\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c\nindex 8169753a88c5..362ed67eb30f 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/vf.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c\n@@ -797,11 +797,11 @@ out:\n }\n \n /**\n- * ixgbevf_rlpml_set_vf - Set the maximum receive packet length\n+ * ixgbevf_set_rlpml_vf - Set the maximum receive packet length\n * @hw: pointer to the HW structure\n * @max_size: value to assign to max frame size\n **/\n-void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size)\n+static void ixgbevf_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size)\n {\n \tu32 msgbuf[2];\n \n@@ -811,12 +811,12 @@ void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size)\n }\n \n /**\n- * ixgbevf_hv_rlpml_set_vf - Set the maximum receive packet length\n+ * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length\n * @hw: pointer to the HW structure\n * @max_size: value to assign to max frame size\n * Hyper-V variant.\n **/\n-void ixgbevf_hv_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size)\n+static void ixgbevf_hv_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size)\n {\n \tu32 reg;\n \n@@ -864,12 +864,12 @@ static int ixgbevf_negotiate_api_version_vf(struct ixgbe_hw *hw, int api)\n }\n \n /**\n- * ixgbevf_hv_negotiate_api_version - Negotiate supported API version\n+ * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version\n * @hw: pointer to the HW structure\n * @api: integer containing requested API version\n * Hyper-V version - only ixgbe_mbox_api_10 supported.\n **/\n-int ixgbevf_hv_negotiate_api_version(struct ixgbe_hw *hw, int api)\n+static int ixgbevf_hv_negotiate_api_version_vf(struct ixgbe_hw *hw, int api)\n {\n \t/* Hyper-V only supports api version ixgbe_mbox_api_10\n \t */\n@@ -951,6 +951,7 @@ static const struct ixgbe_mac_operations ixgbevf_mac_ops = {\n \t.update_xcast_mode\t= ixgbevf_update_xcast_mode,\n \t.set_uc_addr\t\t= ixgbevf_set_uc_addr_vf,\n \t.set_vfta\t\t= ixgbevf_set_vfta_vf,\n+\t.set_rlpml\t\t= ixgbevf_set_rlpml_vf,\n };\n \n static const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = {\n@@ -961,11 +962,13 @@ static const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = {\n \t.stop_adapter\t\t= ixgbevf_stop_hw_vf,\n \t.setup_link\t\t= ixgbevf_setup_mac_link_vf,\n \t.check_link\t\t= ixgbevf_hv_check_mac_link_vf,\n+\t.negotiate_api_version\t= ixgbevf_hv_negotiate_api_version_vf,\n \t.set_rar\t\t= ixgbevf_hv_set_rar_vf,\n \t.update_mc_addr_list\t= ixgbevf_hv_update_mc_addr_list_vf,\n \t.update_xcast_mode\t= ixgbevf_hv_update_xcast_mode,\n \t.set_uc_addr\t\t= ixgbevf_hv_set_uc_addr_vf,\n \t.set_vfta\t\t= ixgbevf_hv_set_vfta_vf,\n+\t.set_rlpml\t\t= ixgbevf_hv_set_rlpml_vf,\n };\n \n const struct ixgbevf_info ixgbevf_82599_vf_info = {\n@@ -1007,8 +1010,3 @@ const struct ixgbevf_info ixgbevf_X550EM_x_vf_hv_info = {\n \t.mac = ixgbe_mac_X550EM_x_vf,\n \t.mac_ops = &ixgbevf_hv_mac_ops,\n };\n-\n-bool ixgbevf_on_hyperv(struct ixgbe_hw *hw)\n-{\n-\treturn hw->mbx.ops.check_for_msg == NULL;\n-}\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h\nindex f7c017058f83..6770f101aa45 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/vf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/vf.h\n@@ -69,6 +69,7 @@ struct ixgbe_mac_operations {\n \ts32 (*disable_mc)(struct ixgbe_hw *);\n \ts32 (*clear_vfta)(struct ixgbe_hw *);\n \ts32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool);\n+\tvoid (*set_rlpml)(struct ixgbe_hw *, u16);\n };\n \n enum ixgbe_mac_type {\n@@ -208,9 +209,6 @@ static inline u32 ixgbe_read_reg_array(struct ixgbe_hw *hw, u32 reg,\n \n #define IXGBE_READ_REG_ARRAY(h, r, o) ixgbe_read_reg_array(h, r, o)\n \n-void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size);\n-void ixgbevf_hv_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size);\n-int ixgbevf_hv_negotiate_api_version(struct ixgbe_hw *hw, int api);\n int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,\n \t\t unsigned int *default_tc);\n int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues);\n", "prefixes": [] }