Lines Matching defs:ids
393 * @ids: new configuration, an array of port ids.
395 * Sets the vport's upcall_portids to @ids.
397 * Returns 0 if successful, -EINVAL if @ids is zero length or cannot be parsed
402 int ovs_vport_set_upcall_portids(struct vport *vport, const struct nlattr *ids)
406 if (!nla_len(ids) || nla_len(ids) % sizeof(u32))
409 if (nla_len(ids) / sizeof(u32) > nr_cpu_ids)
414 vport_portids = kmalloc(sizeof(*vport_portids) + nla_len(ids),
419 vport_portids->n_ids = nla_len(ids) / sizeof(u32);
421 nla_memcpy(vport_portids->ids, ids, nla_len(ids));
447 struct vport_portids *ids;
449 ids = rcu_dereference_ovsl(vport->upcall_portids);
453 ids->n_ids * sizeof(u32), (void *)ids->ids);
455 return nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, ids->ids[0]);
472 struct vport_portids *ids;
476 ids = rcu_dereference(vport->upcall_portids);
479 if (ids->n_ids == 1)
480 return ids->ids[0];
483 ids_index = hash - ids->n_ids * reciprocal_divide(hash, ids->rn_ids);
484 return ids->ids[ids_index];