diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-02-22 12:26:10 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-03-04 12:58:42 -0500 |
commit | 65f0b417dee94f779ce9b77102b7d73c93723b39 (patch) | |
tree | 390279203a8c73a986d15be5cc30f9bb2e95c1e8 /drivers/net/sfc/mcdi.c | |
parent | 6d84b986b26bac1d4d678ff10c10a633bf53f834 (diff) |
sfc: Use write-combining to reduce TX latency
Based on work by Neil Turton <nturton@solarflare.com> and
Kieran Mansley <kmansley@solarflare.com>.
The BIU has now been verified to handle 3- and 4-dword writes within a
single 128-bit register correctly. This means we can enable write-
combining and only insert write barriers between writes to distinct
registers.
This has been observed to save about 0.5 us when pushing a TX
descriptor to an empty TX queue.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/mcdi.c')
-rw-r--r-- | drivers/net/sfc/mcdi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 8bba8955f310..5e118f0d2479 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
@@ -94,14 +94,15 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd, | |||
94 | 94 | ||
95 | efx_writed(efx, &hdr, pdu); | 95 | efx_writed(efx, &hdr, pdu); |
96 | 96 | ||
97 | for (i = 0; i < inlen; i += 4) | 97 | for (i = 0; i < inlen; i += 4) { |
98 | _efx_writed(efx, *((__le32 *)(inbuf + i)), pdu + 4 + i); | 98 | _efx_writed(efx, *((__le32 *)(inbuf + i)), pdu + 4 + i); |
99 | 99 | /* use wmb() within loop to inhibit write combining */ | |
100 | /* Ensure the payload is written out before the header */ | 100 | wmb(); |
101 | wmb(); | 101 | } |
102 | 102 | ||
103 | /* ring the doorbell with a distinctive value */ | 103 | /* ring the doorbell with a distinctive value */ |
104 | _efx_writed(efx, (__force __le32) 0x45789abc, doorbell); | 104 | _efx_writed(efx, (__force __le32) 0x45789abc, doorbell); |
105 | wmb(); | ||
105 | } | 106 | } |
106 | 107 | ||
107 | static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen) | 108 | static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen) |