* [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup
@ 2010-05-06 5:57 Jeff Kirsher
2010-05-06 5:57 ` [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs Jeff Kirsher
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-06 5:57 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher
From: Greg Rose <gregory.v.rose@intel.com>
The driver is unnecessarily writing values to VLAN control registers.
These writes already done elsewhere and are superfluous here.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_sriov.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c
index 221b2ca..c4e5150 100644
--- a/drivers/net/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ixgbe/ixgbe_sriov.c
@@ -98,17 +98,6 @@ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter)
int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, u32 vf)
{
- u32 ctrl;
-
- /* Check if global VLAN already set, if not set it */
- ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_VLNCTRL);
- if (!(ctrl & IXGBE_VLNCTRL_VFE)) {
- /* enable VLAN tag insert/strip */
- ctrl |= IXGBE_VLNCTRL_VFE;
- ctrl &= ~IXGBE_VLNCTRL_CFIEN;
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
- }
-
return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add);
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs
2010-05-06 5:57 [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup Jeff Kirsher
@ 2010-05-06 5:57 ` Jeff Kirsher
2010-05-06 7:32 ` David Miller
2010-05-06 5:57 ` [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt Jeff Kirsher
2010-05-06 7:32 ` [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-06 5:57 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher
From: Greg Rose <gregory.v.rose@intel.com>
The driver was calling the set Rx mode function for every multicast
filter set by the VF. When starting many VMs where each might have
multiple VLAN interfaces this would result in the function being
called hundreds or even thousands of times. This is unnecessary
for the case of the imperfect filters used in the MTA and has been
streamlined to be more efficient.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_sriov.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c
index c4e5150..f6cee94 100644
--- a/drivers/net/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ixgbe/ixgbe_sriov.c
@@ -48,7 +48,11 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
int entries, u16 *hash_list, u32 vf)
{
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
+ struct ixgbe_hw *hw = &adapter->hw;
int i;
+ u32 vector_bit;
+ u32 vector_reg;
+ u32 mta_reg;
/* only so many hash values supported */
entries = min(entries, IXGBE_MAX_VF_MC_ENTRIES);
@@ -68,8 +72,13 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
vfinfo->vf_mc_hashes[i] = hash_list[i];;
}
- /* Flush and reset the mta with the new values */
- ixgbe_set_rx_mode(adapter->netdev);
+ for (i = 0; i < vfinfo->num_vf_mc_hashes; i++) {
+ vector_reg = (vfinfo->vf_mc_hashes[i] >> 5) & 0x7F;
+ vector_bit = vfinfo->vf_mc_hashes[i] & 0x1F;
+ mta_reg = IXGBE_READ_REG(hw, IXGBE_MTA(vector_reg));
+ mta_reg |= (1 << vector_bit);
+ IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg);
+ }
return 0;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs
2010-05-06 5:57 ` [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs Jeff Kirsher
@ 2010-05-06 7:32 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-06 7:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 05 May 2010 22:57:30 -0700
> From: Greg Rose <gregory.v.rose@intel.com>
>
> The driver was calling the set Rx mode function for every multicast
> filter set by the VF. When starting many VMs where each might have
> multiple VLAN interfaces this would result in the function being
> called hundreds or even thousands of times. This is unnecessary
> for the case of the imperfect filters used in the MTA and has been
> streamlined to be more efficient.
>
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt
2010-05-06 5:57 [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup Jeff Kirsher
2010-05-06 5:57 ` [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs Jeff Kirsher
@ 2010-05-06 5:57 ` Jeff Kirsher
2010-05-06 7:32 ` David Miller
2010-05-06 7:32 ` [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-06 5:57 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher
From: Greg Rose <gregory.v.rose@intel.com>
When the PF acks a message from the VF the VF gets an interrupt. It
must cache the ack bit so that polling SW will not miss the ack. Also
avoid reading the message buffer on acks because that also will clear
the ack bit.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbevf/ixgbevf_main.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 0870740..460c37f 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -961,12 +961,28 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data)
eicr = IXGBE_READ_REG(hw, IXGBE_VTEICS);
IXGBE_WRITE_REG(hw, IXGBE_VTEICR, eicr);
+ if (!hw->mbx.ops.check_for_ack(hw)) {
+ /*
+ * checking for the ack clears the PFACK bit. Place
+ * it back in the v2p_mailbox cache so that anyone
+ * polling for an ack will not miss it. Also
+ * avoid the read below because the code to read
+ * the mailbox will also clear the ack bit. This was
+ * causing lost acks. Just cache the bit and exit
+ * the IRQ handler.
+ */
+ hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK;
+ goto out;
+ }
+
+ /* Not an ack interrupt, go ahead and read the message */
hw->mbx.ops.read(hw, &msg, 1);
if ((msg & IXGBE_MBVFICR_VFREQ_MASK) == IXGBE_PF_CONTROL_MSG)
mod_timer(&adapter->watchdog_timer,
round_jiffies(jiffies + 1));
+out:
return IRQ_HANDLED;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt
2010-05-06 5:57 ` [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt Jeff Kirsher
@ 2010-05-06 7:32 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-06 7:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 05 May 2010 22:57:49 -0700
> From: Greg Rose <gregory.v.rose@intel.com>
>
> When the PF acks a message from the VF the VF gets an interrupt. It
> must cache the ack bit so that polling SW will not miss the ack. Also
> avoid reading the message buffer on acks because that also will clear
> the ack bit.
>
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup
2010-05-06 5:57 [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup Jeff Kirsher
2010-05-06 5:57 ` [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs Jeff Kirsher
2010-05-06 5:57 ` [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt Jeff Kirsher
@ 2010-05-06 7:32 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-06 7:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 05 May 2010 22:57:10 -0700
> From: Greg Rose <gregory.v.rose@intel.com>
>
> The driver is unnecessarily writing values to VLAN control registers.
> These writes already done elsewhere and are superfluous here.
>
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-06 7:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 5:57 [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup Jeff Kirsher
2010-05-06 5:57 ` [net-next-2.6 PATCH 2/3] ixgbe: Streamline MC filter setup for VFs Jeff Kirsher
2010-05-06 7:32 ` David Miller
2010-05-06 5:57 ` [net-next-2.6 PATCH 3/3] ixgbevf: Cache PF ack bit in interrupt Jeff Kirsher
2010-05-06 7:32 ` David Miller
2010-05-06 7:32 ` [net-next-2.6 PATCH 1/3] ixgbe: Remove unneeded register writes in VF VLAN setup David Miller
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).