* [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance
@ 2009-02-24 23:40 Jeff Kirsher
2009-02-24 23:40 ` [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames Jeff Kirsher
2009-02-25 0:37 ` [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Jeff Kirsher @ 2009-02-24 23:40 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Peter P Waskiewicz Jr, Jeff Kirsher
From: Shannon Nelson <shannon.nelson@intel.com>
The ring_feature member of ixgbe_adapter is statically allocated based on
the supported features of the device. When a new feature is added, we need
to manually update the static allocation. This patch makes the feature
list an enum, eliminating the need for multiple updates to the code when
adding a new feature.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index e98ace8..c0e56aa 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -148,9 +148,15 @@ struct ixgbe_ring {
u16 rx_buf_len;
};
-#define RING_F_DCB 0
-#define RING_F_VMDQ 1
-#define RING_F_RSS 2
+enum ixgbe_ring_f_enum {
+ RING_F_NONE = 0,
+ RING_F_DCB,
+ RING_F_VMDQ,
+ RING_F_RSS,
+
+ RING_F_ARRAY_SIZE /* must be last in enum set */
+};
+
#define IXGBE_MAX_DCB_INDICES 8
#define IXGBE_MAX_RSS_INDICES 16
#define IXGBE_MAX_VMDQ_INDICES 16
@@ -249,7 +255,7 @@ struct ixgbe_adapter {
u64 non_eop_descs;
int num_msix_vectors;
int max_msix_q_vectors; /* true count of q_vectors for device */
- struct ixgbe_ring_feature ring_feature[3];
+ struct ixgbe_ring_feature ring_feature[RING_F_ARRAY_SIZE];
struct msix_entry *msix_entries;
u64 rx_hdr_split;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames
2009-02-24 23:40 [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance Jeff Kirsher
@ 2009-02-24 23:40 ` Jeff Kirsher
2009-02-25 0:37 ` David Miller
2009-02-25 0:37 ` [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Kirsher @ 2009-02-24 23:40 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Breno Leitao, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
it was pointed out on the list that ixgbe was failing when using 64kB pages
and large 16kB MTU.
since with a 64kB PAGE_SIZE MAX_SKB_FRAGS = 3, the way the driver was
configuring page usage was assuming 2kB is half a page, and was only
ever dmaing that much data to a half page.
(16kB - header size) / 2048 = 7 or 8 pages, which would far exceed 3
adjust the driver to account for these large pages, the hardware can
support DMA to up to 16kB for each descriptor.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 1 +
drivers/net/ixgbe/ixgbe_main.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index c0e56aa..2d877da 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -71,6 +71,7 @@
#define IXGBE_RXBUFFER_128 128 /* Used for packet split */
#define IXGBE_RXBUFFER_256 256 /* Used for packet split */
#define IXGBE_RXBUFFER_2048 2048
+#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */
#define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e0d736c..6564235 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1550,7 +1550,14 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index)
srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
- srrctl |= IXGBE_RXBUFFER_2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
+ u16 bufsz = IXGBE_RXBUFFER_2048;
+ /* grow the amount we can receive on large page machines */
+ if (bufsz < (PAGE_SIZE / 2))
+ bufsz = (PAGE_SIZE / 2);
+ /* cap the bufsz at our largest descriptor size */
+ bufsz = min((u16)IXGBE_MAX_RXBUFFER, bufsz);
+
+ srrctl |= bufsz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
srrctl |= ((IXGBE_RX_HDR_SIZE <<
IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) &
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance
2009-02-24 23:40 [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance Jeff Kirsher
2009-02-24 23:40 ` [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames Jeff Kirsher
@ 2009-02-25 0:37 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2009-02-25 0:37 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, peter.p.waskiewicz.jr
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 24 Feb 2009 15:40:37 -0800
> From: Shannon Nelson <shannon.nelson@intel.com>
>
> The ring_feature member of ixgbe_adapter is statically allocated based on
> the supported features of the device. When a new feature is added, we need
> to manually update the static allocation. This patch makes the feature
> list an enum, eliminating the need for multiple updates to the code when
> adding a new feature.
>
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
I would appreciate it if, in the future, Shannon would signoff his
patches :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames
2009-02-24 23:40 ` [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames Jeff Kirsher
@ 2009-02-25 0:37 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-02-25 0:37 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg, leitao
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 24 Feb 2009 15:40:56 -0800
> it was pointed out on the list that ixgbe was failing when using 64kB pages
> and large 16kB MTU.
>
> since with a 64kB PAGE_SIZE MAX_SKB_FRAGS = 3, the way the driver was
> configuring page usage was assuming 2kB is half a page, and was only
> ever dmaing that much data to a half page.
>
> (16kB - header size) / 2048 = 7 or 8 pages, which would far exceed 3
>
> adjust the driver to account for these large pages, the hardware can
> support DMA to up to 16kB for each descriptor.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance
[not found] <A78C6259B11833419567082E2DC0C256C3A9A322@orsmsx508.amr.corp.intel.com>
@ 2009-02-25 1:26 ` Nelson, Shannon
0 siblings, 0 replies; 5+ messages in thread
From: Nelson, Shannon @ 2009-02-25 1:26 UTC (permalink / raw)
To: Kirsher, Jeffrey T, Waskiewicz Jr, Peter P, davem@davemloft.net
Cc: netdev@vger.kernel.org
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Tuesday, February 24, 2009 4:37 PM
>To: Kirsher, Jeffrey T
>Cc: netdev@vger.kernel.org; gospo@redhat.com; Waskiewicz Jr, Peter P
>Subject: Re: [net-next PATCH 1/2] ixgbe: Move ring features
>into an enum, allowing easier future maintenance
>
>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>Date: Tue, 24 Feb 2009 15:40:37 -0800
>
>> From: Shannon Nelson <shannon.nelson@intel.com>
>>
>> The ring_feature member of ixgbe_adapter is statically
>allocated based on
>> the supported features of the device. When a new feature is
>added, we need
>> to manually update the static allocation. This patch makes
>the feature
>> list an enum, eliminating the need for multiple updates to
>the code when
>> adding a new feature.
>>
>> Signed-off-by: Peter P Waskiewicz Jr
><peter.p.waskiewicz.jr@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
>Applied.
>
>I would appreciate it if, in the future, Shannon would signoff his
>patches :-)
>
Perhaps a little after the fact, but does this help? I didn't expect to get credit - they haven't given me credit for my other little tweaks. Usually I get to remain anonymous...
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-25 1:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 23:40 [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance Jeff Kirsher
2009-02-24 23:40 ` [net-next PATCH 2/2] ixbge: fix bug when using large pages and jumbo frames Jeff Kirsher
2009-02-25 0:37 ` David Miller
2009-02-25 0:37 ` [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance David Miller
[not found] <A78C6259B11833419567082E2DC0C256C3A9A322@orsmsx508.amr.corp.intel.com>
2009-02-25 1:26 ` Nelson, Shannon
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).