Hi Hans,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rdma/for-next]
[also build test WARNING on linus/master v5.12-rc7 next-20210414]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/net-mlx4-Treat...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/9de686423c117ccefb2c09e57ab16f84f...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Hans-Westgaard-Ry/net-mlx4-Treat-VFs-fair-when-handling-comm_channel_events/20210415-194619
git checkout 9de686423c117ccefb2c09e57ab16f84f0434c68
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlx4/cmd.c: In function
'mlx4_master_comm_channel':
> drivers/net/ethernet/mellanox/mlx4/cmd.c:2251:6: warning:
variable 'prev_slave' set but not used [-Wunused-but-set-variable]
2251
| u32 prev_slave;
| ^~~~~~~~~~
vim +/prev_slave +2251 drivers/net/ethernet/mellanox/mlx4/cmd.c
2230
2231 /* master command processing */
2232 void mlx4_master_comm_channel(struct work_struct *work)
2233 {
2234 struct mlx4_mfunc_master_ctx *master =
2235 container_of(work,
2236 struct mlx4_mfunc_master_ctx,
2237 comm_work);
2238 struct mlx4_mfunc *mfunc =
2239 container_of(master, struct mlx4_mfunc, master);
2240 struct mlx4_priv *priv =
2241 container_of(mfunc, struct mlx4_priv, mfunc);
2242 struct mlx4_dev *dev = &priv->dev;
2243 u32 comm_cmd;
2244 int i, slave;
2245 int toggle;
2246 int served = 0;
2247 int reported = 0;
2248 u32 slt;
2249 u32 lbit_vec[COMM_CHANNEL_BIT_ARRAY_SIZE];
2250 u32 nmbr_bits;
2251 u32 prev_slave;
2252 bool first = true;
2253
2254 for (i = 0; i < COMM_CHANNEL_BIT_ARRAY_SIZE; i++)
2255 lbit_vec[i] = be32_to_cpu(master->comm_arm_bit_vector[i]);
2256 nmbr_bits = dev->persist->num_vfs + 1;
2257 if (++priv->next_slave >= nmbr_bits)
2258 priv->next_slave = 0;
2259 slave = priv->next_slave;
2260 while (true) {
2261 slave = find_next_bit((const unsigned long *)&lbit_vec, nmbr_bits, slave);
2262 if (!first && slave >= priv->next_slave) {
2263 break;
2264 } else if (slave == nmbr_bits) {
2265 if (!first)
2266 break;
2267 first = false;
2268 slave = 0;
2269 continue;
2270 }
2271 ++reported;
2272 comm_cmd = swab32(readl(&mfunc->comm[slave].slave_write));
2273 slt = swab32(readl(&mfunc->comm[slave].slave_read)) >> 31;
2274 toggle = comm_cmd >> 31;
2275 if (toggle != slt) {
2276 if (master->slave_state[slave].comm_toggle
2277 != slt) {
2278 pr_info("slave %d out of sync. read toggle %d, state toggle %d.
Resynching.\n",
2279 slave, slt,
2280 master->slave_state[slave].comm_toggle);
2281 master->slave_state[slave].comm_toggle =
2282 slt;
2283 }
2284 mlx4_master_do_cmd(dev, slave,
2285 comm_cmd >> 16 & 0xff,
2286 comm_cmd & 0xffff, toggle);
2287 ++served;
2288 }
2289 prev_slave = slave++;
2290 }
2291
2292 if (reported && reported != served)
2293 mlx4_warn(dev, "Got command event with bitmask from %d slaves but %d were
served %x %d\n",
2294 reported, served, lbit_vec[0], priv->next_slave);
2295
2296 if (mlx4_ARM_COMM_CHANNEL(dev))
2297 mlx4_warn(dev, "Failed to arm comm channel events\n");
2298 }
2299
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org