netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 Net-next] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
@ 2014-01-16  4:25 ethan zhao
  2014-01-16  5:57 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: ethan zhao @ 2014-01-16  4:25 UTC (permalink / raw)
  To: aaron.f.brown, jeffrey.t.kirsher
  Cc: e1000-devel, netdev, ethan.kernel, linux-kernel


Because ixgbe driver limit the max number of VF functions could be enalbed
to 63, so define one macro IXGBE_MAX_VFS_DRV_LIMIT and cleanup the const 63
in code.

v3: revised for net-next tree.

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
---
  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |    4 ++--
  drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |    4 ++--
  drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h |    5 +++++
  3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index cc06854..bea2cec 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5028,7 +5028,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter 
*adapter)

      /* assign number of SR-IOV VFs */
      if (hw->mac.type != ixgbe_mac_82598EB) {
-        if (max_vfs > 63) {
+        if (max_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
              adapter->num_vfs = 0;
              e_dev_warn("max_vfs parameter out of range. Not assigning 
any SR-IOV VFs\n");
          } else {
@@ -7973,7 +7973,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
      ixgbe_init_mbx_params_pf(hw);
      memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
      ixgbe_enable_sriov(adapter);
-    pci_sriov_set_totalvfs(pdev, 63);
+    pci_sriov_set_totalvfs(pdev, IXGBE_MAX_VFS_DRV_LIMIT);
  skip_sriov:

  #endif
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 359f6e6..b324260 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -148,7 +148,7 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
           * physical function.  If the user requests greater thn
           * 63 VFs then it is an error - reset to default of zero.
           */
-        adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, 63);
+        adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, 
IXGBE_MAX_VFS_DRV_LIMIT);

          err = pci_enable_sriov(adapter->pdev, adapter->num_vfs);
          if (err) {
@@ -257,7 +257,7 @@ static int ixgbe_pci_sriov_enable(struct pci_dev 
*dev, int num_vfs)
       * PF.  The PCI bus driver already checks for other values out of
       * range.
       */
-    if (num_vfs > 63) {
+    if (num_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
          err = -EPERM;
          goto err_out;
      }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
index 4713f9f..8bd2919 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
@@ -28,6 +28,11 @@
  #ifndef _IXGBE_SRIOV_H_
  #define _IXGBE_SRIOV_H_

+/*  ixgbe driver limit the max number of VFs could be enabled to
+ *  63 (IXGBE_MAX_VF_FUNCTIONS - 1)
+ */
+#define IXGBE_MAX_VFS_DRV_LIMIT  (IXGBE_MAX_VF_FUNCTIONS - 1)
+
  void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
  void ixgbe_msg_task(struct ixgbe_adapter *adapter);
  int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
-- 
1.7.1


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2 Net-next] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
  2014-01-16  4:25 [PATCH 1/2 Net-next] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63 ethan zhao
@ 2014-01-16  5:57 ` David Miller
  2014-01-16  6:12   ` Ethan Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2014-01-16  5:57 UTC (permalink / raw)
  To: ethan.zhao
  Cc: aaron.f.brown, jeffrey.t.kirsher, e1000-devel, netdev,
	linux-kernel, ethan.kernel

From: ethan zhao <ethan.zhao@oracle.com>
Date: Thu, 16 Jan 2014 12:25:01 +0800

> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>

Please don't give two signoffs for yourself, it is not appropriate at
all.

I am very genuinely curious where you got the idea to do that,
particularly as I've never seen anyone else do it before.  So it's
really not possible that you got the idea from someone else's actions.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2 Net-next] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
  2014-01-16  5:57 ` David Miller
@ 2014-01-16  6:12   ` Ethan Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Ethan Zhao @ 2014-01-16  6:12 UTC (permalink / raw)
  To: David Miller
  Cc: ethan zhao, Brown, Aaron F, Kirsher, Jeffrey T,
	e1000-devel@lists.sourceforge.net, netdev, LKML

David,
   Sorry about the signoffs, I am confused about how to sign the patch,
If I sign it with off-work mail address, some of it is done within work-hours,
maybe that why I sign if with both personal mail address and work one.
If that bother you, just remove it.

Thanks,
Ethan

On Thu, Jan 16, 2014 at 1:57 PM, David Miller <davem@davemloft.net> wrote:
> From: ethan zhao <ethan.zhao@oracle.com>
> Date: Thu, 16 Jan 2014 12:25:01 +0800
>
>> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
>> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
>
> Please don't give two signoffs for yourself, it is not appropriate at
> all.
>
> I am very genuinely curious where you got the idea to do that,
> particularly as I've never seen anyone else do it before.  So it's
> really not possible that you got the idea from someone else's actions.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-16  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16  4:25 [PATCH 1/2 Net-next] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63 ethan zhao
2014-01-16  5:57 ` David Miller
2014-01-16  6:12   ` Ethan Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).