RDMA: Use ib_gid_attr during GID modification

Now that ib_gid_attr contains device, port and index, simplify the
provider APIs add_gid() and del_gid() to use device, port and index
fields from the ib_gid_attr attributes structure.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Parav Pandit
2018-04-01 15:08:24 +03:00
committed by Jason Gunthorpe
parent 3e44e0ee08
commit 414448d249
9 changed files with 63 additions and 95 deletions

View File

@@ -2151,34 +2151,29 @@ struct ib_device {
int (*query_gid)(struct ib_device *device,
u8 port_num, int index,
union ib_gid *gid);
/* When calling add_gid, the HW vendor's driver should
* add the gid of device @device at gid index @index of
* port @port_num to be @gid. Meta-info of that gid (for example,
* the network device related to this gid is available
* at @attr. @context allows the HW vendor driver to store extra
* information together with a GID entry. The HW vendor may allocate
* memory to contain this information and store it in @context when a
* new GID entry is written to. Params are consistent until the next
* call of add_gid or delete_gid. The function should return 0 on
/* When calling add_gid, the HW vendor's driver should add the gid
* of device of port at gid index available at @attr. Meta-info of
* that gid (for example, the network device related to this gid) is
* available at @attr. @context allows the HW vendor driver to store
* extra information together with a GID entry. The HW vendor driver may
* allocate memory to contain this information and store it in @context
* when a new GID entry is written to. Params are consistent until the
* next call of add_gid or delete_gid. The function should return 0 on
* success or error otherwise. The function could be called
* concurrently for different ports. This function is only called
* when roce_gid_table is used.
* concurrently for different ports. This function is only called when
* roce_gid_table is used.
*/
int (*add_gid)(struct ib_device *device,
u8 port_num,
unsigned int index,
const union ib_gid *gid,
int (*add_gid)(const union ib_gid *gid,
const struct ib_gid_attr *attr,
void **context);
/* When calling del_gid, the HW vendor's driver should delete the
* gid of device @device at gid index @index of port @port_num.
* gid of device @device at gid index gid_index of port port_num
* available in @attr.
* Upon the deletion of a GID entry, the HW vendor must free any
* allocated memory. The caller will clear @context afterwards.
* This function is only called when roce_gid_table is used.
*/
int (*del_gid)(struct ib_device *device,
u8 port_num,
unsigned int index,
int (*del_gid)(const struct ib_gid_attr *attr,
void **context);
int (*query_pkey)(struct ib_device *device,
u8 port_num, u16 index, u16 *pkey);