All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test
@ 2020-03-09 13:30 ` Jose Abreu
  0 siblings, 0 replies; 5+ messages in thread
From: Jose Abreu @ 2020-03-09 13:30 UTC (permalink / raw)
  To: netdev
  Cc: Joao Pinto, Jose Abreu, Giuseppe Cavallaro, Alexandre Torgue,
	Jose Abreu, David S. Miller, Maxime Coquelin, linux-stm32,
	linux-arm-kernel, linux-kernel

Since commit 319a1d19471e, stmmac only support basic HW stats type for
action. Set this field in the L3/L4 Filtering test so that it correctly
setups the filter instead of returning EOPNOTSUPP.

Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>

---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index 586a657be984..07dbe4f5456e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -1387,6 +1387,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
 	cls->rule = rule;
 
 	rule->action.entries[0].id = FLOW_ACTION_DROP;
+	rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
 	rule->action.num_entries = 1;
 
 	attr.dst = priv->dev->dev_addr;
@@ -1515,6 +1516,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
 	cls->rule = rule;
 
 	rule->action.entries[0].id = FLOW_ACTION_DROP;
+	rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
 	rule->action.num_entries = 1;
 
 	attr.dst = priv->dev->dev_addr;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test
@ 2020-03-09 13:30 ` Jose Abreu
  0 siblings, 0 replies; 5+ messages in thread
From: Jose Abreu @ 2020-03-09 13:30 UTC (permalink / raw)
  To: netdev
  Cc: Jose Abreu, Joao Pinto, Alexandre Torgue, linux-kernel,
	linux-stm32, Maxime Coquelin, Giuseppe Cavallaro,
	David S. Miller, linux-arm-kernel

Since commit 319a1d19471e, stmmac only support basic HW stats type for
action. Set this field in the L3/L4 Filtering test so that it correctly
setups the filter instead of returning EOPNOTSUPP.

Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>

---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index 586a657be984..07dbe4f5456e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -1387,6 +1387,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
 	cls->rule = rule;
 
 	rule->action.entries[0].id = FLOW_ACTION_DROP;
+	rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
 	rule->action.num_entries = 1;
 
 	attr.dst = priv->dev->dev_addr;
@@ -1515,6 +1516,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
 	cls->rule = rule;
 
 	rule->action.entries[0].id = FLOW_ACTION_DROP;
+	rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
 	rule->action.num_entries = 1;
 
 	attr.dst = priv->dev->dev_addr;
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test
  2020-03-09 13:30 ` Jose Abreu
  (?)
@ 2020-03-09 22:09 ` kbuild test robot
  -1 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-03-09 22:09 UTC (permalink / raw)
  To: kbuild-all

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

Hi Jose,

I love your patch! Yet something to improve:

