Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3857027pxk; Tue, 22 Sep 2020 04:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXlg2SQ4jjIWBckkYRy8qTle6ia/hW3Acx//IwpLlQQUDoN9PWlxxX/lTJGZ00baZV+7Dn X-Received: by 2002:a17:906:2752:: with SMTP id a18mr4352734ejd.350.1600774629278; Tue, 22 Sep 2020 04:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600774629; cv=none; d=google.com; s=arc-20160816; b=FPpkVK60cs0ezddIRqo0DLOn12zexbX4dB64VuwkH3AWXh3kFWbsRVZYG5kdKDGp0i hau2ltu4TI8mOcZbX5BxkJt+HDT+TKss34j+FYmTno5ibmIbrjtOOmjjdmHa+cCraLz5 I4dU92nSWW9QTPA32YjcmFLwYFPpk1Qiw/cuskvGw/REmSJjdZvsKTkVYefmRGlVY340 Wn360z0v0FQDDwCgrKakLcpyHy+7y9SI3/odkpWfcq1oOLN92vPH9lO+aKalNakiSJtA ab9h6VeeHSOj8SEPRDkP7tUs+ETSnLi+xyKnx41PdFK96jhQ0/6UHXH7qg/PHP2gj5/P kzdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=A+FOPcvtjmIzABIpUkqy/yYPo3FuHTzh+DvFAhkENk8=; b=wwnWvY7RPJtx4kvOKCH3MJ8VF1tn4rOG8zHclryLc+0WubtYH6wfaGvDNbFb/EBhtn LinCJVDbiV+TouSVZqRWMH3jTW/NhDLezt7/kL+m4rpzOpFdauTyU4Fwbrm/gmtIyRp2 weeUWZWgm6cNgFUS5Qj2X+r1mYG4/h0FQhs8B84x8YMeuJ0rFKB7E45S5M7qkU1dTi58 p6l5LvxRpF5Sk5p6N825tvQpMSeuk85RlUjU/IA1D3N5PwLt9lZlzt34D61NAbjSjc3j nVjGB8u8z+7WiBVdLfKLBCyoQ+t+mlZ80mt4Qa/0AvA4xXNxMtUr/wIMLrch74vYH5d4 miJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si10085738edy.117.2020.09.22.04.36.45; Tue, 22 Sep 2020 04:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgIVLfk (ORCPT + 99 others); Tue, 22 Sep 2020 07:35:40 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:45738 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726650AbgIVLfj (ORCPT ); Tue, 22 Sep 2020 07:35:39 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from ayal@mellanox.com) with SMTP; 22 Sep 2020 14:35:35 +0300 Received: from dev-l-vrt-210.mtl.labs.mlnx (dev-l-vrt-210.mtl.labs.mlnx [10.234.210.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 08MBZZRO014360; Tue, 22 Sep 2020 14:35:35 +0300 Received: from dev-l-vrt-210.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-210.mtl.labs.mlnx (8.15.2/8.15.2/Debian-8ubuntu1) with ESMTP id 08MBZZ5e009505; Tue, 22 Sep 2020 14:35:35 +0300 Received: (from ayal@localhost) by dev-l-vrt-210.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 08MBZZF6009504; Tue, 22 Sep 2020 14:35:35 +0300 From: Aya Levin To: "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , netdev Cc: Moshe Shemesh , Eran Ben Elisha , , Aya Levin Subject: [PATCH net-next RFC v2 repost 1/3] devlink: Wrap trap related Date: Tue, 22 Sep 2020 14:35:23 +0300 Message-Id: <1600774525-9461-2-git-send-email-ayal@nvidia.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1600774525-9461-1-git-send-email-ayal@nvidia.com> References: <1600774525-9461-1-git-send-email-ayal@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bundle the trap related lists: trap_list, trap_group_list and trap_policer_list in a dedicated struct. This will be handy in the coming patches in the set introducing traps in devlink port context. With trap_lists, code reuse is much simpler. Signed-off-by: Aya Levin --- Changelog: v1->v2: Patch 1: Encapsulate only the traps lists for future code reuse. Don't try to reuse the traps ops. include/net/devlink.h | 10 +++-- net/core/devlink.c | 109 ++++++++++++++++++++++++++------------------------ 2 files changed, 63 insertions(+), 56 deletions(-) diff --git a/include/net/devlink.h b/include/net/devlink.h index eaec0a8cc5ef..f11e09097e44 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -22,6 +22,12 @@ struct devlink_ops; +struct devlink_trap_lists { + struct list_head trap_list; + struct list_head trap_group_list; + struct list_head trap_policer_list; +}; + struct devlink { struct list_head list; struct list_head port_list; @@ -33,9 +39,7 @@ struct devlink { struct list_head reporter_list; struct mutex reporters_lock; /* protects reporter_list */ struct devlink_dpipe_headers *dpipe_headers; - struct list_head trap_list; - struct list_head trap_group_list; - struct list_head trap_policer_list; + struct devlink_trap_lists trap_lists; const struct devlink_ops *ops; struct xarray snapshot_ids; struct device *dev; diff --git a/net/core/devlink.c b/net/core/devlink.c index 19037f114307..fde6f2c5c409 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -6158,11 +6158,11 @@ struct devlink_trap_item { }; static struct devlink_trap_policer_item * -devlink_trap_policer_item_lookup(struct devlink *devlink, u32 id) +devlink_trap_policer_item_lookup(struct devlink_trap_lists *trap_lists, u32 id) { struct devlink_trap_policer_item *policer_item; - list_for_each_entry(policer_item, &devlink->trap_policer_list, list) { + list_for_each_entry(policer_item, &trap_lists->trap_policer_list, list) { if (policer_item->policer->id == id) return policer_item; } @@ -6171,11 +6171,11 @@ devlink_trap_policer_item_lookup(struct devlink *devlink, u32 id) } static struct devlink_trap_item * -devlink_trap_item_lookup(struct devlink *devlink, const char *name) +devlink_trap_item_lookup(struct devlink_trap_lists *trap_lists, const char *name) { struct devlink_trap_item *trap_item; - list_for_each_entry(trap_item, &devlink->trap_list, list) { + list_for_each_entry(trap_item, &trap_lists->trap_list, list) { if (!strcmp(trap_item->trap->name, name)) return trap_item; } @@ -6184,7 +6184,7 @@ devlink_trap_item_lookup(struct devlink *devlink, const char *name) } static struct devlink_trap_item * -devlink_trap_item_get_from_info(struct devlink *devlink, +devlink_trap_item_get_from_info(struct devlink_trap_lists *trap_lists, struct genl_info *info) { struct nlattr *attr; @@ -6193,7 +6193,7 @@ devlink_trap_item_get_from_info(struct devlink *devlink, return NULL; attr = info->attrs[DEVLINK_ATTR_TRAP_NAME]; - return devlink_trap_item_lookup(devlink, nla_data(attr)); + return devlink_trap_item_lookup(trap_lists, nla_data(attr)); } static int @@ -6352,10 +6352,10 @@ static int devlink_nl_cmd_trap_get_doit(struct sk_buff *skb, struct sk_buff *msg; int err; - if (list_empty(&devlink->trap_list)) + if (list_empty(&devlink->trap_lists.trap_list)) return -EOPNOTSUPP; - trap_item = devlink_trap_item_get_from_info(devlink, info); + trap_item = devlink_trap_item_get_from_info(&devlink->trap_lists, info); if (!trap_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap"); return -ENOENT; @@ -6392,7 +6392,7 @@ static int devlink_nl_cmd_trap_get_dumpit(struct sk_buff *msg, if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) continue; mutex_lock(&devlink->lock); - list_for_each_entry(trap_item, &devlink->trap_list, list) { + list_for_each_entry(trap_item, &devlink->trap_lists.trap_list, list) { if (idx < start) { idx++; continue; @@ -6468,10 +6468,10 @@ static int devlink_nl_cmd_trap_set_doit(struct sk_buff *skb, struct devlink_trap_item *trap_item; int err; - if (list_empty(&devlink->trap_list)) + if (list_empty(&devlink->trap_lists.trap_list)) return -EOPNOTSUPP; - trap_item = devlink_trap_item_get_from_info(devlink, info); + trap_item = devlink_trap_item_get_from_info(&devlink->trap_lists, info); if (!trap_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap"); return -ENOENT; @@ -6485,11 +6485,11 @@ static int devlink_nl_cmd_trap_set_doit(struct sk_buff *skb, } static struct devlink_trap_group_item * -devlink_trap_group_item_lookup(struct devlink *devlink, const char *name) +devlink_trap_group_item_lookup(struct devlink_trap_lists *trap_lists, const char *name) { struct devlink_trap_group_item *group_item; - list_for_each_entry(group_item, &devlink->trap_group_list, list) { + list_for_each_entry(group_item, &trap_lists->trap_group_list, list) { if (!strcmp(group_item->group->name, name)) return group_item; } @@ -6498,11 +6498,11 @@ devlink_trap_group_item_lookup(struct devlink *devlink, const char *name) } static struct devlink_trap_group_item * -devlink_trap_group_item_lookup_by_id(struct devlink *devlink, u16 id) +devlink_trap_group_item_lookup_by_id(struct devlink_trap_lists *trap_lists, u16 id) { struct devlink_trap_group_item *group_item; - list_for_each_entry(group_item, &devlink->trap_group_list, list) { + list_for_each_entry(group_item, &trap_lists->trap_group_list, list) { if (group_item->group->id == id) return group_item; } @@ -6511,7 +6511,7 @@ devlink_trap_group_item_lookup_by_id(struct devlink *devlink, u16 id) } static struct devlink_trap_group_item * -devlink_trap_group_item_get_from_info(struct devlink *devlink, +devlink_trap_group_item_get_from_info(struct devlink_trap_lists *trap_lists, struct genl_info *info) { char *name; @@ -6520,7 +6520,7 @@ devlink_trap_group_item_get_from_info(struct devlink *devlink, return NULL; name = nla_data(info->attrs[DEVLINK_ATTR_TRAP_GROUP_NAME]); - return devlink_trap_group_item_lookup(devlink, name); + return devlink_trap_group_item_lookup(trap_lists, name); } static int @@ -6574,10 +6574,10 @@ static int devlink_nl_cmd_trap_group_get_doit(struct sk_buff *skb, struct sk_buff *msg; int err; - if (list_empty(&devlink->trap_group_list)) + if (list_empty(&devlink->trap_lists.trap_group_list)) return -EOPNOTSUPP; - group_item = devlink_trap_group_item_get_from_info(devlink, info); + group_item = devlink_trap_group_item_get_from_info(&devlink->trap_lists, info); if (!group_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap group"); return -ENOENT; @@ -6616,7 +6616,7 @@ static int devlink_nl_cmd_trap_group_get_dumpit(struct sk_buff *msg, if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) continue; mutex_lock(&devlink->lock); - list_for_each_entry(group_item, &devlink->trap_group_list, + list_for_each_entry(group_item, &devlink->trap_lists.trap_group_list, list) { if (idx < start) { idx++; @@ -6652,7 +6652,7 @@ __devlink_trap_group_action_set(struct devlink *devlink, struct devlink_trap_item *trap_item; int err; - list_for_each_entry(trap_item, &devlink->trap_list, list) { + list_for_each_entry(trap_item, &devlink->trap_lists.trap_list, list) { if (strcmp(trap_item->group_item->group->name, group_name)) continue; err = __devlink_trap_action_set(devlink, trap_item, @@ -6712,7 +6712,7 @@ static int devlink_trap_group_set(struct devlink *devlink, u32 policer_id; policer_id = nla_get_u32(attrs[DEVLINK_ATTR_TRAP_POLICER_ID]); - policer_item = devlink_trap_policer_item_lookup(devlink, + policer_item = devlink_trap_policer_item_lookup(&devlink->trap_lists, policer_id); if (policer_id && !policer_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap policer"); @@ -6740,10 +6740,10 @@ static int devlink_nl_cmd_trap_group_set_doit(struct sk_buff *skb, bool modified = false; int err; - if (list_empty(&devlink->trap_group_list)) + if (list_empty(&devlink->trap_lists.trap_group_list)) return -EOPNOTSUPP; - group_item = devlink_trap_group_item_get_from_info(devlink, info); + group_item = devlink_trap_group_item_get_from_info(&devlink->trap_lists, info); if (!group_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap group"); return -ENOENT; @@ -6767,7 +6767,7 @@ static int devlink_nl_cmd_trap_group_set_doit(struct sk_buff *skb, } static struct devlink_trap_policer_item * -devlink_trap_policer_item_get_from_info(struct devlink *devlink, +devlink_trap_policer_item_get_from_info(struct devlink_trap_lists *trap_lists, struct genl_info *info) { u32 id; @@ -6776,7 +6776,7 @@ devlink_trap_policer_item_get_from_info(struct devlink *devlink, return NULL; id = nla_get_u32(info->attrs[DEVLINK_ATTR_TRAP_POLICER_ID]); - return devlink_trap_policer_item_lookup(devlink, id); + return devlink_trap_policer_item_lookup(trap_lists, id); } static int @@ -6862,10 +6862,10 @@ static int devlink_nl_cmd_trap_policer_get_doit(struct sk_buff *skb, struct sk_buff *msg; int err; - if (list_empty(&devlink->trap_policer_list)) + if (list_empty(&devlink->trap_lists.trap_policer_list)) return -EOPNOTSUPP; - policer_item = devlink_trap_policer_item_get_from_info(devlink, info); + policer_item = devlink_trap_policer_item_get_from_info(&devlink->trap_lists, info); if (!policer_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap policer"); return -ENOENT; @@ -6904,7 +6904,7 @@ static int devlink_nl_cmd_trap_policer_get_dumpit(struct sk_buff *msg, if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) continue; mutex_lock(&devlink->lock); - list_for_each_entry(policer_item, &devlink->trap_policer_list, + list_for_each_entry(policer_item, &devlink->trap_lists.trap_policer_list, list) { if (idx < start) { idx++; @@ -6987,13 +6987,13 @@ static int devlink_nl_cmd_trap_policer_set_doit(struct sk_buff *skb, struct netlink_ext_ack *extack = info->extack; struct devlink *devlink = info->user_ptr[0]; - if (list_empty(&devlink->trap_policer_list)) + if (list_empty(&devlink->trap_lists.trap_policer_list)) return -EOPNOTSUPP; if (!devlink->ops->trap_policer_set) return -EOPNOTSUPP; - policer_item = devlink_trap_policer_item_get_from_info(devlink, info); + policer_item = devlink_trap_policer_item_get_from_info(&devlink->trap_lists, info); if (!policer_item) { NL_SET_ERR_MSG_MOD(extack, "Device did not register this trap policer"); return -ENOENT; @@ -7401,9 +7401,9 @@ struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size) INIT_LIST_HEAD(&devlink->param_list); INIT_LIST_HEAD(&devlink->region_list); INIT_LIST_HEAD(&devlink->reporter_list); - INIT_LIST_HEAD(&devlink->trap_list); - INIT_LIST_HEAD(&devlink->trap_group_list); - INIT_LIST_HEAD(&devlink->trap_policer_list); + INIT_LIST_HEAD(&devlink->trap_lists.trap_list); + INIT_LIST_HEAD(&devlink->trap_lists.trap_group_list); + INIT_LIST_HEAD(&devlink->trap_lists.trap_policer_list); mutex_init(&devlink->lock); mutex_init(&devlink->reporters_lock); return devlink; @@ -7488,9 +7488,9 @@ void devlink_free(struct devlink *devlink) { mutex_destroy(&devlink->reporters_lock); mutex_destroy(&devlink->lock); - WARN_ON(!list_empty(&devlink->trap_policer_list)); - WARN_ON(!list_empty(&devlink->trap_group_list)); - WARN_ON(!list_empty(&devlink->trap_list)); + WARN_ON(!list_empty(&devlink->trap_lists.trap_policer_list)); + WARN_ON(!list_empty(&devlink->trap_lists.trap_group_list)); + WARN_ON(!list_empty(&devlink->trap_lists.trap_list)); WARN_ON(!list_empty(&devlink->reporter_list)); WARN_ON(!list_empty(&devlink->region_list)); WARN_ON(!list_empty(&devlink->param_list)); @@ -8984,13 +8984,13 @@ devlink_trap_group_notify(struct devlink *devlink, } static int -devlink_trap_item_group_link(struct devlink *devlink, +devlink_trap_item_group_link(struct devlink_trap_lists *trap_lists, struct devlink_trap_item *trap_item) { u16 group_id = trap_item->trap->init_group_id; struct devlink_trap_group_item *group_item; - group_item = devlink_trap_group_item_lookup_by_id(devlink, group_id); + group_item = devlink_trap_group_item_lookup_by_id(trap_lists, group_id); if (WARN_ON_ONCE(!group_item)) return -EINVAL; @@ -9027,10 +9027,11 @@ static int devlink_trap_register(struct devlink *devlink, const struct devlink_trap *trap, void *priv) { + struct devlink_trap_lists *trap_lists = &devlink->trap_lists; struct devlink_trap_item *trap_item; int err; - if (devlink_trap_item_lookup(devlink, trap->name)) + if (devlink_trap_item_lookup(trap_lists, trap->name)) return -EEXIST; trap_item = kzalloc(sizeof(*trap_item), GFP_KERNEL); @@ -9047,7 +9048,7 @@ devlink_trap_register(struct devlink *devlink, trap_item->action = trap->init_action; trap_item->priv = priv; - err = devlink_trap_item_group_link(devlink, trap_item); + err = devlink_trap_item_group_link(trap_lists, trap_item); if (err) goto err_group_link; @@ -9055,7 +9056,7 @@ devlink_trap_register(struct devlink *devlink, if (err) goto err_trap_init; - list_add_tail(&trap_item->list, &devlink->trap_list); + list_add_tail(&trap_item->list, &trap_lists->trap_list); devlink_trap_notify(devlink, trap_item, DEVLINK_CMD_TRAP_NEW); return 0; @@ -9073,7 +9074,7 @@ static void devlink_trap_unregister(struct devlink *devlink, { struct devlink_trap_item *trap_item; - trap_item = devlink_trap_item_lookup(devlink, trap->name); + trap_item = devlink_trap_item_lookup(&devlink->trap_lists, trap->name); if (WARN_ON_ONCE(!trap_item)) return; @@ -9090,7 +9091,7 @@ static void devlink_trap_disable(struct devlink *devlink, { struct devlink_trap_item *trap_item; - trap_item = devlink_trap_item_lookup(devlink, trap->name); + trap_item = devlink_trap_item_lookup(&devlink->trap_lists, trap->name); if (WARN_ON_ONCE(!trap_item)) return; @@ -9245,7 +9246,7 @@ void *devlink_trap_ctx_priv(void *trap_ctx) EXPORT_SYMBOL_GPL(devlink_trap_ctx_priv); static int -devlink_trap_group_item_policer_link(struct devlink *devlink, +devlink_trap_group_item_policer_link(struct devlink_trap_lists *trap_lists, struct devlink_trap_group_item *group_item) { u32 policer_id = group_item->group->init_policer_id; @@ -9254,7 +9255,7 @@ devlink_trap_group_item_policer_link(struct devlink *devlink, if (policer_id == 0) return 0; - policer_item = devlink_trap_policer_item_lookup(devlink, policer_id); + policer_item = devlink_trap_policer_item_lookup(trap_lists, policer_id); if (WARN_ON_ONCE(!policer_item)) return -EINVAL; @@ -9267,10 +9268,11 @@ static int devlink_trap_group_register(struct devlink *devlink, const struct devlink_trap_group *group) { + struct devlink_trap_lists *trap_lists = &devlink->trap_lists; struct devlink_trap_group_item *group_item; int err; - if (devlink_trap_group_item_lookup(devlink, group->name)) + if (devlink_trap_group_item_lookup(trap_lists, group->name)) return -EEXIST; group_item = kzalloc(sizeof(*group_item), GFP_KERNEL); @@ -9285,7 +9287,7 @@ devlink_trap_group_register(struct devlink *devlink, group_item->group = group; - err = devlink_trap_group_item_policer_link(devlink, group_item); + err = devlink_trap_group_item_policer_link(trap_lists, group_item); if (err) goto err_policer_link; @@ -9295,7 +9297,7 @@ devlink_trap_group_register(struct devlink *devlink, goto err_group_init; } - list_add_tail(&group_item->list, &devlink->trap_group_list); + list_add_tail(&group_item->list, &trap_lists->trap_group_list); devlink_trap_group_notify(devlink, group_item, DEVLINK_CMD_TRAP_GROUP_NEW); @@ -9315,7 +9317,7 @@ devlink_trap_group_unregister(struct devlink *devlink, { struct devlink_trap_group_item *group_item; - group_item = devlink_trap_group_item_lookup(devlink, group->name); + group_item = devlink_trap_group_item_lookup(&devlink->trap_lists, group->name); if (WARN_ON_ONCE(!group_item)) return; @@ -9414,10 +9416,11 @@ static int devlink_trap_policer_register(struct devlink *devlink, const struct devlink_trap_policer *policer) { + struct devlink_trap_lists *trap_lists = &devlink->trap_lists; struct devlink_trap_policer_item *policer_item; int err; - if (devlink_trap_policer_item_lookup(devlink, policer->id)) + if (devlink_trap_policer_item_lookup(trap_lists, policer->id)) return -EEXIST; policer_item = kzalloc(sizeof(*policer_item), GFP_KERNEL); @@ -9434,7 +9437,7 @@ devlink_trap_policer_register(struct devlink *devlink, goto err_policer_init; } - list_add_tail(&policer_item->list, &devlink->trap_policer_list); + list_add_tail(&policer_item->list, &trap_lists->trap_policer_list); devlink_trap_policer_notify(devlink, policer_item, DEVLINK_CMD_TRAP_POLICER_NEW); @@ -9451,7 +9454,7 @@ devlink_trap_policer_unregister(struct devlink *devlink, { struct devlink_trap_policer_item *policer_item; - policer_item = devlink_trap_policer_item_lookup(devlink, policer->id); + policer_item = devlink_trap_policer_item_lookup(&devlink->trap_lists, policer->id); if (WARN_ON_ONCE(!policer_item)) return; -- 2.14.1