On Wed, Mar 21, 2012 at 10:04:15PM +0800, Min Chen wrote:
> In the PORTING file, it reads:
> 
> *lib/netdev-vport.c provides support for "virtual ports" implemented by the
> > Open vSwitch datapath module for the Linux kernel
> >
> 
> netdev-vport.c does not implement its own *recv* function. As in
> netdev-provider.h:
> 
> * May be null if not needed, such as for a network device that does not
> > * implement packet reception through the 'recv' mumber function */
> >
> void (*recv) (struct netdev *netdev, void *buffer, size_t size);
> >
> 
> I wonder where else packet reception can be implemented?

There is no simple way to get all the packets received by a vport
represented by netdev-vport.  (One may add a "userspace" action to the
flows for the vport, but this is not as easy as opening a "raw" socket
for a normal network device.)

But there's also really no reason to need them in this case.  "recv" is
mainly used by the userspace switch.  The userspace switch doesn't have
kernel vports, so "recv" isn't useful for kernel vports.

> And what is the relation between netdev and vport? Is *netdev* used to
> abstract Ethernet interfaces, e.g. eth0 on Linux? Is *vport* used to
> abstract virtual network kernel devices, e.g. tap0 on Linux?

netdev-vport is an instantiation of the abstract netdev interface, in
the same way that netdev-linux is an instantiation of the abstract
netdev interface.  netdev-vport represents vports within the kernel
datapath.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to