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

SR-IOV forwarder #18

Merged
merged 31 commits into from
Dec 29, 2020
Merged

SR-IOV forwarder #18

merged 31 commits into from
Dec 29, 2020

Conversation

Bolodya1997
Copy link

Add SR-IOV forwarder with kernel, VFIO mechanisms supported.

@Bolodya1997 Bolodya1997 marked this pull request as ready for review October 20, 2020 13:05
Dockerfile Outdated Show resolved Hide resolved
@Bolodya1997 Bolodya1997 force-pushed the forwarder branch 2 times, most recently from 414841d to 72db92b Compare October 26, 2020 01:48
Vladimir Popov added 22 commits November 13, 2020 16:09
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>
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>
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>
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>
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>
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>
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>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Vladimir Popov added 2 commits November 18, 2020 16:03
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Bolodya1997 Bolodya1997 force-pushed the forwarder branch 3 times, most recently from 89392f2 to f97e1a8 Compare December 22, 2020 14:00
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Bolodya1997 Bolodya1997 marked this pull request as ready for review December 22, 2020 15:27
Endpoint: socket,
ResourceName: s.name,
}); err != nil {
logEntry.Errorf("error re registering server: %s %+v", s.name, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we do a fatal here? Since it will not continue working properly and will not recover.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, fixed.

}
}

func (s *devicePluginServer) respToDeviceIDs(resp *podresources.ListPodResourcesResponse) map[string]struct{} {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we unify with function respToDeviceIDs from line 121?

Copy link
Author

Choose a reason for hiding this comment

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

Nope, they are different:

  • 121: returns [resource name] -> [list of device IDs for this resource] mapping
  • 206: returns set of the device IDs for the given resource name

return rv
}

func sriovChain(
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to have SR-IOV chain inside NewServer function, it is not so big.

Copy link
Author

@Bolodya1997 Bolodya1997 Dec 28, 2020

Choose a reason for hiding this comment

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


conn, err := s.wrappedServer.Request(ctx, request)
if mech := conn.GetMechanism(); err == nil && mech != nil {
s.connMechanisms[connID] = mech.Clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a synchronisation logic here? I suppose we need.

Copy link
Author

Choose a reason for hiding this comment

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

}

func (s *resetMechanismServer) Close(ctx context.Context, conn *networkservice.Connection) (*empty.Empty, error) {
delete(s.connMechanisms, conn.GetId())
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Please add sync.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in another PR: networkservicemesh/sdk-sriov#73

main.go Outdated
registryapi.NewNetworkServiceEndpointRegistryClient(registryCC),
)
// TODO - something smarter for expireTime
expireTime, err := ptypes.TimestampProto(time.Now().Add(config.MaxTokenLifetime))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @denis-tingajkin already had some chain element for registry, to perform this automatically and it should include automatic re-register to prevent registration expire.

Copy link
Member

Choose a reason for hiding this comment

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

I feel refresh.NewNetworkServiceEndpointRegistryClient() should be fine here.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, fixed.

Copy link
Contributor

@haiodo haiodo left a comment

Choose a reason for hiding this comment

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

In general look good, but it seems it require a bit of more work. Thanks.

@Bolodya1997 Bolodya1997 marked this pull request as draft December 28, 2020 16:45
@Bolodya1997 Bolodya1997 force-pushed the forwarder branch 2 times, most recently from 902e105 to c1964ca Compare December 29, 2020 03:31
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Bolodya1997 Bolodya1997 force-pushed the forwarder branch 2 times, most recently from 1bec9c0 to bfc5f0e Compare December 29, 2020 05:02
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Bolodya1997 Bolodya1997 force-pushed the forwarder branch 2 times, most recently from f162372 to 52f2533 Compare December 29, 2020 08:29
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Bolodya1997 Bolodya1997 marked this pull request as ready for review December 29, 2020 09:02
@haiodo haiodo merged commit 68f6ec3 into networkservicemesh:master Dec 29, 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