+static void pr_out_port_function(struct dl *dl, struct nlattr **tb_port)
+{
+ struct nlattr *tb[DEVLINK_PORT_FUNCTION_ATTR_MAX + 1] = {};
+ unsigned char *data;
+ SPRINT_BUF(hw_addr);
+ uint32_t len;
+ int err;
+
+ if (!tb_port[DEVLINK_ATTR_PORT_FUNCTION])
+ return;
+
+ err = mnl_attr_parse_nested(tb_port[DEVLINK_ATTR_PORT_FUNCTION],
+ function_attr_cb, tb);
+ if (err != MNL_CB_OK)
+ return;
+
+ if (!tb[DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR])
+ return;
+
+ len = mnl_attr_get_payload_len(tb[DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR]);
+ data = mnl_attr_get_payload(tb[DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR]);
+
+ pr_out_object_start(dl, "function");
+ check_indent_newline(dl);
+ print_string(PRINT_ANY, "hw_addr", "hw_addr %s",
+ ll_addr_n2a(data, len, 0, hw_addr, sizeof(hw_addr)));
+ if (!dl->json_output)
+ __pr_out_indent_dec();
+ pr_out_object_end(dl);
+}
+