-
Notifications
You must be signed in to change notification settings - Fork 15
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
SR-IOV forwarder #18
Conversation
5b3e40f
to
2079524
Compare
414841d
to
72db92b
Compare
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>
7d56c41
to
62b6499
Compare
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
89392f2
to
f97e1a8
Compare
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
f97e1a8
to
ccf7b5c
Compare
internal/k8s/deviceplugin/server.go
Outdated
Endpoint: socket, | ||
ResourceName: s.name, | ||
}); err != nil { | ||
logEntry.Errorf("error re registering server: %s %+v", s.name, err) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, fixed.
internal/k8s/deviceplugin/server.go
Outdated
} | ||
} | ||
|
||
func (s *devicePluginServer) respToDeviceIDs(resp *podresources.ListPodResourcesResponse) map[string]struct{} { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, fixed.
There was a problem hiding this 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.
902e105
to
c1964ca
Compare
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
1bec9c0
to
bfc5f0e
Compare
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
f162372
to
52f2533
Compare
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
52f2533
to
9681400
Compare
Add SR-IOV forwarder with kernel, VFIO mechanisms supported.