From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E2A6A0350; Mon, 11 May 2020 16:47:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5EC01C197; Mon, 11 May 2020 16:47:35 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 8E0501C133 for ; Mon, 11 May 2020 16:47:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589208454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ksBDZaapoizOtez35a3NDw8VygDphaiyczYJ4RriCEY=; b=PevtCBn7XQ0JIcHwjxzsMGXAZ9xDeEqljVyV+V+Gtw0nkIxQXy6sf+PF0xZ51Krudkbz2H wEFuZUa+pVg8f1n8cQYKeZfwYwUC9dAPow+JJjGlUo8nuVzOijPmNVqTLqyhKaEc0DEE6j V02ahK0wxFm+8uUr851ZAPjeRj6ZPbk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-0yzHr1-lP9ejFYTyzg3rvQ-1; Mon, 11 May 2020 10:47:29 -0400 X-MC-Unique: 0yzHr1-lP9ejFYTyzg3rvQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 141C3107B7CA; Mon, 11 May 2020 14:47:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF3AD25277; Mon, 11 May 2020 14:47:22 +0000 (UTC) From: Maxime Coquelin To: yong.liu@intel.com, xiaolong.ye@intel.com, ferruh.yigit@intel.com, dev@dpdk.org Cc: Maxime Coquelin Date: Mon, 11 May 2020 16:47:20 +0200 Message-Id: <20200511144720.241224-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/virtio: fix AVX512 datapath selection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The AVX512 packed ring datapath selection was only done at build time, but it should also be checked at runtime that the CPU supports it. This patch add a CPU flags check so that non-vectorized path is selected at runtime if AVX512 is not supported. Fixes: ccb10995c2ad ("net/virtio: add election for vectorized path") Signed-off-by: Maxime Coquelin --- drivers/net/virtio/virtio_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 312871cb48..49ccef12c7 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1965,8 +1965,10 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) PMD_DRV_LOG(INFO, "building environment do not support packed ring vectorized"); #else - hw->use_vec_rx = 1; - hw->use_vec_tx = 1; + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) { + hw->use_vec_rx = 1; + hw->use_vec_tx = 1; + } #endif } } -- 2.25.4