Thread (15 messages) flat view 15 messages, 2 authors, 2023-01-20

Re: [PATCH net-next 4/8] net: microchip: sparx5: Add TC support for IS0 VCAP

From: Steen Hegelund <steen.hegelund@microchip.com>
Date: 2023-01-20 09:37:00
Also in: linux-arm-kernel, lkml

Hi Dan,

On Fri, 2023-01-20 at 12:13 +0300, Dan Carpenter wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the
content is safe

On Fri, Jan 20, 2023 at 10:08:27AM +0100, Steen Hegelund wrote:
quoted
-/* Add a rule counter action - only IS2 is considered for now */
+/* Add a rule counter action */
 static int sparx5_tc_add_rule_counter(struct vcap_admin *admin,
                                    struct vcap_rule *vrule)
 {
-     int err;
+     int err = 0;
Don't initialize.
Yep. No need for that.
quoted
-     err = vcap_rule_mod_action_u32(vrule, VCAP_AF_CNT_ID, vrule->id);
-     if (err)
-             return err;
+     if (admin->vtype == VCAP_TYPE_IS2) {
+             err = vcap_rule_mod_action_u32(vrule, VCAP_AF_CNT_ID,
+                                            vrule->id);
+             if (err)
+                     return err;
+             vcap_rule_set_counter_id(vrule, vrule->id);
+     }

-     vcap_rule_set_counter_id(vrule, vrule->id);
      return err;
return 0;
I will update that.
quoted
 }
regards,
dan carpenter
Thanks for the review.

BR
Steen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help