[dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor recognition on kernels 5.x
Stephen Hemminger
stephen at networkplumber.org
Mon Mar 25 19:07:43 CET 2019
On Mon, 25 Mar 2019 17:03:22 +0000
Viacheslav Ovsiienko <viacheslavo at mellanox.com> wrote:
> + if (switch_id_set) {
> + if (info.port_name_new) {
> + /* New representors naming schema. */
> + if (port_name_set) {
> + info.master = (info.port_name == -1);
> + info.representor = (info.port_name != -1);
> + }
> + } else {
> + /* Legacy representors naming schema. */
> + info.master = (!port_name_set || num_vf_set);
> + info.representor = port_name_set && !num_vf_set;
> + }
> + }
> + assert(!(data.master && data.representor));
> memcpy(arg, &info, sizeof(info));
> return 0;
Since assert() is often removed in non-debug envirionments, why
not add a log message and return an error instead?
More information about the dev
mailing list