[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230510-dcb-rewr-v1-5-83adc1f93356@microchip.com>
Date: Mon, 22 May 2023 20:41:08 +0200
From: Daniel Machon <daniel.machon@...rochip.com>
To: <netdev@...r.kernel.org>
CC: <dsahern@...nel.org>, <stephen@...workplumber.org>, <petrm@...dia.com>,
<UNGLinuxDriver@...rochip.com>, <daniel.machon@...rochip.com>
Subject: [PATCH iproute2-next 5/9] dcb: app: modify
dcb_app_parse_mapping_cb for dcb-rewr reuse
When parsing APP table entries, priority and protocol is assigned from
value and key, respectively. Rewrite requires it opposite.
Modify the existing dcb_app_parse_mapping_cb for dcb-rewr reuse, by
using the newly introduced dcbnl attribute in the dcb_app_table struct.
Signed-off-by: Daniel Machon <daniel.machon@...rochip.com>
---
dcb/dcb_app.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
index 23d6bb2a0013..46af67112748 100644
--- a/dcb/dcb_app.c
+++ b/dcb/dcb_app.c
@@ -232,10 +232,17 @@ void dcb_app_parse_mapping_cb(__u32 key, __u64 value, void *data)
struct dcb_app_parse_mapping *pm = data;
struct dcb_app app = {
.selector = pm->selector,
- .priority = value,
- .protocol = key,
};
+ if (pm->tab->attr == DCB_ATTR_IEEE_APP_TABLE) {
+ app.priority = value;
+ app.protocol = key;
+
+ } else {
+ app.priority = key;
+ app.protocol = value;
+ }
+
if (pm->err)
return;
--
2.34.1
Powered by blists - more mailing lists