All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: liweihang <liweihang@huawei.com>
Cc: chenglang <chenglang@huawei.com>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linuxarm@openeuler.org" <linuxarm@openeuler.org>
Subject: Re: [PATCH for-next 2/6] RDMA/hns: Remove unsupported CMDQ mode
Date: Sun, 7 Feb 2021 10:53:59 +0200	[thread overview]
Message-ID: <20210207085359.GD4656@unreal> (raw)
In-Reply-To: <11e5e5424ad94e329c11e7a7a77f585e@huawei.com>

On Sun, Feb 07, 2021 at 08:15:09AM +0000, liweihang wrote:
> On 2021/2/7 15:52, chenglang wrote:
> >
> > On 2021/2/4 14:23, Weihang Li wrote:
> >> From: Lang Cheng <chenglang@huawei.com>
> >>
> >> HIP08/09 only supports CMDQ in non-interrupt mode, and the firmware always
> >> ignores the flag to indicate the mode. Therefore, remove the dead code.
> >>
> >> Fixes: a04ff739f2a9 ("RDMA/hns: Add command queue support for hip08 RoCE driver")
> >> Signed-off-by: Lang Cheng <chenglang@huawei.com>
> >> Signed-off-by: Weihang Li <liweihang@huawei.com>
> >> ---
> >>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 24 ++++++++----------------
> >>  drivers/infiniband/hw/hns/hns_roce_hw_v2.h |  2 --
> >>  2 files changed, 8 insertions(+), 18 deletions(-)
> >>
> >> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> >> index 7a5a41d..260c17c 100644
> >> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> >> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> >> @@ -1197,8 +1197,7 @@ static void hns_roce_cmq_setup_basic_desc(struct hns_roce_cmq_desc *desc,
> >>  {
> >>  	memset((void *)desc, 0, sizeof(struct hns_roce_cmq_desc));
> >>  	desc->opcode = cpu_to_le16(opcode);
> >> -	desc->flag =
> >> -		cpu_to_le16(HNS_ROCE_CMD_FLAG_NO_INTR | HNS_ROCE_CMD_FLAG_IN);
> >> +	desc->flag = cpu_to_le16(HNS_ROCE_CMD_FLAG_IN);
> >>  	if (is_read)
> >>  		desc->flag |= cpu_to_le16(HNS_ROCE_CMD_FLAG_WR);
> >>  	else
> >> @@ -1275,18 +1274,12 @@ static int __hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
> >>  	/* Write to hardware */
> >>  	roce_write(hr_dev, ROCEE_TX_CMQ_TAIL_REG, csq->next_to_use);
> >>
> >> -	/*
> >> -	 * If the command is sync, wait for the firmware to write back,
> >> -	 * if multi descriptors to be sent, use the first one to check
> >> -	 */
> >> -	if (le16_to_cpu(desc->flag) & HNS_ROCE_CMD_FLAG_NO_INTR) {
> >> -		do {
> >> -			if (hns_roce_cmq_csq_done(hr_dev))
> >> -				break;
> >> -			udelay(1);
> >> -			timeout++;
> >> -		} while (timeout < priv->cmq.tx_timeout);
> >> -	}
> >> +	do {
> >> +		if (hns_roce_cmq_csq_done(hr_dev))
> >> +			break;
> >> +		udelay(1);
> >> +		timeout++;
> >> +	} while (timeout < priv->cmq.tx_timeout);
> >>
> >>  	if (hns_roce_cmq_csq_done(hr_dev)) {
> >>  		handle = 0;
> >> @@ -1626,8 +1619,7 @@ static int hns_roce_set_vf_switch_param(struct hns_roce_dev *hr_dev, int vf_id)
> >>  	if (ret)
> >>  		return ret;
> >>
> >> -	desc.flag =
> >> -		cpu_to_le16(HNS_ROCE_CMD_FLAG_NO_INTR | HNS_ROCE_CMD_FLAG_IN);
> >
> > The old firmware needs this redundant flag, it is best cleaned up after the
> > firmware version is released.
> >
> > Thanks.
>
> Got it, I will drop this one from the series.

And how will it work new kernel with old FW? Or isn't it possible and all
users must upgrade their kernel/FW at the same time?

Thanks

>
> Thanks
> Weihang
>
> >
> >> +	desc.flag = cpu_to_le16(HNS_ROCE_CMD_FLAG_IN);
> >>  	desc.flag &= cpu_to_le16(~HNS_ROCE_CMD_FLAG_WR);
> >>  	roce_set_bit(swt->cfg, VF_SWITCH_DATA_CFG_ALW_LPBK_S, 1);
> >>  	roce_set_bit(swt->cfg, VF_SWITCH_DATA_CFG_ALW_LCL_LPBK_S, 0);
> >> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
> >> index 9f97e32..986a287 100644
> >> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
> >> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
> >> @@ -128,14 +128,12 @@
> >>  #define HNS_ROCE_CMD_FLAG_OUT_VALID_SHIFT	1
> >>  #define HNS_ROCE_CMD_FLAG_NEXT_SHIFT		2
> >>  #define HNS_ROCE_CMD_FLAG_WR_OR_RD_SHIFT	3
> >> -#define HNS_ROCE_CMD_FLAG_NO_INTR_SHIFT		4
> >>  #define HNS_ROCE_CMD_FLAG_ERR_INTR_SHIFT	5
> >>
> >>  #define HNS_ROCE_CMD_FLAG_IN		BIT(HNS_ROCE_CMD_FLAG_IN_VALID_SHIFT)
> >>  #define HNS_ROCE_CMD_FLAG_OUT		BIT(HNS_ROCE_CMD_FLAG_OUT_VALID_SHIFT)
> >>  #define HNS_ROCE_CMD_FLAG_NEXT		BIT(HNS_ROCE_CMD_FLAG_NEXT_SHIFT)
> >>  #define HNS_ROCE_CMD_FLAG_WR		BIT(HNS_ROCE_CMD_FLAG_WR_OR_RD_SHIFT)
> >> -#define HNS_ROCE_CMD_FLAG_NO_INTR	BIT(HNS_ROCE_CMD_FLAG_NO_INTR_SHIFT)
> >>  #define HNS_ROCE_CMD_FLAG_ERR_INTR	BIT(HNS_ROCE_CMD_FLAG_ERR_INTR_SHIFT)
> >>
> >>  #define HNS_ROCE_CMQ_DESC_NUM_S		3
>

  reply	other threads:[~2021-02-07  8:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  6:23 [PATCH for-next 0/6] RDMA/hns: Fix and refactor CMDQ related code Weihang Li
2021-02-04  6:23 ` [PATCH for-next 1/6] RDMA/hns: Remove unused member and variable of CMDQ Weihang Li
2021-02-04  6:23 ` [PATCH for-next 2/6] RDMA/hns: Remove unsupported CMDQ mode Weihang Li
     [not found]   ` <aabcf1a1-1cdf-5d05-cc11-daa36f9f10fa@huawei.com>
2021-02-07  8:15     ` liweihang
2021-02-07  8:53       ` Leon Romanovsky [this message]
2021-02-04  6:23 ` [PATCH for-next 3/6] RDMA/hns: Fixes missing error code of CMDQ Weihang Li
2021-02-04  6:23 ` [PATCH for-next 4/6] RDMA/hns: Remove redundant operations on CMDQ Weihang Li
2021-02-04  6:23 ` [PATCH for-next 5/6] RDMA/hns: Adjust fields and variables about CMDQ tail/head Weihang Li
2021-02-04  6:23 ` [PATCH for-next 6/6] RDMA/hns: Refactor process of posting CMDQ Weihang Li

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=20210207085359.GD4656@unreal \
    --to=leon@kernel.org \
    --cc=chenglang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=liweihang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.