From cb14f930f94a1e03addaa962373531dcffdf4853 Mon Sep 17 00:00:00 2001 From: Weihang Li Date: Wed, 9 Oct 2019 15:57:38 +0800 Subject: [PATCH] RDMA/hns: Initialize last_port_state to IB_PORT_DOWN driver inclusion category: bugfix bugzilla: NA CVE: NA Setting last_port_state to IB_PORT_ACTIVE when initial will cause event lost, it should be IB_PORT_DOWN. Fixes: cc591fc6b310 ("RDMA/hns: Deliver net device event to ofed") Feature or Bugfix: Bugfix Signed-off-by: Weihang Li Reviewed-by: chenglang Reviewed-by: liuyixian Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 74dc50642e9f..cc57726b0193 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -283,7 +283,7 @@ static int hns_roce_setup_mtu_mac_state(struct hns_roce_dev *hr_dev) u8 i; for (i = 0; i < hr_dev->caps.num_ports; i++) { - hr_dev->iboe.last_port_state[i] = IB_PORT_ACTIVE; + hr_dev->iboe.last_port_state[i] = IB_PORT_DOWN; if (hr_dev->hw->set_mtu) hr_dev->hw->set_mtu(hr_dev, hr_dev->iboe.phy_port[i], hr_dev->caps.max_mtu); -- GitLab