[auto build test ERROR on ipvs/master]
[also build test ERROR on v5.6-rc5 next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jose-Abreu/net-stmmac-selftests-Fix-L3-L4-Filtering-test/20200310-030822
base:   https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git master
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.5.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.5.0 make.cross ARCH=parisc 

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

All errors (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:1284:25: error: 'struct flow_action_entry' has no member named 'hw_stats_type'
     rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
                            ^
>> drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c:1284:42: error: 'FLOW_ACTION_HW_STATS_TYPE_ANY' undeclared (first use in this function); did you mean 'FLOW_ACTION_PTYPE'?
     rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                             FLOW_ACTION_PTYPE
   drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c:1284:42: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c: In function '__stmmac_test_l4filt':
   drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c:1409:25: error: 'struct flow_action_entry' has no member named 'hw_stats_type'
     rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
                            ^
   drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c:1409:42: error: 'FLOW_ACTION_HW_STATS_TYPE_ANY' undeclared (first use in this function); did you mean 'FLOW_ACTION_PTYPE'?
     rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                             FLOW_ACTION_PTYPE

vim +1284 drivers/net//ethernet/stmicro/stmmac/stmmac_selftests.c

  1226	
  1227	#ifdef CONFIG_NET_CLS_ACT
  1228	static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
  1229					u32 dst_mask, u32 src_mask)
  1230	{
  1231		struct flow_dissector_key_ipv4_addrs key, mask;
  1232		unsigned long dummy_cookie = 0xdeadbeef;
  1233		struct stmmac_packet_attrs attr = { };
  1234		struct flow_dissector *dissector;
  1235		struct flow_cls_offload *cls;
  1236		struct flow_rule *rule;
  1237		int ret;
  1238	
  1239		if (!tc_can_offload(priv->dev))
  1240			return -EOPNOTSUPP;
  1241		if (!priv->dma_cap.l3l4fnum)
  1242			return -EOPNOTSUPP;
  1243		if (priv->rss.enable)
  1244			stmmac_rss_configure(priv, priv->hw, NULL,
  1245					     priv->plat->rx_queues_to_use);
  1246	
  1247		dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
  1248		if (!dissector) {
  1249			ret = -ENOMEM;
  1250			goto cleanup_rss;
  1251		}
  1252	
  1253		dissector->used_keys |= (1 << FLOW_DISSECTOR_KEY_IPV4_ADDRS);
  1254		dissector->offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] = 0;
  1255	
  1256		cls = kzalloc(sizeof(*cls), GFP_KERNEL);
  1257		if (!cls) {
  1258			ret = -ENOMEM;
  1259			goto cleanup_dissector;
  1260		}
  1261	
  1262		cls->common.chain_index = 0;
  1263		cls->command = FLOW_CLS_REPLACE;
  1264		cls->cookie = dummy_cookie;
  1265	
  1266		rule = kzalloc(struct_size(rule, action.entries, 1), GFP_KERNEL);
  1267		if (!rule) {
  1268			ret = -ENOMEM;
  1269			goto cleanup_cls;
  1270		}
  1271	
  1272		rule->match.dissector = dissector;
  1273		rule->match.key = (void *)&key;
  1274		rule->match.mask = (void *)&mask;
  1275	
  1276		key.src = htonl(src);
  1277		key.dst = htonl(dst);
  1278		mask.src = src_mask;
  1279		mask.dst = dst_mask;
  1280	
  1281		cls->rule = rule;
  1282	
  1283		rule->action.entries[0].id = FLOW_ACTION_DROP;
> 1284		rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
  1285		rule->action.num_entries = 1;
  1286	
  1287		attr.dst = priv->dev->dev_addr;
  1288		attr.ip_dst = dst;
  1289		attr.ip_src = src;
  1290	
  1291		/* Shall receive packet */
  1292		ret = __stmmac_test_loopback(priv, &attr);
  1293		if (ret)
  1294			goto cleanup_rule;
  1295	
  1296		ret = stmmac_tc_setup_cls(priv, priv, cls);
  1297		if (ret)
  1298			goto cleanup_rule;
  1299	
  1300		/* Shall NOT receive packet */
  1301		ret = __stmmac_test_loopback(priv, &attr);
  1302		ret = ret ? 0 : -EINVAL;
  1303	
  1304		cls->command = FLOW_CLS_DESTROY;
  1305		stmmac_tc_setup_cls(priv, priv, cls);
  1306	cleanup_rule:
  1307		kfree(rule);
  1308	cleanup_cls:
  1309		kfree(cls);
  1310	cleanup_dissector:
  1311		kfree(dissector);
  1312	cleanup_rss:
  1313		if (priv->rss.enable) {
  1314			stmmac_rss_configure(priv, priv->hw, &priv->rss,
  1315					     priv->plat->rx_queues_to_use);
  1316		}
  1317	
  1318		return ret;
  1319	}
  1320	#else
  1321	static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
  1322					u32 dst_mask, u32 src_mask)
  1323	{
  1324		return -EOPNOTSUPP;
  1325	}
  1326	#endif
  1327	

---
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: 58595 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test
  2020-03-09 13:30 ` Jose Abreu
@ 2020-03-12  6:05   ` David Miller
  -1 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-12  6:05 UTC (permalink / raw)
  To: Jose.Abreu
  Cc: netdev, Joao.Pinto, peppe.cavallaro, alexandre.torgue,
	mcoquelin.stm32, linux-stm32, linux-arm-kernel, linux-kernel

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Mon,  9 Mar 2020 14:30:22 +0100

> Since commit 319a1d19471e, stmmac only support basic HW stats type for
> action. Set this field in the L3/L4 Filtering test so that it correctly
> setups the filter instead of returning EOPNOTSUPP.
> 
> Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
> Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test
@ 2020-03-12  6:05   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-12  6:05 UTC (permalink / raw)
  To: Jose.Abreu
  Cc: Joao.Pinto, alexandre.torgue, netdev, linux-kernel,
	mcoquelin.stm32, peppe.cavallaro, linux-stm32, linux-arm-kernel

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Mon,  9 Mar 2020 14:30:22 +0100

> Since commit 319a1d19471e, stmmac only support basic HW stats type for
> action. Set this field in the L3/L4 Filtering test so that it correctly
> setups the filter instead of returning EOPNOTSUPP.
> 
> Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
> Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-12  6:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 13:30 [PATCH net-next] net: stmmac: selftests: Fix L3/L4 Filtering test Jose Abreu
2020-03-09 13:30 ` Jose Abreu
2020-03-09 22:09 ` kbuild test robot
2020-03-12  6:05 ` David Miller
2020-03-12  6:05   ` David Miller

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.