diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-09-22 08:27:27 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-09-22 08:27:27 +0000 |
commit | 9fd573c39d61153ea00229a22d52293017a35a9e (patch) | |
tree | 0022e54c289be9c8abb1f440ebe83025dce57741 /sys/dev/oce | |
parent | 2f872218e723d313dbbe8672788eae694d0d17ad (diff) | |
download | src-9fd573c39d61153ea00229a22d52293017a35a9e.tar.gz src-9fd573c39d61153ea00229a22d52293017a35a9e.zip |
Improve transmit sending offload, TSO, algorithm in general.
The current TSO limitation feature only takes the total number of
bytes in an mbuf chain into account and does not limit by the number
of mbufs in a chain. Some kinds of hardware is limited by two
factors. One is the fragment length and the second is the fragment
count. Both of these limits need to be taken into account when doing
TSO. Else some kinds of hardware might have to drop completely valid
mbuf chains because they cannot loaded into the given hardware's DMA
engine. The new way of doing TSO limitation has been made backwards
compatible as input from other FreeBSD developers and will use
defaults for values not set.
Reviewed by: adrian, rmacklem
Sponsored by: Mellanox Technologies
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=271946
Diffstat (limited to 'sys/dev/oce')
-rw-r--r-- | sys/dev/oce/oce_if.c | 4 | ||||
-rw-r--r-- | sys/dev/oce/oce_if.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 3348efc05c76..fe48007e8973 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -1731,7 +1731,9 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); diff --git a/sys/dev/oce/oce_if.h b/sys/dev/oce/oce_if.h index b6db402e7766..bb788413faa0 100644 --- a/sys/dev/oce/oce_if.h +++ b/sys/dev/oce/oce_if.h @@ -152,7 +152,6 @@ extern int mp_ncpus; /* system's total active cpu cores */ #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 |