tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Howto use agr to aggregate VPN tunnels



	Hello,

Thor Lancelot Simon a écrit :
On Mon, Dec 19, 2016 at 10:08:29PM +0100, BERTRAND jo??l wrote:

If I try to sent ICMP packets over agr0, bad checksums counter goes up :

28 packets transmitted, 0 packets received, 100.0% packet loss
einstein# netstat -s | grep bad
         ...
         32 bad checksums
	...

	I suppose packets are not transfered from agr0 to tap0/1 as checksum are
false.

That's interesting -- they're probably zero or uninitialized.  The question
is, why?  There have been a number of bugs like this over the years, but since
agr works with real Ethernet interfaces...

Actually, I wonder if anyone has agr working with an Ethernet interface that
does _not_ have checksum offload support.  We did a bunch of work at CP to be
sure that checksum offloading would work properly with vlan stacked on agr
stacked on... and we would definitely have tested with checksum offload
_disabled_ in the physical interface at the bottom, but possibly not with an
interface that didn't announce the capability at all -- maybe there's a call
to in_delayed_cksum() missing somewhere?

I have tried to understood how agr driver works and I have added some printf() in agr_xmit_frame() (sys/net/agr/if_agr.c). I don't see any message I have added in this function.

After some investigations, I have found that agr_start() doesn't work as expected:

IFQ_DEQUEUE(&ifp->if_snd, m) takes frames from queue. In a second time, agr_select_tx_port() has to return a port of agr interface, but this function always returns 0.

	Here is my modified function :

static void
agr_start(struct ifnet *ifp)
{
        struct agr_softc *sc = ifp->if_softc;
        struct mbuf *m;

        AGR_LOCK(sc);

        while (/* CONSTCOND */ 1) {
                struct agr_port *port;

printf("agr_start before IFQ_DEQUEUE\n");
                IFQ_DEQUEUE(&ifp->if_snd, m);
printf("agr_start after IFQ_DEQUEUE\n");
                if (m == NULL) {
printf("m == NULL\n");
                        break;
                }
                bpf_mtap(ifp, m);
                port = agr_select_tx_port(sc, m);
printf("port=%p\n", port);
                if (port) {
                        int error;

                        error = agr_xmit_frame(port->port_ifp, m);
                        if (error) {
                                ifp->if_oerrors++;
                        } else {
                                ifp->if_opackets++;
                        }
                } else {
                        m_freem(m);
                        ifp->if_oerrors++;
                }
        }

        AGR_UNLOCK(sc);

        ifp->if_flags &= ~IFF_OACTIVE;
}

and I see in dmesg :

agr_start before IFQ_DEQUEUE
agr_start after IFQ_DEQUEUE
port=0x0
agr_start before IFQ_DEQUEUE
agr_start after IFQ_DEQUEUE
m == NULL

agr_select_tx_port() is a redirection to ieee8023ad_select_tx_port() (ieee8023ad_lacp.c).

I have added some printf() in this new function, and I have seen that la is always NULL :

        la = lsc->lsc_active_aggregator;
        if (__predict_false(la == NULL)) {
LACP_DPRINTF((NULL, "%s: no active aggregator\n", __func__));
printf("end 2\n");
                return NULL;
        }

	I don't understand why no aggregator is active :

tap0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=5<VLAN_MTU,JUMBO_MTU>
        ec_enabled=0
        address: f2:0b:a4:a5:5c:b2
        media: Ethernet autoselect
tap1: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=5<VLAN_MTU,JUMBO_MTU>
        ec_enabled=0
        address: f2:0b:a4:93:ad:64
        media: Ethernet autoselect
agr0: flags=0xb843<UP,BROADCAST,RUNNING,SIMPLEX,LINK0,LINK1,MULTICAST> mtu 1500
        agrport: tap0, flags=0x3<COLLECTING,DISTRIBUTING>
        agrport: tap1, flags=0x3<COLLECTING,DISTRIBUTING>
        address: f2:0b:a4:a5:5c:b2
        inet 192.168.100.2/24 broadcast 192.168.100.255 flags 0x0
        inet6 fe80::f00b:a4ff:fea5:5cb2%agr0/64 flags 0x0 scopeid 0x6

	Any idea ?

	Best regards,

	JKB


Home | Main Index | Thread Index | Old Index