Giter Site home page Giter Site logo

Comments (9)

jhk098 avatar jhk098 commented on August 28, 2024

It can be done, but it has to be implemented.

This code
https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_generic.c#L985-L1002
must be extended to check if the mbuf m has a VLAN tag within its metadata. If present, the VLAN header must be inserted while copying data. Alternatively, the VLAN tag can be pushed back from the metadata into the packet data here
https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_generic.c#L845

from netmap.

cygnus2048 avatar cygnus2048 commented on August 28, 2024

It can be done, but it has to be implemented.

This code https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_generic.c#L985-L1002 must be extended to check if the mbuf m has a VLAN tag within its metadata. If present, the VLAN header must be inserted while copying data. Alternatively, the VLAN tag can be pushed back from the metadata into the packet data here https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_generic.c#L845

Do those fixes also apply to the ixgbe driver? I've been fighting this issue for quite some time with Netmap in trying to access the interface as a trunk port, i.e. multiple VLANs at once on the same interface.

from netmap.

jhk098 avatar jhk098 commented on August 28, 2024

The ixgbe driver has native netmap support, so that's a different story. With native support you should be able to see the VLAN tag if you disable the VLAN hw offloads, as described in the README.md.
If you are using ixgbe with emulated netmap mode (why?) then yes, the fix will apply also in this case.

from netmap.

cygnus2048 avatar cygnus2048 commented on August 28, 2024

Thanks. Yes, I am using native and not emulated mode. I also have all VLAN offloads disabled, however, I still do not receive the VLAN tags in the received packets. For performance reasons I am using a 4.4.86 kernel, (newer had much worse performance) and running inside a VM with the interface connected in PCI passthrough mode, where the complete interface is disconnected from the host and connected to the VM. In other words, I am not using VFs I was not able to get VLAN packets out/in using VFs in SR-IOV mode.

from netmap.

jhk098 avatar jhk098 commented on August 28, 2024

There must be something wrong with your offload configuration...
Netmap does not modify the packet contents in any way, so if you don't see the VLAN tag it means that the NIC is stripping it for some reason. There are many VLAN-related offloads, maybe someone is still active and causing the stripping.

from netmap.

jhk098 avatar jhk098 commented on August 28, 2024

Also make sure you are not using emulated mode, by checking in the dmesg.
If something like this

[ 2865.316685] 256.410317 [1136] generic_netmap_attach     Emulated adapter for enp3s2 created (prev was NULL)
[ 2865.340627] 256.434258 [ 320] generic_netmap_register   Emulated adapter for enp3s2 activated
[ 2865.340651] 256.434283 [ 864] tc_configure              ifp enp3s2 qdisc netmapemu parent 4294967295 handle 0

is present, then you are using emulated mode.

from netmap.

drearms avatar drearms commented on August 28, 2024

from netmap.

drearms avatar drearms commented on August 28, 2024

My plan is to use netmap in a system that will be deployed at multiple locations also many years ahead in time. This makes it handy to use netmap in emulated mode to avoid clutter when the computers suddenly has a new nic.

On FreeBSD, this is not a problem, but on Linux (Ubuntu) I cannot see vlan tags, which is a huge drawback. I think I understand the explanation in #259, but I don't understand why it has to be this way.

Do I just have to accept this or is there a way to sneak around this issue somehow?

It sounds like you need a solution that allows you to use netmap in emulated mode with Linux (Ubuntu) while still allowing you to see the VLAN tags. Have you tried using a virtual switch such as Open vSwitch or OpenFlow? This would allow you to configure your network to handle VLAN tags and have the flexibility you need for your system deployment. Let me know if you need any help setting this up!

from netmap.

koverskeid avatar koverskeid commented on August 28, 2024

My plan is to use netmap in a system that will be deployed at multiple locations also many years ahead in time. This makes it handy to use netmap in emulated mode to avoid clutter when the computers suddenly has a new nic.
On FreeBSD, this is not a problem, but on Linux (Ubuntu) I cannot see vlan tags, which is a huge drawback. I think I understand the explanation in #259, but I don't understand why it has to be this way.
Do I just have to accept this or is there a way to sneak around this issue somehow?

It sounds like you need a solution that allows you to use netmap in emulated mode with Linux (Ubuntu) while still allowing you to see the VLAN tags. Have you tried using a virtual switch such as Open vSwitch or OpenFlow? This would allow you to configure your network to handle VLAN tags and have the flexibility you need for your system deployment. Let me know if you need any help setting this up!

My intesion is to implement a prp solution, so I need to receive frames on two interfaces with or withouth vlan tags, analyze them in a user space program, drop them or modify and forward them to a tap interface. Is this possible to achieve with Open vSwitch or OpenFlow?

from netmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.