From patchwork Thu Jun 4 20:23:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Sullivan X-Patchwork-Id: 480879 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id C408614027F for ; Fri, 5 Jun 2015 06:22:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F34439653C; Thu, 4 Jun 2015 20:22:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tb4OOA3JWVGg; Thu, 4 Jun 2015 20:22:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7772596541; Thu, 4 Jun 2015 20:22:29 +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 187531C1F3C for ; Thu, 4 Jun 2015 20:22:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 14CCC32CB6 for ; Thu, 4 Jun 2015 20:22:27 +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 lQuHM4njvrx7 for ; Thu, 4 Jun 2015 20:22:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by silver.osuosl.org (Postfix) with ESMTP id 2C35B32C8A for ; Thu, 4 Jun 2015 20:22:25 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 04 Jun 2015 13:22:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,554,1427785200"; d="scan'208";a="705514380" Received: from catheri1-tigger.jf.intel.com ([134.134.176.92]) by orsmga001.jf.intel.com with ESMTP; 04 Jun 2015 13:22:25 -0700 From: Catherine Sullivan To: intel-wired-lan@lists.osuosl.org Date: Thu, 4 Jun 2015 16:23:59 -0400 Message-Id: <1433449442-31420-6-git-send-email-catherine.sullivan@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1433449442-31420-1-git-send-email-catherine.sullivan@intel.com> References: <1433449442-31420-1-git-send-email-catherine.sullivan@intel.com> Subject: [Intel-wired-lan] [intel-wired-lan][net-next PATCH 5/8] i40evf: support virtual channel API version 1.1 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" From: Mitch Williams Store off the PF's API version, then use it to determine whether or not to send it our capabilities. Change the version checking to allow for PF drivers with lower API versions than our current version, so we can still talk to PF drivers over the 1.0 API. Signed-off-by: Mitch Williams Change-ID: I8edc55d1229c7decf0ed3f285a63032694007c2e Tested-By: Jim young --- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 ++++++ drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index e2b7bf6..0d0ad3d 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -2130,6 +2130,12 @@ static void i40evf_init_task(struct work_struct *work) if (err) { if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) err = i40evf_send_api_ver(adapter); + else + dev_err(&pdev->dev, "Unsupported PF API version %d.%d, expected %d.%d\n", + adapter->pf_version.major, + adapter->pf_version.minor, + I40E_VIRTCHNL_VERSION_MAJOR, + I40E_VIRTCHNL_VERSION_MINOR); goto err; } err = i40evf_send_vf_config_msg(adapter); diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c index a37d56b..52c6959 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c @@ -125,8 +125,11 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter) } pf_vvi = (struct i40e_virtchnl_version_info *)event.msg_buf; - if ((pf_vvi->major != I40E_VIRTCHNL_VERSION_MAJOR) || - (pf_vvi->minor != I40E_VIRTCHNL_VERSION_MINOR)) + adapter->pf_version = *pf_vvi; + + if ((pf_vvi->major > I40E_VIRTCHNL_VERSION_MAJOR) || + ((pf_vvi->major == I40E_VIRTCHNL_VERSION_MAJOR) && + (pf_vvi->minor > I40E_VIRTCHNL_VERSION_MINOR))) err = -EIO; out_alloc: