All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] RFC - best way to organize a multiprotocol transport?
@ 2014-03-21 10:01 Anton Ivanov
  2014-03-21 13:14 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Ivanov @ 2014-03-21 10:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber, Stefan Hajnoczi

Hi list, hi all,

I am interested in what would be the best way to organize a
multiprotocol transport.

I am playing with l2tpv3 and gre - At the end of the day 90% of the
driver code for either looks the same.

If we ignore GRE checksums for a moment, the only differences are in
"form header" and "verify header" functions. TX is the same, RX is the
same, poll state engine is the same and 70% of the init code is the same.

Further to this, if I implement recvmmsg (instead of packet_mmap) based
raw driver this ends up sharing 50% of the code with it too. Same story
with udp based legacy "socket" in unicast mode - that can be expressed
as a NULL encaps sharing 90% of the code with l2tpv3 or gre.

I am wondering how to re-organize these so that the code is not
duplicated across 3-4 drivers as well as allow people to easily add more
encaps in the future.

One way will be to pull all common routines into a common file and have
different option sets and different inits. Another will be to have
"encaps" as a parameter to a common driver. This, however will make all
params optional making option parsing ugly and prone to coding errors.

A.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-21 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 10:01 [Qemu-devel] RFC - best way to organize a multiprotocol transport? Anton Ivanov
2014-03-21 13:14 ` Stefan Hajnoczi
2014-03-21 14:06   ` Anton Ivanov
2014-03-21 15:27     ` Stefan Hajnoczi
2014-03-21 17:00       ` Anton Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.