From patchwork Mon Jan 16 14:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 44212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1236146wrn; Mon, 16 Jan 2023 07:01:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXsr8AY5BecXGXu3hP/mKRGRtAO7l2dAuP2rt/eJiGGLoXSqWOzR6D7PiT9nMxZJsIhfEAj8 X-Received: by 2002:adf:ff92:0:b0:2bd:f4c8:18bf with SMTP id j18-20020adfff92000000b002bdf4c818bfmr6692257wrr.43.1673881306699; Mon, 16 Jan 2023 07:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673881306; cv=none; d=google.com; s=arc-20160816; b=aueofmMVfb8aTs8Mq6rraZNMHIRl5YPm+bbqYBlr81B5Ke2mRIt8pG5GmAf7zW6Vi/ NUcCN4py3Qe+kNCZAghwvKXeYlDauEodYMrPx8rffYoz4x/+TdRJt1BUrn3jcKLgkbKr qunYoXYAE1IbWF/zuqBT+fxwlXDDoDRO4PtVIA+e4K6/BbT+cTCAUoZm5rUveKkC3J9i XjR2ycJznasYs7n+rHeGfKoyohjeFRaMIK72xt3t5UJpe3TL236xhbomzpyrWEq6yp6u GdCJcgDl/AYhUpbyFQmprJAhGQNeJcL/65p1YVJ8xNowWHAvmlyyKSGNkYGIBjiJJfbG PohQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dz47vTH2YEVkAAjyYNZGCtk9r+L9045l46FXqQc4RyE=; b=kPR/r7quhsVdQZAF33O3BaGXBj0lkZ3bzFxDKB3aY9JnfDynFpQEPAPvvaz1pUeZrh YPWbFJJVOdJzKqWVuTgsi8SR2S3cKvkgta5E6adYdbxFL+gPVGEsns0wqZeE5cJRqV/b zPzpLGMoFG7JyKfz2unZqgN+EgLVryuxWe2HniVn9a5/hpV6ZiDsDOmMcBYfqR1ougTO RNSYDshplExeeG9r64Reh7PyvmxOpErWDfodBTPoIAJK1wzEhC3Seb+RBuuV1yB8HmVv tf9JdEeCoIk3tpJtUpPBuGuQToIrcR1UvyrT6nWyAKF42UTlhCRRFE6Exu8cq+t3S4/O UvkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="YlLXbD/x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb9-20020a0564020d0900b0046dbdeddd3asi6676130edb.507.2023.01.16.07.01.21; Mon, 16 Jan 2023 07:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="YlLXbD/x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232988AbjAPPBF (ORCPT + 99 others); Mon, 16 Jan 2023 10:01:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbjAPPAN (ORCPT ); Mon, 16 Jan 2023 10:00:13 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74406222CC; Mon, 16 Jan 2023 06:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673880630; x=1705416630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vwtYbLrA2oTbDo1HOHwwRKLWlo8AMmLQ34Uv58yjfws=; b=YlLXbD/xH8kgQTkLRr+JqKIq4TuKZXlbZIHxgkTu5vCDdLk4dwTsABmQ AeuYF6TBiiy6T0I1KMKlz4xfCjKe+GGFTLIr7xSGeJF6hGmvdJ3hElLEF 4XNPoK6pLIEzpHwSedvvoLSCcK1flJQ4APf8vwFUWkIggnIOrHLU72K8y LSPmKsDYmjApKJHoWfcsexl7ta3hAP7GbdSHuQrT0op44Eu9yy+vXdNxH hn/mDQg731eiNGebP//OejsTY+JjXE9gcm2hF+QQk98gFaqh4gW60BePD D/yfqeL3k7gSFIL3tRPGtUB6INH746et/jMqkI32RQWqq8DhKDM1wqzW0 A==; X-IronPort-AV: E=Sophos;i="5.97,221,1669100400"; d="scan'208";a="132549087" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 16 Jan 2023 07:49:09 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 16 Jan 2023 07:49:09 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 16 Jan 2023 07:49:05 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next v2 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Date: Mon, 16 Jan 2023 15:48:48 +0100 Message-ID: <20230116144853.2446315-2-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230116144853.2446315-1-daniel.machon@microchip.com> References: <20230116144853.2446315-1-daniel.machon@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755191765280609896?= X-GMAIL-MSGID: =?utf-8?q?1755191765280609896?= In preparation to DCB rewrite. Modify dcb_app_add to take new struct list_head * as parameter, to make the used list configurable. This is done to allow reusing the function for adding rewrite entries to the rewrite table, which is introduced in a later patch. Signed-off-by: Daniel Machon Reviewed-by: Petr Machata --- net/dcb/dcbnl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index f9949e051f49..a76bdf6f0198 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1955,7 +1955,8 @@ static struct dcb_app_type *dcb_app_lookup(const struct dcb_app *app, return NULL; } -static int dcb_app_add(const struct dcb_app *app, int ifindex) +static int dcb_app_add(struct list_head *list, const struct dcb_app *app, + int ifindex) { struct dcb_app_type *entry; @@ -1965,7 +1966,7 @@ static int dcb_app_add(const struct dcb_app *app, int ifindex) memcpy(&entry->app, app, sizeof(*app)); entry->ifindex = ifindex; - list_add(&entry->list, &dcb_app_list); + list_add(&entry->list, list); return 0; } @@ -2028,7 +2029,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) } /* App type does not exist add new application type */ if (new->priority) - err = dcb_app_add(new, dev->ifindex); + err = dcb_app_add(&dcb_app_list, new, dev->ifindex); out: spin_unlock_bh(&dcb_lock); if (!err) @@ -2088,7 +2089,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) goto out; } - err = dcb_app_add(new, dev->ifindex); + err = dcb_app_add(&dcb_app_list, new, dev->ifindex); out: spin_unlock_bh(&dcb_lock); if (!err)