Re: [ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
Done. On Fri, Feb 07, 2020 at 10:02:06PM +0530, Martin Varghese wrote: > Thanks Ben, > Please keep martin.vargh...@nokia.com > > On Fri, Feb 7, 2020 at 9:33 PM Ben Pfaff wrote: > > > Of course. > > > > I see a couple of email addresses for you. Which one is best for the > > authors file? > > > > On Fri, Feb 07, 2020 at 04:47:42PM +0530, Martin Varghese wrote: > > > HI > > > I checked the Authors file today and coudn't find my name. I would like > > to > > > see my name there :) if i meet the criteria > > > Thanks, > > > Martin > > > > > > On Fri, Nov 22, 2019 at 10:57 PM Ben Pfaff wrote: > > > > > > > On Fri, Nov 22, 2019 at 08:32:53AM -0800, Gregory Rose wrote: > > > > > On 11/21/2019 10:07 PM, Martin Varghese wrote: > > > > > > From: Martin Varghese > > > > > > > > > > > > Upstream commit: > > > > > > commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 > > > > > > Author: Martin Varghese > > > > > > Date: Mon Nov 4 07:27:44 2019 +0530 > > > > > > > > > > > > Change in Openvswitch to support MPLS label depth of 3 in > > ingress > > > > > > direction > > > > > > > > > > > > The openvswitch was supporting a MPLS label depth of 1 in the > > > > > > ingress direction though the userspace OVS supports a max > > depth > > > > > > of 3 labels.This change enables openvswitch module to support > > a > > > > > > max depth of 3 labels in the ingress. > > > > > > > > > > > > Signed-off-by: Martin Varghese > > > > > > Acked-by: Pravin B Shelar > > > > > > Signed-off-by: David S. Miller > > > > > > > > > > > > Signed-off-by: Martin Varghese > > > > > > > > > > Thanks Martin. > > > > > > > > > > Tested-by: Greg Rose > > > > > Reviewed-by: Greg Rose > > > > > > > > I applied this to master, thanks everyone! > > > > > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
Thanks Ben, Please keep martin.vargh...@nokia.com On Fri, Feb 7, 2020 at 9:33 PM Ben Pfaff wrote: > Of course. > > I see a couple of email addresses for you. Which one is best for the > authors file? > > On Fri, Feb 07, 2020 at 04:47:42PM +0530, Martin Varghese wrote: > > HI > > I checked the Authors file today and coudn't find my name. I would like > to > > see my name there :) if i meet the criteria > > Thanks, > > Martin > > > > On Fri, Nov 22, 2019 at 10:57 PM Ben Pfaff wrote: > > > > > On Fri, Nov 22, 2019 at 08:32:53AM -0800, Gregory Rose wrote: > > > > On 11/21/2019 10:07 PM, Martin Varghese wrote: > > > > > From: Martin Varghese > > > > > > > > > > Upstream commit: > > > > > commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 > > > > > Author: Martin Varghese > > > > > Date: Mon Nov 4 07:27:44 2019 +0530 > > > > > > > > > > Change in Openvswitch to support MPLS label depth of 3 in > ingress > > > > > direction > > > > > > > > > > The openvswitch was supporting a MPLS label depth of 1 in the > > > > > ingress direction though the userspace OVS supports a max > depth > > > > > of 3 labels.This change enables openvswitch module to support > a > > > > > max depth of 3 labels in the ingress. > > > > > > > > > > Signed-off-by: Martin Varghese > > > > > Acked-by: Pravin B Shelar > > > > > Signed-off-by: David S. Miller > > > > > > > > > > Signed-off-by: Martin Varghese > > > > > > > > Thanks Martin. > > > > > > > > Tested-by: Greg Rose > > > > Reviewed-by: Greg Rose > > > > > > I applied this to master, thanks everyone! > > > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
HI I checked the Authors file today and coudn't find my name. I would like to see my name there :) if i meet the criteria Thanks, Martin On Fri, Nov 22, 2019 at 10:57 PM Ben Pfaff wrote: > On Fri, Nov 22, 2019 at 08:32:53AM -0800, Gregory Rose wrote: > > On 11/21/2019 10:07 PM, Martin Varghese wrote: > > > From: Martin Varghese > > > > > > Upstream commit: > > > commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 > > > Author: Martin Varghese > > > Date: Mon Nov 4 07:27:44 2019 +0530 > > > > > > Change in Openvswitch to support MPLS label depth of 3 in ingress > > > direction > > > > > > The openvswitch was supporting a MPLS label depth of 1 in the > > > ingress direction though the userspace OVS supports a max depth > > > of 3 labels.This change enables openvswitch module to support a > > > max depth of 3 labels in the ingress. > > > > > > Signed-off-by: Martin Varghese > > > Acked-by: Pravin B Shelar > > > Signed-off-by: David S. Miller > > > > > > Signed-off-by: Martin Varghese > > > > Thanks Martin. > > > > Tested-by: Greg Rose > > Reviewed-by: Greg Rose > > I applied this to master, thanks everyone! > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
On Fri, Nov 22, 2019 at 08:32:53AM -0800, Gregory Rose wrote: > On 11/21/2019 10:07 PM, Martin Varghese wrote: > > From: Martin Varghese > > > > Upstream commit: > > commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 > > Author: Martin Varghese > > Date: Mon Nov 4 07:27:44 2019 +0530 > > > > Change in Openvswitch to support MPLS label depth of 3 in ingress > > direction > > > > The openvswitch was supporting a MPLS label depth of 1 in the > > ingress direction though the userspace OVS supports a max depth > > of 3 labels.This change enables openvswitch module to support a > > max depth of 3 labels in the ingress. > > > > Signed-off-by: Martin Varghese > > Acked-by: Pravin B Shelar > > Signed-off-by: David S. Miller > > > > Signed-off-by: Martin Varghese > > Thanks Martin. > > Tested-by: Greg Rose > Reviewed-by: Greg Rose I applied this to master, thanks everyone! ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
On 11/21/2019 10:07 PM, Martin Varghese wrote: From: Martin Varghese Upstream commit: commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 Author: Martin Varghese Date: Mon Nov 4 07:27:44 2019 +0530 Change in Openvswitch to support MPLS label depth of 3 in ingress direction The openvswitch was supporting a MPLS label depth of 1 in the ingress direction though the userspace OVS supports a max depth of 3 labels.This change enables openvswitch module to support a max depth of 3 labels in the ingress. Signed-off-by: Martin Varghese Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Signed-off-by: Martin Varghese Thanks Martin. Tested-by: Greg Rose Reviewed-by: Greg Rose --- datapath/actions.c | 2 +- datapath/flow.c | 20 datapath/flow.h | 8 +++-- datapath/flow_netlink.c | 85 - tests/system-traffic.at | 39 +++ 5 files changed, 122 insertions(+), 32 deletions(-) diff --git a/datapath/actions.c b/datapath/actions.c index a44e804..fbf4457 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -276,7 +276,7 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, } stack->label_stack_entry = lse; - flow_key->mpls.top_lse = lse; + flow_key->mpls.lse[0] = lse; return 0; } diff --git a/datapath/flow.c b/datapath/flow.c index 916f7f4..6dc7402 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -659,27 +659,35 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key) memset(>ipv4, 0, sizeof(key->ipv4)); } } else if (eth_p_mpls(key->eth.type)) { - size_t stack_len = MPLS_HLEN; + u8 label_count = 1; + memset(>mpls, 0, sizeof(key->mpls)); skb_set_inner_network_header(skb, skb->mac_len); while (1) { __be32 lse; - error = check_header(skb, skb->mac_len + stack_len); + error = check_header(skb, skb->mac_len + +label_count * MPLS_HLEN); if (unlikely(error)) return 0; memcpy(, skb_inner_network_header(skb), MPLS_HLEN); - if (stack_len == MPLS_HLEN) - memcpy(>mpls.top_lse, , MPLS_HLEN); + if (label_count <= MPLS_LABEL_DEPTH) + memcpy(>mpls.lse[label_count - 1], , + MPLS_HLEN); - skb_set_inner_network_header(skb, skb->mac_len + stack_len); + skb_set_inner_network_header(skb, skb->mac_len + +label_count * MPLS_HLEN); if (lse & htonl(MPLS_LS_S_MASK)) break; - stack_len += MPLS_HLEN; + label_count++; } + if (label_count > MPLS_LABEL_DEPTH) + label_count = MPLS_LABEL_DEPTH; + + key->mpls.num_labels_mask = GENMASK(label_count - 1, 0); } else if (key->eth.type == htons(ETH_P_IPV6)) { int nh_len; /* IPv6 Header + Extensions */ diff --git a/datapath/flow.h b/datapath/flow.h index 5560300..4ad5363 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -43,6 +43,7 @@ enum sw_flow_mac_proto { MAC_PROTO_ETHERNET, }; #define SW_FLOW_KEY_INVALID 0x80 +#define MPLS_LABEL_DEPTH 3 /* Store options at the end of the array if they are less than the * maximum size. This allows us to get the benefits of variable length @@ -98,9 +99,6 @@ struct sw_flow_key { */ union { struct { - __be32 top_lse; /* top label stack entry */ - } mpls; - struct { u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ u8 tos; /* IP ToS. */ u8 ttl; /* IP TTL/hop limit. */ @@ -148,6 +146,10 @@ struct sw_flow_key { } nd; }; } ipv6; + struct { + u32 num_labels_mask;/* labels present bitmap of effective length MPLS_LABEL_DEPTH */ + __be32 lse[MPLS_LABEL_DEPTH]; /* label stack entry */ + } mpls; struct ovs_key_nsh nsh; /* network service header */ }; struct { diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index 35f13d7..9fc1a19 100644 --- a/datapath/flow_netlink.c +++ b/datapath/flow_netlink.c @@ -438,7 +438,7 @@ static const struct ovs_len_tbl ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = {
[ovs-dev] [PATCH] Datapath: Change in openvswitch kernel module to support MPLS label depth of 3 in ingress direction.
From: Martin Varghese Upstream commit: commit fbdcdd78da7c95f1b970d371e1b23cbd3aa990f3 Author: Martin Varghese Date: Mon Nov 4 07:27:44 2019 +0530 Change in Openvswitch to support MPLS label depth of 3 in ingress direction The openvswitch was supporting a MPLS label depth of 1 in the ingress direction though the userspace OVS supports a max depth of 3 labels.This change enables openvswitch module to support a max depth of 3 labels in the ingress. Signed-off-by: Martin Varghese Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Signed-off-by: Martin Varghese --- datapath/actions.c | 2 +- datapath/flow.c | 20 datapath/flow.h | 8 +++-- datapath/flow_netlink.c | 85 - tests/system-traffic.at | 39 +++ 5 files changed, 122 insertions(+), 32 deletions(-) diff --git a/datapath/actions.c b/datapath/actions.c index a44e804..fbf4457 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -276,7 +276,7 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, } stack->label_stack_entry = lse; - flow_key->mpls.top_lse = lse; + flow_key->mpls.lse[0] = lse; return 0; } diff --git a/datapath/flow.c b/datapath/flow.c index 916f7f4..6dc7402 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -659,27 +659,35 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key) memset(>ipv4, 0, sizeof(key->ipv4)); } } else if (eth_p_mpls(key->eth.type)) { - size_t stack_len = MPLS_HLEN; + u8 label_count = 1; + memset(>mpls, 0, sizeof(key->mpls)); skb_set_inner_network_header(skb, skb->mac_len); while (1) { __be32 lse; - error = check_header(skb, skb->mac_len + stack_len); + error = check_header(skb, skb->mac_len + +label_count * MPLS_HLEN); if (unlikely(error)) return 0; memcpy(, skb_inner_network_header(skb), MPLS_HLEN); - if (stack_len == MPLS_HLEN) - memcpy(>mpls.top_lse, , MPLS_HLEN); + if (label_count <= MPLS_LABEL_DEPTH) + memcpy(>mpls.lse[label_count - 1], , + MPLS_HLEN); - skb_set_inner_network_header(skb, skb->mac_len + stack_len); + skb_set_inner_network_header(skb, skb->mac_len + +label_count * MPLS_HLEN); if (lse & htonl(MPLS_LS_S_MASK)) break; - stack_len += MPLS_HLEN; + label_count++; } + if (label_count > MPLS_LABEL_DEPTH) + label_count = MPLS_LABEL_DEPTH; + + key->mpls.num_labels_mask = GENMASK(label_count - 1, 0); } else if (key->eth.type == htons(ETH_P_IPV6)) { int nh_len; /* IPv6 Header + Extensions */ diff --git a/datapath/flow.h b/datapath/flow.h index 5560300..4ad5363 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -43,6 +43,7 @@ enum sw_flow_mac_proto { MAC_PROTO_ETHERNET, }; #define SW_FLOW_KEY_INVALID0x80 +#define MPLS_LABEL_DEPTH 3 /* Store options at the end of the array if they are less than the * maximum size. This allows us to get the benefits of variable length @@ -98,9 +99,6 @@ struct sw_flow_key { */ union { struct { - __be32 top_lse; /* top label stack entry */ - } mpls; - struct { u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ u8 tos; /* IP ToS. */ u8 ttl; /* IP TTL/hop limit. */ @@ -148,6 +146,10 @@ struct sw_flow_key { } nd; }; } ipv6; + struct { + u32 num_labels_mask;/* labels present bitmap of effective length MPLS_LABEL_DEPTH */ + __be32 lse[MPLS_LABEL_DEPTH]; /* label stack entry */ + } mpls; struct ovs_key_nsh nsh; /* network service header */ }; struct { diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index 35f13d7..9fc1a19 100644 --- a/datapath/flow_netlink.c +++ b/datapath/flow_netlink.c @@ -438,7 +438,7 @@ static const struct ovs_len_tbl ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = { [OVS_KEY_ATTR_DP_HASH] = { .len =