X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fkni%2Frte_kni.c;h=d3e236005ed59b6234bd723143dab37e2ab440d6;hb=28dde5da503ed09f10cdfb295e390b114df7330a;hp=eb24b0d0ae4e5e7750cef698c97b6df26dbf9c45;hpb=0db3d5551abe94bb8a7030c1b90496b290ddb7f4;p=dpdk.git diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c index eb24b0d0ae..d3e236005e 100644 --- a/lib/kni/rte_kni.c +++ b/lib/kni/rte_kni.c @@ -811,6 +811,9 @@ rte_kni_update_link(struct rte_kni *kni, unsigned int linkup) } old_linkup = (old_carrier[0] == '1'); + if (old_linkup == (int)linkup) + goto out; + new_carrier = linkup ? "1" : "0"; ret = write(fd, new_carrier, 1); if (ret < 1) { @@ -818,7 +821,7 @@ rte_kni_update_link(struct rte_kni *kni, unsigned int linkup) close(fd); return -1; } - +out: close(fd); return old_linkup; }