mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wenjia Zhang <wenjia@linux.ibm.com>
To: Guangguan Wang <guangguan.wang@linux.alibaba.com>,
	jaka@linux.ibm.com, kgraul@linux.ibm.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: tonylu@linux.alibaba.com, alibuda@linux.alibaba.com,
	guwen@linux.alibaba.com, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net/smc: bugfix for smcr v2 server connect success statistic
Date: Fri, 8 Sep 2023 11:42:36 +0200	[thread overview]
Message-ID: <be086da3-061d-8f39-6e79-0e5d21771453@linux.ibm.com> (raw)
In-Reply-To: <20230908033143.89489-2-guangguan.wang@linux.alibaba.com>



On 08.09.23 05:31, Guangguan Wang wrote:
> In the macro SMC_STAT_SERV_SUCC_INC, the smcd_version is used
> to determin whether to increase the v1 statistic or the v2
> statistic. It is correct for SMCD. But for SMCR, smcr_version
> should be used.
> 
> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
> ---
>   net/smc/smc_stats.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/smc/smc_stats.h b/net/smc/smc_stats.h
> index b60fe1eb37ab..aa8928975cc6 100644
> --- a/net/smc/smc_stats.h
> +++ b/net/smc/smc_stats.h
> @@ -243,8 +243,9 @@ while (0)
>   #define SMC_STAT_SERV_SUCC_INC(net, _ini) \
>   do { \
>   	typeof(_ini) i = (_ini); \
> -	bool is_v2 = (i->smcd_version & SMC_V2); \
>   	bool is_smcd = (i->is_smcd); \
> +	u8 version = is_smcd ? i->smcd_version : i->smcr_version; \
> +	bool is_v2 = (version & SMC_V2); \
>   	typeof(net->smc.smc_stats) smc_stats = (net)->smc.smc_stats; \
>   	if (is_v2 && is_smcd) \
>   		this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \

ohje, that is because the statistic was implemented first, then SMCR_v2. 
Good catch! Thank you!

  reply	other threads:[~2023-09-08  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08  3:31 [PATCH net 0/2] Two fixes for SMC-R Guangguan Wang
2023-09-08  3:31 ` [PATCH net 1/2] net/smc: bugfix for smcr v2 server connect success statistic Guangguan Wang
2023-09-08  9:42   ` Wenjia Zhang [this message]
2023-09-08  3:31 ` [PATCH net 2/2] net/smc: use smc_lgr_list.lock to protect smc_lgr_list.list iterate in smcr_port_add Guangguan Wang
2023-09-08  9:42 ` [PATCH net 0/2] Two fixes for SMC-R Wenjia Zhang

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=be086da3-061d-8f39-6e79-0e5d21771453@linux.ibm.com \
    --to=wenjia@linux.ibm.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=guangguan.wang@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tonylu@linux.alibaba.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

all inboxes | Powered by JetHome®