Hi Vladimir,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    
https://github.com/0day-ci/linux/commits/Vladimir-Oltean/tag_8021q-for-Ocelot-switches/20210120-145800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
7b8fc0103bb51d1d3e1fb5fd67958612e709f883
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-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/c1cb52858ce53bff4293bc96d800bbb0bd22fc74
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Vladimir-Oltean/tag_8021q-for-Ocelot-switches/20210120-145800
        git checkout c1cb52858ce53bff4293bc96d800bbb0bd22fc74
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=nds32 

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

All warnings (new ones prefixed by >>):

   drivers/net/dsa/ocelot/felix.c: In function 'felix_setup_tag_8021q':
>> drivers/net/dsa/ocelot/felix.c:464:12: warning: variable 'err' set but not 
>> used [-Wunused-but-set-variable]
     464 |  int port, err;
         |            ^~~


vim +/err +464 drivers/net/dsa/ocelot/felix.c

7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  458  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  459  static int 
felix_setup_tag_8021q(struct dsa_switch *ds, int cpu)
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  460  {
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  461         struct ocelot *ocelot = 
ds->priv;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  462         struct felix *felix = 
ocelot_to_felix(ocelot);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  463         unsigned long cpu_flood;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20 @464         int port, err;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  465  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  466         
felix_8021q_cpu_port_init(ocelot, cpu);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  467  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  468         for (port = 0; port < 
ds->num_ports; port++) {
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  469                 if 
(dsa_is_unused_port(ds, port))
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  470                         
continue;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  471  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  472                 /* This 
overwrites ocelot_init():
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  473                  * Do not 
forward BPDU frames to the CPU port module,
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  474                  * for 2 
reasons:
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  475                  * - When these 
packets are injected from the tag_8021q
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  476                  *   CPU port, 
we want them to go out, not loop back
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  477                  *   into the 
system.
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  478                  * - STP 
traffic ingressing on a user port should go to
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  479                  *   the 
tag_8021q CPU port, not to the hardware CPU
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  480                  *   port 
module.
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  481                  */
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  482                 
ocelot_write_gix(ocelot,
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  483                                 
 ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_REDIR_ENA(0),
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  484                                 
 ANA_PORT_CPU_FWD_BPDU_CFG, port);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  485         }
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  486  
c1cb52858ce53bf Vladimir Oltean 2021-01-20  487         /* In tag_8021q mode, 
the CPU port module is unused, except for PTP
c1cb52858ce53bf Vladimir Oltean 2021-01-20  488          * frames. So we want 
to disable flooding of any kind to the CPU port
c1cb52858ce53bf Vladimir Oltean 2021-01-20  489          * module, since 
packets going there will end in a black hole.
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  490          */
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  491         cpu_flood = 
ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports));
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  492         ocelot_rmw_rix(ocelot, 
0, cpu_flood, ANA_PGID_PGID, PGID_UC);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  493         ocelot_rmw_rix(ocelot, 
0, cpu_flood, ANA_PGID_PGID, PGID_MC);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  494  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  495         
ocelot_apply_bridge_fwd_mask(ocelot);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  496  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  497         felix->dsa_8021q_ctx = 
kzalloc(sizeof(*felix->dsa_8021q_ctx),
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  498                                 
       GFP_KERNEL);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  499         if 
(!felix->dsa_8021q_ctx)
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  500                 return -ENOMEM;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  501  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  502         
felix->dsa_8021q_ctx->ops = &felix_tag_8021q_ops;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  503         
felix->dsa_8021q_ctx->proto = htons(ETH_P_8021AD);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  504         
felix->dsa_8021q_ctx->ds = ds;
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  505  
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  506         rtnl_lock();
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  507         err = 
dsa_8021q_setup(felix->dsa_8021q_ctx, true);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  508         rtnl_unlock();
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  509  
c1cb52858ce53bf Vladimir Oltean 2021-01-20  510         return 
felix_setup_mmio_filtering(felix);
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  511  }
7bc3a3dc54b2bb6 Vladimir Oltean 2021-01-20  512  

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

Attachment: .config.gz
Description: application/gzip

Reply via email to