From: Vladimir Oltean <olteanv@gmail.com> Date: 2021-03-04 10:31:28
From: Vladimir Oltean <vladimir.oltean@nxp.com>
An attempt is made to warn the user about the fact that VCAP IS1 cannot
offload keys matching on destination IP (at least given the current half
key format), but sadly that warning fails miserably in practice, due to
the fact that it operates on an uninitialized "match" variable. We must
first decode the keys from the flow rule.
Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1")
Reported-by: Colin Ian King <redacted>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/mscc/ocelot_flower.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -540,13 +540,14 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress,return-EOPNOTSUPP;}+flow_rule_match_ipv4_addrs(rule,&match);+if(filter->block_id==VCAP_IS1&&*(u32*)&match.mask->dst){NL_SET_ERR_MSG_MOD(extack,"Key type S1_NORMAL cannot match on destination IP");return-EOPNOTSUPP;}-flow_rule_match_ipv4_addrs(rule,&match);tmp=&filter->key.ipv4.sip.value.addr[0];memcpy(tmp,&match.key->src,4);
From: Colin Ian King <hidden> Date: 2021-03-04 10:32:47
On 04/03/2021 10:29, Vladimir Oltean wrote:
quoted hunk
From: Vladimir Oltean <vladimir.oltean@nxp.com>
An attempt is made to warn the user about the fact that VCAP IS1 cannot
offload keys matching on destination IP (at least given the current half
key format), but sadly that warning fails miserably in practice, due to
the fact that it operates on an uninitialized "match" variable. We must
first decode the keys from the flow rule.
Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1")
Reported-by: Colin Ian King <redacted>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/mscc/ocelot_flower.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -540,13 +540,14 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress,return-EOPNOTSUPP;}+flow_rule_match_ipv4_addrs(rule,&match);+if(filter->block_id==VCAP_IS1&&*(u32*)&match.mask->dst){NL_SET_ERR_MSG_MOD(extack,"Key type S1_NORMAL cannot match on destination IP");return-EOPNOTSUPP;}-flow_rule_match_ipv4_addrs(rule,&match);tmp=&filter->key.ipv4.sip.value.addr[0];memcpy(tmp,&match.key->src,4);
Thanks, looks good to me.
Reviewed-by: Colin Ian King <redacted>
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 4 Mar 2021 12:29:43 +0200 you wrote:
From: Vladimir Oltean <vladimir.oltean@nxp.com>
An attempt is made to warn the user about the fact that VCAP IS1 cannot
offload keys matching on destination IP (at least given the current half
key format), but sadly that warning fails miserably in practice, due to
the fact that it operates on an uninitialized "match" variable. We must
first decode the keys from the flow rule.
[...]