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@xxxxxxxxxxxxxxxxx> > --- > 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