All of lore.kernel.org
 help / color / mirror / Atom feed
* [frank-w-bpi-r2-4.14:5.11-offload 18/31] net/netfilter/xt_FLOWOFFLOAD.c:244:28: warning: variable 'prev_type' set but not used
@ 2021-01-24 14:06 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-01-24 14:06 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 15330 bytes --]

tree:   https://github.com/frank-w/BPI-R2-4.14 5.11-offload
head:   50acae9795949f4830c14549445a48cffedcbbe9
commit: 3f8673ea08e364fdb2261e7ac7327da0eef0589a [18/31] net: resolve forwarding path from virtual netdevice and HW destination address
config: ia64-allmodconfig (attached as .config)
compiler: ia64-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/frank-w/BPI-R2-4.14/commit/3f8673ea08e364fdb2261e7ac7327da0eef0589a
        git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
        git fetch --no-tags frank-w-bpi-r2-4.14 5.11-offload
        git checkout 3f8673ea08e364fdb2261e7ac7327da0eef0589a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

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

All warnings (new ones prefixed by >>):

   net/netfilter/xt_FLOWOFFLOAD.c: In function 'xt_flowoffload_check_hook':
   net/netfilter/xt_FLOWOFFLOAD.c:174:27: error: 'FLOW_OFFLOAD_XMIT_DIRECT' undeclared (first use in this function); did you mean 'FLOW_OFFLOAD_XMIT_XFRM'?
     174 |   if (tuple->xmit_type == FLOW_OFFLOAD_XMIT_DIRECT)
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~
         |                           FLOW_OFFLOAD_XMIT_XFRM
   net/netfilter/xt_FLOWOFFLOAD.c:174:27: note: each undeclared identifier is reported only once for each function it appears in
   net/netfilter/xt_FLOWOFFLOAD.c:175:19: error: 'struct flow_offload_tuple' has no member named 'out'
     175 |    ifindex = tuple->out.ifidx;
         |                   ^~
   net/netfilter/xt_FLOWOFFLOAD.c:180:38: error: 'struct flow_offload_tuple' has no member named 'offload_iifidx'
     180 |       hook->ops.dev->ifindex != tuple->offload_iifidx &&
         |                                      ^~
   net/netfilter/xt_FLOWOFFLOAD.c: In function 'xt_flowoffload_route_check_path':
   net/netfilter/xt_FLOWOFFLOAD.c:251:20: error: 'struct <anonymous>' has no member named 'in'
     251 |  route->tuple[!dir].in.ifindex = dev->ifindex;
         |                    ^
   net/netfilter/xt_FLOWOFFLOAD.c:267:26: error: 'struct <anonymous>' has no member named 'out'
     267 |  memcpy(route->tuple[dir].out.h_dest, n->ha, ETH_ALEN);
         |                          ^
   net/netfilter/xt_FLOWOFFLOAD.c:274:50: error: 'struct <anonymous>' has no member named 'out'
     274 |  if (dev_fill_forward_path(dev, route->tuple[dir].out.h_dest, &stack) ||
         |                                                  ^
   net/netfilter/xt_FLOWOFFLOAD.c:281:35: error: 'struct <anonymous>' has no member named 'in'
     281 |   int n_vlans = route->tuple[!dir].in.num_vlans;
         |                                   ^
   net/netfilter/xt_FLOWOFFLOAD.c:284:45: error: 'struct <anonymous>' has no member named 'out'
     284 |   if (!is_valid_ether_addr(route->tuple[dir].out.h_source)) {
         |                                             ^
   net/netfilter/xt_FLOWOFFLOAD.c:285:28: error: 'struct <anonymous>' has no member named 'out'
     285 |    memcpy(route->tuple[dir].out.h_source,
         |                            ^
   net/netfilter/xt_FLOWOFFLOAD.c:287:34: error: 'FLOW_OFFLOAD_XMIT_DIRECT' undeclared (first use in this function); did you mean 'FLOW_OFFLOAD_XMIT_XFRM'?
     287 |    route->tuple[dir].xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
         |                                  ^~~~~~~~~~~~~~~~~~~~~~~~
         |                                  FLOW_OFFLOAD_XMIT_XFRM
   net/netfilter/xt_FLOWOFFLOAD.c:288:21: error: 'struct <anonymous>' has no member named 'out'
     288 |    route->tuple[dir].out.ifindex = dev->ifindex;
         |                     ^
   net/netfilter/xt_FLOWOFFLOAD.c:292:8: error: 'DEV_PATH_VLAN' undeclared (first use in this function)
     292 |   case DEV_PATH_VLAN:
         |        ^~~~~~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c:293:19: error: 'NF_FLOW_TABLE_VLAN_MAX' undeclared (first use in this function); did you mean 'NF_FLOWTABLE_COUNTER'?
     293 |    if (n_vlans >= NF_FLOW_TABLE_VLAN_MAX ||
         |                   ^~~~~~~~~~~~~~~~~~~~~~
         |                   NF_FLOWTABLE_COUNTER
   net/netfilter/xt_FLOWOFFLOAD.c:299:22: error: 'struct <anonymous>' has no member named 'in'
     299 |    route->tuple[!dir].in.num_vlans++;
         |                      ^
   net/netfilter/xt_FLOWOFFLOAD.c:300:22: error: 'struct <anonymous>' has no member named 'in'
     300 |    route->tuple[!dir].in.vid[n_vlans] = path->vlan.id;
         |                      ^
   net/netfilter/xt_FLOWOFFLOAD.c:300:45: error: 'const struct net_device_path' has no member named 'vlan'
     300 |    route->tuple[!dir].in.vid[n_vlans] = path->vlan.id;
         |                                             ^~
   net/netfilter/xt_FLOWOFFLOAD.c:301:22: error: 'struct <anonymous>' has no member named 'in'
     301 |    route->tuple[!dir].in.vproto[n_vlans] = path->vlan.proto;
         |                      ^
   net/netfilter/xt_FLOWOFFLOAD.c:301:48: error: 'const struct net_device_path' has no member named 'vlan'
     301 |    route->tuple[!dir].in.vproto[n_vlans] = path->vlan.proto;
         |                                                ^~
   net/netfilter/xt_FLOWOFFLOAD.c:303:8: error: 'DEV_PATH_BRIDGE' undeclared (first use in this function)
     303 |   case DEV_PATH_BRIDGE:
         |        ^~~~~~~~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c:316:20: error: 'struct <anonymous>' has no member named 'in'
     316 |  route->tuple[!dir].in.ifindex = dev->ifindex;
         |                    ^
   net/netfilter/xt_FLOWOFFLOAD.c:317:20: error: 'struct <anonymous>' has no member named 'in'
     317 |  route->tuple[!dir].in.offload_ifindex = (*hw_dev)->ifindex;
         |                    ^
>> net/netfilter/xt_FLOWOFFLOAD.c:244:28: warning: variable 'prev_type' set but not used [-Wunused-but-set-variable]
     244 |  enum net_device_path_type prev_type;
         |                            ^~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c: In function 'nf_flow_rule_route_inet':
   net/netfilter/xt_FLOWOFFLOAD.c:564:9: error: too many arguments to function 'nf_flow_rule_route_ipv4'
     564 |   err = nf_flow_rule_route_ipv4(net, flow, dir, flow_rule, stack);
         |         ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/netfilter/xt_FLOWOFFLOAD.c:16:
   include/net/netfilter/nf_flow_table.h:273:5: note: declared here
     273 | int nf_flow_rule_route_ipv4(struct net *net, const struct flow_offload *flow,
         |     ^~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c:567:9: error: too many arguments to function 'nf_flow_rule_route_ipv6'
     567 |   err = nf_flow_rule_route_ipv6(net, flow, dir, flow_rule, stack);
         |         ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/netfilter/xt_FLOWOFFLOAD.c:16:
   include/net/netfilter/nf_flow_table.h:276:5: note: declared here
     276 | int nf_flow_rule_route_ipv6(struct net *net, const struct flow_offload *flow,
         |     ^~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c: At top level:
   net/netfilter/xt_FLOWOFFLOAD.c:581:13: error: initialization of 'int (*)(struct net *, const struct flow_offload *, enum flow_offload_tuple_dir,  struct nf_flow_rule *)' from incompatible pointer type 'int (*)(struct net *, const struct flow_offload *, enum flow_offload_tuple_dir,  struct nf_flow_rule *, const struct net_device_path_stack *)' [-Werror=incompatible-pointer-types]
     581 |  .action  = nf_flow_rule_route_inet,
         |             ^~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/xt_FLOWOFFLOAD.c:581:13: note: (near initialization for 'flowtable_inet.action')
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/prev_type +244 net/netfilter/xt_FLOWOFFLOAD.c

26940979563e55c1 Felix Fietkau 2021-01-23  233  
26940979563e55c1 Felix Fietkau 2021-01-23  234  static void
26940979563e55c1 Felix Fietkau 2021-01-23  235  xt_flowoffload_route_check_path(struct nf_flow_route *route,
26940979563e55c1 Felix Fietkau 2021-01-23  236  				const struct nf_conn *ct,
26940979563e55c1 Felix Fietkau 2021-01-23  237  				enum ip_conntrack_dir dir,
26940979563e55c1 Felix Fietkau 2021-01-23  238  				struct net_device **flow_dev,
26940979563e55c1 Felix Fietkau 2021-01-23  239  				struct net_device **hw_dev)
26940979563e55c1 Felix Fietkau 2021-01-23  240  {
26940979563e55c1 Felix Fietkau 2021-01-23  241  	const struct dst_entry *dst = route->tuple[dir].dst;
26940979563e55c1 Felix Fietkau 2021-01-23  242  	const void *daddr = &ct->tuplehash[!dir].tuple.src.u3;
26940979563e55c1 Felix Fietkau 2021-01-23  243  	struct net_device_path_stack stack;
26940979563e55c1 Felix Fietkau 2021-01-23 @244  	enum net_device_path_type prev_type;
26940979563e55c1 Felix Fietkau 2021-01-23  245  	struct net_device *dev = dst->dev;
26940979563e55c1 Felix Fietkau 2021-01-23  246  	struct neighbour *n;
26940979563e55c1 Felix Fietkau 2021-01-23  247  	bool last = false;
26940979563e55c1 Felix Fietkau 2021-01-23  248  	u8 nud_state;
26940979563e55c1 Felix Fietkau 2021-01-23  249  	int i;
26940979563e55c1 Felix Fietkau 2021-01-23  250  
26940979563e55c1 Felix Fietkau 2021-01-23  251  	route->tuple[!dir].in.ifindex = dev->ifindex;
26940979563e55c1 Felix Fietkau 2021-01-23  252  
26940979563e55c1 Felix Fietkau 2021-01-23  253  	if (route->tuple[dir].xmit_type == FLOW_OFFLOAD_XMIT_XFRM)
26940979563e55c1 Felix Fietkau 2021-01-23  254  		return;
26940979563e55c1 Felix Fietkau 2021-01-23  255  
26940979563e55c1 Felix Fietkau 2021-01-23  256  	if ((dev->flags & IFF_LOOPBACK) ||
26940979563e55c1 Felix Fietkau 2021-01-23  257  	    dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN ||
26940979563e55c1 Felix Fietkau 2021-01-23  258  	    !is_valid_ether_addr(dev->dev_addr))
26940979563e55c1 Felix Fietkau 2021-01-23  259  		return;
26940979563e55c1 Felix Fietkau 2021-01-23  260  
26940979563e55c1 Felix Fietkau 2021-01-23  261  	n = dst_neigh_lookup(dst, daddr);
26940979563e55c1 Felix Fietkau 2021-01-23  262  	if (!n)
26940979563e55c1 Felix Fietkau 2021-01-23  263  		return;
26940979563e55c1 Felix Fietkau 2021-01-23  264  
26940979563e55c1 Felix Fietkau 2021-01-23  265  	read_lock_bh(&n->lock);
26940979563e55c1 Felix Fietkau 2021-01-23  266  	nud_state = n->nud_state;
26940979563e55c1 Felix Fietkau 2021-01-23  267  	memcpy(route->tuple[dir].out.h_dest, n->ha, ETH_ALEN);
26940979563e55c1 Felix Fietkau 2021-01-23  268  	read_unlock_bh(&n->lock);
26940979563e55c1 Felix Fietkau 2021-01-23  269  	neigh_release(n);
26940979563e55c1 Felix Fietkau 2021-01-23  270  
26940979563e55c1 Felix Fietkau 2021-01-23  271  	if (!(nud_state & NUD_VALID))
26940979563e55c1 Felix Fietkau 2021-01-23  272  		return;
26940979563e55c1 Felix Fietkau 2021-01-23  273  
26940979563e55c1 Felix Fietkau 2021-01-23  274  	if (dev_fill_forward_path(dev, route->tuple[dir].out.h_dest, &stack) ||
26940979563e55c1 Felix Fietkau 2021-01-23  275  		!stack.num_paths)
26940979563e55c1 Felix Fietkau 2021-01-23  276  		return;
26940979563e55c1 Felix Fietkau 2021-01-23  277  
26940979563e55c1 Felix Fietkau 2021-01-23  278  	prev_type = DEV_PATH_ETHERNET;
26940979563e55c1 Felix Fietkau 2021-01-23  279  	for (i = 0; i <= stack.num_paths; i++) {
26940979563e55c1 Felix Fietkau 2021-01-23  280  		const struct net_device_path *path = &stack.path[i];
26940979563e55c1 Felix Fietkau 2021-01-23  281  		int n_vlans = route->tuple[!dir].in.num_vlans;
26940979563e55c1 Felix Fietkau 2021-01-23  282  
26940979563e55c1 Felix Fietkau 2021-01-23  283  		dev = (struct net_device *)path->dev;
26940979563e55c1 Felix Fietkau 2021-01-23  284  		if (!is_valid_ether_addr(route->tuple[dir].out.h_source)) {
26940979563e55c1 Felix Fietkau 2021-01-23  285  			memcpy(route->tuple[dir].out.h_source,
26940979563e55c1 Felix Fietkau 2021-01-23  286  			       dev->dev_addr, ETH_ALEN);
26940979563e55c1 Felix Fietkau 2021-01-23  287  			route->tuple[dir].xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
26940979563e55c1 Felix Fietkau 2021-01-23  288  			route->tuple[dir].out.ifindex = dev->ifindex;
26940979563e55c1 Felix Fietkau 2021-01-23  289  		}
26940979563e55c1 Felix Fietkau 2021-01-23  290  
26940979563e55c1 Felix Fietkau 2021-01-23  291  		switch (path->type) {
26940979563e55c1 Felix Fietkau 2021-01-23  292  		case DEV_PATH_VLAN:
26940979563e55c1 Felix Fietkau 2021-01-23  293  			if (n_vlans >= NF_FLOW_TABLE_VLAN_MAX ||
26940979563e55c1 Felix Fietkau 2021-01-23  294  			    i == stack.num_paths) {
26940979563e55c1 Felix Fietkau 2021-01-23  295  				last = true;
26940979563e55c1 Felix Fietkau 2021-01-23  296  				break;
26940979563e55c1 Felix Fietkau 2021-01-23  297  			}
26940979563e55c1 Felix Fietkau 2021-01-23  298  
26940979563e55c1 Felix Fietkau 2021-01-23  299  			route->tuple[!dir].in.num_vlans++;
26940979563e55c1 Felix Fietkau 2021-01-23  300  			route->tuple[!dir].in.vid[n_vlans] = path->vlan.id;
26940979563e55c1 Felix Fietkau 2021-01-23  301  			route->tuple[!dir].in.vproto[n_vlans] = path->vlan.proto;
26940979563e55c1 Felix Fietkau 2021-01-23  302  			break;
26940979563e55c1 Felix Fietkau 2021-01-23  303  		case DEV_PATH_BRIDGE:
26940979563e55c1 Felix Fietkau 2021-01-23  304  		case DEV_PATH_ETHERNET:
26940979563e55c1 Felix Fietkau 2021-01-23  305  		default:
26940979563e55c1 Felix Fietkau 2021-01-23  306  			last = true;
26940979563e55c1 Felix Fietkau 2021-01-23  307  			break;
26940979563e55c1 Felix Fietkau 2021-01-23  308  		}
26940979563e55c1 Felix Fietkau 2021-01-23  309  
26940979563e55c1 Felix Fietkau 2021-01-23  310  		if (last)
26940979563e55c1 Felix Fietkau 2021-01-23  311  			break;
26940979563e55c1 Felix Fietkau 2021-01-23  312  	}
26940979563e55c1 Felix Fietkau 2021-01-23  313  
26940979563e55c1 Felix Fietkau 2021-01-23  314  	*flow_dev = dev;
26940979563e55c1 Felix Fietkau 2021-01-23  315  	*hw_dev = (struct net_device *)stack.path[stack.num_paths - 1].dev;
26940979563e55c1 Felix Fietkau 2021-01-23  316  	route->tuple[!dir].in.ifindex = dev->ifindex;
26940979563e55c1 Felix Fietkau 2021-01-23  317  	route->tuple[!dir].in.offload_ifindex = (*hw_dev)->ifindex;
26940979563e55c1 Felix Fietkau 2021-01-23  318  }
26940979563e55c1 Felix Fietkau 2021-01-23  319  

:::::: The code at line 244 was first introduced by commit
:::::: 26940979563e55c1893ebfaf53e464c3a4724b7f netfilter: add xt_OFFLOAD target

:::::: TO: Felix Fietkau <nbd@nbd.name>
:::::: CC: Frank Wunderlich <frank-w@public-files.de>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 63479 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-24 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 14:06 [frank-w-bpi-r2-4.14:5.11-offload 18/31] net/netfilter/xt_FLOWOFFLOAD.c:244:28: warning: variable 'prev_type' set but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.