Skip to content

Commit

Permalink
update qos process
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Aug 2, 2021
1 parent d8c42e1 commit e1caa59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/daemon/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ func (c *Controller) handlePod(key string) error {
provider := fmt.Sprintf("%s.%s.ovn", multiNet.Name, multiNet.Namespace)
if pod.Annotations[fmt.Sprintf(util.AllocatedAnnotationTemplate, provider)] == "true" {
ifaceID = ovs.PodNameToPortName(pod.Name, pod.Namespace, provider)
err = ovs.SetInterfaceBandwidth(pod.Name, pod.Namespace, ifaceID, pod.Annotations[fmt.Sprintf(util.IngressRateAnnotationTemplate, provider)], pod.Annotations[fmt.Sprintf(util.EgressRateAnnotationTemplate, provider)])
err = ovs.SetInterfaceBandwidth(pod.Name, pod.Namespace, ifaceID, pod.Annotations[fmt.Sprintf(util.EgressRateAnnotationTemplate, provider)], pod.Annotations[fmt.Sprintf(util.IngressRateAnnotationTemplate, provider)])
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/daemon/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (csh cniServerHandler) configureNic(podName, podNamespace, provider, netns,
if err = configureHostNic(hostNicName, vlanID); err != nil {
return err
}
if err = ovs.SetInterfaceBandwidth(podName, podNamespace, ifaceID, ingress, egress); err != nil {
if err = ovs.SetInterfaceBandwidth(podName, podNamespace, ifaceID, egress, ingress); err != nil {
return err
}

Expand Down Expand Up @@ -888,7 +888,7 @@ func (csh cniServerHandler) configureNicWithInternalPort(podName, podNamespace,
return containerNicName, fmt.Errorf("failed to parse mac %s %v", macAddr, err)
}

if err = ovs.SetInterfaceBandwidth(podName, podNamespace, ifaceID, ingress, egress); err != nil {
if err = ovs.SetInterfaceBandwidth(podName, podNamespace, ifaceID, egress, ingress); err != nil {
return containerNicName, err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ovs/ovs-vsctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func ClearPodBandwidth(podName, podNamespace string) error {
return nil
}

// SetInterfaceBandwidth set ingress/egress qos for given pod
// SetInterfaceBandwidth set ingress/egress qos for given pod, from the point of pod's view
func SetInterfaceBandwidth(podName, podNamespace, iface, ingress, egress string) error {
ingressMPS, _ := strconv.Atoi(ingress)
ingressKPS := ingressMPS * 1000
Expand Down

0 comments on commit e1caa59

Please sign in to comment.