diff --git a/lib/dpctl.c b/lib/dpctl.c
index b769544..a0c639e 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -120,6 +120,14 @@ dpctl_error(struct dpctl_params* dpctl_p, int err_no, const char *fmt, ...)
 
     errno = save_errno;
 }
+
+static void
+dpctl_error_opening_dp(struct dpctl_params *dpctl_p, int err_no,
+                       const char *func_name)
+{
+    dpctl_error(dpctl_p, err_no, "%s: opening datapath", func_name);
+}
+
 
 static int dpctl_add_if(int argc, const char *argv[], struct dpctl_params *);
 
@@ -214,7 +222,7 @@ dpctl_del_dp(int argc OVS_UNUSED, const char *argv[],
 
     error = parsed_dpif_open(argv[1], false, &dpif);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
     error = dpif_delete(dpif);
@@ -235,7 +243,7 @@ dpctl_add_if(int argc OVS_UNUSED, const char *argv[],
 
     error = parsed_dpif_open(argv[1], false, &dpif);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
     for (i = 2; i < argc; i++) {
@@ -324,7 +332,7 @@ dpctl_set_if(int argc, const char *argv[], struct dpctl_params *dpctl_p)
 
     error = parsed_dpif_open(argv[1], false, &dpif);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
     for (i = 2; i < argc; i++) {
@@ -459,7 +467,7 @@ dpctl_del_if(int argc, const char *argv[], struct dpctl_params *dpctl_p)
 
     error = parsed_dpif_open(argv[1], false, &dpif);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
     for (i = 2; i < argc; i++) {
@@ -838,7 +846,7 @@ dpctl_dump_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)
     error = parsed_dpif_open(name, false, &dpif);
     free(name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         goto out_free;
     }
 
@@ -974,7 +982,7 @@ dpctl_put_flow(int argc, const char *argv[], enum dpif_flow_put_flags flags,
     error = parsed_dpif_open(dp_name, false, &dpif);
     free(dp_name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1086,7 +1094,7 @@ dpctl_get_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p)
     error = parsed_dpif_open(dp_name, false, &dpif);
     free(dp_name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1145,7 +1153,7 @@ dpctl_del_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p)
     error = parsed_dpif_open(dp_name, false, &dpif);
     free(dp_name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1225,7 +1233,7 @@ dpctl_del_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)
     error = parsed_dpif_open(name, false, &dpif);
     free(name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1294,7 +1302,7 @@ dpctl_dump_conntrack(int argc, const char *argv[],
     error = parsed_dpif_open(name, false, &dpif);
     free(name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1360,7 +1368,7 @@ dpctl_flush_conntrack(int argc, const char *argv[],
         error = parsed_dpif_open(name, false, &dpif);
         free(name);
         if (error) {
-            dpctl_error(dpctl_p, error, "opening datapath");
+            dpctl_error_opening_dp(dpctl_p, error, __func__);
             return error;
         }
     }
@@ -1444,7 +1452,7 @@ dpctl_ct_stats_show(int argc, const char *argv[],
     error = parsed_dpif_open(name, false, &dpif);
     free(name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
@@ -1581,7 +1589,7 @@ dpctl_ct_bkts(int argc, const char *argv[],
     error = parsed_dpif_open(name, false, &dpif);
     free(name);
     if (error) {
-        dpctl_error(dpctl_p, error, "opening datapath");
+        dpctl_error_opening_dp(dpctl_p, error, __func__);
         return error;
     }
 
