Skip to content

Commit 173bc6b

Browse files
oulijunjgunthorpe
authored andcommitted
RDMA/hns: Fix a bug with modifying mac address
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. Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent fc968ae commit 173bc6b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/infiniband/hw/hns/hns_roce_main.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
100100
unsigned int index, void **context)
101101
{
102102
struct hns_roce_dev *hr_dev = to_hr_dev(device);
103+
struct ib_gid_attr zattr = { };
103104
union ib_gid zgid = { {0} };
104105
u8 port = port_num - 1;
105106
unsigned long flags;
@@ -110,7 +111,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
110111

111112
spin_lock_irqsave(&hr_dev->iboe.lock, flags);
112113

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);
114115

115116
spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
116117

0 commit comments

Comments
 (0)