Skip to content

Commit

Permalink
lib/tc: add set ipv4 dscp and ecn action offload via pedit
Browse files Browse the repository at this point in the history
Add setting of ipv4 dscp and ecn fields in tc offload using pedit.

Signed-off-by: Pieter Jansen van Vuuren <[email protected]>
Signed-off-by: Louis Peens <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
pjvuuren authored and shorman-netronome committed Jan 31, 2019
1 parent 0d9f0cd commit 9543122
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/netdev-tc-offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct netlink_field {
int size;
};

static struct netlink_field set_flower_map[][3] = {
static struct netlink_field set_flower_map[][4] = {
[OVS_KEY_ATTR_IPV4] = {
{ offsetof(struct ovs_key_ipv4, ipv4_src),
offsetof(struct tc_flower_key, ipv4.ipv4_src),
Expand All @@ -66,6 +66,10 @@ static struct netlink_field set_flower_map[][3] = {
offsetof(struct tc_flower_key, ipv4.rewrite_ttl),
MEMBER_SIZEOF(struct tc_flower_key, ipv4.rewrite_ttl)
},
{ offsetof(struct ovs_key_ipv4, ipv4_tos),
offsetof(struct tc_flower_key, ipv4.rewrite_tos),
MEMBER_SIZEOF(struct tc_flower_key, ipv4.rewrite_tos)
},
},
[OVS_KEY_ATTR_IPV6] = {
{ offsetof(struct ovs_key_ipv6, ipv6_src),
Expand Down
5 changes: 5 additions & 0 deletions lib/tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ static struct flower_key_to_pedit flower_pedit_map[] = {
8,
offsetof(struct tc_flower_key, ipv4.rewrite_ttl),
MEMBER_SIZEOF(struct tc_flower_key, ipv4.rewrite_ttl)
}, {
TCA_PEDIT_KEY_EX_HDR_TYPE_IP4,
1,
offsetof(struct tc_flower_key, ipv4.rewrite_tos),
MEMBER_SIZEOF(struct tc_flower_key, ipv4.rewrite_tos)
}, {
TCA_PEDIT_KEY_EX_HDR_TYPE_IP6,
7,
Expand Down
1 change: 1 addition & 0 deletions lib/tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ struct tc_flower_key {
ovs_be32 ipv4_src;
ovs_be32 ipv4_dst;
uint8_t rewrite_ttl;
uint8_t rewrite_tos;
} ipv4;
struct {
struct in6_addr ipv6_src;
Expand Down

0 comments on commit 9543122

Please sign in to comment.