Lines Matching refs:ids
327 * @ids: new configuration, an array of port ids.
329 * Sets the vport's upcall_portids to @ids.
331 * Returns 0 if successful, -EINVAL if @ids is zero length or cannot be parsed
336 int ovs_vport_set_upcall_portids(struct vport *vport, const struct nlattr *ids)
340 if (!nla_len(ids) || nla_len(ids) % sizeof(u32))
345 vport_portids = kmalloc(sizeof(*vport_portids) + nla_len(ids),
350 vport_portids->n_ids = nla_len(ids) / sizeof(u32);
352 nla_memcpy(vport_portids->ids, ids, nla_len(ids));
378 struct vport_portids *ids;
380 ids = rcu_dereference_ovsl(vport->upcall_portids);
384 ids->n_ids * sizeof(u32), (void *)ids->ids);
386 return nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, ids->ids[0]);
403 struct vport_portids *ids;
407 ids = rcu_dereference(vport->upcall_portids);
410 if (ids->n_ids == 1)
411 return ids->ids[0];
414 ids_index = hash - ids->n_ids * reciprocal_divide(hash, ids->rn_ids);
415 return ids->ids[ids_index];