DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Muhammad Jawad Hussain <jawad.hussain@emumba.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] examples/ethtool: adds promiscuous mode functionality
Date: Mon, 3 Jul 2023 15:08:00 -0700	[thread overview]
Message-ID: <20230703150800.272e1a90@hermes.local> (raw)
In-Reply-To: <20220811094508.97467-1-jawad.hussain@emumba.com>

On Thu, 11 Aug 2022 14:45:08 +0500
Muhammad Jawad Hussain <jawad.hussain@emumba.com> 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.

  parent reply	other threads:[~2023-07-03 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  5:50 [PATCH] " Muhammad Jawad Hussain
2022-08-11  9:45 ` [PATCH v2] " Muhammad Jawad Hussain
2022-08-22  5:31   ` Muhammad Jawad Hussain
2023-07-03 22:08   ` Stephen Hemminger [this message]
2022-05-29 14:28 Muhammad Jawad Hussain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230703150800.272e1a90@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jawad.hussain@emumba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).