From patchwork Tue Jun 16 09:26:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivakumar Subramani X-Patchwork-Id: 28727 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4DE33B70BB for ; Tue, 16 Jun 2009 19:45:22 +1000 (EST) Received: by ozlabs.org (Postfix) id 40515DDDA2; Tue, 16 Jun 2009 19:45:22 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C6AFBDDDA1 for ; Tue, 16 Jun 2009 19:45:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755036AbZFPJoz (ORCPT ); Tue, 16 Jun 2009 05:44:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752640AbZFPJoz (ORCPT ); Tue, 16 Jun 2009 05:44:55 -0400 Received: from barracuda.s2io.com ([72.1.205.138]:51862 "EHLO barracuda.s2io.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638AbZFPJoy (ORCPT ); Tue, 16 Jun 2009 05:44:54 -0400 X-Greylist: delayed 945 seconds by postgrey-1.27 at vger.kernel.org; Tue, 16 Jun 2009 05:44:54 EDT X-ASG-Debug-ID: 1245144378-0e5301180000-gSecQ8 X-Barracuda-URL: http://72.1.205.138:8000/cgi-bin/mark.cgi Received: from guinness.s2io.com (localhost [127.0.0.1]) by barracuda.s2io.com (Spam Firewall) with ESMTP id 6A6AB2021002; Tue, 16 Jun 2009 05:26:18 -0400 (EDT) Received: from guinness.s2io.com (142-46-210.147.tel-ott.com [142.46.210.147]) by barracuda.s2io.com with ESMTP id dp5CN1pxdEEJH842; Tue, 16 Jun 2009 05:26:18 -0400 (EDT) X-Barracuda-Envelope-From: Sivakumar.Subramani@neterion.com X-ASG-Whitelist: Client Received: from guinness.s2io.com (localhost [127.0.0.1]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id n5G9QImd013531; Tue, 16 Jun 2009 05:26:18 -0400 (EDT) Received: from localhost (ssubrama@localhost) by guinness.s2io.com (8.12.6/8.12.6/Submit) with ESMTP id n5G9QFsC013528; Tue, 16 Jun 2009 05:26:15 -0400 (EDT) Date: Tue, 16 Jun 2009 05:26:09 -0400 (EDT) From: Sivakumar Subramani To: netdev@vger.kernel.org, davem@davemloft.net cc: support@neterion.com, sivakumar.subramani@neterion.com, santosh.rastapur@neterion.com, ram.vepa@neterion.com X-ASG-Orig-Subj: [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver. Subject: [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver. Message-ID: MIME-Version: 1.0 X-Barracuda-Connect: 142-46-210.147.tel-ott.com[142.46.210.147] X-Barracuda-Start-Time: 1245144379 X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at s2io.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - Enabled SRIOV support in the driver. - Call __vxge_hw_verify_pci_e_info() for the PF only. This function verifies the negotiated link width and current link speed in the Link Status Register (offset 12h) which are reserved fields for VFs as per the SRIOV specification, section 3.5.8. Signed-off-by: Sivakumar Subramani Signed-off-by: Rastapur Santosh Signed-off-by: Ramkrishna Vepa --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urpN org/drivers/net/vxge/vxge-config.c mod/drivers/net/vxge/vxge-config.c --- org/drivers/net/vxge/vxge-config.c 2009-06-15 22:51:49.000000000 -0700 +++ mod/drivers/net/vxge/vxge-config.c 2009-06-15 22:55:59.000000000 -0700 @@ -454,7 +454,7 @@ __vxge_hw_verify_pci_e_info(struct __vxg return VXGE_HW_OK; } -static enum vxge_hw_status +enum vxge_hw_status __vxge_hw_device_is_privilaged(struct __vxge_hw_device *hldev) { if ((hldev->host_type == VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION || @@ -676,10 +676,12 @@ enum vxge_hw_status __vxge_hw_device_ini { enum vxge_hw_status status = VXGE_HW_OK; - /* Validate the pci-e link width and speed */ - status = __vxge_hw_verify_pci_e_info(hldev); - if (status != VXGE_HW_OK) - goto exit; + if (VXGE_HW_OK == __vxge_hw_device_is_privilaged(hldev)) { + /* Validate the pci-e link width and speed */ + status = __vxge_hw_verify_pci_e_info(hldev); + if (status != VXGE_HW_OK) + goto exit; + } vxge_hw_wrr_rebalance(hldev); exit: diff -urpN org/drivers/net/vxge/vxge-main.c mod/drivers/net/vxge/vxge-main.c --- org/drivers/net/vxge/vxge-main.c 2009-06-15 22:51:43.000000000 -0700 +++ mod/drivers/net/vxge/vxge-main.c 2009-06-15 23:03:04.000000000 -0700 @@ -4203,6 +4203,17 @@ vxge_probe(struct pci_dev *pdev, const s max_vpath_supported++; } +#ifdef CONFIG_PCI_IOV + /* Enable SRIOV mode, if firmware has SRIOV support and if it is a PF */ + if ((VXGE_HW_FUNCTION_MODE_SRIOV == + ll_config.device_hw_info.function_mode) && + (max_config_dev > 1) && (pdev->is_physfn)) { + ret = pci_enable_sriov(pdev, max_config_dev - 1); + if (ret) + vxge_debug_ll_config(VXGE_ERR, + "Failed to enable SRIOV: %d \n", ret); + } +#endif /* * Configure vpaths and get driver configured number of vpaths * which is less than or equal to the maximum vpaths per function. @@ -4366,6 +4377,9 @@ _exit6: vxge_device_unregister(hldev); _exit5: +#ifdef CONFIG_PCI_IOV + pci_disable_sriov(pdev); +#endif vxge_hw_device_terminate(hldev); _exit4: iounmap(attr.bar1); @@ -4428,6 +4442,9 @@ vxge_remove(struct pci_dev *pdev) iounmap(vdev->bar0); iounmap(vdev->bar1); +#ifdef CONFIG_PCI_IOV + pci_disable_sriov(pdev); +#endif /* we are safe to free it now */ free_netdev(dev); diff -urpN org/drivers/net/vxge/vxge-version.h mod/drivers/net/vxge/vxge-version.h --- org/drivers/net/vxge/vxge-version.h 2009-06-15 22:51:54.000000000 -0700 +++ mod/drivers/net/vxge/vxge-version.h 2009-06-15 23:04:18.000000000 -0700 @@ -17,7 +17,7 @@ #define VXGE_VERSION_MAJOR "2" #define VXGE_VERSION_MINOR "0" -#define VXGE_VERSION_FIX "1" -#define VXGE_VERSION_BUILD "17129" +#define VXGE_VERSION_FIX "4" +#define VXGE_VERSION_BUILD "17784" #define VXGE_VERSION_FOR "k" #endif