提交 173bc6be 编写于 作者: O oulijun 提交者: Jason Gunthorpe

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: NLijun Ou <oulijun@huawei.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 fc968aee
...@@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num, ...@@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
unsigned int index, void **context) unsigned int index, void **context)
{ {
struct hns_roce_dev *hr_dev = to_hr_dev(device); struct hns_roce_dev *hr_dev = to_hr_dev(device);
struct ib_gid_attr zattr = { };
union ib_gid zgid = { {0} }; union ib_gid zgid = { {0} };
u8 port = port_num - 1; u8 port = port_num - 1;
unsigned long flags; unsigned long flags;
...@@ -110,7 +111,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num, ...@@ -110,7 +111,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
spin_lock_irqsave(&hr_dev->iboe.lock, flags); spin_lock_irqsave(&hr_dev->iboe.lock, flags);
ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, NULL); ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, &zattr);
spin_unlock_irqrestore(&hr_dev->iboe.lock, flags); spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册