Hi Brian,

Thank you for the patch! Perhaps something to improve:

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

url:    
https://github.com/0day-ci/linux/commits/Brian-Vazquez/fib-use-indirect-call-wrappers-in-the-most-common-fib_rules_ops/20200725-095008
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
dfd3d5266dc1d9a2b06e5a09bbff4cee547eeb5f
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 
8bf4c1f4fb257774f66c8cda07adc6c5e8668326)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>):

>> net/ipv4/fib_rules.c:107:29: warning: no previous prototype for function 
>> 'fib4_rule_action' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE int fib4_rule_action(struct fib_rule *rule,
                               ^
   net/ipv4/fib_rules.c:107:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE int fib4_rule_action(struct fib_rule *rule,
                           ^
                           static 
>> net/ipv4/fib_rules.c:143:30: warning: no previous prototype for function 
>> 'fib4_rule_suppress' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
                                ^
   net/ipv4/fib_rules.c:143:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
                           ^
                           static 
>> net/ipv4/fib_rules.c:175:29: warning: no previous prototype for function 
>> 'fib4_rule_match' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
                               ^
   net/ipv4/fib_rules.c:175:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
                           ^
                           static 
   3 warnings generated.
--
>> net/ipv6/fib6_rules.c:259:29: warning: no previous prototype for function 
>> 'fib6_rule_action' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE int fib6_rule_action(struct fib_rule *rule,
                               ^
   net/ipv6/fib6_rules.c:259:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE int fib6_rule_action(struct fib_rule *rule,
                           ^
                           static 
>> net/ipv6/fib6_rules.c:269:30: warning: no previous prototype for function 
>> 'fib6_rule_suppress' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
                                ^
   net/ipv6/fib6_rules.c:269:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
                           ^
                           static 
>> net/ipv6/fib6_rules.c:302:29: warning: no previous prototype for function 
>> 'fib6_rule_match' [-Wmissing-prototypes]
   INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
                               ^
   net/ipv6/fib6_rules.c:302:25: note: declare 'static' if the function is not 
intended to be used outside of this translation unit
   INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
                           ^
                           static 
   3 warnings generated.

vim +/fib4_rule_action +107 net/ipv4/fib_rules.c

   106  
 > 107  INDIRECT_CALLABLE_SCOPE int fib4_rule_action(struct fib_rule *rule,
   108                              struct flowi *flp, int flags,
   109                              struct fib_lookup_arg *arg)
   110  {
   111          int err = -EAGAIN;
   112          struct fib_table *tbl;
   113          u32 tb_id;
   114  
   115          switch (rule->action) {
   116          case FR_ACT_TO_TBL:
   117                  break;
   118  
   119          case FR_ACT_UNREACHABLE:
   120                  return -ENETUNREACH;
   121  
   122          case FR_ACT_PROHIBIT:
   123                  return -EACCES;
   124  
   125          case FR_ACT_BLACKHOLE:
   126          default:
   127                  return -EINVAL;
   128          }
   129  
   130          rcu_read_lock();
   131  
   132          tb_id = fib_rule_get_table(rule, arg);
   133          tbl = fib_get_table(rule->fr_net, tb_id);
   134          if (tbl)
   135                  err = fib_table_lookup(tbl, &flp->u.ip4,
   136                                         (struct fib_result *)arg->result,
   137                                         arg->flags);
   138  
   139          rcu_read_unlock();
   140          return err;
   141  }
   142  
 > 143  INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
   144                                                  struct fib_lookup_arg 
*arg)
   145  {
   146          struct fib_result *result = (struct fib_result *) arg->result;
   147          struct net_device *dev = NULL;
   148  
   149          if (result->fi) {
   150                  struct fib_nh_common *nhc = fib_info_nhc(result->fi, 0);
   151  
   152                  dev = nhc->nhc_dev;
   153          }
   154  
   155          /* do not accept result if the route does
   156           * not meet the required prefix length
   157           */
   158          if (result->prefixlen <= rule->suppress_prefixlen)
   159                  goto suppress_route;
   160  
   161          /* do not accept result if the route uses a device
   162           * belonging to a forbidden interface group
   163           */
   164          if (rule->suppress_ifgroup != -1 && dev && dev->group == 
rule->suppress_ifgroup)
   165                  goto suppress_route;
   166  
   167          return false;
   168  
   169  suppress_route:
   170          if (!(arg->flags & FIB_LOOKUP_NOREF))
   171                  fib_info_put(result->fi);
   172          return true;
   173  }
   174  
 > 175  INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
   176                                              struct flowi *fl, int flags)
   177  {
   178          struct fib4_rule *r = (struct fib4_rule *) rule;
   179          struct flowi4 *fl4 = &fl->u.ip4;
   180          __be32 daddr = fl4->daddr;
   181          __be32 saddr = fl4->saddr;
   182  
   183          if (((saddr ^ r->src) & r->srcmask) ||
   184              ((daddr ^ r->dst) & r->dstmask))
   185                  return 0;
   186  
   187          if (r->tos && (r->tos != fl4->flowi4_tos))
   188                  return 0;
   189  
   190          if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto))
   191                  return 0;
   192  
   193          if (fib_rule_port_range_set(&rule->sport_range) &&
   194              !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport))
   195                  return 0;
   196  
   197          if (fib_rule_port_range_set(&rule->dport_range) &&
   198              !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport))
   199                  return 0;
   200  
   201          return 1;
   202  }
   203  

---
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