Message ID | 20230105081335.1261636-3-steen.hegelund@microchip.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Add support for two classes of VCAP rules | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 2 this patch: 2 |
netdev/cc_maintainers | success | CCed 10 of 10 maintainers |
netdev/build_clang | success | Errors and warnings before: 1 this patch: 1 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 2 this patch: 2 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 25 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
On Thu, Jan 05, 2023 at 09:13:29AM +0100, Steen Hegelund wrote: > When a rule counter is external to the VCAP such as the Sparx5 IS2 counters > are, then this counter must be reset when a new rule is created. > > Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> > --- > drivers/net/ethernet/microchip/vcap/vcap_api.c | 3 +++ > drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c | 4 ++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c > index b9b6432f4094..67e0a3d9103a 100644 > --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c > +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c > @@ -1808,6 +1808,7 @@ int vcap_add_rule(struct vcap_rule *rule) > { > struct vcap_rule_internal *ri = to_intrule(rule); > struct vcap_rule_move move = {0}; > + struct vcap_counter ctr = {0}; > int ret; > > ret = vcap_api_check(ri->vctrl); > @@ -1833,6 +1834,8 @@ int vcap_add_rule(struct vcap_rule *rule) > ret = vcap_write_rule(ri); > if (ret) > pr_err("%s:%d: rule write error: %d\n", __func__, __LINE__, ret); > + /* Set the counter to zero */ > + ret = vcap_write_counter(ri, &ctr); > out: > mutex_unlock(&ri->admin->lock); > return ret; I feel like you intended to send a v2 series but accidentally resent the v1 series. Otherwise I guess I have the same question as before. regards, dan carpenter
Hi Dan, On Thu, 2023-01-05 at 12:10 +0300, Dan Carpenter wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > On Thu, Jan 05, 2023 at 09:13:29AM +0100, Steen Hegelund wrote: > > When a rule counter is external to the VCAP such as the Sparx5 IS2 counters > > are, then this counter must be reset when a new rule is created. > > > > Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> > > --- > > drivers/net/ethernet/microchip/vcap/vcap_api.c | 3 +++ > > drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c | 4 ++-- > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c > > b/drivers/net/ethernet/microchip/vcap/vcap_api.c > > index b9b6432f4094..67e0a3d9103a 100644 > > --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c > > +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c > > @@ -1808,6 +1808,7 @@ int vcap_add_rule(struct vcap_rule *rule) > > { > > struct vcap_rule_internal *ri = to_intrule(rule); > > struct vcap_rule_move move = {0}; > > + struct vcap_counter ctr = {0}; > > int ret; > > > > ret = vcap_api_check(ri->vctrl); > > @@ -1833,6 +1834,8 @@ int vcap_add_rule(struct vcap_rule *rule) > > ret = vcap_write_rule(ri); > > if (ret) > > pr_err("%s:%d: rule write error: %d\n", __func__, __LINE__, > > ret); > > + /* Set the counter to zero */ > > + ret = vcap_write_counter(ri, &ctr); > > out: > > mutex_unlock(&ri->admin->lock); > > return ret; > > I feel like you intended to send a v2 series but accidentally resent > the v1 series. Otherwise I guess I have the same question as before. This series was first sent to net, but the response was that I should go into net-next instead, so it is really a first version in net-next. What was your question? I was not able to find it... BR Steen > > regards, > dan carpenter >
[ Email re-arranged because I screwed up - dan] On Thu, Jan 05, 2023 at 11:43:17AM +0100, Steen Hegelund wrote: > This series was first sent to net, but the response was that I should go into > net-next instead, so it is really a first version in net-next. > > What was your question? I was not able to find it... Ugh... Oauth2 code (mutt/msmtp) silently ate my email. Sorry. > > > @@ -1833,6 +1834,8 @@ int vcap_add_rule(struct vcap_rule *rule) > > > ret = vcap_write_rule(ri); > > > if (ret) > > > pr_err("%s:%d: rule write error: %d\n", __func__, __LINE__, > > > ret); There should be a "goto out;" after the pr_err(). > > > + /* Set the counter to zero */ > > > + ret = vcap_write_counter(ri, &ctr); > > > out: > > > mutex_unlock(&ri->admin->lock); > > > return ret; > > regards, dan carpenter
Hi Dan, On Thu, 2023-01-05 at 13:58 +0300, Dan Carpenter wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > [ Email re-arranged because I screwed up - dan] > > On Thu, Jan 05, 2023 at 11:43:17AM +0100, Steen Hegelund wrote: > > > This series was first sent to net, but the response was that I should go > > into > > net-next instead, so it is really a first version in net-next. > > > > What was your question? I was not able to find it... > > Ugh... Oauth2 code (mutt/msmtp) silently ate my email. Sorry. > > > > > @@ -1833,6 +1834,8 @@ int vcap_add_rule(struct vcap_rule *rule) > > > > ret = vcap_write_rule(ri); > > > > if (ret) > > > > pr_err("%s:%d: rule write error: %d\n", __func__, > > > > __LINE__, > > > > ret); > > There should be a "goto out;" after the pr_err(). Indeed - You are right. I will add that in the next series. > > > > > + /* Set the counter to zero */ > > > > + ret = vcap_write_counter(ri, &ctr); > > > > out: > > > > mutex_unlock(&ri->admin->lock); > > > > return ret; > > > > > regards, > dan carpenter > Thanks for the feedback. BR Steen
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index b9b6432f4094..67e0a3d9103a 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -1808,6 +1808,7 @@ int vcap_add_rule(struct vcap_rule *rule) { struct vcap_rule_internal *ri = to_intrule(rule); struct vcap_rule_move move = {0}; + struct vcap_counter ctr = {0}; int ret; ret = vcap_api_check(ri->vctrl); @@ -1833,6 +1834,8 @@ int vcap_add_rule(struct vcap_rule *rule) ret = vcap_write_rule(ri); if (ret) pr_err("%s:%d: rule write error: %d\n", __func__, __LINE__, ret); + /* Set the counter to zero */ + ret = vcap_write_counter(ri, &ctr); out: mutex_unlock(&ri->admin->lock); return ret; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c index 76a31215ebfb..944de5cb9114 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c @@ -1343,8 +1343,8 @@ static void vcap_api_encode_rule_test(struct kunit *test) u32 port_mask_rng_mask = 0x0f; u32 igr_port_mask_value = 0xffabcd01; u32 igr_port_mask_mask = ~0; - /* counter is not written yet, so it is not in expwriteaddr */ - u32 expwriteaddr[] = {792, 793, 794, 795, 796, 797, 0}; + /* counter is written as the last operation */ + u32 expwriteaddr[] = {792, 793, 794, 795, 796, 797, 792}; int idx; vcap_test_api_init(&is2_admin);
When a rule counter is external to the VCAP such as the Sparx5 IS2 counters are, then this counter must be reset when a new rule is created. Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> --- drivers/net/ethernet/microchip/vcap/vcap_api.c | 3 +++ drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)