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 61B9242D98; Fri, 30 Jun 2023 19:59:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB223410FC; Fri, 30 Jun 2023 19:59:21 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 00B4640EDB for ; Fri, 30 Jun 2023 19:59:19 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1b7fef01fe4so15641515ad.0 for ; Fri, 30 Jun 2023 10:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688147959; x=1690739959; 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=ZZ6i3cKVxuMtuaagWDtt3tWHNSqG6CwYTbdps5g29Jw=; b=W6DZZyIEqQxMd0JNOQRpBIiKkv8++sh1rtcUD1xRiEHLu1qKNMVyzAcpDe13aD/Cpk o5Nia8dCRI1wjILVyWgCM/i0Y9ZVfhnAF0eHVurtoZ+EOksexS6rbAKrFfA9uGPZw1al LSA1O3jGcSTLF4tMCUvz7F/BjpgwX/duCMHLPMqWN4TgvFpS6xpuhNP/SAXxfeT+8h3T 8SDN5HhU1k+F45Iq8K+fqT71iuqEVJo1Ez0BRxYAxvdjI9IvDs5gUxApaqqhT1+OOsaz W489qJ/u17qJHVz57Xr+8eWGQlXQF1WiKtUTosELBwal98AuYtlc7IMd8eHpn5g7qyYU m2Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688147959; x=1690739959; 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=ZZ6i3cKVxuMtuaagWDtt3tWHNSqG6CwYTbdps5g29Jw=; b=CrK4AlG7X0nHHu5NjquH0tgQNKZd/rjK3dRrRcjLnNZDtpH2STVtciKkUPvhFzHcxG 4jGcMnD9+at4vyTsFwi2lM1NUDhId3N3rdzqUEW3bKHPsDXBsG54BrMisJcGYepahPpd pHeTf250IhmQiFjMDtys3eqbq6C88Si/211heEjTK0A6nI86uNIjgpovJUI8MCA6bWpu RTu21GyI8h6BB+ct21togVGrl3bvUIqyZNzaPnXTA3BThhPMCWdOepL5vEAjn75h+URI GjJfEfHU/nlypDyIThPr0oGF6+mU1Mk8o2Crk7zPa+/QcrTE28306KLcJscg9D9wY1cy 1Mvw== X-Gm-Message-State: ABy/qLYM8FW1kvu2rQQI8NK8WQryIZWH+8Q7eN86wTngESxe1nv8ku61 1K7MY5tZGuH9N/qEaqpe5tIHUg== X-Google-Smtp-Source: APBJJlGeSsaVqilU39AQiPA5AqIHFAuChWEm1vAXH1B5dfzsdG27UR95Ypr9GVsC8W7hZaiAu8B70w== X-Received: by 2002:a17:903:22c6:b0:1b8:49af:a719 with SMTP id y6-20020a17090322c600b001b849afa719mr2575363plg.52.1688147959034; Fri, 30 Jun 2023 10:59:19 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id n13-20020a170903110d00b001b5656b0bf9sm10997188plh.286.2023.06.30.10.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 10:59:18 -0700 (PDT) Date: Fri, 30 Jun 2023 10:59:16 -0700 From: Stephen Hemminger To: "Min Hu (Connor)" Cc: , , , , , , , , , Subject: Re: [dpdk-dev] [PATCH 01/10] net/pfe: check return value Message-ID: <20230630105916.090fc4ef@hermes.local> In-Reply-To: <1618839289-33224-2-git-send-email-humin29@huawei.com> References: <1618839289-33224-1-git-send-email-humin29@huawei.com> <1618839289-33224-2-git-send-email-humin29@huawei.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 Mon, 19 Apr 2021 21:34:40 +0800 "Min Hu (Connor)" wrote: > > fd = open("/dev/mem", O_RDWR); > + if (fd < 0) { > + PFE_PMD_ERR("Can not open /dev/mem"); > + rc = -EIO; > + goto err; > + } > + This patch makes sense and should be applied. But the errno is most like EPERM so maybe: rc = -errno; PS: /dev/mem is a bad idea, Linux kernel config often disables it in distributions. Not sure why this driver can't use UIO or VFIO like normal devices. This should have been caught during code review.