提交 277e9179 编写于 作者: S Steen Hegelund 提交者: David S. Miller

net: microchip: sparx5: Ensure VCAP last_used_addr is set back to default

This ensures that the last_used_addr in a VCAP instance is returned to the
default value when all rules have been deleted.
Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bcddc196
......@@ -1249,9 +1249,9 @@ int vcap_del_rule(struct vcap_control *vctrl, struct net_device *ndev, u32 id)
vctrl->ops->init(ndev, admin, admin->last_used_addr, ri->size + gap);
kfree(ri);
/* Update the last used address */
/* Update the last used address, set to default when no rules */
if (list_empty(&admin->rules)) {
admin->last_used_addr = admin->last_valid_addr;
admin->last_used_addr = admin->last_valid_addr + 1;
} else {
elem = list_last_entry(&admin->rules, struct vcap_rule_internal,
list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册