Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vlan multiplexing] add vlan tag for vlan supported kernel mechanism #1088

Merged
merged 5 commits into from
Sep 29, 2021

Conversation

pperiyasamy
Copy link
Member

Signed-off-by: Periyasamy Palanisamy periyasamy.palanisamy@est.tech

Description

Issue link

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
@pperiyasamy pperiyasamy changed the title add vlan tag for vlan supported kernel mechanism [vlan multiplexing] add vlan tag for vlan supported kernel mechanism Sep 28, 2021
@pperiyasamy
Copy link
Member Author

/cc @JanScheurich

@JanScheurich
Copy link

Does that mean the VLAN-multiplexing will only work with local kernel mechanism? That would exclude VLAN multiplexing on SRIOV vfio devices in NSE pods. For Mellanox SmartVFs it's OK as they are kernel mechanisms as well as DPDK devices.

@Bolodya1997
Copy link

@pperiyasamy
Please add some WithVLAN option and use VLAN tags only if it is selected. I suppose that there are cases when we don't need VLAN tags for kernel mechanism.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
@edwarnicke
Copy link
Member

@pperiyasamy Would it possibly make more sense to have a separate 'vlan' chain element that handles these details? (similar to how vni is handled) This would give nice modularity, and allow easy use of vlan multiplexing across different mechanisms.

@pperiyasamy
Copy link
Member Author

@edwarnicke @JanScheurich where do you want 'vlan' chain element to be placed ? currently only kernel mechanism has vlan parameter support, so can we place it under sdk/pkg/networkservice/common/mechanisms/kernel/vlan for now ?

@edwarnicke
Copy link
Member

@pperiyasamy Sounds about right :)

This reverts commit cf8d38b.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
This reverts commit 1d6415f.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
@pperiyasamy
Copy link
Member Author

@pperiyasamy Sounds about right :)

done. please review it now.

@edwarnicke
Copy link
Member

@pperiyasamy This looks good.

@JanScheurich A brief comment here on 'working with other non kernel mechanisms'. As written, the implementation @pperiyasamy has provided only works for kernel mechanism... but it has the right architectural whitespace to be easily extended to any Vlan supporting mechanism.

I'll talk through how briefly, and you can all decide when you'd like to make those extensions :)

Right now the constants 'SupportsVLAN' and 'VLAN' are only defined in api/networkservice/mechanisms/kernel/constants.go. As you can see just above there, we've in the past defined some constants by reference to 'common' because those constants get used in multiple mechanisms.

vlan multiplexing is seen as a cross-cutting concern... you could treat it as such by introducing pkg/api/networkservice/mechanisms/vlanmultiplexing/constants.go (to act as a home for the constants, similar to what commons does) and pkg/api/networkservice/mechanisms/vlanmultiplexing/helpers.go to introduce its own ToMechanism and accessors (which could be reused in the kernel mechanism). This way other mechanisms could do likewise, and the vlan chain element could support whatever mechanism provides SupportsVlan.

Thoughts?

@edwarnicke edwarnicke merged commit e550639 into networkservicemesh:main Sep 29, 2021
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Sep 29, 2021
…k@main

PR link: networkservicemesh/sdk#1088

Commit: e550639
Author: peri
Date: 2021-09-29 15:14:41 +0200
Message:
  - [vlan multiplexing] add vlan tag for vlan supported kernel mechanism (#1088)
* add vlan tag for vlan supported kernel mechanism

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* use options closure to set vlan id range

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "use options closure to set vlan id range"

This reverts commit cf8d38b6312c52582cc8c9e6e78125453f095779.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* Revert "add vlan tag for vlan supported kernel mechanism"

This reverts commit 1d6415f19687b518434114f14bdf22330b97c21a.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>

* add vlan server chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
@JanScheurich
Copy link

Right now the constants 'SupportsVLAN' and 'VLAN' are only defined in api/networkservice/mechanisms/kernel/constants.go. As you can see just above there, we've in the past defined some constants by reference to 'common' because those constants get used in multiple mechanisms.

vlan multiplexing is seen as a cross-cutting concern... you could treat it as such by introducing pkg/api/networkservice/mechanisms/vlanmultiplexing/constants.go (to act as a home for the constants, similar to what commons does) and pkg/api/networkservice/mechanisms/vlanmultiplexing/helpers.go to introduce its own ToMechanism and accessors (which could be reused in the kernel mechanism). This way other mechanisms could do likewise, and the vlan chain element could support whatever mechanism provides SupportsVlan.

Thoughts?

Makes sense. The current implementation in the kernel mechanism is sufficient for our OVS forwarder + SmartVF use case. We can leave the generalization to a future contributor.

@edwarnicke
Copy link
Member

edwarnicke commented Sep 29, 2021

@JanScheurich

Makes sense. The current implementation in the kernel mechanism is sufficient for our OVS forwarder + SmartVF use case. We can leave the generalization to a future contributor.

This is what I expected :) That's why I merged this PR and just left my comment in case I misread the situation :)

@edwarnicke
Copy link
Member

The good news is its actually pretty each and non-impactful to generalize from @pperiyasamy 's implementation here :)

@pperiyasamy pperiyasamy deleted the kernel-vlan branch September 29, 2021 13:48
@pperiyasamy
Copy link
Member Author

@Bolodya1997 @edwarnicke @JanScheurich Thanks all for your inputs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants