CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Paul Blakey <pa...@mellanox.com>
CC: Saeed Mahameed <sae...@mellanox.com>
CC: Roi Dayan <r...@mellanox.com>
CC: Mark Bloch <ma...@mellanox.com>
CC: Maor Gottlieb <ma...@mellanox.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: 49c0355d301b4e0e01e0f19ddbb023bd7d0ee48c net/mlx5: Wait for inactive 
autogroups
date:   4 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 4 months ago
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1777 try_add_to_existing_fg() 
error: double unlocked 'fte->node.lock' (orig line 1775)

Old smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1584 dest_is_valid() error: 
we previously assumed 'dest' could be null (see line 1574)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1835 _mlx5_add_flow_rules() 
error: double unlocked 'ft->node.lock' (orig line 1827)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1851 _mlx5_add_flow_rules() 
error: double unlocked 'ft->node.lock' (orig line 1827)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1857 _mlx5_add_flow_rules() 
error: double unlocked 'ft->node.lock' (orig line 1827)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1863 _mlx5_add_flow_rules() 
error: double unlocked 'ft->node.lock' (orig line 1827)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1876 _mlx5_add_flow_rules() 
error: double unlocked 'fte->node.lock' (orig line 1874)

# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=49c0355d301b4e0e01e0f19ddbb023bd7d0ee48c
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 49c0355d301b4e0e01e0f19ddbb023bd7d0ee48c
vim +1777 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

