Unix Technical Forum

some sk(4) improvements

This is a discussion on some sk(4) improvements within the mailing.openbsd.tech forums, part of the OpenBSD category; --> - Fix Yukon ram sizing. - Lower interrupt moderation timer to improve performance. - Keep tx queue running by ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 08:22 AM
Brad
 
Posts: n/a
Default some sk(4) improvements

- Fix Yukon ram sizing.
- Lower interrupt moderation timer to improve performance.
- Keep tx queue running by kicking the tx bmu repeatedly.
- Handle if_timer a bit better.

From NetBSD

Index: if_sk.c
================================================== =================
RCS file: /cvs/src/sys/dev/pci/if_sk.c,v
retrieving revision 1.47
diff -u -p -r1.47 if_sk.c
--- if_sk.c 14 Oct 2004 15:27:39 -0000 1.47
+++ if_sk.c 17 Oct 2004 04:30:39 -0000
@@ -1118,7 +1118,7 @@ void sk_reset(struct sk_softc *sc)
* register represents 18.825ns, so to specify a timeout in
* microseconds, we have to multiply by 54.
*/
- sk_win_write_4(sc, SK_IMTIMERINIT, SK_IM_USECS(200));
+ sk_win_write_4(sc, SK_IMTIMERINIT, SK_IM_USECS(100));
sk_win_write_4(sc, SK_IMMR, SK_ISR_TX1_S_EOF|SK_ISR_TX2_S_EOF|
SK_ISR_RX1_EOF|SK_ISR_RX2_EOF);
sk_win_write_1(sc, SK_IMTIMERCTL, SK_IMCTL_START);
@@ -1528,19 +1528,16 @@ skc_attach(struct device *parent, struct
goto fail;
break;
}
-
- DPRINTFN(2, ("skc_attach: ramsize=%d(%dk), rboff=%d\n",
- sc->sk_ramsize, sc->sk_ramsize / 1024,
- sc->sk_rboff));
} else {
- sc->sk_ramsize = 0x20000;
+ u_int8_t val = sk_win_read_1(sc, SK_EPROM0);
+ sc->sk_ramsize = ( val == 0 ) ? 0x20000 : (( val * 4 )*1024);
sc->sk_rboff = SK_RBOFF_0;
-
- DPRINTFN(2, ("skc_attach: ramsize=%dk (%d), rboff=%d\n",
- sc->sk_ramsize / 1024, sc->sk_ramsize,
- sc->sk_rboff));
}

+ DPRINTFN(2, ("skc_attach: ramsize=%d (%dk), rboff=%d\n",
+ sc->sk_ramsize, sc->sk_ramsize / 1024,
+ sc->sk_rboff));
+
/* Read and save physical media type */
switch(sk_win_read_1(sc, SK_PMDTYPE)) {
case SK_PMD_1000BASESX:
@@ -1949,8 +1946,11 @@ sk_txeof(struct sk_if_softc *sc_if)
}
sc_if->sk_cdata.sk_tx_cnt--;
SK_INC(idx, SK_TX_RING_CNT);
- ifp->if_timer = 0;
}
+ if (sc_if->sk_cdata.sk_tx_cnt == 0)
+ ifp->if_timer = 0;
+ else /* nudge chip to keep tx ring moving */
+ CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START);

sc_if->sk_cdata.sk_tx_cons = idx;

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com