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 DBACF42DC6; Tue, 4 Jul 2023 00:08:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B159F40F18; Tue, 4 Jul 2023 00:08:04 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 4917B40E03 for ; Tue, 4 Jul 2023 00:08:03 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-262ec7b261bso3685938a91.3 for ; Mon, 03 Jul 2023 15:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688422082; x=1691014082; 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=id06t3TMEKxEIUdPFLG6tQjjrFiDVWVxezpNo94drRQ=; b=HsVpcQEtTOYL6xpzxHZPeN+0JrT3/sEFKrmrwgmBb/wDcojdP9YfMbQ2rJX8jrZ8bO GWBIzYNpJ262EeTFeUbw1OvItYKSiw/3/oznjqZDXQadY1P/++5wVy+jFj3TSZlgKMK1 7WYlZ3MO1vq6jM8KwW5AIb9nWHuY2iC5+Pvfj5B4nypmgtcCgWiD75iWOIL3PCtPAbWD nuD93hXXG9GT8TlqsdEx+KzWS10kyi32zS6rp2ZZstW6PNCthp5oKa5JvdfPJlyV6i9z tisBuZKBC9s0Ib8v4Kv0eiK9Zc/O3bnIA5EDJBxf/Le3EyJqx8i6oie+yve/ZjTTq2BL MwoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688422082; x=1691014082; 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=id06t3TMEKxEIUdPFLG6tQjjrFiDVWVxezpNo94drRQ=; b=jQ11UuxnxUB6j0V/Vq/rRe/umrrSsq0/hf1l1yg3dAv02q8dMLDPUz0iEw+8KRexer QM089wHRmTN2GE5O+5tOE/Go2bMKEzsAfdIrUAYMCmiRq7wMbtQFGRtssu/a/WyQBkux /4TKhLPWFMdnjX827DrX0XPWL+9ZeqdXa6qMvwf1YuYZOZ3Xq1cYLtl6ymdFIFaqMWvI YImxkRfg4b9J5kUKcCvG+/KFUKAyBMikY0JECU0cU1HLsqC3q5uoFEtNwP40jeEx9fUs /VJ8RYXnAJlWaWoLhblY+9kd4EDt9akSdV6L+kbxE+QbY6knyCKTno7Kjy1mZNYnEYI1 i0rg== X-Gm-Message-State: ABy/qLZhFqFwpe6sAkazbv4gr7hRUyDcuETRtfnQc+4CTO0H0wRDpFys Of3RaWzTKyGAJuG6hr+3mFB0+CkYoNo9ridz7NE= X-Google-Smtp-Source: APBJJlEfa6dkET0Myqmqdh0rg6R46b2g6flCVn9x2fqxnGsZbawGusC4M4/al0p7izRdXuLpDksiew== X-Received: by 2002:a17:902:748c:b0:1b8:73a4:706a with SMTP id h12-20020a170902748c00b001b873a4706amr10014081pll.69.1688422082309; Mon, 03 Jul 2023 15:08:02 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id d3-20020a170902b70300b001b3d6c86ffdsm15750063pls.156.2023.07.03.15.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 15:08:02 -0700 (PDT) Date: Mon, 3 Jul 2023 15:08:00 -0700 From: Stephen Hemminger To: Muhammad Jawad Hussain Cc: dev@dpdk.org Subject: Re: [PATCH v2] examples/ethtool: adds promiscuous mode functionality Message-ID: <20230703150800.272e1a90@hermes.local> In-Reply-To: <20220811094508.97467-1-jawad.hussain@emumba.com> References: <20220525055042.123144-1-jawad.hussain@emumba.com> <20220811094508.97467-1-jawad.hussain@emumba.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, 11 Aug 2022 14:45:08 +0500 Muhammad Jawad Hussain wrote: > > > +int > +eth_set_promisc_mode(uint16_t port, int enable) > +{ > + int ret; > + > + > + if (enable) > + ret = rte_eth_promiscuous_enable(port); > + else > + ret = rte_eth_promiscuous_disable(port); > + > + if (ret != 0) { > + fprintf(stderr, > + "Error during %s promiscuous mode for port %u: %s\n", > + enable ? "enabling" : "disabling", > + port, rte_strerror(-ret)); > + return 0; > + } else > + return 1; > +} > + > + > + > + Some minor comments: 1. The naming convention in ethtool should be followed. This should be named: rte_ethtool_set_promisc_mode 2. Indentation is wrong for the "return 0" part 3. Lots of useless extra blank lines, one will do fine. Overall, the idea is fine, but almost no one cares about the ethtool example. That is why no one reviewed or acked it.