[ovs-discuss] Help needed to understand code snippet

neeraj mehta mehtaneeraj07 at gmail.com
Wed Sep 23 12:55:03 UTC 2015


Hello Team,

Can you help me in understanding below snippet.

I was looking at the code in bond.c:bond_compose_learning_packet( ). In
this, function choose_output_slave ( ) can return NULL. And returned
pointer is used as  "*port_aux = slave->aux".
How will it work?
====================================================
static struct bond_slave *
choose_output_slave(const struct bond *bond, const struct flow *flow,
                    struct flow_wildcards *wc, uint16_t vlan)
{
    struct bond_entry *e;
    int balance;

    balance = bond->balance;
    if (bond->lacp_status == LACP_CONFIGURED) {
        /* LACP has been configured on this bond but negotiations were
         * unsuccussful. If lacp_fallback_ab is enabled use active-
         * backup mode else drop all traffic. */
        if (!bond->lacp_fallback_ab) {
            return NULL;
        }

.....
===================================================

===================================================
slave = choose_output_slave(bond, &flow, NULL, vlan);

    packet = ofpbuf_new(0);
    compose_rarp(packet, eth_src);
    if (vlan) {
        eth_push_vlan(packet, htons(ETH_TYPE_VLAN), htons(vlan));
    }

    *port_aux = slave->aux;
    ovs_rwlock_unlock(&rwlock);
    }
======================================================

Regards
Neeraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20150923/8ccceb6a/attachment-0002.html>


More information about the discuss mailing list