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

Add vfio-server #1

Merged
merged 6 commits into from
Dec 14, 2020
Merged

Conversation

Bolodya1997
Copy link

Description

vfio-server nse provides network service -> { MAC address, VLAN tag } mapping.

Configuration

  • NSE_NAME - A string value of network service endpoint name (default "vfio-server")
  • NSE_BASE_DIR - A base directory to create a unix socker for listening incoming requests (default "./")
  • NSE_CONNECT_TO - A Network service Manager connectTo URL (default "unix:///var/lib/networkservicemesh/nsm.io.sock")
  • NSE_MAX_TOKEN_LIFETIME - A token lifetime duration (default 24h)
  • NSE_SERVICES - A list of supported Network Services in inner format:
    Name@Domain: { addr: MACAddr; vlan: VLANTag; labels: Labels; }
    MACAddr = xx:xx:xx:xx:xx:xx
    Labels = label_1=value_1&label_2=value_2
    - Name - a Network Service name
    - Domain - a Network Service domain (don't confuse it with interdomain domains)
    - MACAddr - a MAC address for the Network Service
    - VLANTag - a VLAN tag for the Network Service
    - labelN=valueN - pairs of labels supported by the Network Service
    • Examples:
      • pingpong@worker.domain: { addr: 0a:55:44:33:22:11 }
        • pingpong Network Service
        • worker.domain Network Service domain
        • 0a:55:44:33:22:11 MAC address

Vladimir Popov added 3 commits December 10, 2020 12:58
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Vladimir Popov added 2 commits December 10, 2020 14:49
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Dockerfile Show resolved Hide resolved
@@ -20,4 +23,5 @@ CMD dlv -l :40000 --headless=true --api-version=2 test -test.v ./...

FROM alpine as runtime
COPY --from=build /bin/app /bin/app
COPY --from=build /bin/dlv /bin/dlv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: you could use target debug.

Suggested change
COPY --from=build /bin/dlv /bin/dlv

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there is an additional option to start debugging ourselves with passed env variable:

cmd-nse-vfio/main.go

Lines 77 to 79 in a01453e

if err := debug.Self(); err != nil {
log.Entry(ctx).Infof("%s", err)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that we need dlv in runtiume.

"github.com/networkservicemesh/cmd-nse-vfio/internal/config"
)

type mapServer struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it is not part of sdk-sriov?

// Name@Domain: { addr: MACAddr; vlan: VLANTag; labels: Labels; }
// MACAddr = xx:xx:xx:xx:xx:xx
// Labels = label_1=value_1&label_2=value_2
func (s *ServiceConfig) UnmarshalBinary(bytes []byte) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use json here?

@haiodo haiodo merged commit 94d2b88 into networkservicemesh:master Dec 14, 2020
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.

3 participants