ovs-dpdk bridge internal port 访问延迟问题, fix

来源:互联网 发布:省市区县json数据 编辑:程序博客网 时间:2024/05/17 22:17

转载请注明出处:http://blog.csdn.net/hliyuxin/article/details/51736742
现有的云主机结构中,物理机通过bridge的brpri和linux系统通信(如dns, 云硬盘等),当主机负载比较高时,访问主机的管理口出出现延迟。

Bridge brpri
Controller “tcp:127.0.0.1:56XXX”
is_connected: true
fail_mode: standalone
Port “n-1b107218”
Interface “n-1b107218”
type: dpdkvhostuser
Port “n-96bc3455”
Interface “n-96bc3455”
type: dpdkvhostuser
Port brpri
Interface brpri
type: internal

原因是,local port是tap类型port, 在main线程中的dpif_netdev_run处理,主机负载比较高时且local port的流量比较大时,main线程有很多其它的事情处理,所以导致local port 响应延迟。

这时,将local port 的处理单独用一个pmd线程。修改代码之后,访问延迟的问题不再出现。

diff --git a/lib/netdev.c b/lib/netdev.cindex 19dc824..a051a0e 100644--- a/lib/netdev.c+++ b/lib/netdev.c@@ -112,6 +112,7 @@ netdev_is_pmd(const struct netdev *netdev)     return (!strcmp(netdev->netdev_class->type, "dpdk") ||             !strcmp(netdev->netdev_class->type, "dpdkb") ||             !strcmp(netdev->netdev_class->type, "dpdkr") ||+            (!strcmp(netdev->netdev_class->type, "tap") && strcmp(netdev->name, "ovs-netdev")) ||             !strcmp(netdev->netdev_class->type, "dpdkvhostcuse") ||             !strcmp(netdev->netdev_class->type, "dpdkvhostuser")); }@@ -531,6 +532,8 @@ netdev_get_numa_id(const struct netdev *netdev) {     if (netdev->netdev_class->get_numa_id) {         return netdev->netdev_class->get_numa_id(netdev);+    } else if (!strcmp(netdev->netdev_class->type, "tap") && strcmp(netdev->name, "ovs-netdev")) {+        return 0;     } else {         return NETDEV_NUMA_UNSPEC;     }......
0 0
原创粉丝点击