Re: [net-next 07/10] net/mlx5e: Add support for hw encapsulation of MPLS over UDP

2020-05-26 Thread Saeed Mahameed
On Tue, 2020-05-26 at 13:27 -0600, David Ahern wrote: > On 5/26/20 1:19 PM, Jakub Kicinski wrote: > > On Fri, 22 May 2020 16:51:45 -0700 Saeed Mahameed wrote: > > > +static inline __be32 mpls_label_id_field(__be32 label, u8 tos, > > > u8 ttl) > > > +{ > > > + u32 res; > > > + > > > + /* mpls label

Re: [net-next 07/10] net/mlx5e: Add support for hw encapsulation of MPLS over UDP

2020-05-26 Thread David Ahern
On 5/26/20 1:19 PM, Jakub Kicinski wrote: > On Fri, 22 May 2020 16:51:45 -0700 Saeed Mahameed wrote: >> +static inline __be32 mpls_label_id_field(__be32 label, u8 tos, u8 ttl) >> +{ >> +u32 res; >> + >> +/* mpls label is 32 bits long and construction as follows: >> + * 20 bits label >>

Re: [net-next 07/10] net/mlx5e: Add support for hw encapsulation of MPLS over UDP

2020-05-26 Thread Jakub Kicinski
On Fri, 22 May 2020 16:51:45 -0700 Saeed Mahameed wrote: > +static inline __be32 mpls_label_id_field(__be32 label, u8 tos, u8 ttl) > +{ > + u32 res; > + > + /* mpls label is 32 bits long and construction as follows: > + * 20 bits label > + * 3 bits tos > + * 1 bit bottom of s

[net-next 07/10] net/mlx5e: Add support for hw encapsulation of MPLS over UDP

2020-05-22 Thread Saeed Mahameed
From: Eli Cohen MPLS over UDP is supported by adding a rule on a representor net device which does tunnel_key set, push mpls and forward to a baredup device. At the hardware level we use a packet_reformat_context object to do the encapsulation of the packet. The resulting packet looks as follows