> -----Original Message-----
> From: dev <[email protected]> On Behalf Of Amber, Kumar
> Sent: Thursday, July 1, 2021 9:43 AM
> To: Flavio Leitner <[email protected]>
> Cc: [email protected]; [email protected]
> Subject: Re: [ovs-dev] [v4 11/12] dpif-netdev/mfex: add more AVX512 traffic
> profiles
>
> Hi Flavio,
<snip to just the below cast topic>
> > > +static void
> > > +mfex_handle_tcp_flags(const struct tcp_header *tcp, uint64_t *block)
> > > +{
> > > + uint16_t ctl = (OVS_FORCE uint16_t) TCP_FLAGS_BE16(tcp->tcp_ctl);
> >
> > Why casting to uint16_t?
OVS marks the tcp header as a big-endian (BE) variable. Compiler warns (fails
with -Werror)
to read that value as a little-endian (LE) value.
As the BE value must be pushed into the miniflow as BE, we need to cast it to a
little-endian value, to be able to store it without a byte-swap. The value from
the
TCP header cannot be read directly, that's what the cast and the OVS_FORCE()
is there for. The LE uint16_t is then pushed into the miniflow, and the compiler
is happy to do that for us.
<snip other topics>
Regards, -Harry
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev