aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/sfc/tx.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 283e5f87b09f..65c220f8661d 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -189,18 +189,6 @@ struct efx_short_copy_buffer {
189 u8 buf[L1_CACHE_BYTES]; 189 u8 buf[L1_CACHE_BYTES];
190}; 190};
191 191
192/* Copy in explicit 64-bit writes. */
193static void efx_memcpy_64(void __iomem *dest, void *src, size_t len)
194{
195 u64 *src64 = src;
196 u64 __iomem *dest64 = dest;
197 size_t l64 = len / 8;
198 size_t i;
199
200 for (i = 0; i < l64; i++)
201 writeq(src64[i], &dest64[i]);
202}
203
204/* Copy to PIO, respecting that writes to PIO buffers must be dword aligned. 192/* Copy to PIO, respecting that writes to PIO buffers must be dword aligned.
205 * Advances piobuf pointer. Leaves additional data in the copy buffer. 193 * Advances piobuf pointer. Leaves additional data in the copy buffer.
206 */ 194 */
@@ -210,7 +198,7 @@ static void efx_memcpy_toio_aligned(struct efx_nic *efx, u8 __iomem **piobuf,
210{ 198{
211 int block_len = len & ~(sizeof(copy_buf->buf) - 1); 199 int block_len = len & ~(sizeof(copy_buf->buf) - 1);
212 200
213 efx_memcpy_64(*piobuf, data, block_len); 201 __iowrite64_copy(*piobuf, data, block_len >> 3);
214 *piobuf += block_len; 202 *piobuf += block_len;
215 len -= block_len; 203 len -= block_len;
216 204
@@ -242,7 +230,8 @@ static void efx_memcpy_toio_aligned_cb(struct efx_nic *efx, u8 __iomem **piobuf,
242 if (copy_buf->used < sizeof(copy_buf->buf)) 230 if (copy_buf->used < sizeof(copy_buf->buf))
243 return; 231 return;
244 232
245 efx_memcpy_64(*piobuf, copy_buf->buf, sizeof(copy_buf->buf)); 233 __iowrite64_copy(*piobuf, copy_buf->buf,
234 sizeof(copy_buf->buf) >> 3);
246 *piobuf += sizeof(copy_buf->buf); 235 *piobuf += sizeof(copy_buf->buf);
247 data += copy_to_buf; 236 data += copy_to_buf;
248 len -= copy_to_buf; 237 len -= copy_to_buf;
@@ -257,7 +246,8 @@ static void efx_flush_copy_buffer(struct efx_nic *efx, u8 __iomem *piobuf,
257{ 246{
258 /* if there's anything in it, write the whole buffer, including junk */ 247 /* if there's anything in it, write the whole buffer, including junk */
259 if (copy_buf->used) 248 if (copy_buf->used)
260 efx_memcpy_64(piobuf, copy_buf->buf, sizeof(copy_buf->buf)); 249 __iowrite64_copy(piobuf, copy_buf->buf,
250 sizeof(copy_buf->buf) >> 3);
261} 251}
262 252
263/* Traverse skb structure and copy fragments in to PIO buffer. 253/* Traverse skb structure and copy fragments in to PIO buffer.
@@ -316,8 +306,8 @@ efx_enqueue_skb_pio(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
316 */ 306 */
317 BUILD_BUG_ON(L1_CACHE_BYTES > 307 BUILD_BUG_ON(L1_CACHE_BYTES >
318 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))); 308 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)));
319 efx_memcpy_64(tx_queue->piobuf, skb->data, 309 __iowrite64_copy(tx_queue->piobuf, skb->data,
320 ALIGN(skb->len, L1_CACHE_BYTES)); 310 ALIGN(skb->len, L1_CACHE_BYTES) >> 3);
321 } 311 }
322 312
323 EFX_POPULATE_QWORD_5(buffer->option, 313 EFX_POPULATE_QWORD_5(buffer->option,