Re: [PATCH net-next 1/4] net/mlx4_core: Fix QUERY FUNC CAP flags

2 messages, 2 authors, 2016-07-10 · open the first message on its own page

Re: [PATCH net-next 1/4] net/mlx4_core: Fix QUERY FUNC CAP flags

From: Or Gerlitz <hidden>
Date: 2016-07-07 19:26:09

On Wed, Jul 6, 2016 at 3:29 PM, Tariq Toukan [off-list ref] wrote:
From: Moshe Shemesh <redacted>

Separate QUERY_FUNC_CAP flags0 from QUERY_FUNC_CAP flags.
Remove QUERY_FUNC_CAP port_flags field which was not in use.
The patch title says "Fix ..." but the change log doesn't say if this
is fixing real bug, or cleaning up dead code, nor you point to the
commit you are fixing, please add that, I guess it is something we do
wrong w.r.t the PHV bit but I am not clear what.

quoted hunk
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index f4497cf..355f05e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -612,8 +612,7 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
                MLX4_GET(func_cap->phys_port_id, outbox,
                         QUERY_FUNC_CAP_PHYS_PORT_ID);

-       MLX4_GET(field, outbox, QUERY_FUNC_CAP_FLAGS0_OFFSET);
-       func_cap->flags |= (field & QUERY_FUNC_CAP_PHV_BIT);
+       MLX4_GET(func_cap->flags0, outbox, QUERY_FUNC_CAP_FLAGS0_OFFSET);

        /* All other resources are allocated by the master, but we still report
         * 'num' and 'reserved' capabilities as follows:
@@ -2874,7 +2873,7 @@ int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv)
        memset(&func_cap, 0, sizeof(func_cap));
        err = mlx4_QUERY_FUNC_CAP(dev, port, &func_cap);
        if (!err)
-               *phv = func_cap.flags & QUERY_FUNC_CAP_PHV_BIT;
+               *phv = func_cap.flags0 & QUERY_FUNC_CAP_PHV_BIT;
        return err;
 }
 EXPORT_SYMBOL(get_phv_bit);
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.h b/drivers/net/ethernet/mellanox/mlx4/fw.h
index cdbd76f..f11614f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.h
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.h
@@ -152,7 +152,7 @@ struct mlx4_func_cap {
        u32     qp1_proxy_qpn;
        u32     reserved_lkey;
        u8      physical_port;
-       u8      port_flags;
+       u8      flags0;
        u8      flags1;
        u64     phys_port_id;
        u32     extra_flags;

RE: [PATCH net-next 1/4] net/mlx4_core: Fix QUERY FUNC CAP flags

From: Moshe Shemesh <hidden>
Date: 2016-07-10 13:04:51

On Wed, Jul 6, 2016 at 3:29 PM, Tariq Toukan [off-list ref] wrote:
quoted
From: Moshe Shemesh <redacted>

Separate QUERY_FUNC_CAP flags0 from QUERY_FUNC_CAP flags.
Remove QUERY_FUNC_CAP port_flags field which was not in use.
The patch title says "Fix ..." but the change log doesn't say if this is fixing real bug, or cleaning up dead >code, nor you point to the commit you are fixing, please add that, I guess it is something we do wrong >w.r.t the PHV bit but I am not clear what.
Both dead code and a bug:
One part is removing dead code (unused field - port_flags).
"Remove QUERY_FUNC_CAP port_flags field which was not in use." 

The other part is fixing a bug, as "flags" is already used for other set of flags in Func cap, while phv bit should be part of a different set of flags "flags0".
"Separate QUERY_FUNC_CAP flags0 from QUERY_FUNC_CAP flags." 

We will submit v2 with an updated commit massage including the relevant Fixes lines.

Regards,
Moshe.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help