From: Daniel Machon <daniel.machon@microchip.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <lars.povlsen@microchip.com>,
<Steen.Hegelund@microchip.com>, <daniel.machon@microchip.com>,
<UNGLinuxDriver@microchip.com>, <joe@perches.com>,
<error27@gmail.com>, <horatiu.vultur@microchip.com>,
<Julia.Lawall@inria.fr>, <petrm@nvidia.com>,
<vladimir.oltean@nxp.com>, <maxime.chevallier@bootlin.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
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 [thread overview]
Message-ID: <20230116144853.2446315-2-daniel.machon@microchip.com> (raw)
In-Reply-To: <20230116144853.2446315-1-daniel.machon@microchip.com>
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 <daniel.machon@microchip.com>
---
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)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-01-16 14:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 14:48 [PATCH net-next v2 0/6] Introduce new DCB rewrite table Daniel Machon
2023-01-16 14:48 ` Daniel Machon [this message]
2023-01-18 11:02 ` [PATCH net-next v2 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 2/6] net: dcb: add new common function for set/del of app/rewr entries Daniel Machon
2023-01-18 10:26 ` Petr Machata
2023-01-18 11:03 ` Petr Machata
2023-01-18 13:56 ` Daniel.Machon
2023-01-18 15:42 ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 3/6] net: dcb: add new rewrite table Daniel Machon
2023-01-18 10:54 ` Petr Machata
2023-01-18 13:47 ` Daniel.Machon
2023-01-18 15:20 ` Petr Machata
2023-01-18 15:07 ` Dan Carpenter
2023-01-18 15:11 ` Dan Carpenter
2023-01-19 9:38 ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 4/6] net: dcb: add helper functions to retrieve PCP and DSCP rewrite maps Daniel Machon
2023-01-18 11:01 ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 5/6] net: microchip: sparx5: add support for PCP rewrite Daniel Machon
2023-01-16 14:48 ` [PATCH net-next v2 6/6] net: microchip: sparx5: add support for DSCP rewrite Daniel Machon
2023-01-18 11:00 ` [PATCH net-next v2 0/6] Introduce new DCB rewrite table Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230116144853.2446315-2-daniel.machon@microchip.com \
--to=daniel.machon@microchip.com \
--cc=Julia.Lawall@inria.fr \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=joe@perches.com \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).