-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Add-MPLS-actions-to-TC'
John Hurley says: ==================== Add MPLS actions to TC This patchset introduces a new TC action module that allows the manipulation of the MPLS headers of packets. The code impliments functionality including push, pop, and modify. Also included are tests for the new funtionality. Note that these will require iproute2 changes to be submitted soon. NOTE: these patches are applied to net-next along with the patch: [PATCH net 1/1] net: openvswitch: fix csum updates for MPLS actions This patch has been accepted into net but, at time of posting, is not yet in net-next. v6-v7: - add extra tests for setting max/min and exceeding range of fields - patch 5 (Roman Mashak) v5-v6: - add CONFIG_NET_ACT_MPLS to tc-testing config file - patch 5 (Davide Caratti) v4-v5: - move mpls_hdr() call to after skb_ensure_writable - patch 3 (Willem de Bruijn) - move mpls_dec_ttl to helper - patch 4 (Willem de Bruijn) - add iproute2 usage example to commit msg - patch 4 (David Ahern) - align label validation with mpls core code - patch 4 (David Ahern) - improve extack message for no proto in mpls pop - patch 4 (David Ahern) v3-v4: - refactor and reuse OvS code (Cong Wang) - use csum API rather than skb_post*rscum to update skb->csum (Cong Wang) - remove unnecessary warning (Cong Wang) - add comments to uapi attributes (David Ahern) - set strict type policy check for TCA_MPLS_UNSPEC (David Ahern) - expand/improve extack messages (David Ahern) - add option to manually set BOS v2-v3: - remove a few unnecessary line breaks (Jiri Pirko) - retract hw offload patch from set (resubmit with driver changes) (Jiri) v1->v2: - ensure TCA_ID_MPLS does not conflict with TCA_ID_CTINFO (Davide Caratti) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
11 changed files
with
1,754 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ | ||
/* Copyright (C) 2019 Netronome Systems, Inc. */ | ||
|
||
#ifndef __NET_TC_MPLS_H | ||
#define __NET_TC_MPLS_H | ||
|
||
#include <linux/tc_act/tc_mpls.h> | ||
#include <net/act_api.h> | ||
|
||
struct tcf_mpls_params { | ||
int tcfm_action; | ||
u32 tcfm_label; | ||
u8 tcfm_tc; | ||
u8 tcfm_ttl; | ||
u8 tcfm_bos; | ||
__be16 tcfm_proto; | ||
struct rcu_head rcu; | ||
}; | ||
|
||
#define ACT_MPLS_TC_NOT_SET 0xff | ||
#define ACT_MPLS_BOS_NOT_SET 0xff | ||
#define ACT_MPLS_LABEL_NOT_SET 0xffffffff | ||
|
||
struct tcf_mpls { | ||
struct tc_action common; | ||
struct tcf_mpls_params __rcu *mpls_p; | ||
}; | ||
#define to_mpls(a) ((struct tcf_mpls *)a) | ||
|
||
#endif /* __NET_TC_MPLS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
/* Copyright (C) 2019 Netronome Systems, Inc. */ | ||
|
||
#ifndef __LINUX_TC_MPLS_H | ||
#define __LINUX_TC_MPLS_H | ||
|
||
#include <linux/pkt_cls.h> | ||
|
||
#define TCA_MPLS_ACT_POP 1 | ||
#define TCA_MPLS_ACT_PUSH 2 | ||
#define TCA_MPLS_ACT_MODIFY 3 | ||
#define TCA_MPLS_ACT_DEC_TTL 4 | ||
|
||
struct tc_mpls { | ||
tc_gen; /* generic TC action fields. */ | ||
int m_action; /* action of type TCA_MPLS_ACT_*. */ | ||
}; | ||
|
||
enum { | ||
TCA_MPLS_UNSPEC, | ||
TCA_MPLS_TM, /* struct tcf_t; time values associated with action. */ | ||
TCA_MPLS_PARMS, /* struct tc_mpls; action type and general TC fields. */ | ||
TCA_MPLS_PAD, | ||
TCA_MPLS_PROTO, /* be16; eth_type of pushed or next (for pop) header. */ | ||
TCA_MPLS_LABEL, /* u32; MPLS label. Lower 20 bits are used. */ | ||
TCA_MPLS_TC, /* u8; MPLS TC field. Lower 3 bits are used. */ | ||
TCA_MPLS_TTL, /* u8; MPLS TTL field. Must not be 0. */ | ||
TCA_MPLS_BOS, /* u8; MPLS BOS field. Either 1 or 0. */ | ||
__TCA_MPLS_MAX, | ||
}; | ||
#define TCA_MPLS_MAX (__TCA_MPLS_MAX - 1) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.