From: Leon Romanovsky <leon@kernel.org>
To: Cheng Xu <chengyou@linux.alibaba.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, KaiShen@linux.alibaba.com
Subject: Re: [PATCH for-next 4/4] RDMA/erdma: Support dynamic mtu
Date: Tue, 20 Sep 2022 14:32:17 +0300 [thread overview]
Message-ID: <YymkwSPZa3B0oTKk@unreal> (raw)
In-Reply-To: <20220909093822.33868-5-chengyou@linux.alibaba.com>
On Fri, Sep 09, 2022 at 05:38:22PM +0800, Cheng Xu wrote:
> Hardware now support jumbo frame for RDMA. So we introduce a new CMDQ
> message to support mtu change notification.
>
> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> ---
> drivers/infiniband/hw/erdma/erdma.h | 1 +
> drivers/infiniband/hw/erdma/erdma_hw.h | 6 ++++++
> drivers/infiniband/hw/erdma/erdma_main.c | 8 +++++++-
> drivers/infiniband/hw/erdma/erdma_verbs.c | 11 +++++++++++
> drivers/infiniband/hw/erdma/erdma_verbs.h | 1 +
> 5 files changed, 26 insertions(+), 1 deletion(-)
<...>
> --- a/drivers/infiniband/hw/erdma/erdma_main.c
> +++ b/drivers/infiniband/hw/erdma/erdma_main.c
> @@ -34,10 +34,15 @@ static int erdma_netdev_event(struct notifier_block *nb, unsigned long event,
> dev->state = IB_PORT_DOWN;
> erdma_port_event(dev, IB_EVENT_PORT_ERR);
> break;
> + case NETDEV_CHANGEMTU:
> + if (dev->mtu != netdev->mtu) {
> + erdma_set_mtu(dev, netdev->mtu);
> + dev->mtu = netdev->mtu;
> + }
> + break;
> case NETDEV_REGISTER:
> case NETDEV_UNREGISTER:
> case NETDEV_CHANGEADDR:
> - case NETDEV_CHANGEMTU:
> case NETDEV_GOING_DOWN:
> case NETDEV_CHANGE:
> default:
> @@ -95,6 +100,7 @@ static int erdma_device_register(struct erdma_dev *dev)
> if (ret)
> return ret;
>
> + dev->mtu = dev->netdev->mtu;
> addrconf_addr_eui48((u8 *)&ibdev->node_guid, dev->netdev->dev_addr);
>
> ret = ib_register_device(ibdev, "erdma_%d", &dev->pdev->dev);
> diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c
> index aea93d08af95..62be98e2b941 100644
> --- a/drivers/infiniband/hw/erdma/erdma_verbs.c
> +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
> @@ -1436,6 +1436,17 @@ int erdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
> return ret;
> }
>
> +void erdma_set_mtu(struct erdma_dev *dev, u32 mtu)
> +{
> + struct erdma_cmdq_config_mtu_req req;
> +
> + erdma_cmdq_build_reqhdr(&req.hdr, CMDQ_SUBMOD_COMMON,
> + CMDQ_OPCODE_CONF_MTU);
> + req.mtu = mtu;
> +
> + erdma_post_cmd_wait(&dev->cmdq, &req, sizeof(req), NULL, NULL);
> +}
I don't see any backward compatibility here. How can you make sure that
new code that supports MTU change works correctly on old FW/device?
Thanks
next prev parent reply other threads:[~2022-09-20 11:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 9:38 [PATCH for-next 0/4] RDMA/erdma: cleanups and updates 9-9-2022 Cheng Xu
2022-09-09 9:38 ` [PATCH for-next 1/4] RDMA/erdma: Eliminate unnecessary casting for erdma_post_cmd_wait Cheng Xu
2022-09-09 9:38 ` [PATCH for-next 2/4] RDMA/erdma: Remove redundant includes Cheng Xu
2022-09-09 9:38 ` [PATCH for-next 3/4] RDMA/erdma: Make hardware internal opcodes invisible to driver Cheng Xu
2022-09-09 9:38 ` [PATCH for-next 4/4] RDMA/erdma: Support dynamic mtu Cheng Xu
2022-09-20 11:32 ` Leon Romanovsky [this message]
2022-09-21 2:28 ` Cheng Xu
2022-09-21 7:35 ` Leon Romanovsky
2022-09-21 7:32 ` (subset) " Leon Romanovsky
2022-09-20 11:33 ` [PATCH for-next 0/4] RDMA/erdma: cleanups and updates 9-9-2022 Leon Romanovsky
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=YymkwSPZa3B0oTKk@unreal \
--to=leon@kernel.org \
--cc=KaiShen@linux.alibaba.com \
--cc=chengyou@linux.alibaba.com \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
/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