From patchwork Fri Oct 27 14:32:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 133505 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53B9A43217; Fri, 27 Oct 2023 16:32:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E3BA40291; Fri, 27 Oct 2023 16:32:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 45EAC40279 for ; Fri, 27 Oct 2023 16:32:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698417174; 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=jQvchgkVWaxvAebte7IX8X5lC4GQlY8uc/G3Uc0BOm4=; b=fbq3E4ITFK+oUwV9ef7hOVJMKfI69QHTocaABjefKDX/QGd+ox2d3yen/tYuoW0xGFz5Vp lpnz4qDpFzMk/pNCl8DW03nJ8G1Yv2zGWExftoIna+b7iZJzuBxWYBBroY/pB5RprzfRYv pA4RcW5d93opXdnrGOuy4imSuk1NrQA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-uoN9Fjq9NkWXg6M4yQmXYA-1; Fri, 27 Oct 2023 10:32:51 -0400 X-MC-Unique: uoN9Fjq9NkWXg6M4yQmXYA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF448101A53B; Fri, 27 Oct 2023 14:32:50 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEEB040C6F79; Fri, 27 Oct 2023 14:32:49 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Ciara Loftus , Qi Zhang , Ferruh Yigit , Frank Du Subject: [PATCH] net/af_xdp: avoid error log for virtual interfaces Date: Fri, 27 Oct 2023 16:32:41 +0200 Message-ID: <20231027143241.538670-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For virtual interfaces, like a veth or a tap used in OVS unit tests, plugging a af_xdp port on them results in an error level message: dpdk|ERR|EAL: eal_parse_sysfs_value(): cannot open sysfs value /sys/class/net/ovs-tap1/device/numa_node netdev_dpdk|INFO|Device 'net_af_xdptap1,iface=ovs-tap1' attached to DPDK Avoid this error by checking if the sysfs file exists, like what is done in DPDK bus drivers using eal_parse_sysfs_value(). Fixes: 3d28387cbc48 ("net/af_xdp: parse NUMA node ID from sysfs") Signed-off-by: David Marchand Acked-by: Ferruh Yigit --- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 0cc51223ba..353c8688ec 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -2399,7 +2399,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev) snprintf(numa_path, sizeof(numa_path), "/sys/class/net/%s/device/numa_node", if_name); - if (eal_parse_sysfs_value(numa_path, &numa) != 0) + if (access(numa_path, R_OK) != 0 || eal_parse_sysfs_value(numa_path, &numa) != 0) dev->device.numa_node = rte_socket_id(); else dev->device.numa_node = numa;