net/mlx5: E-Switch, Add SR-IOV (FDB) support
Hello Saeed Mahameed,
The patch 81848731ff40: "net/mlx5: E-Switch, Add SR-IOV (FDB) support" from Dec 1, 2015, leads to the following static checker warning:
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:579 esw_fdb_set_vport_rule()
warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
568 esw_debug(esw->dev,
569 "\tFDB add rule dmac_v(%pM) dmac_c(%pM) -> vport(%d)\n",
570 dmac_v, dmac_c, vport);
571 flow_rule =
572 mlx5_add_flow_rule(esw,
573 match_header, 574 match_c, 575 match_v, 576 MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, 577 0, &dest);
578 if (IS_ERR_OR_NULL(flow_rule)) {
mlx5_add_flow_rule() only returns NULL on error. It never returns ERR_PTRs.
579 pr_warn(
580 "FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n",
^^^^^^^^
It's not a terrible bug but this always says "err(0)" which is not very useful, and it causes this static checker warning.
581 dmac_v, dmac_c, vport, PTR_ERR(flow_rule)); 582 flow_rule = NULL; 583 } 584 out: 585 kfree(match_v); 586 kfree(match_c); 587 return flow_rule; 588 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · Dan Carpenter
Hello Saeed Mahameed,
The patch
81848731ff40: "net/mlx5: E-Switch, Add SR-IOV (FDB) support" from Dec 1, 2015, leads to the following static checker warning:
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:579esw_fdb_set_vport_rule()
warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
568 esw_debug(esw->dev,
569 "\tFDB add ruledmac_v(%pM)dmac_c(%pM)-> vport(%d)\n",570 dmac_v, dmac_c, vport); 571 flow_rule = 572 mlx5_add_flow_rule(esw, 573 match_header, 574 match_c, 575 match_v, 576 MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, 577 0, &dest); 578 if (IS_ERR_OR_NULL(flow_rule)) {
Quoted 8 lines
mlx5_add_flow_rule()only returns NULL on error. It never returnsERR_PTRs.579 pr_warn( 580 "FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n", ^^^^^^^^It's not a terrible bug but this always says "err(0)" which is not very useful, and it causes this static checker warning.
Hi Dan,
Thanks for pointing this out, this is already fixed in the latest flow steering patches sent to net-next.
"net/mlx5: Use flow steering infrastructure for mlx5_en"
Quoted 10 lines
581 dmac_v, dmac_c, vport, PTR_ERR(flow_rule)); 582 flow_rule = NULL; 583 } 584 out: 585 kfree(match_v); 586 kfree(match_c); 587 return flow_rule; 588 }
Quoted 6 lines
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html