Hi!
This updated patch against current CVS implements TCP segmentation offloading for RTL8139 in C+ mode.
I fixed a couple of problems in implementation (wrong sequence number calculation), and now TCP performance seem to be normal.
Dependency on slirp.h header is now gone.
Again tested with linux (ethtool -K eth0 tx on sg on tso on); please apply.
It turned out that a couple of variable types were left dependent on slirp.h
and transmit/receive pointers were not reset in right places (required for freebsd re driver)
This is an incremental update to fix these problems.
--- hw/rtl8139-20060709-with-working-tso-2.c 2006-07-09 12:41:47.000000000 +0400 +++ hw/rtl8139.c 2006-07-11 01:15:27.000000000 +0400 @@ -40,6 +40,7 @@ * 2006-Jul-09 Igor Kovalenko : Fixed TCP header length calculation while processing * segmentation offloading * Removed slirp.h dependency + * Added rx/tx buffer reset when enabling rx/tx operation */ #include "vl.h" @@ -1368,10 +1369,14 @@ if (val & CmdRxEnb) { DEBUG_PRINT(("RTL8139: ChipCmd enable receiver\n")); + + s->currCPlusRxDesc = 0; } if (val & CmdTxEnb) { DEBUG_PRINT(("RTL8139: ChipCmd enable transmitter\n")); + + s->currCPlusTxDesc = 0; } /* mask unwriteable bits */ @@ -2078,8 +2083,8 @@ /* ip packet header */ ip_header *ip = 0; int hlen = 0; - u_int8_t ip_protocol = 0; - u_int16_t ip_data_len = 0; + uint8_t ip_protocol = 0; + uint16_t ip_data_len = 0; uint8_t *eth_payload_data = 0; size_t eth_payload_len = 0; @@ -2450,8 +2455,6 @@ DEBUG_PRINT(("RTL8139: TxAddr write offset=0x%x val=0x%08x\n", txAddrOffset, val)); s->TxAddr[txAddrOffset/4] = le32_to_cpu(val); - - s->currCPlusTxDesc = 0; } static uint32_t rtl8139_TxAddr_read(RTL8139State *s, uint32_t txAddrOffset)
_______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel