Re: [PATCH net-next 05/13] net: stmmac: selftests: Add selftest for L3/L4 Filters
From: kbuild test robot
Date: Mon Sep 02 2019 - 06:35:46 EST
Hi Jose,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Jose-Abreu/net-stmmac-Improvements-for-next/20190902-160927
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c: In function '__stmmac_test_l3filt':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1249:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c: In function '__stmmac_test_l4filt':
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1362:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
vim +1249 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
1170
1171 #ifdef CONFIG_NET_CLS_ACT
1172 static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
1173 u32 dst_mask, u32 src_mask)
1174 {
1175 struct flow_dissector_key_ipv4_addrs key, mask;
1176 unsigned long dummy_cookie = 0xdeadbeef;
1177 struct flow_dissector dissector = { };
1178 struct stmmac_packet_attrs attr = { };
1179 struct flow_cls_offload cls = { };
1180 struct flow_rule *rule;
1181 int ret;
1182
1183 if (!tc_can_offload(priv->dev))
1184 return -EOPNOTSUPP;
1185 if (!priv->dma_cap.l3l4fnum)
1186 return -EOPNOTSUPP;
1187 if (priv->rss.enable) {
1188 struct stmmac_rss rss = { .enable = false, };
1189
1190 stmmac_rss_configure(priv, priv->hw, &rss,
1191 priv->plat->rx_queues_to_use);
1192 }
1193
1194 dissector.used_keys |= (1 << FLOW_DISSECTOR_KEY_IPV4_ADDRS);
1195 dissector.offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] = 0;
1196
1197 cls.common.chain_index = 0;
1198 cls.command = FLOW_CLS_REPLACE;
1199 cls.cookie = dummy_cookie;
1200
1201 rule = kzalloc(struct_size(rule, action.entries, 1), GFP_KERNEL);
1202 if (!rule) {
1203 ret = -ENOMEM;
1204 goto cleanup_rss;
1205 }
1206
1207 rule->match.dissector = &dissector;
1208 rule->match.key = (void *)&key;
1209 rule->match.mask = (void *)&mask;
1210
1211 key.src = htonl(src);
1212 key.dst = htonl(dst);
1213 mask.src = src_mask;
1214 mask.dst = dst_mask;
1215
1216 cls.rule = rule;
1217
1218 rule->action.entries[0].id = FLOW_ACTION_DROP;
1219 rule->action.num_entries = 1;
1220
1221 attr.dst = priv->dev->dev_addr;
1222 attr.ip_dst = dst;
1223 attr.ip_src = src;
1224
1225 /* Shall receive packet */
1226 ret = __stmmac_test_loopback(priv, &attr);
1227 if (ret)
1228 goto cleanup_rule;
1229
1230 ret = stmmac_tc_setup_cls(priv, priv, &cls);
1231 if (ret)
1232 goto cleanup_rule;
1233
1234 /* Shall NOT receive packet */
1235 ret = __stmmac_test_loopback(priv, &attr);
1236 ret = ret ? 0 : -EINVAL;
1237
1238 cls.command = FLOW_CLS_DESTROY;
1239 stmmac_tc_setup_cls(priv, priv, &cls);
1240 cleanup_rule:
1241 kfree(rule);
1242 cleanup_rss:
1243 if (priv->rss.enable) {
1244 stmmac_rss_configure(priv, priv->hw, &priv->rss,
1245 priv->plat->rx_queues_to_use);
1246 }
1247
1248 return ret;
> 1249 }
1250 #else
1251 static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
1252 u32 dst_mask, u32 src_mask)
1253 {
1254 return -EOPNOTSUPP;
1255 }
1256 #endif
1257
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip