aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ena
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@FreeBSD.org>2019-10-31 15:38:17 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2019-10-31 15:38:17 +0000
commit472d4784a87272264078f53af87bda4e2c8b7c8b (patch)
tree88d2cad5b60b5a0c58d325866538989638e3e91c /sys/dev/ena
parenta3da4fc60bc5878d6d48443edd6419f1a2b3efa0 (diff)
downloadsrc-472d4784a87272264078f53af87bda4e2c8b7c8b.tar.gz
src-472d4784a87272264078f53af87bda4e2c8b7c8b.zip
Add WC support for arm64 in the ENA driver
As the pmamp_change_attr() is public on arm64 since r351131, it can be used on the arm64 to map memory range as with the write combined attribute. It requires the driver to use generic VM_MEMATTR_WRITE_COMBINING flag instead of the x86 specific PAT_WRITE_COMBINING. Differential Revision: https://reviews.freebsd.org/D21931 Submitted by: Michal Krawczyk <mk@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc.
Notes
Notes: svn path=/head/; revision=354218
Diffstat (limited to 'sys/dev/ena')
-rw-r--r--sys/dev/ena/ena.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 14e63bdaa8f4..48af655cf982 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -3309,7 +3309,7 @@ ena_calc_io_queue_num(struct ena_adapter *adapter,
static int
ena_enable_wc(struct resource *res)
{
-#if defined(__i386) || defined(__amd64)
+#if defined(__i386) || defined(__amd64) || defined(__aarch64__)
vm_offset_t va;
vm_size_t len;
int rc;
@@ -3317,7 +3317,7 @@ ena_enable_wc(struct resource *res)
va = (vm_offset_t)rman_get_virtual(res);
len = rman_get_size(res);
/* Enable write combining */
- rc = pmap_change_attr(va, len, PAT_WRITE_COMBINING);
+ rc = pmap_change_attr(va, len, VM_MEMATTR_WRITE_COMBINING);
if (unlikely(rc != 0)) {
ena_trace(ENA_ALERT, "pmap_change_attr failed, %d\n", rc);
return (rc);
@@ -4352,14 +4352,6 @@ ena_attach(device_t pdev)
set_default_llq_configurations(&llq_config);
-#if defined(__arm__) || defined(__aarch64__)
- /*
- * Force LLQ disable, as the driver is not supporting WC enablement
- * on the ARM architecture. Using LLQ without WC would affect
- * performance in a negative way.
- */
- ena_dev->supported_features &= ~(1 << ENA_ADMIN_LLQ);
-#endif
rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx.llq,
&llq_config);
if (unlikely(rc != 0)) {