summaryrefslogtreecommitdiff
path: root/net/mpls
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.com>2020-05-27 08:35:03 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2020-05-29 21:20:20 -0700
commit86ae579cefffe18cb08928505d90fbc87367e8f5 (patch)
treec92e197ebad6d3f196f0aa22ea4a96173d8820c4 /net/mpls
parente1167e16114f78f948078749aa1608a785f65807 (diff)
downloadlwn-86ae579cefffe18cb08928505d90fbc87367e8f5.tar.gz
lwn-86ae579cefffe18cb08928505d90fbc87367e8f5.zip
net: Make mpls_entry_encode() available for generic users
Move mpls_entry_encode() from net/mpls/internal.h to include/net/mpls.h and make it available for other users. Specifically, hardware driver that offload MPLS can benefit from that. Suggested-by: Jakub Kicinski <kuba@kernel.org> Suggested-by: David Ahern <dsahern@gmail.com> Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'net/mpls')
-rw-r--r--net/mpls/internal.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/mpls/internal.h b/net/mpls/internal.h
index 0e9aa94adc07..838cdfc10e47 100644
--- a/net/mpls/internal.h
+++ b/net/mpls/internal.h
@@ -172,17 +172,6 @@ struct mpls_route { /* next hop label forwarding entry */
#define endfor_nexthops(rt) }
-static inline struct mpls_shim_hdr mpls_entry_encode(u32 label, unsigned ttl, unsigned tc, bool bos)
-{
- struct mpls_shim_hdr result;
- result.label_stack_entry =
- cpu_to_be32((label << MPLS_LS_LABEL_SHIFT) |
- (tc << MPLS_LS_TC_SHIFT) |
- (bos ? (1 << MPLS_LS_S_SHIFT) : 0) |
- (ttl << MPLS_LS_TTL_SHIFT));
- return result;
-}
-
static inline struct mpls_entry_decoded mpls_entry_decode(struct mpls_shim_hdr *hdr)
{
struct mpls_entry_decoded result;