Un-wildcarding is important for MAC aging. After inserting a megaflow into the datapath, our only interaction with packets in that megaflow later comes from statistics on the number of packets and bytes that have passed through it. If we wildcard the dl_src, then we don't have any way to find out whether a source MAC is still in use on the port, so we don't have whether it can be expired.
I suppose in theory we also want to discard packets where dl_src == dl_dst. That's a corner case. On Thu, Aug 18, 2016 at 07:39:10PM +0000, Mattia Citterio wrote: > Hello Ben, > thank you very much for the quick answer. > > Don't want to bother you... I agree with you that source MAC is needed in MAC > learning but I think it is not needed in L2-forwarding. > Think you have 1000 devices talking to another: you'll will install in the > system 1000 flows. If you un-wildcard dl_src you'll install only one flow. > As I understood wildcard is used only in the "forwarding" process so I guess > you can look at dl_src and learn it and also un-wildcard dl_src and reduce > datapath flows. The two things are not mutually exclusive. > > ________________________________________ > Da: Ben Pfaff <b...@ovn.org> > Inviato: giovedì 18 agosto 2016 18:03 > A: Mattia Citterio > Cc: discuss@openvswitch.org > Oggetto: Re: [ovs-discuss] Un-wildcarding dl_src in action NORMAL > > On Thu, Aug 18, 2016 at 03:56:13PM +0000, Mattia Citterio wrote: > > Hi all, > > > > > > We're an Italian telco and we use Openvswitch in our core routers. We use > > Openvswitch 2.4 but my question is also valid for the master branch. > > > > Digging into the code we found a piece we're not able to understand: > > https://github.com/openvswitch/ovs/blob/branch-2.4/ofproto/ofproto-dpif-xlate.c#L2221. > > Our question is: why do you un-wildcard (I mean set to 0xff) dl_src? > > > > We think L2-switching is based only on dl_dst and the right instruction > > would be: > > > > memset(&wc->masks.dl_src, 0, sizeof wc->masks.dl_src); > > > > Are we wrong? > > The "normal" action does MAC learning, which looks at the source MAC. _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss