[dpdk-dev] [PATCH 0/4] Introduce IF proxy library

Andrzej Ostruszka [C] aostruszka at marvell.com
Thu Apr 16 19:26:49 CEST 2020


On 4/16/20 7:04 PM, Stephen Hemminger wrote:
> On Thu, 16 Apr 2020 22:19:05 +0530
> Jerin Jacob <jerinjacobk at gmail.com> wrote:
> 
>> On Thu, Apr 16, 2020 at 9:41 PM Stephen Hemminger
>> <stephen at networkplumber.org> wrote:
[...]
>>> Has anyone investigated solving this in the kernel rather than
>>> creating the added overhead of more Linux devices?
>>>
>>> What I am thinking of is a netlink to userspace interface.
>>> The kernel already has File-System-in-Userspace (FUSE) to allow
>>> for filesystems. What about having a NUSE (Netlink in userspace)?  
>>
>> IMO, there is no issue with the Linux Netlink _userspace_ interface.
>> The goal of IF proxy to abstract the OS differences so that it can
>> work with Linux, FreeBSD, and Windows(if needed).
>>
>>
>>>
>>> Then DPDK could have a daemon that is a provider to NUSE.
>>> This solution would also benefit other non-DPDK projects like VPP
>>> and allow DPDK to integrate with devlink etc.  
> 
> With the wider use of tap devices like this, it may be a problem
> for other usages of TAP. If nothing else, having to figure out which
> tap is which would be error prone.

Stephen, the library does not require TAP - only some DPDK port that is
visible to the system (has non-zero if_index).  As to the confusion - if
we use TAP then it has optional 'iface=...' argument, so we can name
those proxy interfaces as 'iface=proxy0' or something like that.  This
is under control of application (just call ...create_by_devarg() with
proper argument).

> Also, TAP on Windows is only available as an out-of-tree driver
> from OpenVPN. And the TAP on Windows is quite, limited, deprecated,
> poorly supported and buggy. There is no standard TAP like interface
> in Windows.
> 
> TAP on BSD is different than Linux and has different control functions.
> Don't remember what the interface notification mechanism is on BSD,
> it is not netlink.
> 
> So is IF proxy even going to work on these other OS?

No.  At the moment only Linux is supported.  I don't know much about
Windows, it would need some TAP-like driver and implementation would
probably make use of "IP Helper" library (some extra thread doing
polling?).  As for FreeBSD I'm convinced that very similar
implementation is possible by using PF_ROUTE sockets.

What the library does to help with other platforms is that it defines
following structure:

/* Every implementation should provide definition of this structure:
 * - init : called during library initialization (NULL when not needed)
 * - events : this should return bitmask of supported events (can be
 *     NULL if all defined events are supported by the implementation)
 * - listen : this function should start service listening to the
 *     network configuration events/changes,
 * - close : this function should close the service started by listen()
 * - get_info : this function should query system for current
 *     configuration of interface with index 'if_index'.  After
 *     successful initialization of listening service this function is
 *     called with 0 as an argument.  In that case configuration of all
 *     ports should be obtained - and when this procedure completes a
 *     RTE_IFPX_CFG_DONE event should be signaled via
 *     ifpx_notify_event().
 */
extern
struct ifpx_platform_callbacks {
	void (*init)(void);
	uint64_t (*events)(void);
	int (*listen)(void);
	int (*close)(void);
	void (*get_info)(int if_index);
} ifpx_platform;

With regards
Andrzej Ostruszka


More information about the dev mailing list