From owner-svn-src-all@freebsd.org Thu Oct 31 15:38:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E742F15D031; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qGd5bpYz4TGs; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43AC24C73; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFcHIo053036; Thu, 31 Oct 2019 15:38:17 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFcHPE053035; Thu, 31 Oct 2019 15:38:17 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311538.x9VFcHPE053035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354218 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 15:38:18 -0000 Author: mw Date: Thu Oct 31 15:38:17 2019 New Revision: 354218 URL: https://svnweb.freebsd.org/changeset/base/354218 Log: 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 Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:16:10 2019 (r354217) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:38:17 2019 (r354218) @@ -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)) {