From kevin at tyndur.org Sun Feb 13 22:31:56 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 13 Feb 2011 22:31:56 +0100 Subject: [cdi-devel] [PATCH] e1000: Fix receive buffer size Message-ID: <1297632716-13473-1-git-send-email-kevin@tyndur.org> We use receive buffers of 1536 bytes, but tell the NIC that the buffer size is 2048. Probably not a good idea. While at it, make the buffer size setting in RCTL explicit, even though it's just a zero. Signed-off-by: Kevin Wolf --- e1000/device.c | 3 ++- e1000/device.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e1000/device.c b/e1000/device.c index 6ce814c..c817cc2 100644 --- a/e1000/device.c +++ b/e1000/device.c @@ -323,7 +323,8 @@ static void reset_nic(struct e1000_device* netcard) netcard->rx_cur_buffer = 0; // Rx/Tx aktivieren - reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST); + reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST + | RCTL_2K_BUFSIZE); reg_outl(netcard, REG_TX_CTL, TCTL_ENABLE | TCTL_PADDING | TCTL_COLL_TSH | TCTL_COLL_DIST); } diff --git a/e1000/device.h b/e1000/device.h index af614c2..1fd1750 100644 --- a/e1000/device.h +++ b/e1000/device.h @@ -83,6 +83,7 @@ enum { enum { RCTL_ENABLE = (1 << 1), RCTL_BROADCAST = (1 << 15), /* BAM */ + RCTL_2K_BUFSIZE = (0 << 16), /* BSIZE */ }; enum { @@ -127,7 +128,7 @@ enum { #define TX_BUFFER_SIZE 2048 //#define TX_BUFFER_NUM 64 -#define RX_BUFFER_SIZE 1536 +#define RX_BUFFER_SIZE 2048 //#define RX_BUFFER_NUM 64 // Die Anzahl von Deskriptoren muss jeweils ein vielfaches von 8 sein -- 1.6.0.2 From redelman at gmail.com Mon Feb 14 00:24:11 2011 From: redelman at gmail.com (Rich Edelman) Date: Sun, 13 Feb 2011 17:24:11 -0600 Subject: [cdi-devel] [PATCH] e1000: Fix receive buffer size In-Reply-To: <1297632716-13473-1-git-send-email-kevin@tyndur.org> References: <1297632716-13473-1-git-send-email-kevin@tyndur.org> Message-ID: Looks good to me. Acked-by: Rich Edelman On Sun, Feb 13, 2011 at 3:31 PM, Kevin Wolf wrote: > We use receive buffers of 1536 bytes, but tell the NIC that the buffer > size is 2048. Probably not a good idea. > > While at it, make the buffer size setting in RCTL explicit, even though > it's just a zero. > > Signed-off-by: Kevin Wolf > --- > ?e1000/device.c | ? ?3 ++- > ?e1000/device.h | ? ?3 ++- > ?2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/e1000/device.c b/e1000/device.c > index 6ce814c..c817cc2 100644 > --- a/e1000/device.c > +++ b/e1000/device.c > @@ -323,7 +323,8 @@ static void reset_nic(struct e1000_device* netcard) > ? ? netcard->rx_cur_buffer = 0; > > ? ? // Rx/Tx aktivieren > - ? ?reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST); > + ? ?reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST > + ? ? ? ?| RCTL_2K_BUFSIZE); > ? ? reg_outl(netcard, REG_TX_CTL, TCTL_ENABLE | TCTL_PADDING > ? ? ? ? | TCTL_COLL_TSH | TCTL_COLL_DIST); > ?} > diff --git a/e1000/device.h b/e1000/device.h > index af614c2..1fd1750 100644 > --- a/e1000/device.h > +++ b/e1000/device.h > @@ -83,6 +83,7 @@ enum { > ?enum { > ? ? RCTL_ENABLE ? ? = (1 << ?1), > ? ? RCTL_BROADCAST ?= (1 << 15), /* BAM */ > + ? ?RCTL_2K_BUFSIZE = (0 << 16), /* BSIZE */ > ?}; > > ?enum { > @@ -127,7 +128,7 @@ enum { > ?#define TX_BUFFER_SIZE ?2048 > ?//#define TX_BUFFER_NUM ? 64 > > -#define RX_BUFFER_SIZE ?1536 > +#define RX_BUFFER_SIZE ?2048 > ?//#define RX_BUFFER_NUM ? 64 > > ?// Die Anzahl von Deskriptoren muss jeweils ein vielfaches von 8 sein > -- > 1.6.0.2 > > _______________________________________________ > cdi-devel mailing list > cdi-devel at tyndur.org > http://list.tyndur.org/cgi-bin/mailman/listinfo/cdi-devel >