DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Maxime Gouin <maxime.gouin@6wind.com>, dev@dpdk.org
Cc: Heinrich Kuhn <heinrich.kuhn@corigine.com>,
	Alejandro Lucero <alejandro.lucero@netronome.com>,
	Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address
Date: Tue, 11 Jan 2022 14:46:57 +0000	[thread overview]
Message-ID: <585db764-26a3-6297-98b8-08301301fcf9@redhat.com> (raw)
In-Reply-To: <20220105103203.7166-1-maxime.gouin@6wind.com>

On 05/01/2022 10:32, Maxime Gouin wrote:
> reported by code analysis tool C++test (version 10.4):
> 
>> /build/dpdk-20.11/drivers/net/nfp/nfp_net.c
>> 546   Conditions "(hw->ctrl &NFP_NET_CFG_CTRL_ENABLE) &&
>          !! (hw->cap &NFP_NET_CFG_C" is always evaluated to false
>> 547   Condition "! (hw->cap &NFP_NET_CFG_C" is always evaluated to false
> 
> The previous "if" checks exactly the same condition. Removal of duplicate
> code.
> 
> Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change")
> 

Cc: stable@dpdk.org

> Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>

Acked-by: Kevin Traynor <ktraynor@redhat.com>

> ---
>   drivers/net/nfp/nfp_common.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
> index f8978e803a0f..b26770dbfbe4 100644
> --- a/drivers/net/nfp/nfp_common.c
> +++ b/drivers/net/nfp/nfp_common.c
> @@ -280,10 +280,6 @@ nfp_set_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
>   		return -EBUSY;
>   	}
>   
> -	if ((hw->ctrl & NFP_NET_CFG_CTRL_ENABLE) &&
> -	    !(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR))
> -		return -EBUSY;
> -
>   	/* Writing new MAC to the specific port BAR address */
>   	nfp_net_write_mac(hw, (uint8_t *)mac_addr);
>   
> 


      parent reply	other threads:[~2022-01-11 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 10:32 Maxime Gouin
2022-01-05 10:32 ` [PATCH 2/2] net/nfp: remove useless range checks Maxime Gouin
2022-01-11 14:54   ` Kevin Traynor
2022-01-21 14:39     ` Ferruh Yigit
2022-01-11 14:46 ` Kevin Traynor [this message]

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=585db764-26a3-6297-98b8-08301301fcf9@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=dev@dpdk.org \
    --cc=heinrich.kuhn@corigine.com \
    --cc=maxime.gouin@6wind.com \
    --cc=olivier.matz@6wind.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).