diff --git a/cmd/ncproxy/ncproxy.go b/cmd/ncproxy/ncproxy.go index 8f37b7d182..462aa43939 100644 --- a/cmd/ncproxy/ncproxy.go +++ b/cmd/ncproxy/ncproxy.go @@ -11,6 +11,7 @@ import ( "github.com/Microsoft/hcsshim/cmd/ncproxy/nodenetsvc" "github.com/Microsoft/hcsshim/hcn" "github.com/Microsoft/hcsshim/internal/computeagent" + "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/ncproxyttrpc" "github.com/Microsoft/hcsshim/internal/oc" "github.com/Microsoft/hcsshim/internal/uvm" @@ -56,6 +57,85 @@ func (s *grpcService) AddNIC(ctx context.Context, req *ncproxygrpc.AddNICRequest return nil, status.Errorf(codes.FailedPrecondition, "No shim registered for namespace `%s`", req.ContainerID) } +func (s *grpcService) ModifyNIC(ctx context.Context, req *ncproxygrpc.ModifyNICRequest) (_ *ncproxygrpc.ModifyNICResponse, err error) { + ctx, span := trace.StartSpan(ctx, "ModifyNIC") + defer span.End() + defer func() { oc.SetSpanStatus(span, err) }() + + span.AddAttributes( + trace.StringAttribute("containerID", req.ContainerID), + trace.StringAttribute("endpointName", req.EndpointName), + trace.StringAttribute("nicID", req.NicID)) + + log.G(ctx).WithField("iov settings", req.IovPolicySettings).Info("ModifyNIC iov settings") + + if req.ContainerID == "" || req.EndpointName == "" || req.NicID == "" || req.IovPolicySettings == nil { + return nil, status.Error(codes.InvalidArgument, "received empty field in request") + } + + if client, ok := containerIDToShim[req.ContainerID]; ok { + caReq := &computeagent.ModifyNICInternalRequest{ + NicID: req.NicID, + EndpointName: req.EndpointName, + IovPolicySettings: &computeagent.IovSettings{ + IovOffloadWeight: req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: req.IovPolicySettings.InterruptModeration, + }, + } + + hcnIOVSettings := &hcn.IovPolicySetting{ + IovOffloadWeight: req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: req.IovPolicySettings.InterruptModeration, + } + rawJSON, err := json.Marshal(hcnIOVSettings) + if err != nil { + return nil, err + } + + iovPolicy := hcn.EndpointPolicy{ + Type: hcn.IOV, + Settings: rawJSON, + } + policies := []hcn.EndpointPolicy{iovPolicy} + + ep, err := hcn.GetEndpointByName(req.EndpointName) + if err != nil { + if _, ok := err.(hcn.EndpointNotFoundError); ok { + return nil, status.Errorf(codes.NotFound, "no endpoint with name `%s` found", req.EndpointName) + } + return nil, errors.Wrapf(err, "failed to get endpoint with name `%s`", req.EndpointName) + } + + // To turn off iov offload on an endpoint, we need to first call into HCS to change the + // offload weight and then call into HNS to revoke the policy. + // + // To turn on iov offload, the reverse order is used. + if req.IovPolicySettings.IovOffloadWeight == 0 { + if _, err := client.ModifyNIC(ctx, caReq); err != nil { + return nil, err + } + if err := modifyEndpoint(ctx, ep.Id, policies, hcn.RequestTypeUpdate); err != nil { + return nil, errors.Wrap(err, "failed to modify network adapter") + } + if err := modifyEndpoint(ctx, ep.Id, policies, hcn.RequestTypeRemove); err != nil { + return nil, errors.Wrap(err, "failed to modify network adapter") + } + } else { + if err := modifyEndpoint(ctx, ep.Id, policies, hcn.RequestTypeUpdate); err != nil { + return nil, errors.Wrap(err, "failed to modify network adapter") + } + if _, err := client.ModifyNIC(ctx, caReq); err != nil { + return nil, err + } + } + + return &ncproxygrpc.ModifyNICResponse{}, nil + } + return nil, status.Errorf(codes.FailedPrecondition, "No shim registered for containerID `%s`", req.ContainerID) +} + func (s *grpcService) DeleteNIC(ctx context.Context, req *ncproxygrpc.DeleteNICRequest) (_ *ncproxygrpc.DeleteNICResponse, err error) { ctx, span := trace.StartSpan(ctx, "DeleteNIC") defer span.End() @@ -176,6 +256,43 @@ func (s *grpcService) CreateNetwork(ctx context.Context, req *ncproxygrpc.Create }, nil } +func constructEndpointPolicies(req *ncproxygrpc.CreateEndpointRequest) ([]hcn.EndpointPolicy, error) { + policies := []hcn.EndpointPolicy{} + if req.IovPolicySettings != nil { + iovSettings := hcn.IovPolicySetting{ + IovOffloadWeight: req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: req.IovPolicySettings.InterruptModeration, + } + iovJSON, err := json.Marshal(iovSettings) + if err != nil { + return []hcn.EndpointPolicy{}, errors.Wrap(err, "failed to marshal IovPolicySettings") + } + policy := hcn.EndpointPolicy{ + Type: hcn.IOV, + Settings: iovJSON, + } + policies = append(policies, policy) + } + + if req.PortnamePolicySetting != nil { + portPolicy := hcn.PortnameEndpointPolicySetting{ + Name: req.PortnamePolicySetting.PortName, + } + portPolicyJSON, err := json.Marshal(portPolicy) + if err != nil { + return []hcn.EndpointPolicy{}, errors.Wrap(err, "failed to marshal portname") + } + policy := hcn.EndpointPolicy{ + Type: hcn.PortName, + Settings: portPolicyJSON, + } + policies = append(policies, policy) + } + + return policies, nil +} + func (s *grpcService) CreateEndpoint(ctx context.Context, req *ncproxygrpc.CreateEndpointRequest) (_ *ncproxygrpc.CreateEndpointResponse, err error) { ctx, span := trace.StartSpan(ctx, "CreateEndpoint") //nolint:ineffassign,staticcheck defer span.End() @@ -210,22 +327,9 @@ func (s *grpcService) CreateEndpoint(ctx context.Context, req *ncproxygrpc.Creat PrefixLength: uint8(prefixLen), } - // Construct the portname policy we'll be setting on the endpoint. - var portPolicy hcn.PortnameEndpointPolicySetting - if req.PortnamePolicySetting != nil { - portPolicy = hcn.PortnameEndpointPolicySetting{ - Name: req.PortnamePolicySetting.PortName, - } - } - portPolicyJSON, err := json.Marshal(portPolicy) + policies, err := constructEndpointPolicies(req) if err != nil { - return nil, errors.Wrap(err, "failed to marshal portname") - } - - // Construct endpoint policy - epPolicy := hcn.EndpointPolicy{ - Type: hcn.EndpointPolicyType(req.PolicyType.String()), - Settings: portPolicyJSON, + return nil, errors.Wrap(err, "failed to construct endpoint policies") } endpoint := &hcn.HostComputeEndpoint{ @@ -233,7 +337,7 @@ func (s *grpcService) CreateEndpoint(ctx context.Context, req *ncproxygrpc.Creat HostComputeNetwork: network.Id, MacAddress: req.Macaddress, IpConfigurations: []hcn.IpConfig{ipConfig}, - Policies: []hcn.EndpointPolicy{epPolicy}, + Policies: policies, SchemaVersion: hcn.SchemaVersion{ Major: 2, Minor: 0, @@ -498,3 +602,22 @@ func (s *ttrpcService) ConfigureNetworking(ctx context.Context, req *ncproxyttrp } return &ncproxyttrpc.ConfigureNetworkingInternalResponse{}, nil } + +func modifyEndpoint(ctx context.Context, id string, policies []hcn.EndpointPolicy, requestType hcn.RequestType) error { + endpointRequest := hcn.PolicyEndpointRequest{ + Policies: policies, + } + + settingsJSON, err := json.Marshal(endpointRequest) + if err != nil { + return err + } + + requestMessage := &hcn.ModifyEndpointSettingRequest{ + ResourceType: hcn.EndpointResourceTypePolicy, + RequestType: requestType, + Settings: settingsJSON, + } + + return hcn.ModifyEndpointSettings(id, requestMessage) +} diff --git a/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go b/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go index fb337b715c..5666c7b62c 100644 --- a/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go +++ b/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go @@ -44,7 +44,7 @@ func (x CreateNetworkRequest_NetworkMode) String() string { } func (CreateNetworkRequest_NetworkMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{4, 0} + return fileDescriptor_b4dbe7e533383a60, []int{6, 0} } type CreateNetworkRequest_IpamType int32 @@ -69,29 +69,7 @@ func (x CreateNetworkRequest_IpamType) String() string { } func (CreateNetworkRequest_IpamType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{4, 1} -} - -type CreateEndpointRequest_EndpointPolicyType int32 - -const ( - CreateEndpointRequest_PortName CreateEndpointRequest_EndpointPolicyType = 0 -) - -var CreateEndpointRequest_EndpointPolicyType_name = map[int32]string{ - 0: "PortName", -} - -var CreateEndpointRequest_EndpointPolicyType_value = map[string]int32{ - "PortName": 0, -} - -func (x CreateEndpointRequest_EndpointPolicyType) String() string { - return proto.EnumName(CreateEndpointRequest_EndpointPolicyType_name, int32(x)) -} - -func (CreateEndpointRequest_EndpointPolicyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{6, 0} + return fileDescriptor_b4dbe7e533383a60, []int{6, 1} } type AddNICRequest struct { @@ -173,6 +151,86 @@ func (m *AddNICResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AddNICResponse proto.InternalMessageInfo +type ModifyNICRequest struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` + EndpointName string `protobuf:"bytes,3,opt,name=endpoint_name,json=endpointName,proto3" json:"endpoint_name,omitempty"` + IovPolicySettings *IovEndpointPolicySetting `protobuf:"bytes,4,opt,name=iov_policy_settings,json=iovPolicySettings,proto3" json:"iov_policy_settings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICRequest) Reset() { *m = ModifyNICRequest{} } +func (*ModifyNICRequest) ProtoMessage() {} +func (*ModifyNICRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b4dbe7e533383a60, []int{2} +} +func (m *ModifyNICRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICRequest.Merge(m, src) +} +func (m *ModifyNICRequest) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICRequest proto.InternalMessageInfo + +type ModifyNICResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICResponse) Reset() { *m = ModifyNICResponse{} } +func (*ModifyNICResponse) ProtoMessage() {} +func (*ModifyNICResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b4dbe7e533383a60, []int{3} +} +func (m *ModifyNICResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICResponse.Merge(m, src) +} +func (m *ModifyNICResponse) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICResponse proto.InternalMessageInfo + type DeleteNICRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` @@ -185,7 +243,7 @@ type DeleteNICRequest struct { func (m *DeleteNICRequest) Reset() { *m = DeleteNICRequest{} } func (*DeleteNICRequest) ProtoMessage() {} func (*DeleteNICRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{2} + return fileDescriptor_b4dbe7e533383a60, []int{4} } func (m *DeleteNICRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -223,7 +281,7 @@ type DeleteNICResponse struct { func (m *DeleteNICResponse) Reset() { *m = DeleteNICResponse{} } func (*DeleteNICResponse) ProtoMessage() {} func (*DeleteNICResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{3} + return fileDescriptor_b4dbe7e533383a60, []int{5} } func (m *DeleteNICResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -267,7 +325,7 @@ type CreateNetworkRequest struct { func (m *CreateNetworkRequest) Reset() { *m = CreateNetworkRequest{} } func (*CreateNetworkRequest) ProtoMessage() {} func (*CreateNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{4} + return fileDescriptor_b4dbe7e533383a60, []int{6} } func (m *CreateNetworkRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -306,7 +364,7 @@ type CreateNetworkResponse struct { func (m *CreateNetworkResponse) Reset() { *m = CreateNetworkResponse{} } func (*CreateNetworkResponse) ProtoMessage() {} func (*CreateNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{5} + return fileDescriptor_b4dbe7e533383a60, []int{7} } func (m *CreateNetworkResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -335,30 +393,24 @@ func (m *CreateNetworkResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateNetworkResponse proto.InternalMessageInfo -type CreateEndpointRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Macaddress string `protobuf:"bytes,2,opt,name=macaddress,proto3" json:"macaddress,omitempty"` - Ipaddress string `protobuf:"bytes,3,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"` - IpaddressPrefixlength string `protobuf:"bytes,4,opt,name=ipaddress_prefixlength,json=ipaddressPrefixlength,proto3" json:"ipaddress_prefixlength,omitempty"` - PolicyType CreateEndpointRequest_EndpointPolicyType `protobuf:"varint,5,opt,name=policy_type,json=policyType,proto3,enum=ncproxygrpc.CreateEndpointRequest_EndpointPolicyType" json:"policy_type,omitempty"` - PortnamePolicySetting *CreateEndpointRequest_PortNameEndpointPolicySetting `protobuf:"bytes,6,opt,name=portname_policy_setting,json=portnamePolicySetting,proto3" json:"portname_policy_setting,omitempty"` - NetworkName string `protobuf:"bytes,7,opt,name=network_name,json=networkName,proto3" json:"network_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type PortNameEndpointPolicySetting struct { + PortName string `protobuf:"bytes,1,opt,name=port_name,json=portName,proto3" json:"port_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateEndpointRequest) Reset() { *m = CreateEndpointRequest{} } -func (*CreateEndpointRequest) ProtoMessage() {} -func (*CreateEndpointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{6} +func (m *PortNameEndpointPolicySetting) Reset() { *m = PortNameEndpointPolicySetting{} } +func (*PortNameEndpointPolicySetting) ProtoMessage() {} +func (*PortNameEndpointPolicySetting) Descriptor() ([]byte, []int) { + return fileDescriptor_b4dbe7e533383a60, []int{8} } -func (m *CreateEndpointRequest) XXX_Unmarshal(b []byte) error { +func (m *PortNameEndpointPolicySetting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PortNameEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CreateEndpointRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_PortNameEndpointPolicySetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalTo(b) @@ -368,38 +420,83 @@ func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *CreateEndpointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateEndpointRequest.Merge(m, src) +func (m *PortNameEndpointPolicySetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_PortNameEndpointPolicySetting.Merge(m, src) } -func (m *CreateEndpointRequest) XXX_Size() int { +func (m *PortNameEndpointPolicySetting) XXX_Size() int { return m.Size() } -func (m *CreateEndpointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateEndpointRequest.DiscardUnknown(m) +func (m *PortNameEndpointPolicySetting) XXX_DiscardUnknown() { + xxx_messageInfo_PortNameEndpointPolicySetting.DiscardUnknown(m) } -var xxx_messageInfo_CreateEndpointRequest proto.InternalMessageInfo +var xxx_messageInfo_PortNameEndpointPolicySetting proto.InternalMessageInfo -type CreateEndpointRequest_PortNameEndpointPolicySetting struct { - PortName string `protobuf:"bytes,1,opt,name=port_name,json=portName,proto3" json:"port_name,omitempty"` +type IovEndpointPolicySetting struct { + IovOffloadWeight uint32 `protobuf:"varint,1,opt,name=IovOffloadWeight,proto3" json:"IovOffloadWeight,omitempty"` + QueuePairsRequested uint32 `protobuf:"varint,2,opt,name=QueuePairsRequested,proto3" json:"QueuePairsRequested,omitempty"` + InterruptModeration uint32 `protobuf:"varint,3,opt,name=InterruptModeration,proto3" json:"InterruptModeration,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Reset() { - *m = CreateEndpointRequest_PortNameEndpointPolicySetting{} +func (m *IovEndpointPolicySetting) Reset() { *m = IovEndpointPolicySetting{} } +func (*IovEndpointPolicySetting) ProtoMessage() {} +func (*IovEndpointPolicySetting) Descriptor() ([]byte, []int) { + return fileDescriptor_b4dbe7e533383a60, []int{9} } -func (*CreateEndpointRequest_PortNameEndpointPolicySetting) ProtoMessage() {} -func (*CreateEndpointRequest_PortNameEndpointPolicySetting) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{6, 0} +func (m *IovEndpointPolicySetting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IovEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IovEndpointPolicySetting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IovEndpointPolicySetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_IovEndpointPolicySetting.Merge(m, src) +} +func (m *IovEndpointPolicySetting) XXX_Size() int { + return m.Size() +} +func (m *IovEndpointPolicySetting) XXX_DiscardUnknown() { + xxx_messageInfo_IovEndpointPolicySetting.DiscardUnknown(m) +} + +var xxx_messageInfo_IovEndpointPolicySetting proto.InternalMessageInfo + +type CreateEndpointRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Macaddress string `protobuf:"bytes,2,opt,name=macaddress,proto3" json:"macaddress,omitempty"` + Ipaddress string `protobuf:"bytes,3,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"` + IpaddressPrefixlength string `protobuf:"bytes,4,opt,name=ipaddress_prefixlength,json=ipaddressPrefixlength,proto3" json:"ipaddress_prefixlength,omitempty"` + NetworkName string `protobuf:"bytes,5,opt,name=network_name,json=networkName,proto3" json:"network_name,omitempty"` + PortnamePolicySetting *PortNameEndpointPolicySetting `protobuf:"bytes,6,opt,name=portname_policy_setting,json=portnamePolicySetting,proto3" json:"portname_policy_setting,omitempty"` + IovPolicySettings *IovEndpointPolicySetting `protobuf:"bytes,7,opt,name=iov_policy_settings,json=iovPolicySettings,proto3" json:"iov_policy_settings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateEndpointRequest) Reset() { *m = CreateEndpointRequest{} } +func (*CreateEndpointRequest) ProtoMessage() {} +func (*CreateEndpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b4dbe7e533383a60, []int{10} } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_Unmarshal(b []byte) error { +func (m *CreateEndpointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CreateEndpointRequest_PortNameEndpointPolicySetting.Marshal(b, m, deterministic) + return xxx_messageInfo_CreateEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalTo(b) @@ -409,17 +506,17 @@ func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_Marshal(b []by return b[:n], nil } } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateEndpointRequest_PortNameEndpointPolicySetting.Merge(m, src) +func (m *CreateEndpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateEndpointRequest.Merge(m, src) } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_Size() int { +func (m *CreateEndpointRequest) XXX_Size() int { return m.Size() } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) XXX_DiscardUnknown() { - xxx_messageInfo_CreateEndpointRequest_PortNameEndpointPolicySetting.DiscardUnknown(m) +func (m *CreateEndpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateEndpointRequest.DiscardUnknown(m) } -var xxx_messageInfo_CreateEndpointRequest_PortNameEndpointPolicySetting proto.InternalMessageInfo +var xxx_messageInfo_CreateEndpointRequest proto.InternalMessageInfo type CreateEndpointResponse struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -431,7 +528,7 @@ type CreateEndpointResponse struct { func (m *CreateEndpointResponse) Reset() { *m = CreateEndpointResponse{} } func (*CreateEndpointResponse) ProtoMessage() {} func (*CreateEndpointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{7} + return fileDescriptor_b4dbe7e533383a60, []int{11} } func (m *CreateEndpointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,7 +568,7 @@ type AddEndpointRequest struct { func (m *AddEndpointRequest) Reset() { *m = AddEndpointRequest{} } func (*AddEndpointRequest) ProtoMessage() {} func (*AddEndpointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{8} + return fileDescriptor_b4dbe7e533383a60, []int{12} } func (m *AddEndpointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -509,7 +606,7 @@ type AddEndpointResponse struct { func (m *AddEndpointResponse) Reset() { *m = AddEndpointResponse{} } func (*AddEndpointResponse) ProtoMessage() {} func (*AddEndpointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{9} + return fileDescriptor_b4dbe7e533383a60, []int{13} } func (m *AddEndpointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,7 +645,7 @@ type DeleteEndpointRequest struct { func (m *DeleteEndpointRequest) Reset() { *m = DeleteEndpointRequest{} } func (*DeleteEndpointRequest) ProtoMessage() {} func (*DeleteEndpointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{10} + return fileDescriptor_b4dbe7e533383a60, []int{14} } func (m *DeleteEndpointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -586,7 +683,7 @@ type DeleteEndpointResponse struct { func (m *DeleteEndpointResponse) Reset() { *m = DeleteEndpointResponse{} } func (*DeleteEndpointResponse) ProtoMessage() {} func (*DeleteEndpointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{11} + return fileDescriptor_b4dbe7e533383a60, []int{15} } func (m *DeleteEndpointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +722,7 @@ type DeleteNetworkRequest struct { func (m *DeleteNetworkRequest) Reset() { *m = DeleteNetworkRequest{} } func (*DeleteNetworkRequest) ProtoMessage() {} func (*DeleteNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{12} + return fileDescriptor_b4dbe7e533383a60, []int{16} } func (m *DeleteNetworkRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -663,7 +760,7 @@ type DeleteNetworkResponse struct { func (m *DeleteNetworkResponse) Reset() { *m = DeleteNetworkResponse{} } func (*DeleteNetworkResponse) ProtoMessage() {} func (*DeleteNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{13} + return fileDescriptor_b4dbe7e533383a60, []int{17} } func (m *DeleteNetworkResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -702,7 +799,7 @@ type GetEndpointRequest struct { func (m *GetEndpointRequest) Reset() { *m = GetEndpointRequest{} } func (*GetEndpointRequest) ProtoMessage() {} func (*GetEndpointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{14} + return fileDescriptor_b4dbe7e533383a60, []int{18} } func (m *GetEndpointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +841,7 @@ type GetEndpointResponse struct { func (m *GetEndpointResponse) Reset() { *m = GetEndpointResponse{} } func (*GetEndpointResponse) ProtoMessage() {} func (*GetEndpointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{15} + return fileDescriptor_b4dbe7e533383a60, []int{19} } func (m *GetEndpointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -783,7 +880,7 @@ type GetNetworkRequest struct { func (m *GetNetworkRequest) Reset() { *m = GetNetworkRequest{} } func (*GetNetworkRequest) ProtoMessage() {} func (*GetNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{16} + return fileDescriptor_b4dbe7e533383a60, []int{20} } func (m *GetNetworkRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -823,7 +920,7 @@ type GetNetworkResponse struct { func (m *GetNetworkResponse) Reset() { *m = GetNetworkResponse{} } func (*GetNetworkResponse) ProtoMessage() {} func (*GetNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{17} + return fileDescriptor_b4dbe7e533383a60, []int{21} } func (m *GetNetworkResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -861,7 +958,7 @@ type GetEndpointsRequest struct { func (m *GetEndpointsRequest) Reset() { *m = GetEndpointsRequest{} } func (*GetEndpointsRequest) ProtoMessage() {} func (*GetEndpointsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{18} + return fileDescriptor_b4dbe7e533383a60, []int{22} } func (m *GetEndpointsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -900,7 +997,7 @@ type GetEndpointsResponse struct { func (m *GetEndpointsResponse) Reset() { *m = GetEndpointsResponse{} } func (*GetEndpointsResponse) ProtoMessage() {} func (*GetEndpointsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{19} + return fileDescriptor_b4dbe7e533383a60, []int{23} } func (m *GetEndpointsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -938,7 +1035,7 @@ type GetNetworksRequest struct { func (m *GetNetworksRequest) Reset() { *m = GetNetworksRequest{} } func (*GetNetworksRequest) ProtoMessage() {} func (*GetNetworksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{20} + return fileDescriptor_b4dbe7e533383a60, []int{24} } func (m *GetNetworksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -977,7 +1074,7 @@ type GetNetworksResponse struct { func (m *GetNetworksResponse) Reset() { *m = GetNetworksResponse{} } func (*GetNetworksResponse) ProtoMessage() {} func (*GetNetworksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4dbe7e533383a60, []int{21} + return fileDescriptor_b4dbe7e533383a60, []int{25} } func (m *GetNetworksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1009,15 +1106,17 @@ var xxx_messageInfo_GetNetworksResponse proto.InternalMessageInfo func init() { proto.RegisterEnum("ncproxygrpc.CreateNetworkRequest_NetworkMode", CreateNetworkRequest_NetworkMode_name, CreateNetworkRequest_NetworkMode_value) proto.RegisterEnum("ncproxygrpc.CreateNetworkRequest_IpamType", CreateNetworkRequest_IpamType_name, CreateNetworkRequest_IpamType_value) - proto.RegisterEnum("ncproxygrpc.CreateEndpointRequest_EndpointPolicyType", CreateEndpointRequest_EndpointPolicyType_name, CreateEndpointRequest_EndpointPolicyType_value) proto.RegisterType((*AddNICRequest)(nil), "ncproxygrpc.AddNICRequest") proto.RegisterType((*AddNICResponse)(nil), "ncproxygrpc.AddNICResponse") + proto.RegisterType((*ModifyNICRequest)(nil), "ncproxygrpc.ModifyNICRequest") + proto.RegisterType((*ModifyNICResponse)(nil), "ncproxygrpc.ModifyNICResponse") proto.RegisterType((*DeleteNICRequest)(nil), "ncproxygrpc.DeleteNICRequest") proto.RegisterType((*DeleteNICResponse)(nil), "ncproxygrpc.DeleteNICResponse") proto.RegisterType((*CreateNetworkRequest)(nil), "ncproxygrpc.CreateNetworkRequest") proto.RegisterType((*CreateNetworkResponse)(nil), "ncproxygrpc.CreateNetworkResponse") + proto.RegisterType((*PortNameEndpointPolicySetting)(nil), "ncproxygrpc.PortNameEndpointPolicySetting") + proto.RegisterType((*IovEndpointPolicySetting)(nil), "ncproxygrpc.IovEndpointPolicySetting") proto.RegisterType((*CreateEndpointRequest)(nil), "ncproxygrpc.CreateEndpointRequest") - proto.RegisterType((*CreateEndpointRequest_PortNameEndpointPolicySetting)(nil), "ncproxygrpc.CreateEndpointRequest.PortNameEndpointPolicySetting") proto.RegisterType((*CreateEndpointResponse)(nil), "ncproxygrpc.CreateEndpointResponse") proto.RegisterType((*AddEndpointRequest)(nil), "ncproxygrpc.AddEndpointRequest") proto.RegisterType((*AddEndpointResponse)(nil), "ncproxygrpc.AddEndpointResponse") @@ -1040,72 +1139,79 @@ func init() { } var fileDescriptor_b4dbe7e533383a60 = []byte{ - // 1041 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0xd3, 0x36, 0x4d, 0x9e, 0xd3, 0x36, 0xfb, 0x9a, 0x64, 0xa3, 0x2c, 0xeb, 0xa4, 0xb3, - 0x87, 0xad, 0x16, 0x91, 0xa0, 0xc0, 0x9e, 0x40, 0x68, 0xbb, 0x09, 0x2a, 0x91, 0x68, 0x88, 0xbc, - 0xcb, 0x0a, 0x09, 0xa4, 0xc8, 0xb5, 0xa7, 0x89, 0x45, 0x63, 0x1b, 0x7b, 0xaa, 0x36, 0x37, 0xce, - 0x48, 0x7c, 0x20, 0xbe, 0xc1, 0x1e, 0x39, 0x72, 0xaa, 0x68, 0xbe, 0x04, 0x1c, 0x91, 0xc7, 0x63, - 0xc7, 0x36, 0xf9, 0x77, 0xdc, 0x93, 0xed, 0xf7, 0xde, 0xfc, 0xde, 0xef, 0xfd, 0x1d, 0xc3, 0xc5, - 0xd8, 0x64, 0x93, 0x9b, 0xcb, 0x96, 0x6e, 0x4f, 0xdb, 0x17, 0xa6, 0xee, 0xda, 0x9e, 0x7d, 0xc5, - 0xda, 0x13, 0xdd, 0xf3, 0x26, 0xe6, 0xb4, 0xad, 0x4f, 0x8d, 0xb6, 0xa5, 0x3b, 0xae, 0x7d, 0x37, - 0x0b, 0x9f, 0x63, 0xd7, 0xd1, 0xdb, 0x16, 0x65, 0xb7, 0xb6, 0xfb, 0xb3, 0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x7e, 0x80, 0x83, 0xc4, 0xc2, 0xc7, 0x93, 0x8d, 0x17, 0x5b, 0x9d, 0xac, - 0x33, 0x89, 0x90, 0x7f, 0x84, 0xc3, 0xe4, 0x7e, 0x40, 0xb2, 0x79, 0x1f, 0xd6, 0x9f, 0xad, 0xb5, - 0x89, 0xc0, 0x55, 0x90, 0x63, 0xc3, 0x8e, 0x8d, 0x74, 0xca, 0xd2, 0xb0, 0xcd, 0xd5, 0x06, 0x71, - 0xc2, 0xc9, 0xe1, 0x4f, 0x11, 0x5e, 0xba, 0x46, 0x52, 0x84, 0x57, 0x6c, 0x0f, 0x9e, 0xe7, 0xc4, - 0x4e, 0x48, 0xe5, 0x79, 0xd9, 0x6e, 0xa9, 0x93, 0x75, 0x26, 0xf1, 0x54, 0xc4, 0xfa, 0x1e, 0x1b, - 0xab, 0x27, 0x62, 0x59, 0x2a, 0x96, 0x8c, 0x0c, 0xc9, 0xe0, 0x77, 0x00, 0x8b, 0xfe, 0x46, 0x65, - 0x65, 0xe3, 0x07, 0x88, 0x9b, 0x06, 0x83, 0x64, 0xf0, 0x7b, 0x28, 0xc6, 0x47, 0x1a, 0x57, 0x92, - 0x08, 0xc7, 0xb2, 0x7e, 0xb2, 0xc6, 0x22, 0x15, 0x7b, 0x38, 0xbb, 0xb8, 0x8a, 0x88, 0xb7, 0x32, - 0xf6, 0xf4, 0xd8, 0x93, 0xcc, 0xeb, 0xda, 0xfb, 0x07, 0x25, 0xf3, 0xd7, 0x83, 0x92, 0xf9, 0x75, - 0xae, 0x48, 0xef, 0xe7, 0x8a, 0xf4, 0xe7, 0x5c, 0x91, 0xfe, 0x9e, 0x2b, 0xd2, 0x65, 0x8e, 0xff, - 0xef, 0x7f, 0xf6, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0xe3, 0xef, 0x3b, 0x40, 0x0c, 0x00, + // 1153 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0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 0xb7, 0x2b, 0x6e, 0x67, 0x3d, 0x7f, 0x1d, 0xea, + 0x42, 0x21, 0xb8, 0xfd, 0xa0, 0x7a, 0x22, 0x57, 0xe2, 0x7a, 0x56, 0x7f, 0x90, 0xe9, 0x93, 0x14, + 0xca, 0xa1, 0x2f, 0xa1, 0x14, 0xdd, 0x24, 0xd0, 0xc3, 0x44, 0x6c, 0xfa, 0x1e, 0x55, 0x6f, 0x2c, + 0x72, 0xc7, 0xb3, 0x45, 0x9f, 0xfc, 0x54, 0xb6, 0xf4, 0xcd, 0x24, 0x95, 0xed, 0xed, 0x9b, 0x42, + 0x0e, 0x7d, 0x0b, 0xe5, 0xc4, 0x07, 0x0b, 0x1d, 0xdc, 0xf9, 0x61, 0xae, 0xe3, 0x65, 0x21, 0x51, + 0xe6, 0xef, 0x60, 0x2b, 0xa9, 0x36, 0x28, 0x6b, 0x5d, 0x6a, 0xb4, 0xea, 0x8f, 0x96, 0xc6, 0x44, + 0xc9, 0x75, 0x50, 0x63, 0xd2, 0x81, 0x9a, 0xe9, 0x06, 0xa4, 0xd3, 0xb6, 0x16, 0x07, 0xc4, 0x01, + 0x27, 0xa5, 0x24, 0x05, 0x38, 0x53, 0x94, 0x52, 0x80, 0x17, 0x68, 0x91, 0xa8, 0x73, 0x42, 0x61, + 0x52, 0x75, 0xce, 0x52, 0xaa, 0x3a, 0x5e, 0x16, 0x12, 0x2f, 0x45, 0x6c, 0x8a, 0x50, 0x73, 0xf1, + 0x7c, 0x65, 0x95, 0x22, 0x63, 0x00, 0x71, 0x0e, 0x3d, 0x03, 0x98, 0x4f, 0x0b, 0x6a, 0x2c, 0x1c, + 0xa3, 0x20, 0xe3, 0x5d, 0x63, 0x86, 0x73, 0xe8, 0x25, 0x6c, 0xc6, 0x05, 0x02, 0x2d, 0x04, 0x11, + 0x0e, 0x79, 0xfd, 0x60, 0x49, 0x44, 0xea, 0xec, 0xa1, 0x12, 0xa0, 0x45, 0x40, 0xbc, 0x85, 0x67, + 0x4f, 0x8b, 0x08, 0xce, 0x3d, 0xad, 0xbd, 0x7e, 0xd3, 0xc8, 0xfd, 0xf1, 0xa6, 0x91, 0xfb, 0x69, + 0xd6, 0x50, 0x5e, 0xcf, 0x1a, 0xca, 0xef, 0xb3, 0x86, 0xf2, 0xe7, 0xac, 0xa1, 0x5c, 0x16, 0xc4, + 0x7f, 0xb5, 0x0f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x63, 0xb5, 0xba, 0xfc, 0x0d, 0x00, 0x00, } @@ -1122,6 +1228,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type NetworkConfigProxyClient interface { AddNIC(ctx context.Context, in *AddNICRequest, opts ...grpc.CallOption) (*AddNICResponse, error) + ModifyNIC(ctx context.Context, in *ModifyNICRequest, opts ...grpc.CallOption) (*ModifyNICResponse, error) DeleteNIC(ctx context.Context, in *DeleteNICRequest, opts ...grpc.CallOption) (*DeleteNICResponse, error) CreateNetwork(ctx context.Context, in *CreateNetworkRequest, opts ...grpc.CallOption) (*CreateNetworkResponse, error) CreateEndpoint(ctx context.Context, in *CreateEndpointRequest, opts ...grpc.CallOption) (*CreateEndpointResponse, error) @@ -1151,6 +1258,15 @@ func (c *networkConfigProxyClient) AddNIC(ctx context.Context, in *AddNICRequest return out, nil } +func (c *networkConfigProxyClient) ModifyNIC(ctx context.Context, in *ModifyNICRequest, opts ...grpc.CallOption) (*ModifyNICResponse, error) { + out := new(ModifyNICResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/ModifyNIC", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *networkConfigProxyClient) DeleteNIC(ctx context.Context, in *DeleteNICRequest, opts ...grpc.CallOption) (*DeleteNICResponse, error) { out := new(DeleteNICResponse) err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/DeleteNIC", in, out, opts...) @@ -1244,6 +1360,7 @@ func (c *networkConfigProxyClient) GetNetworks(ctx context.Context, in *GetNetwo // NetworkConfigProxyServer is the server API for NetworkConfigProxy service. type NetworkConfigProxyServer interface { AddNIC(context.Context, *AddNICRequest) (*AddNICResponse, error) + ModifyNIC(context.Context, *ModifyNICRequest) (*ModifyNICResponse, error) DeleteNIC(context.Context, *DeleteNICRequest) (*DeleteNICResponse, error) CreateNetwork(context.Context, *CreateNetworkRequest) (*CreateNetworkResponse, error) CreateEndpoint(context.Context, *CreateEndpointRequest) (*CreateEndpointResponse, error) @@ -1278,6 +1395,24 @@ func _NetworkConfigProxy_AddNIC_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _NetworkConfigProxy_ModifyNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyNICRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).ModifyNIC(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/ModifyNIC", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).ModifyNIC(ctx, req.(*ModifyNICRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _NetworkConfigProxy_DeleteNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteNICRequest) if err := dec(in); err != nil { @@ -1466,6 +1601,10 @@ var _NetworkConfigProxy_serviceDesc = grpc.ServiceDesc{ MethodName: "AddNIC", Handler: _NetworkConfigProxy_AddNIC_Handler, }, + { + MethodName: "ModifyNIC", + Handler: _NetworkConfigProxy_ModifyNIC_Handler, + }, { MethodName: "DeleteNIC", Handler: _NetworkConfigProxy_DeleteNIC_Handler, @@ -1571,6 +1710,76 @@ func (m *AddNICResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + if len(m.NicID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i += copy(dAtA[i:], m.NicID) + } + if len(m.EndpointName) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) + i += copy(dAtA[i:], m.EndpointName) + } + if m.IovPolicySettings != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) + n1, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1722,7 +1931,7 @@ func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { +func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -1732,55 +1941,52 @@ func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *PortNameEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Name) > 0 { + if len(m.PortName) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.PortName))) + i += copy(dAtA[i:], m.PortName) } - if len(m.Ipaddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) - i += copy(dAtA[i:], m.Ipaddress) + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.IpaddressPrefixlength) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.IpaddressPrefixlength))) - i += copy(dAtA[i:], m.IpaddressPrefixlength) + return i, nil +} + +func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - if m.PolicyType != 0 { - dAtA[i] = 0x28 + return dAtA[:n], nil +} + +func (m *IovEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.IovOffloadWeight != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PolicyType)) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) } - if m.PortnamePolicySetting != nil { - dAtA[i] = 0x32 + if m.QueuePairsRequested != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PortnamePolicySetting.Size())) - n1, err := m.PortnamePolicySetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) } - if len(m.NetworkName) > 0 { - dAtA[i] = 0x3a + if m.InterruptModeration != 0 { + dAtA[i] = 0x18 i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) - i += copy(dAtA[i:], m.NetworkName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.InterruptModeration)) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1788,7 +1994,7 @@ func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { +func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -1798,16 +2004,60 @@ func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Marshal() (dAtA [] return dAtA[:n], nil } -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { +func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.PortName) > 0 { + if len(m.Name) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.PortName))) - i += copy(dAtA[i:], m.PortName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Macaddress) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i += copy(dAtA[i:], m.Macaddress) + } + if len(m.Ipaddress) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i += copy(dAtA[i:], m.Ipaddress) + } + if len(m.IpaddressPrefixlength) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.IpaddressPrefixlength))) + i += copy(dAtA[i:], m.IpaddressPrefixlength) + } + if len(m.NetworkName) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) + i += copy(dAtA[i:], m.NetworkName) + } + if m.PortnamePolicySetting != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PortnamePolicySetting.Size())) + n2, err := m.PortnamePolicySetting.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.IovPolicySettings != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) + n3, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2277,6 +2527,46 @@ func (m *AddNICResponse) Size() (n int) { return n } +func (m *ModifyNICRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NicID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.EndpointName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.IovPolicySettings != nil { + l = m.IovPolicySettings.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ModifyNICResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *DeleteNICRequest) Size() (n int) { if m == nil { return 0 @@ -2365,6 +2655,43 @@ func (m *CreateNetworkResponse) Size() (n int) { return n } +func (m *PortNameEndpointPolicySetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IovEndpointPolicySetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IovOffloadWeight != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.IovOffloadWeight)) + } + if m.QueuePairsRequested != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.QueuePairsRequested)) + } + if m.InterruptModeration != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.InterruptModeration)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *CreateEndpointRequest) Size() (n int) { if m == nil { return 0 @@ -2387,31 +2714,16 @@ func (m *CreateEndpointRequest) Size() (n int) { if l > 0 { n += 1 + l + sovNetworkconfigproxy(uint64(l)) } - if m.PolicyType != 0 { - n += 1 + sovNetworkconfigproxy(uint64(m.PolicyType)) - } - if m.PortnamePolicySetting != nil { - l = m.PortnamePolicySetting.Size() - n += 1 + l + sovNetworkconfigproxy(uint64(l)) - } l = len(m.NetworkName) if l > 0 { n += 1 + l + sovNetworkconfigproxy(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Size() (n int) { - if m == nil { - return 0 + if m.PortnamePolicySetting != nil { + l = m.PortnamePolicySetting.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) } - var l int - _ = l - l = len(m.PortName) - if l > 0 { + if m.IovPolicySettings != nil { + l = m.IovPolicySettings.Size() n += 1 + l + sovNetworkconfigproxy(uint64(l)) } if m.XXX_unrecognized != nil { @@ -2700,6 +3012,30 @@ func (this *AddNICResponse) String() string { }, "") return s } +func (this *ModifyNICRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICRequest{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, + `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, + `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ModifyNICResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} func (this *DeleteNICRequest) String() string { if this == nil { return "nil" @@ -2750,29 +3086,42 @@ func (this *CreateNetworkResponse) String() string { }, "") return s } -func (this *CreateEndpointRequest) String() string { +func (this *PortNameEndpointPolicySetting) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&CreateEndpointRequest{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Macaddress:` + fmt.Sprintf("%v", this.Macaddress) + `,`, - `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, - `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, - `PolicyType:` + fmt.Sprintf("%v", this.PolicyType) + `,`, - `PortnamePolicySetting:` + strings.Replace(fmt.Sprintf("%v", this.PortnamePolicySetting), "CreateEndpointRequest_PortNameEndpointPolicySetting", "CreateEndpointRequest_PortNameEndpointPolicySetting", 1) + `,`, - `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, + s := strings.Join([]string{`&PortNameEndpointPolicySetting{`, + `PortName:` + fmt.Sprintf("%v", this.PortName) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } -func (this *CreateEndpointRequest_PortNameEndpointPolicySetting) String() string { +func (this *IovEndpointPolicySetting) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&CreateEndpointRequest_PortNameEndpointPolicySetting{`, - `PortName:` + fmt.Sprintf("%v", this.PortName) + `,`, + s := strings.Join([]string{`&IovEndpointPolicySetting{`, + `IovOffloadWeight:` + fmt.Sprintf("%v", this.IovOffloadWeight) + `,`, + `QueuePairsRequested:` + fmt.Sprintf("%v", this.QueuePairsRequested) + `,`, + `InterruptModeration:` + fmt.Sprintf("%v", this.InterruptModeration) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateEndpointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateEndpointRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Macaddress:` + fmt.Sprintf("%v", this.Macaddress) + `,`, + `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, + `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, + `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, + `PortnamePolicySetting:` + strings.Replace(fmt.Sprintf("%v", this.PortnamePolicySetting), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -3155,7 +3504,7 @@ func (m *AddNICResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { +func (m *ModifyNICRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3178,10 +3527,10 @@ func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteNICRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ModifyNICRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModifyNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3280,6 +3629,42 @@ func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { } m.EndpointName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IovPolicySettings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IovPolicySettings == nil { + m.IovPolicySettings = &IovEndpointPolicySetting{} + } + if err := m.IovPolicySettings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) @@ -3305,7 +3690,7 @@ func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { +func (m *ModifyNICResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3328,10 +3713,10 @@ func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteNICResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ModifyNICResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModifyNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3359,7 +3744,7 @@ func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { +func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3382,15 +3767,15 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateNetworkRequest: wiretype end group for non-group") + return fmt.Errorf("proto: DeleteNICRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeleteNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3418,12 +3803,216 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.ContainerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NicID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNICResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateNetworkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } m.Mode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -3665,7 +4254,7 @@ func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { +func (m *PortNameEndpointPolicySetting) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3688,15 +4277,15 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateEndpointRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PortNameEndpointPolicySetting: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PortNameEndpointPolicySetting: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PortName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3724,13 +4313,86 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.PortName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IovEndpointPolicySetting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IovEndpointPolicySetting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IovEndpointPolicySetting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IovOffloadWeight", wireType) + } + m.IovOffloadWeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IovOffloadWeight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Macaddress", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueuePairsRequested", wireType) } - var stringLen uint64 + m.QueuePairsRequested = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkconfigproxy @@ -3740,27 +4402,87 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.QueuePairsRequested |= uint32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InterruptModeration", wireType) + } + m.InterruptModeration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InterruptModeration |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthNetworkconfigproxy } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Macaddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateEndpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ipaddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3788,11 +4510,11 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ipaddress = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IpaddressPrefixlength", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Macaddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3820,13 +4542,13 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IpaddressPrefixlength = string(dAtA[iNdEx:postIndex]) + m.Macaddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PolicyType", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ipaddress", wireType) } - m.PolicyType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkconfigproxy @@ -3836,16 +4558,29 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PolicyType |= CreateEndpointRequest_EndpointPolicyType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 6: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ipaddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortnamePolicySetting", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IpaddressPrefixlength", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkconfigproxy @@ -3855,29 +4590,25 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthNetworkconfigproxy } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthNetworkconfigproxy } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PortnamePolicySetting == nil { - m.PortnamePolicySetting = &CreateEndpointRequest_PortNameEndpointPolicySetting{} - } - if err := m.PortnamePolicySetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.IpaddressPrefixlength = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NetworkName", wireType) } @@ -3909,65 +4640,47 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { } m.NetworkName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) - if err != nil { - return err + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortnamePolicySetting", wireType) } - if skippy < 0 { + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthNetworkconfigproxy } - if (iNdEx + skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthNetworkconfigproxy } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.PortnamePolicySetting == nil { + m.PortnamePolicySetting = &PortNameEndpointPolicySetting{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.PortnamePolicySetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PortNameEndpointPolicySetting: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PortNameEndpointPolicySetting: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IovPolicySettings", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkconfigproxy @@ -3977,23 +4690,27 @@ func (m *CreateEndpointRequest_PortNameEndpointPolicySetting) Unmarshal(dAtA []b } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthNetworkconfigproxy } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthNetworkconfigproxy } if postIndex > l { return io.ErrUnexpectedEOF } - m.PortName = string(dAtA[iNdEx:postIndex]) + if m.IovPolicySettings == nil { + m.IovPolicySettings = &IovEndpointPolicySetting{} + } + if err := m.IovPolicySettings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/cmd/ncproxy/ncproxygrpc/networkconfigproxy.proto b/cmd/ncproxy/ncproxygrpc/networkconfigproxy.proto index 4a7d8ed495..c63483671c 100644 --- a/cmd/ncproxy/ncproxygrpc/networkconfigproxy.proto +++ b/cmd/ncproxy/ncproxygrpc/networkconfigproxy.proto @@ -4,6 +4,7 @@ package ncproxygrpc; service NetworkConfigProxy { rpc AddNIC(AddNICRequest) returns (AddNICResponse) {} + rpc ModifyNIC(ModifyNICRequest) returns (ModifyNICResponse) {} rpc DeleteNIC(DeleteNICRequest) returns (DeleteNICResponse) {} rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) {} rpc CreateEndpoint(CreateEndpointRequest) returns (CreateEndpointResponse) {} @@ -24,6 +25,15 @@ message AddNICRequest { message AddNICResponse {} +message ModifyNICRequest { + string container_id = 1; + string nic_id = 2; + string endpoint_name = 3; + IovEndpointPolicySetting iov_policy_settings = 4; +} + +message ModifyNICResponse {} + message DeleteNICRequest { string container_id = 1; string nic_id = 2; @@ -56,23 +66,24 @@ message CreateNetworkResponse{ string id = 1; } -message CreateEndpointRequest { - enum EndpointPolicyType - { - PortName = 0; - } +message PortNameEndpointPolicySetting { + string port_name = 1; +} - message PortNameEndpointPolicySetting { - string port_name = 1; - } +message IovEndpointPolicySetting { + uint32 IovOffloadWeight = 1; + uint32 QueuePairsRequested = 2; + uint32 InterruptModeration = 3; +} +message CreateEndpointRequest { string name = 1; string macaddress = 2; string ipaddress = 3; string ipaddress_prefixlength = 4; - EndpointPolicyType policy_type = 5; + string network_name = 5; PortNameEndpointPolicySetting portname_policy_setting = 6; - string network_name = 7; + IovEndpointPolicySetting iov_policy_settings = 7; } message CreateEndpointResponse{ diff --git a/cmd/ncproxy/nodenetsvc/nodenetsvc.proto b/cmd/ncproxy/nodenetsvc/nodenetsvc.proto index 58d12aa42a..f8d2c4973f 100644 --- a/cmd/ncproxy/nodenetsvc/nodenetsvc.proto +++ b/cmd/ncproxy/nodenetsvc/nodenetsvc.proto @@ -38,4 +38,4 @@ message ConfigureContainerNetworkingResponse { bool success = 1; string response_json = 2; string error_json= 3; -} \ No newline at end of file +} diff --git a/hcn/hcnpolicy.go b/hcn/hcnpolicy.go index 99493a4df4..c032d79490 100644 --- a/hcn/hcnpolicy.go +++ b/hcn/hcnpolicy.go @@ -19,6 +19,7 @@ const ( L4WFPPROXY EndpointPolicyType = "L4WFPPROXY" PortName EndpointPolicyType = "PortName" EncapOverhead EndpointPolicyType = "EncapOverhead" + IOV EndpointPolicyType = "Iov" // Endpoint and Network have InterfaceConstraint and ProviderAddress NetworkProviderAddress EndpointPolicyType = "ProviderAddress" NetworkInterfaceConstraint EndpointPolicyType = "InterfaceConstraint" @@ -171,6 +172,13 @@ type EncapOverheadEndpointPolicySetting struct { Overhead uint16 `json:",omitempty"` } +// IovPolicySetting sets the Iov settings for an endpoint. +type IovPolicySetting struct { + IovOffloadWeight uint32 `json:",omitempty"` + QueuePairsRequested uint32 `json:",omitempty"` + InterruptModeration uint32 `json:",omitempty"` +} + /// Endpoint and Network Policy objects // ProviderAddressEndpointPolicySetting sets the PA for an endpoint. diff --git a/internal/computeagent/computeagent.pb.go b/internal/computeagent/computeagent.pb.go index 4fa9dd36e9..fa92638697 100644 --- a/internal/computeagent/computeagent.pb.go +++ b/internal/computeagent/computeagent.pb.go @@ -104,6 +104,85 @@ func (m *AddNICInternalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AddNICInternalResponse proto.InternalMessageInfo +type ModifyNICInternalRequest struct { + NicID string `protobuf:"bytes,1,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` + EndpointName string `protobuf:"bytes,2,opt,name=endpoint_name,json=endpointName,proto3" json:"endpoint_name,omitempty"` + IovPolicySettings *IovSettings `protobuf:"bytes,3,opt,name=iov_policy_settings,json=iovPolicySettings,proto3" json:"iov_policy_settings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICInternalRequest) Reset() { *m = ModifyNICInternalRequest{} } +func (*ModifyNICInternalRequest) ProtoMessage() {} +func (*ModifyNICInternalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2f03dc308add4c, []int{2} +} +func (m *ModifyNICInternalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICInternalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICInternalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICInternalRequest.Merge(m, src) +} +func (m *ModifyNICInternalRequest) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICInternalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICInternalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICInternalRequest proto.InternalMessageInfo + +type ModifyNICInternalResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICInternalResponse) Reset() { *m = ModifyNICInternalResponse{} } +func (*ModifyNICInternalResponse) ProtoMessage() {} +func (*ModifyNICInternalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2f03dc308add4c, []int{3} +} +func (m *ModifyNICInternalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICInternalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICInternalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICInternalResponse.Merge(m, src) +} +func (m *ModifyNICInternalResponse) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICInternalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICInternalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICInternalResponse proto.InternalMessageInfo + type DeleteNICInternalRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` @@ -116,7 +195,7 @@ type DeleteNICInternalRequest struct { func (m *DeleteNICInternalRequest) Reset() { *m = DeleteNICInternalRequest{} } func (*DeleteNICInternalRequest) ProtoMessage() {} func (*DeleteNICInternalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7f2f03dc308add4c, []int{2} + return fileDescriptor_7f2f03dc308add4c, []int{4} } func (m *DeleteNICInternalRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -154,7 +233,7 @@ type DeleteNICInternalResponse struct { func (m *DeleteNICInternalResponse) Reset() { *m = DeleteNICInternalResponse{} } func (*DeleteNICInternalResponse) ProtoMessage() {} func (*DeleteNICInternalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7f2f03dc308add4c, []int{3} + return fileDescriptor_7f2f03dc308add4c, []int{5} } func (m *DeleteNICInternalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -183,11 +262,55 @@ func (m *DeleteNICInternalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteNICInternalResponse proto.InternalMessageInfo +type IovSettings struct { + IovOffloadWeight uint32 `protobuf:"varint,1,opt,name=IovOffloadWeight,proto3" json:"IovOffloadWeight,omitempty"` + QueuePairsRequested uint32 `protobuf:"varint,2,opt,name=QueuePairsRequested,proto3" json:"QueuePairsRequested,omitempty"` + InterruptModeration uint32 `protobuf:"varint,3,opt,name=InterruptModeration,proto3" json:"InterruptModeration,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IovSettings) Reset() { *m = IovSettings{} } +func (*IovSettings) ProtoMessage() {} +func (*IovSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2f03dc308add4c, []int{6} +} +func (m *IovSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IovSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IovSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IovSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_IovSettings.Merge(m, src) +} +func (m *IovSettings) XXX_Size() int { + return m.Size() +} +func (m *IovSettings) XXX_DiscardUnknown() { + xxx_messageInfo_IovSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_IovSettings proto.InternalMessageInfo + func init() { proto.RegisterType((*AddNICInternalRequest)(nil), "AddNICInternalRequest") proto.RegisterType((*AddNICInternalResponse)(nil), "AddNICInternalResponse") + proto.RegisterType((*ModifyNICInternalRequest)(nil), "ModifyNICInternalRequest") + proto.RegisterType((*ModifyNICInternalResponse)(nil), "ModifyNICInternalResponse") proto.RegisterType((*DeleteNICInternalRequest)(nil), "DeleteNICInternalRequest") proto.RegisterType((*DeleteNICInternalResponse)(nil), "DeleteNICInternalResponse") + proto.RegisterType((*IovSettings)(nil), "IovSettings") } func init() { @@ -195,29 +318,38 @@ func init() { } var fileDescriptor_7f2f03dc308add4c = []byte{ - // 339 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xb1, 0x4f, 0xfa, 0x40, - 0x14, 0xc7, 0x7b, 0xbf, 0x5f, 0x20, 0xe1, 0xc0, 0x98, 0x5c, 0x14, 0x4b, 0x4d, 0x0a, 0xa9, 0x8b, - 0x53, 0x9b, 0xe0, 0xc8, 0x60, 0x80, 0x3a, 0x74, 0x90, 0xa1, 0x93, 0xba, 0x90, 0x72, 0x7d, 0x96, - 0x4b, 0xe8, 0x5d, 0xed, 0x1d, 0xbb, 0xff, 0x82, 0x26, 0xfe, 0x4f, 0x8c, 0x8e, 0x4e, 0x44, 0xee, - 0x2f, 0x31, 0xa5, 0x42, 0xd4, 0xc0, 0xe0, 0xe6, 0xf6, 0xde, 0x37, 0xdf, 0xdc, 0x7d, 0xde, 0xf7, - 0x3d, 0x7c, 0x95, 0x30, 0x35, 0x9d, 0x4f, 0x5c, 0x2a, 0x52, 0xef, 0x9a, 0xd1, 0x5c, 0x48, 0x71, - 0xaf, 0xbc, 0x29, 0x95, 0x72, 0xca, 0x52, 0x8f, 0x71, 0x05, 0x39, 0x8f, 0x66, 0x1e, 0x15, 0x69, - 0x36, 0x57, 0x10, 0x25, 0xc0, 0xd5, 0xb7, 0xc6, 0xcd, 0x72, 0xa1, 0x84, 0x75, 0x94, 0x88, 0x44, - 0xac, 0x4b, 0xaf, 0xa8, 0x4a, 0xd5, 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 0x9b, 0x1b, 0x63, - 0x52, 0x5d, 0xdf, 0xd6, 0xc5, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x77, 0xdb, 0x0e, 0x0a, 0xba, - 0x02, 0x00, 0x00, + // 492 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xb3, 0x45, 0x8d, 0x94, 0x4d, 0x22, 0x60, 0x0b, 0xc5, 0x71, 0x25, 0xb7, 0x0a, 0x17, + 0xc4, 0xc1, 0x46, 0xe1, 0x58, 0x24, 0xd4, 0x26, 0x1c, 0x7c, 0x48, 0x28, 0xe6, 0xc0, 0x9f, 0x4b, + 0xe4, 0xda, 0x13, 0x67, 0xa4, 0x78, 0xc7, 0xd8, 0xeb, 0x48, 0xbd, 0xf1, 0x0c, 0x48, 0x1c, 0x11, + 0xaf, 0xd3, 0x23, 0x37, 0x38, 0x55, 0xd4, 0x4f, 0x82, 0xec, 0x38, 0xa1, 0x50, 0x5b, 0x82, 0x5b, + 0x6f, 0xde, 0x6f, 0x3f, 0xef, 0xfc, 0x76, 0xe6, 0xd3, 0xf2, 0x17, 0x01, 0xaa, 0x79, 0x7a, 0x6a, + 0x7a, 0x14, 0x5a, 0x63, 0xf4, 0x62, 0x4a, 0x68, 0xa6, 0xac, 0xb9, 0x97, 0x24, 0x73, 0x0c, 0x2d, + 0x94, 0x0a, 0x62, 0xe9, 0x2e, 0x2c, 0x8f, 0xc2, 0x28, 0x55, 0xe0, 0x06, 0x20, 0xd5, 0x1f, 0x0b, + 0x33, 0x8a, 0x49, 0x91, 0x7e, 0x2f, 0xa0, 0x80, 0x8a, 0x4f, 0x2b, 0xff, 0x5a, 0xa9, 0xfd, 0x4f, + 0x8c, 0xdf, 0x3f, 0xf2, 0xfd, 0x89, 0x3d, 0xb4, 0xcb, 0x83, 0x1c, 0xf8, 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f, 0x00, 0x06, 0x73, 0x55, 0xb0, 0x76, 0x9d, 0x6b, 0xba, 0x78, 0xc2, 0x77, 0x5e, 0xa5, + 0x90, 0xc2, 0x89, 0x8b, 0x71, 0x52, 0x5e, 0x14, 0x56, 0xb0, 0x5d, 0xa7, 0x6a, 0x2b, 0xff, 0xa3, + 0x20, 0x88, 0xd3, 0x48, 0x8d, 0xc9, 0x87, 0xd8, 0x55, 0x48, 0xb2, 0xa0, 0xee, 0x3a, 0x55, 0x5b, + 0x83, 0xef, 0x8c, 0x77, 0x86, 0xab, 0xbc, 0x1f, 0xe5, 0x79, 0x17, 0x87, 0xbc, 0xb9, 0x8a, 0x8f, + 0xd8, 0x35, 0x2b, 0xb3, 0xad, 0x3f, 0x30, 0x6b, 0xf2, 0xd5, 0x10, 0x23, 0xde, 0xda, 0xcc, 0x4f, + 0xf4, 0xcc, 0xba, 0xb0, 0xe9, 0xba, 0x59, 0x3f, 0xe6, 0xe2, 0x94, 0x4d, 0x43, 0x45, 0xcf, 0xac, + 0x9b, 0xb9, 0xae, 0x9b, 0xf5, 0x7d, 0x6f, 0x1c, 0xbf, 0x3b, 0xbf, 0x34, 0x1a, 0x3f, 0x2e, 0x8d, + 0xc6, 0xc7, 0xcc, 0x60, 0xe7, 0x99, 0xc1, 0xbe, 0x65, 0x06, 0xfb, 0x99, 0x19, 0xec, 0xfd, 0xf3, + 0xff, 0x7f, 0x13, 0x0e, 0xaf, 0x2e, 0xde, 0x36, 0x4e, 0x9b, 0xc5, 0x03, 0xf0, 0xf4, 0x57, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x20, 0x70, 0xc7, 0x0f, 0x5f, 0x04, 0x00, 0x00, } func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { @@ -280,6 +412,70 @@ func (m *AddNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.NicID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i += copy(dAtA[i:], m.NicID) + } + if len(m.EndpointName) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.EndpointName))) + i += copy(dAtA[i:], m.EndpointName) + } + if m.IovPolicySettings != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovPolicySettings.Size())) + n1, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -340,6 +536,42 @@ func (m *DeleteNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *IovSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IovSettings) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.IovOffloadWeight != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) + } + if m.QueuePairsRequested != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + } + if m.InterruptModeration != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintComputeagent(dAtA, i, uint64(m.InterruptModeration)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func encodeVarintComputeagent(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -385,6 +617,42 @@ func (m *AddNICInternalResponse) Size() (n int) { return n } +func (m *ModifyNICInternalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NicID) + if l > 0 { + n += 1 + l + sovComputeagent(uint64(l)) + } + l = len(m.EndpointName) + if l > 0 { + n += 1 + l + sovComputeagent(uint64(l)) + } + if m.IovPolicySettings != nil { + l = m.IovPolicySettings.Size() + n += 1 + l + sovComputeagent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ModifyNICInternalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *DeleteNICInternalRequest) Size() (n int) { if m == nil { return 0 @@ -421,6 +689,27 @@ func (m *DeleteNICInternalResponse) Size() (n int) { return n } +func (m *IovSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IovOffloadWeight != 0 { + n += 1 + sovComputeagent(uint64(m.IovOffloadWeight)) + } + if m.QueuePairsRequested != 0 { + n += 1 + sovComputeagent(uint64(m.QueuePairsRequested)) + } + if m.InterruptModeration != 0 { + n += 1 + sovComputeagent(uint64(m.InterruptModeration)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovComputeagent(x uint64) (n int) { for { n++ @@ -457,6 +746,29 @@ func (this *AddNICInternalResponse) String() string { }, "") return s } +func (this *ModifyNICInternalRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICInternalRequest{`, + `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, + `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, + `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovSettings", "IovSettings", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ModifyNICInternalResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICInternalResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} func (this *DeleteNICInternalRequest) String() string { if this == nil { return "nil" @@ -480,6 +792,19 @@ func (this *DeleteNICInternalResponse) String() string { }, "") return s } +func (this *IovSettings) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IovSettings{`, + `IovOffloadWeight:` + fmt.Sprintf("%v", this.IovOffloadWeight) + `,`, + `QueuePairsRequested:` + fmt.Sprintf("%v", this.QueuePairsRequested) + `,`, + `InterruptModeration:` + fmt.Sprintf("%v", this.InterruptModeration) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} func valueToStringComputeagent(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -491,6 +816,7 @@ func valueToStringComputeagent(v interface{}) string { type ComputeAgentService interface { AddNIC(ctx context.Context, req *AddNICInternalRequest) (*AddNICInternalResponse, error) + ModifyNIC(ctx context.Context, req *ModifyNICInternalRequest) (*ModifyNICInternalResponse, error) DeleteNIC(ctx context.Context, req *DeleteNICInternalRequest) (*DeleteNICInternalResponse, error) } @@ -503,6 +829,13 @@ func RegisterComputeAgentService(srv *github_com_containerd_ttrpc.Server, svc Co } return svc.AddNIC(ctx, &req) }, + "ModifyNIC": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ModifyNICInternalRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.ModifyNIC(ctx, &req) + }, "DeleteNIC": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { var req DeleteNICInternalRequest if err := unmarshal(&req); err != nil { @@ -531,6 +864,14 @@ func (c *computeAgentClient) AddNIC(ctx context.Context, req *AddNICInternalRequ return &resp, nil } +func (c *computeAgentClient) ModifyNIC(ctx context.Context, req *ModifyNICInternalRequest) (*ModifyNICInternalResponse, error) { + var resp ModifyNICInternalResponse + if err := c.client.Call(ctx, "ComputeAgent", "ModifyNIC", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + func (c *computeAgentClient) DeleteNIC(ctx context.Context, req *DeleteNICInternalRequest) (*DeleteNICInternalResponse, error) { var resp DeleteNICInternalResponse if err := c.client.Call(ctx, "ComputeAgent", "DeleteNIC", req, &resp); err != nil { @@ -742,7 +1083,7 @@ func (m *AddNICInternalResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { +func (m *ModifyNICInternalRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -765,15 +1106,15 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteNICInternalRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ModifyNICInternalRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteNICInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModifyNICInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -801,11 +1142,11 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerID = string(dAtA[iNdEx:postIndex]) + m.NicID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -833,13 +1174,13 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NicID = string(dAtA[iNdEx:postIndex]) + m.EndpointName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IovPolicySettings", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowComputeagent @@ -849,23 +1190,27 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthComputeagent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthComputeagent } if postIndex > l { return io.ErrUnexpectedEOF } - m.EndpointName = string(dAtA[iNdEx:postIndex]) + if m.IovPolicySettings == nil { + m.IovPolicySettings = &IovSettings{} + } + if err := m.IovPolicySettings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -892,7 +1237,211 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { +func (m *ModifyNICInternalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyNICInternalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyNICInternalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipComputeagent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNICInternalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNICInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthComputeagent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComputeagent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthComputeagent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComputeagent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NicID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthComputeagent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthComputeagent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipComputeagent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -946,6 +1495,117 @@ func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *IovSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IovSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IovSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IovOffloadWeight", wireType) + } + m.IovOffloadWeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IovOffloadWeight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueuePairsRequested", wireType) + } + m.QueuePairsRequested = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueuePairsRequested |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InterruptModeration", wireType) + } + m.InterruptModeration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComputeagent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InterruptModeration |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipComputeagent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthComputeagent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipComputeagent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/internal/computeagent/computeagent.proto b/internal/computeagent/computeagent.proto index 49fa7f36cb..06e301063b 100644 --- a/internal/computeagent/computeagent.proto +++ b/internal/computeagent/computeagent.proto @@ -6,6 +6,7 @@ import weak "gogoproto/gogo.proto"; service ComputeAgent{ rpc AddNIC(AddNICInternalRequest) returns (AddNICInternalResponse) {} + rpc ModifyNIC(ModifyNICInternalRequest) returns (ModifyNICInternalResponse) {} rpc DeleteNIC(DeleteNICInternalRequest) returns (DeleteNICInternalResponse) {} } @@ -17,10 +18,24 @@ message AddNICInternalRequest { message AddNICInternalResponse {} +message ModifyNICInternalRequest { + string nic_id = 1; + string endpoint_name = 2; + IovSettings iov_policy_settings = 3; +} + +message ModifyNICInternalResponse {} + message DeleteNICInternalRequest { string container_id = 1; string nic_id = 2; string endpoint_name = 3; } -message DeleteNICInternalResponse {} \ No newline at end of file +message DeleteNICInternalResponse {} + +message IovSettings { + uint32 IovOffloadWeight = 1; + uint32 QueuePairsRequested = 2; + uint32 InterruptModeration = 3; +} diff --git a/internal/ncproxyttrpc/networkconfigproxy.proto b/internal/ncproxyttrpc/networkconfigproxy.proto index 9ec8864c3e..882d8c3008 100644 --- a/internal/ncproxyttrpc/networkconfigproxy.proto +++ b/internal/ncproxyttrpc/networkconfigproxy.proto @@ -26,4 +26,4 @@ message ConfigureNetworkingInternalRequest{ RequestTypeInternal request_type = 2; } -message ConfigureNetworkingInternalResponse{} \ No newline at end of file +message ConfigureNetworkingInternalResponse{} diff --git a/internal/schema2/interrupt_moderation_mode.go b/internal/schema2/interrupt_moderation_mode.go new file mode 100644 index 0000000000..a614d63bd7 --- /dev/null +++ b/internal/schema2/interrupt_moderation_mode.go @@ -0,0 +1,42 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type InterruptModerationName string + +// The valid interrupt moderation modes for I/O virtualization (IOV) offloading. +const ( + DefaultName InterruptModerationName = "Default" + AdaptiveName InterruptModerationName = "Adaptive" + OffName InterruptModerationName = "Off" + LowName InterruptModerationName = "Low" + MediumName InterruptModerationName = "Medium" + HighName InterruptModerationName = "High" +) + +type InterruptModerationValue uint32 + +const ( + DefaultValue InterruptModerationValue = iota + AdaptiveValue + OffValue + LowValue InterruptModerationValue = 100 + MediumValue InterruptModerationValue = 200 + HighValue InterruptModerationValue = 300 +) + +var InterruptModerationValueToName = map[InterruptModerationValue]InterruptModerationName{ + DefaultValue: DefaultName, + AdaptiveValue: AdaptiveName, + OffValue: OffName, + LowValue: LowName, + MediumValue: MediumName, + HighValue: HighName, +} diff --git a/internal/schema2/iov_settings.go b/internal/schema2/iov_settings.go new file mode 100644 index 0000000000..2a55cc37cd --- /dev/null +++ b/internal/schema2/iov_settings.go @@ -0,0 +1,22 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type IovSettings struct { + // The weight assigned to this port for I/O virtualization (IOV) offloading. + // Setting this to 0 disables IOV offloading. + OffloadWeight *uint32 `json:"OffloadWeight,omitempty"` + + // The number of queue pairs requested for this port for I/O virtualization (IOV) offloading. + QueuePairsRequested *uint32 `json:"QueuePairsRequested,omitempty"` + + // The interrupt moderation mode for I/O virtualization (IOV) offloading. + InterruptModeration *InterruptModerationName `json:"InterruptModeration,omitempty"` +} diff --git a/internal/schema2/network_adapter.go b/internal/schema2/network_adapter.go index a9c750b341..7408abd317 100644 --- a/internal/schema2/network_adapter.go +++ b/internal/schema2/network_adapter.go @@ -11,6 +11,7 @@ package hcsschema type NetworkAdapter struct { EndpointId string `json:"EndpointId,omitempty"` - MacAddress string `json:"MacAddress,omitempty"` + // The I/O virtualization (IOV) offloading configuration. + IovSettings *IovSettings `json:"IovSettings,omitempty"` } diff --git a/internal/uvm/computeagent.go b/internal/uvm/computeagent.go index a2cfc8215f..a3d6ac62e0 100644 --- a/internal/uvm/computeagent.go +++ b/internal/uvm/computeagent.go @@ -7,10 +7,13 @@ import ( "github.com/Microsoft/go-winio" "github.com/Microsoft/hcsshim/internal/computeagent" "github.com/Microsoft/hcsshim/internal/hns" + hcsschema "github.com/Microsoft/hcsshim/internal/schema2" "github.com/Microsoft/hcsshim/pkg/octtrpc" "github.com/containerd/ttrpc" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/Microsoft/hcsshim/internal/log" ) @@ -36,6 +39,10 @@ func (ca *computeAgent) AddNIC(ctx context.Context, req *computeagent.AddNICInte "nicID": req.NicID, }).Info("AddNIC request") + if req.NicID == "" || req.EndpointName == "" { + return nil, status.Error(codes.InvalidArgument, "received empty field in request") + } + endpoint, err := hns.GetHNSEndpointByName(req.EndpointName) if err != nil { return nil, errors.Wrapf(err, "failed to get endpoint with name %q", req.EndpointName) @@ -46,6 +53,44 @@ func (ca *computeAgent) AddNIC(ctx context.Context, req *computeagent.AddNICInte return &computeagent.AddNICInternalResponse{}, nil } +// ModifyNIC will modify a NIC from the computeagent services hosting UVM. +func (ca *computeAgent) ModifyNIC(ctx context.Context, req *computeagent.ModifyNICInternalRequest) (*computeagent.ModifyNICInternalResponse, error) { + log.G(ctx).WithFields(logrus.Fields{ + "nicID": req.NicID, + "endpointName": req.EndpointName, + }).Info("ModifyNIC request") + + if req.NicID == "" || req.EndpointName == "" || req.IovPolicySettings == nil { + return nil, status.Error(codes.InvalidArgument, "received empty field in request") + } + + endpoint, err := hns.GetHNSEndpointByName(req.EndpointName) + if err != nil { + return nil, errors.Wrapf(err, "failed to get endpoint with name `%s`", req.EndpointName) + } + + moderationValue := hcsschema.InterruptModerationValue(req.IovPolicySettings.InterruptModeration) + moderationName := hcsschema.InterruptModerationValueToName[moderationValue] + + iovSettings := &hcsschema.IovSettings{ + OffloadWeight: &req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: &req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: &moderationName, + } + + nic := &hcsschema.NetworkAdapter{ + EndpointId: endpoint.Id, + MacAddress: endpoint.MacAddress, + IovSettings: iovSettings, + } + + if err := ca.uvm.UpdateNIC(ctx, req.NicID, nic); err != nil { + return nil, errors.Wrap(err, "failed to update UVM's network adapter") + } + + return &computeagent.ModifyNICInternalResponse{}, nil +} + // DeleteNIC will delete a NIC from the computeagent services hosting UVM. func (ca *computeAgent) DeleteNIC(ctx context.Context, req *computeagent.DeleteNICInternalRequest) (*computeagent.DeleteNICInternalResponse, error) { log.G(ctx).WithFields(logrus.Fields{ @@ -54,6 +99,10 @@ func (ca *computeAgent) DeleteNIC(ctx context.Context, req *computeagent.DeleteN "endpointName": req.EndpointName, }).Info("DeleteNIC request") + if req.NicID == "" || req.EndpointName == "" { + return nil, status.Error(codes.InvalidArgument, "received empty field in request") + } + endpoint, err := hns.GetHNSEndpointByName(req.EndpointName) if err != nil { return nil, errors.Wrapf(err, "failed to get endpoint with name %q", req.EndpointName) diff --git a/internal/uvm/network.go b/internal/uvm/network.go index 1b72d7ce56..04f4b9252a 100644 --- a/internal/uvm/network.go +++ b/internal/uvm/network.go @@ -642,3 +642,13 @@ func (uvm *UtilityVM) RemoveAllNICs(ctx context.Context) error { } return nil } + +// UpdateNIC updates a UVM's network adapter. +func (uvm *UtilityVM) UpdateNIC(ctx context.Context, id string, settings *hcsschema.NetworkAdapter) error { + req := &hcsschema.ModifySettingRequest{ + RequestType: requesttype.Update, + ResourcePath: fmt.Sprintf(networkResourceFormat, id), + Settings: settings, + } + return uvm.modify(ctx, req) +}