From patchwork Wed Mar 25 17:42:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Zolotarov X-Patchwork-Id: 454740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id C9B9A14009B for ; Thu, 26 Mar 2015 05:59:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C94BA31B66 for ; Wed, 25 Mar 2015 18:59:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sRpCn30X-E5o for ; Wed, 25 Mar 2015 18:59:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8492E338DF for ; Wed, 25 Mar 2015 18:59:36 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1E5641BFA7A for ; Wed, 25 Mar 2015 17:51:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 19F9132EF1 for ; Wed, 25 Mar 2015 17:51:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9R1OxFBVkdav for ; Wed, 25 Mar 2015 17:51:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by silver.osuosl.org (Postfix) with ESMTPS id 1C8B832DBA for ; Wed, 25 Mar 2015 17:51:14 +0000 (UTC) Received: by wixw10 with SMTP id w10so80172735wix.0 for ; Wed, 25 Mar 2015 10:51:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ln3PEs39LKbgQheD3p2HhVakjpMrH/iFUW14eKdsdoY=; b=ae79zcRwBK5OekkJVTu1hZACSgjWufQFeDPRmf6ch004K7Z1nhp+SuQ3nlsTncV5J/ o9Wpla43ue9DEDw9QNec6kIhFfghWlxW5n8uSNUpqwZoMkAM3zIf1uj8BjQYRz/t6Oek 7Fu8lJ5xkMpwwnLrxGzB2KHQnpthEfGzqszVgt7hM8u/00nATiM4hcyUf0LXmFZI2tjv N136X/W/zBD831uzUSTQc3lk4X02zn/tyKvhtjgmdz8bvoajg6lMOZz7OsqnWTJpg1le O84z9OnCs4qnCqfnO6iOHjpHDEx+Gv93tlEVpF8Sm9o4DKCsrJnArKLHLVgkuqbyyT6y tCpg== X-Gm-Message-State: ALoCoQlvmaVjFGl8x8K7pkiH4J+cmXa241t+uomSJQNzZ9lzoOZj4YSycSXUjMYb5PyyZxtmyiGm X-Received: by 10.194.208.229 with SMTP id mh5mr20292713wjc.108.1427305376712; Wed, 25 Mar 2015 10:42:56 -0700 (PDT) Received: from vladz-laptop.localdomain (bzq-109-65-117-109.red.bezeqint.net. [109.65.117.109]) by mx.google.com with ESMTPSA id na4sm5267653wic.10.2015.03.25.10.42.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 10:42:56 -0700 (PDT) From: Vlad Zolotarov To: netdev@vger.kernel.org Date: Wed, 25 Mar 2015 19:42:40 +0200 Message-Id: <1427305362-23948-6-git-send-email-vladz@cloudius-systems.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1427305362-23948-1-git-send-email-vladz@cloudius-systems.com> References: <1427305362-23948-1-git-send-email-vladz@cloudius-systems.com> X-Mailman-Approved-At: Wed, 25 Mar 2015 18:59:34 +0000 Cc: avi@cloudius-systems.com, intel-wired-lan@lists.osuosl.org, gleb@cloudius-systems.com Subject: [Intel-wired-lan] [PATCH net-next v8 5/7] ixgbe: Add GET_RSS_KEY command to VF-PF channel commands set 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" For 82599 and x540 VFs and PF share the same RSS Key. Therefore we will return the same RSS key for all VFs. x550 on the other hand has a separate RSS Key for every pool. Signed-off-by: Vlad Zolotarov --- New in v5: - Use a newly added netdev op to allow/prevent the RSS Hash Key querying on a per-VF basis. New in v3: - Added a support for x550 devices. New in v1 (compared to RFC): - Use "if-else" statement instead of a "switch-case" for a single option case (in ixgbe_get_vf_rss_key()). --- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 2 ++ drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 27 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h index f9b5eae..3f14373 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h @@ -105,6 +105,8 @@ enum ixgbe_pfvf_api_rev { #define IXGBE_VF_RETA_SZ 1 /* Number of RETA DWs to bring */ #define IXGBE_VF_RETA_OFFSET 2 /* Offset in RETA */ +#define IXGBE_VF_GET_RSS_KEY 0x0b /* get RSS key */ + /* length of permanent address message returned from PF */ #define IXGBE_VF_PERMADDR_MSG_LEN 4 /* word in permanent address message with the current multicast type */ diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 301bb1b..78517a1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -1016,6 +1016,30 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) return 0; } +static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter, + u32 *msgbuf, u32 vf) +{ + struct ixgbe_hw *hw = &adapter->hw; + int i; + u32 *rss_key = &msgbuf[1]; + + /* verify the PF is supporting the correct API */ + if (!adapter->vfinfo[vf].rss_query_enabled || + (adapter->vfinfo[vf].vf_api != ixgbe_mbox_api_12)) + return -EPERM; + + /* Read the RSS KEY */ + if (hw->mac.type >= ixgbe_mac_X550) { + for (i = 0; i < 10; i++) + rss_key[i] = IXGBE_READ_REG(hw, + IXGBE_PFVFRSSRK(i, vf)); + } else + for (i = 0; i < 10; i++) + rss_key[i] = IXGBE_READ_REG(hw, IXGBE_RSSRK(i)); + + return 0; +} + static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) { u32 mbx_size = IXGBE_VFMAILBOX_SIZE; @@ -1075,6 +1099,9 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) case IXGBE_VF_GET_RETA: retval = ixgbe_get_vf_reta(adapter, msgbuf, vf); break; + case IXGBE_VF_GET_RSS_KEY: + retval = ixgbe_get_vf_rss_key(adapter, msgbuf, vf); + break; default: e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]); retval = IXGBE_ERR_MBX;