Dmitry Eremin-Solenikov(lumag) replied on github web page:

platform/linux-generic/odp_ipsec.c
@@ -1307,8 +1308,10 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt,
        ipsec_sa = _odp_ipsec_sa_use(sa);
        ODP_ASSERT(NULL != ipsec_sa);
 
-       if ((opt && opt->frag_mode == ODP_IPSEC_FRAG_CHECK) ||
-           (!opt && ipsec_sa->out.frag_mode == ODP_IPSEC_FRAG_CHECK))
+       frag_mode = ipsec_sa->out.frag_mode;
+       if (opt->flag.frag_mode)
+               frag_mode = opt->frag_mode;
+       if (frag_mode == ODP_IPSEC_FRAG_CHECK)
                mtu = ipsec_sa->out.mtu;
        else
                mtu = UINT32_MAX;


Comment:
No, it this code might be expanded to support other fragmentation modes.

> Dmitry Eremin-Solenikov(lumag) wrote:
> ack


>> Dmitry Eremin-Solenikov(lumag) wrote:
>> No, because this code is implemented in the same way as the rest of 
>> `odp_packet_lX_type()` functions.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> `return pkt_hdr->p.input_flags.eth ? ODP_PROTO_L2_TYPE_ETH : 
>>> ODP_PROTO_L2_TYPE_NONE;` might be simpler here.


>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>> `opt = param->num_opt ? &param->opt[opt_idx] : &default_opt_out;` might be 
>>>> simpler here.


>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>>> `opt = param->num_opt ? &param->opt[opt_idx] : &default_opt_out;` might 
>>>>> be simpler here.


>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>>>> `opt = param->num_opt ? &param->opt[opt_idx] : &default_opt_out;` might 
>>>>>> be simpler here.


>>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>>>>> `mtu = frag_mode == ODP_IPSEC_FRAG_CHECK ? ipsec_sa->out.mtu : 
>>>>>>> UINT32_MAX;` might be simpler here.


>>>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>>>>>> `frag_mode = opt->flag.frag_mode ? opt->frag_mode : 
>>>>>>>> ipsec_sa->out.frag_mode;` might be simpler here.


https://github.com/Linaro/odp/pull/502#discussion_r171027141
updated_at 2018-02-27 18:50:40

Reply via email to