/[linux-patches]/genpatches-2.6/trunk/2.6.16/2401_sky2-jumbo-packets.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.16/2401_sky2-jumbo-packets.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 474 - (show annotations) (download) (as text)
Sat May 27 10:48:41 2006 UTC (14 years, 5 months ago) by dsd
File MIME type: text/x-diff
File size: 1848 byte(s)
sky2 jumbo packet bugfix
1 From: Stephen Hemminger <shemminger@osdl.org>
2 Date: Mon, 22 May 2006 19:03:42 +0000 (-0700)
3 Subject: [PATCH] sky2: fix jumbo packet support
4 X-Git-Tag: v2.6.17-rc5
5 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a1433ac4ab46fb23ae77804c207a1f710a7b12f1
6
7 [PATCH] sky2: fix jumbo packet support
8
9 The truncate threshold calculation to prevent receiver from getting stuck
10 was incorrect, and it didn't take into account the upper limit on bits
11 in the register so the jumbo packet support was broken.
12
13 Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
14 Signed-off-by: Jeff Garzik <jeff@garzik.org>
15 ---
16
17 --- a/drivers/net/sky2.c
18 +++ b/drivers/net/sky2.c
19 @@ -979,6 +979,7 @@ static int sky2_rx_start(struct sky2_por
20 struct sky2_hw *hw = sky2->hw;
21 unsigned rxq = rxqaddr[sky2->port];
22 int i;
23 + unsigned thresh;
24
25 sky2->rx_put = sky2->rx_next = 0;
26 sky2_qset(hw, rxq);
27 @@ -1003,9 +1004,21 @@ static int sky2_rx_start(struct sky2_por
28 sky2_rx_add(sky2, re->mapaddr);
29 }
30
31 - /* Truncate oversize frames */
32 - sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8);
33 - sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
34 +
35 + /*
36 + * The receiver hangs if it receives frames larger than the
37 + * packet buffer. As a workaround, truncate oversize frames, but
38 + * the register is limited to 9 bits, so if you do frames > 2052
39 + * you better get the MTU right!
40 + */
41 + thresh = (sky2->rx_bufsize - 8) / sizeof(u32);
42 + if (thresh > 0x1ff)
43 + sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF);
44 + else {
45 + sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), thresh);
46 + sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
47 + }
48 +
49
50 /* Tell chip about available buffers */
51 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);

  ViewVC Help
Powered by ViewVC 1.1.20