net/mlx5: fix VXLAN device rollback if rule apply fails
[dpdk.git] / drivers / net / softnic / parser.c
index 7087b87..a8688a2 100644 (file)
@@ -92,6 +92,24 @@ softnic_parser_read_arg_bool(const char *p)
        return result;
 }
 
+int
+softnic_parser_read_int32(int32_t *value, const char *p)
+{
+       char *next;
+       int32_t val;
+
+       p = skip_white_spaces(p);
+       if (!isdigit(*p))
+               return -EINVAL;
+
+       val = strtol(p, &next, 10);
+       if (p == next)
+               return -EINVAL;
+
+       *value = val;
+       return 0;
+}
+
 int
 softnic_parser_read_uint64(uint64_t *value, const char *p)
 {