@@ -1376,11 +1376,17 @@ dsa_user_add_cls_matchall_mirred(struct net_device *dev,
1376
1376
struct dsa_port * to_dp ;
1377
1377
int err ;
1378
1378
1379
- if (cls -> common .protocol != htons (ETH_P_ALL ))
1379
+ if (cls -> common .protocol != htons (ETH_P_ALL )) {
1380
+ NL_SET_ERR_MSG_MOD (extack ,
1381
+ "Can only offload \"protocol all\" matchall filter" );
1380
1382
return - EOPNOTSUPP ;
1383
+ }
1381
1384
1382
- if (!ds -> ops -> port_mirror_add )
1385
+ if (!ds -> ops -> port_mirror_add ) {
1386
+ NL_SET_ERR_MSG_MOD (extack ,
1387
+ "Switch does not support mirroring operation" );
1383
1388
return - EOPNOTSUPP ;
1389
+ }
1384
1390
1385
1391
if (!flow_action_basic_hw_stats_check (& cls -> rule -> action , extack ))
1386
1392
return - EOPNOTSUPP ;
@@ -1487,16 +1493,21 @@ static int dsa_user_add_cls_matchall(struct net_device *dev,
1487
1493
bool ingress )
1488
1494
{
1489
1495
const struct flow_action * action = & cls -> rule -> action ;
1496
+ struct netlink_ext_ack * extack = cls -> common .extack ;
1490
1497
1491
- if (!flow_offload_has_one_action (action ))
1498
+ if (!flow_offload_has_one_action (action )) {
1499
+ NL_SET_ERR_MSG_MOD (extack ,
1500
+ "Cannot offload matchall filter with more than one action" );
1492
1501
return - EOPNOTSUPP ;
1502
+ }
1493
1503
1494
1504
switch (action -> entries [0 ].id ) {
1495
1505
case FLOW_ACTION_MIRRED :
1496
1506
return dsa_user_add_cls_matchall_mirred (dev , cls , ingress );
1497
1507
case FLOW_ACTION_POLICE :
1498
1508
return dsa_user_add_cls_matchall_police (dev , cls , ingress );
1499
1509
default :
1510
+ NL_SET_ERR_MSG_MOD (extack , "Unknown action" );
1500
1511
break ;
1501
1512
}
1502
1513
0 commit comments