internal.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) internal.h (680a93166e80e43e3ff85be06005c5cfa492d852)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef MPLS_INTERNAL_H
3#define MPLS_INTERNAL_H
4#include <net/mpls.h>
5
6/* put a reasonable limit on the number of labels
7 * we will accept from userspace
8 */

--- 84 unchanged lines hidden (view full) ---

93 * modified handling netdev events with rtnl lock held
94 */
95 unsigned int nh_flags;
96 u8 nh_labels;
97 u8 nh_via_alen;
98 u8 nh_via_table;
99 u8 nh_reserved1;
100
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef MPLS_INTERNAL_H
3#define MPLS_INTERNAL_H
4#include <net/mpls.h>
5
6/* put a reasonable limit on the number of labels
7 * we will accept from userspace
8 */

--- 84 unchanged lines hidden (view full) ---

93 * modified handling netdev events with rtnl lock held
94 */
95 unsigned int nh_flags;
96 u8 nh_labels;
97 u8 nh_via_alen;
98 u8 nh_via_table;
99 u8 nh_reserved1;
100
101 u32 nh_label[0];
101 u32 nh_label[];
102};
103
104/* offset of via from beginning of mpls_nh */
105#define MPLS_NH_VIA_OFF(num_labels) \
106 ALIGN(sizeof(struct mpls_nh) + (num_labels) * sizeof(u32), \
107 VIA_ALEN_ALIGN)
108
109/* all nexthops within a route have the same size based on the

--- 39 unchanged lines hidden (view full) ---

149 u8 rt_nhn;
150 /* rt_nhn_alive is accessed under RCU in the packet path; it
151 * is modified handling netdev events with rtnl lock held
152 */
153 u8 rt_nhn_alive;
154 u8 rt_nh_size;
155 u8 rt_via_offset;
156 u8 rt_reserved1;
102};
103
104/* offset of via from beginning of mpls_nh */
105#define MPLS_NH_VIA_OFF(num_labels) \
106 ALIGN(sizeof(struct mpls_nh) + (num_labels) * sizeof(u32), \
107 VIA_ALEN_ALIGN)
108
109/* all nexthops within a route have the same size based on the

--- 39 unchanged lines hidden (view full) ---

149 u8 rt_nhn;
150 /* rt_nhn_alive is accessed under RCU in the packet path; it
151 * is modified handling netdev events with rtnl lock held
152 */
153 u8 rt_nhn_alive;
154 u8 rt_nh_size;
155 u8 rt_via_offset;
156 u8 rt_reserved1;
157 struct mpls_nh rt_nh[0];
157 struct mpls_nh rt_nh[];
158};
159
160#define for_nexthops(rt) { \
161 int nhsel; struct mpls_nh *nh; u8 *__nh; \
162 for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \
163 nhsel < (rt)->rt_nhn; \
164 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
165

--- 49 unchanged lines hidden ---
158};
159
160#define for_nexthops(rt) { \
161 int nhsel; struct mpls_nh *nh; u8 *__nh; \
162 for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \
163 nhsel < (rt)->rt_nhn; \
164 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
165

--- 49 unchanged lines hidden ---