Message ID | 20230515082356.3471136-4-roid@nvidia.com |
---|---|
State | Changes Requested |
Delegated to: | Simon Horman |
Headers | show |
Series | Add vxlan gbp offload with TC | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | warning | apply and check: warning |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
On 15 May 2023, at 10:23, Roi Dayan wrote: > From: Gavin Li <gavinl@nvidia.com> > > Extract vxlan gbp option encoding to odp_encode_gbp_raw to be used in > following commits. > > Signed-off-by: Gavin Li <gavinl@nvidia.com> > Reviewed-by: Roi Dayan <roid@nvidia.com> > Reviewed-by: Simon Horman <simon.horman@corigine.com> > --- > lib/odp-util.c | 2 +- > lib/odp-util.h | 5 +++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/lib/odp-util.c b/lib/odp-util.c > index f62dc86c5f9e..bf34c61fec58 100644 > --- a/lib/odp-util.c > +++ b/lib/odp-util.c > @@ -3281,7 +3281,7 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key, > > vxlan_opts_ofs = nl_msg_start_nested(a, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); > nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP, > - (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id)); > + odp_encode_gbp_raw(tun_key->gbp_flags, tun_key->gbp_id)); One small nit, this is over 79 chars. > nl_msg_end_nested(a, vxlan_opts_ofs); > } > > diff --git a/lib/odp-util.h b/lib/odp-util.h > index cf762bdc3547..163efe7a87b5 100644 > --- a/lib/odp-util.h > +++ b/lib/odp-util.h > @@ -382,6 +382,11 @@ static inline void odp_decode_gbp_raw(uint32_t gbp_raw, > *flags = (gbp_raw >> 16) & 0xFF; > } > > +static inline uint32_t odp_encode_gbp_raw(uint8_t flags, ovs_be16 id) > +{ > + return (flags << 16) | ntohs(id); > +} > + > struct attr_len_tbl { > int len; > const struct attr_len_tbl *next; > -- > 2.38.0
On 5/26/2023 5:10 PM, Eelco Chaudron wrote: > External email: Use caution opening links or attachments > > > On 15 May 2023, at 10:23, Roi Dayan wrote: > >> From: Gavin Li <gavinl@nvidia.com> >> >> Extract vxlan gbp option encoding to odp_encode_gbp_raw to be used in >> following commits. >> >> Signed-off-by: Gavin Li <gavinl@nvidia.com> >> Reviewed-by: Roi Dayan <roid@nvidia.com> >> Reviewed-by: Simon Horman <simon.horman@corigine.com> >> --- >> lib/odp-util.c | 2 +- >> lib/odp-util.h | 5 +++++ >> 2 files changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/lib/odp-util.c b/lib/odp-util.c >> index f62dc86c5f9e..bf34c61fec58 100644 >> --- a/lib/odp-util.c >> +++ b/lib/odp-util.c >> @@ -3281,7 +3281,7 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key, >> >> vxlan_opts_ofs = nl_msg_start_nested(a, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); >> nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP, >> - (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id)); >> + odp_encode_gbp_raw(tun_key->gbp_flags, tun_key->gbp_id)); > One small nit, this is over 79 chars. ACK > >> nl_msg_end_nested(a, vxlan_opts_ofs); >> } >> >> diff --git a/lib/odp-util.h b/lib/odp-util.h >> index cf762bdc3547..163efe7a87b5 100644 >> --- a/lib/odp-util.h >> +++ b/lib/odp-util.h >> @@ -382,6 +382,11 @@ static inline void odp_decode_gbp_raw(uint32_t gbp_raw, >> *flags = (gbp_raw >> 16) & 0xFF; >> } >> >> +static inline uint32_t odp_encode_gbp_raw(uint8_t flags, ovs_be16 id) >> +{ >> + return (flags << 16) | ntohs(id); >> +} >> + >> struct attr_len_tbl { >> int len; >> const struct attr_len_tbl *next; >> -- >> 2.38.0
diff --git a/lib/odp-util.c b/lib/odp-util.c index f62dc86c5f9e..bf34c61fec58 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -3281,7 +3281,7 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key, vxlan_opts_ofs = nl_msg_start_nested(a, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP, - (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id)); + odp_encode_gbp_raw(tun_key->gbp_flags, tun_key->gbp_id)); nl_msg_end_nested(a, vxlan_opts_ofs); } diff --git a/lib/odp-util.h b/lib/odp-util.h index cf762bdc3547..163efe7a87b5 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -382,6 +382,11 @@ static inline void odp_decode_gbp_raw(uint32_t gbp_raw, *flags = (gbp_raw >> 16) & 0xFF; } +static inline uint32_t odp_encode_gbp_raw(uint8_t flags, ovs_be16 id) +{ + return (flags << 16) | ntohs(id); +} + struct attr_len_tbl { int len; const struct attr_len_tbl *next;