コード例 #1
0
ファイル: multipath.c プロジェクト: iwaseyusuke/ovs
/* Executes 'mp' based on the current contents of 'flow', writing the results
 * back into 'flow'.  Sets fields in 'wc' that were used to calculate
 * the result. */
void
multipath_execute(const struct ofpact_multipath *mp, struct flow *flow,
                  struct flow_wildcards *wc)
{
    /* Calculate value to store. */
    uint32_t hash = flow_hash_fields(flow, mp->fields, mp->basis);
    uint16_t link = multipath_algorithm(hash, mp->algorithm,
                                        mp->max_link + 1, mp->arg);

    flow_mask_hash_fields(flow, wc, mp->fields);
    nxm_reg_load(&mp->dst, link, flow, wc);
}
コード例 #2
0
ファイル: multipath.c プロジェクト: apanda/openvswitch-new
void
multipath_execute(const struct nx_action_multipath *mp, struct flow *flow)
{
    /* Calculate value to store. */
    uint32_t hash = flow_hash_fields(flow, ntohs(mp->fields),
                                     ntohs(mp->basis));
    uint16_t link = multipath_algorithm(hash, ntohs(mp->algorithm),
                                        ntohs(mp->max_link) + 1,
                                        ntohl(mp->arg));
    struct mf_subfield dst;

    nxm_decode(&dst, mp->dst, mp->ofs_nbits);
    mf_set_subfield_value(&dst, link, flow);
}