When modifying mac address, it will trigger hns_roce_del_gid function and can't delete the default gid matched the index because the attribute of gid is null.
Unified · Split
| @@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num, · 99 unmodified lines | ||
| 100 | 100 | unsigned int index, void **context) |
| 101 | 101 | { |
| 102 | 102 | struct hns_roce_dev *hr_dev = to_hr_dev(device); |
| 103 | + struct ib_gid_attr zattr = { }; | |
| 103 | 104 | union ib_gid zgid = { {0} }; |
| 104 | 105 | u8 port = port_num - 1; |
| 105 | 106 | unsigned long flags; |
| @@ -110,7 +111,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num, · 4 unmodified lines | ||
| 110 | 111 | |
| 111 | 112 | spin_lock_irqsave(&hr_dev->iboe.lock, flags); |
| 112 | 113 | |
| 113 | − ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, NULL); | |
| 114 | + ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, &zattr); | |
| 114 | 115 | |
| 115 | 116 | spin_unlock_irqrestore(&hr_dev->iboe.lock, flags); |
| 116 | 117 | |