* [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes
@ 2008-12-10 2:41 Jeff Kirsher
2008-12-10 2:42 ` [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment Jeff Kirsher
2008-12-10 9:09 ` [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Jeff Kirsher @ 2008-12-10 2:41 UTC (permalink / raw)
To: davem; +Cc: netdev, jeff, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
As we begin to move into virtualization the use of a global value for
buffer sizes becomes undesirable. This change makes it so only 256 and 512
byte buffers require use of the RCTL register.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/igb_main.c | 32 ++++++++++++++------------------
1 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index c49b8d8..dad742f 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1801,25 +1801,21 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
*/
rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256);
- if (adapter->netdev->mtu <= ETH_DATA_LEN) {
- /* Setup buffer sizes */
- switch (adapter->rx_buffer_len) {
- case IGB_RXBUFFER_256:
- rctl |= E1000_RCTL_SZ_256;
- break;
- case IGB_RXBUFFER_512:
- rctl |= E1000_RCTL_SZ_512;
- break;
- case IGB_RXBUFFER_1024:
- rctl |= E1000_RCTL_SZ_1024;
- break;
- default:
- rctl |= E1000_RCTL_SZ_2048;
- break;
- }
- } else {
+ if (adapter->netdev->mtu > ETH_DATA_LEN)
rctl |= E1000_RCTL_LPE;
- srrctl = adapter->rx_buffer_len >> E1000_SRRCTL_BSIZEPKT_SHIFT;
+
+ /* Setup buffer sizes */
+ switch (adapter->rx_buffer_len) {
+ case IGB_RXBUFFER_256:
+ rctl |= E1000_RCTL_SZ_256;
+ break;
+ case IGB_RXBUFFER_512:
+ rctl |= E1000_RCTL_SZ_512;
+ break;
+ default:
+ srrctl = ALIGN(adapter->rx_buffer_len, 1024)
+ >> E1000_SRRCTL_BSIZEPKT_SHIFT;
+ break;
}
/* 82575 and greater support packet-split where the protocol
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment
2008-12-10 2:41 [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes Jeff Kirsher
@ 2008-12-10 2:42 ` Jeff Kirsher
2008-12-10 9:11 ` David Miller
2008-12-10 9:09 ` [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2008-12-10 2:42 UTC (permalink / raw)
To: davem; +Cc: netdev, jeff, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
When running in a virtual environment the ports of an 82575/6 can appear to
be single function devices which is not correct. To resolve this we rely
on the function number stored in the status register.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/e1000_mac.c | 18 ++++++------------
drivers/net/igb/e1000_regs.h | 4 ++++
drivers/net/igb/igb_ethtool.c | 2 --
3 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index e18747c..137269d 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -83,8 +83,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
{
struct e1000_bus_info *bus = &hw->bus;
s32 ret_val;
- u32 status;
- u16 pcie_link_status, pci_header_type;
+ u32 reg;
+ u16 pcie_link_status;
bus->type = e1000_bus_type_pci_express;
bus->speed = e1000_bus_speed_2500;
@@ -99,14 +99,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
PCIE_LINK_WIDTH_MASK) >>
PCIE_LINK_WIDTH_SHIFT);
- igb_read_pci_cfg(hw, PCI_HEADER_TYPE_REGISTER, &pci_header_type);
- if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
- status = rd32(E1000_STATUS);
- bus->func = (status & E1000_STATUS_FUNC_MASK)
- >> E1000_STATUS_FUNC_SHIFT;
- } else {
- bus->func = 0;
- }
+ reg = rd32(E1000_STATUS);
+ bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
return 0;
}
@@ -229,8 +223,8 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
if (!hw->mac.disable_av)
rar_high |= E1000_RAH_AV;
- array_wr32(E1000_RA, (index << 1), rar_low);
- array_wr32(E1000_RA, ((index << 1) + 1), rar_high);
+ wr32(E1000_RAL(index), rar_low);
+ wr32(E1000_RAH(index), rar_high);
}
/**
diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
index 95523af..bdf5d83 100644
--- a/drivers/net/igb/e1000_regs.h
+++ b/drivers/net/igb/e1000_regs.h
@@ -221,6 +221,10 @@
#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
#define E1000_RA 0x05400 /* Receive Address - RW Array */
#define E1000_RA2 0x054E0 /* 2nd half of receive address array - RW Array */
+#define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
+ (0x054E0 + ((_i - 16) * 8)))
+#define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
+ (0x054E4 + ((_i - 16) * 8)))
#define E1000_VFTA 0x05600 /* VLAN Filter Table Array - RW Array */
#define E1000_VMD_CTL 0x0581C /* VMDq Control - RW */
#define E1000_WUC 0x05800 /* Wakeup Control - RW */
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index d5efbcc..3c831f1 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -494,8 +494,6 @@ static void igb_get_regs(struct net_device *netdev,
/* These should probably be added to e1000_regs.h instead */
#define E1000_PSRTYPE_REG(_i) (0x05480 + ((_i) * 4))
- #define E1000_RAL(_i) (0x05400 + ((_i) * 8))
- #define E1000_RAH(_i) (0x05404 + ((_i) * 8))
#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes
2008-12-10 2:41 [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes Jeff Kirsher
2008-12-10 2:42 ` [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment Jeff Kirsher
@ 2008-12-10 9:09 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2008-12-10 9:09 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, jeff, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 09 Dec 2008 18:41:57 -0800
> As we begin to move into virtualization the use of a global value for
> buffer sizes becomes undesirable. This change makes it so only 256 and 512
> byte buffers require use of the RCTL register.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment
2008-12-10 2:42 ` [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment Jeff Kirsher
@ 2008-12-10 9:11 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2008-12-10 9:11 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, jeff, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 09 Dec 2008 18:42:16 -0800
> When running in a virtual environment the ports of an 82575/6 can appear to
> be single function devices which is not correct. To resolve this we rely
> on the function number stored in the status register.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Also applied, thanks!
I noticed that there is a LRO Kconfig option for this driver.
That should be eliminated and LRO enabled by default since
for the cases where LRO causes trouble (routing, bridging,
etc.) we'll make ethtool calls to disable LRO on the device.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-10 9:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 2:41 [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes Jeff Kirsher
2008-12-10 2:42 ` [NET-NEXT PATCH 2/2] igb: Correctly determine pci-e function number in virtual environment Jeff Kirsher
2008-12-10 9:11 ` David Miller
2008-12-10 9:09 ` [NET-NEXT PATCH 1/2] igb: update handling of RCTL for smaller buffer sizes 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).