7dee607ed0e0450 Parav Pandit  2019-09-18  1688  
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1689  static struct mlx5_flow_handle *
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1690  try_add_to_existing_fg(struct 
mlx5_flow_table *ft,
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1691                         struct 
list_head *match_head,
5233794b179136d Arnd Bergmann 2019-06-18  1692                         const 
struct mlx5_flow_spec *spec,
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1693                         struct 
mlx5_flow_act *flow_act,
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1694                         struct 
mlx5_flow_destination *dest,
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1695                         int 
dest_num,
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1696                         int 
ft_version)
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1697  {
a369d4ac4dff921 Maor Gottlieb 2017-08-27  1698          struct 
mlx5_flow_steering *steering = get_steering(&ft->node);
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1699          struct mlx5_flow_group 
*g;
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1700          struct mlx5_flow_handle 
*rule;
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1701          struct match_list *iter;
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1702          bool take_write = false;
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1703          struct fs_fte *fte;
dc638d1122d25d4 Eli Cohen     2020-03-04  1704          u64  version = 0;
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1705          int err;
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1706  
bb0ee7dcc4ecd6a Jianbo Liu    2019-06-25  1707          fte = alloc_fte(ft, 
spec, flow_act);
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1708          if (IS_ERR(fte))
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1709                  return  
ERR_PTR(-ENOMEM);
46719d77d5f38b8 Maor Gottlieb 2017-07-25  1710  
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1711  search_again_locked:
d5634fee245f9e9 Paul Blakey   2018-09-20  1712          if (flow_act->flags & 
FLOW_ACT_NO_APPEND)
d5634fee245f9e9 Paul Blakey   2018-09-20  1713                  goto 
skip_search;
dc638d1122d25d4 Eli Cohen     2020-03-04  1714          version = 
matched_fgs_get_version(match_head);
dc638d1122d25d4 Eli Cohen     2020-03-04  1715          /* Try to find an fte 
with identical match value and attempt update its
dc638d1122d25d4 Eli Cohen     2020-03-04  1716           * action.
dc638d1122d25d4 Eli Cohen     2020-03-04  1717           */
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1718          
list_for_each_entry(iter, match_head, list) {
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1719                  struct fs_fte 
*fte_tmp;
693c6883bbc4f76 Matan Barak   2017-05-28  1720  
693c6883bbc4f76 Matan Barak   2017-05-28  1721                  g = iter->g;
ad9421e36a77056 Roi Dayan     2018-08-20  1722                  fte_tmp = 
lookup_fte_locked(g, spec->match_value, take_write);
ad9421e36a77056 Roi Dayan     2018-08-20  1723                  if (!fte_tmp)
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1724                          
continue;
bb0ee7dcc4ecd6a Jianbo Liu    2019-06-25  1725                  rule = 
add_rule_fg(g, spec, flow_act, dest, dest_num, fte_tmp);
476d61b783e5481 Eli Britstein 2019-01-31  1726                  
up_write_ref_node(&fte_tmp->node, false);
476d61b783e5481 Eli Britstein 2019-01-31  1727                  
tree_put_node(&fte_tmp->node, false);
a369d4ac4dff921 Maor Gottlieb 2017-08-27  1728                  
kmem_cache_free(steering->ftes_cache, fte);
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1729                  return rule;
693c6883bbc4f76 Matan Barak   2017-05-28  1730          }
693c6883bbc4f76 Matan Barak   2017-05-28  1731  
d5634fee245f9e9 Paul Blakey   2018-09-20  1732  skip_search:
d5634fee245f9e9 Paul Blakey   2018-09-20  1733          /* No group with 
matching fte found, or we skipped the search.
d5634fee245f9e9 Paul Blakey   2018-09-20  1734           * Try to add a new fte 
to any matching fg.
d5634fee245f9e9 Paul Blakey   2018-09-20  1735           */
d5634fee245f9e9 Paul Blakey   2018-09-20  1736  
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1737          /* Check the ft 
version, for case that new flow group
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1738           * was added while the 
fgs weren't locked
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1739           */
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1740          if 
(atomic_read(&ft->node.version) != ft_version) {
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1741                  rule = 
ERR_PTR(-EAGAIN);
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1742                  goto out;
693c6883bbc4f76 Matan Barak   2017-05-28  1743          }
693c6883bbc4f76 Matan Barak   2017-05-28  1744  
dc638d1122d25d4 Eli Cohen     2020-03-04  1745          /* Check the fgs 
version. If version have changed it could be that an
dc638d1122d25d4 Eli Cohen     2020-03-04  1746           * FTE with the same 
match value was added while the fgs weren't
dc638d1122d25d4 Eli Cohen     2020-03-04  1747           * locked.
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1748           */
dc638d1122d25d4 Eli Cohen     2020-03-04  1749          if (!(flow_act->flags & 
FLOW_ACT_NO_APPEND) &&
dc638d1122d25d4 Eli Cohen     2020-03-04  1750              version != 
matched_fgs_get_version(match_head)) {
ad9421e36a77056 Roi Dayan     2018-08-20  1751                  take_write = 
true;
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1752                  goto 
search_again_locked;
ad9421e36a77056 Roi Dayan     2018-08-20  1753          }
b92af5a72ca982f Matan Barak   2017-08-10  1754  
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1755          
list_for_each_entry(iter, match_head, list) {
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1756                  g = iter->g;
693c6883bbc4f76 Matan Barak   2017-05-28  1757  
ad9421e36a77056 Roi Dayan     2018-08-20  1758                  
nested_down_write_ref_node(&g->node, FS_LOCK_PARENT);
ad9421e36a77056 Roi Dayan     2018-08-20  1759  
49c0355d301b4e0 Paul Blakey   2020-05-07  1760                  if 
(!g->node.active) {
49c0355d301b4e0 Paul Blakey   2020-05-07  1761                          
up_write_ref_node(&g->node, false);
49c0355d301b4e0 Paul Blakey   2020-05-07  1762                          
continue;
49c0355d301b4e0 Paul Blakey   2020-05-07  1763                  }
49c0355d301b4e0 Paul Blakey   2020-05-07  1764  
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1765                  err = 
insert_fte(g, fte);
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1766                  if (err) {
476d61b783e5481 Eli Britstein 2019-01-31  1767                          
up_write_ref_node(&g->node, false);
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1768                          if (err 
== -ENOSPC)
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1769                                  
continue;
a369d4ac4dff921 Maor Gottlieb 2017-08-27  1770                          
kmem_cache_free(steering->ftes_cache, fte);
f5c2ff179f51101 Maor Gottlieb 2017-08-29  1771                          return 
ERR_PTR(err);
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1772                  }
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1773  
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1774                  
nested_down_write_ref_node(&fte->node, FS_LOCK_CHILD);
476d61b783e5481 Eli Britstein 2019-01-31 @1775                  
up_write_ref_node(&g->node, false);
bb0ee7dcc4ecd6a Jianbo Liu    2019-06-25  1776                  rule = 
add_rule_fg(g, spec, flow_act, dest, dest_num, fte);
476d61b783e5481 Eli Britstein 2019-01-31 @1777                  
up_write_ref_node(&fte->node, false);
476d61b783e5481 Eli Britstein 2019-01-31  1778                  
tree_put_node(&fte->node, false);
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1779                  return rule;
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1780          }
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1781          rule = ERR_PTR(-ENOENT);
bd71b08ec2ee450 Maor Gottlieb 2017-08-27  1782  out:
a369d4ac4dff921 Maor Gottlieb 2017-08-27  1783          
kmem_cache_free(steering->ftes_cache, fte);
693c6883bbc4f76 Matan Barak   2017-05-28  1784          return rule;
693c6883bbc4f76 Matan Barak   2017-05-28  1785  }
693c6883bbc4f76 Matan Barak   2017-05-28  1786  

:::::: The code at line 1777 was first introduced by commit
:::::: 476d61b783e5481bbfaac4518b0b3d2b5addbc19 net/mlx5: Add a locked flag to 
node removal functions

:::::: TO: Eli Britstein <el...@mellanox.com>
:::::: CC: Saeed Mahameed <sae...@mellanox.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to