From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C04BAA0542; Thu, 10 Nov 2022 17:22:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99A5240150; Thu, 10 Nov 2022 17:22:00 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id EB07C400EF for ; Thu, 10 Nov 2022 17:21:58 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id j12so1780324plj.5 for ; Thu, 10 Nov 2022 08:21:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=0S4TqK726GDUmO0R+xbVjT8BrAYDbp0IAxFsMsalo3g=; b=SyeXqe6uS/wNm6fc6lKUOF4jnGklUx2a0Sk5361fi1oajaDDYu1eQK6MsP9CaVCe71 JHwGx9qrneNAad/+sXrUY2Pqf0kIeWBTYUbsAlgiOm3m9o8pf5oSON5p9+1806salfYn UREUn1nKzk56vcQbd3j4SlU4/9mjJIjYiaKYoQVaaP1y4zWRzqIInlHGaQwSJd9nS7ZQ d9fuRfCRkmrxXzr+eBcXY89SwIQ1z3LactUV6qmpMDjP7VZTIu1/AdlIFCGlEoJZLZAj 4GgQxwMRvbjZVpKxOAzUjqpIkXxJYMPBhAMQ5P1ncjPGEShtCzLuJhpc26hf1azWqCZJ /oqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0S4TqK726GDUmO0R+xbVjT8BrAYDbp0IAxFsMsalo3g=; b=oWTULfx0CCgzx6zQg2uqNH0mhdKTvRfPz5Hsc9Hs5S5J9sSxuhzrcAsOTwtIhvNnJK yVv53WNQzyRJPbLJnW3ZspSLaHlNjsQzokva2/B4mMIxkdLAwv2n33sde5Mrk8bidv0E K6/Dw+zOGFvquPXRrTXZcVlDa8AjOZkH1hNgD6KMDI8QZj+jMs1rgcJAgKxG2B6FG3CL BSgV1s77WjPK59kEGUOBqxojsFMA77T331z9r0bttkWgEE/r4BnpFf3i76gX4QUV/dDs SYg4Gahfb9A7lC4bOzq7vb2CbP1sWjay2wZxQNiIS40bAdxamqx8jfp8Ecssd+SDYrnX bDUQ== X-Gm-Message-State: ACrzQf1IMlxqIV00TTWLvjQd1u6oqwmZeOYbuj6s4BPCIrnufby7kZAN DVwzprNRgu9C+EfB6YPJjaJCCQ== X-Google-Smtp-Source: AMsMyM5VVLMfOHtEc+nNkjiachnX7dIqm+Qaxbix73vdXYTpH8n0r8sZG4aIKqKN1BEb8QGycy3f0Q== X-Received: by 2002:a17:90b:4b4e:b0:214:9b2:423c with SMTP id mi14-20020a17090b4b4e00b0021409b2423cmr50261918pjb.125.1668097318122; Thu, 10 Nov 2022 08:21:58 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id w13-20020a1709027b8d00b00186c5e8b1d0sm11328965pll.149.2022.11.10.08.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 08:21:57 -0800 (PST) Date: Thu, 10 Nov 2022 08:21:54 -0800 From: Stephen Hemminger To: Bing Zhao Cc: , , , , Subject: Re: [PATCH] common/mlx5: fix the sysfs port name translation Message-ID: <20221110082154.118781cd@hermes.local> In-Reply-To: <20221110155726.649190-1-bingz@nvidia.com> References: <20221110155726.649190-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 10 Nov 2022 17:57:26 +0200 Bing Zhao wrote: > With some OFED or upstream kernel of mlx5, the port name fetched from > "/sys/class/net/[DEV]/phys_port_name" may have a tailing "\n" as the > EOL. The sscanf() will return the scanned items number with this EOL. Why not fix the DPDK driver to strip off the new line when the port name is read? The code in mlx5_os.c should do it there.