[ovs-dev] [v8 02/12] dpif-netdev: Add auto validation function for miniflow extract

Amber, Kumar kumar.amber at intel.com
Sun Jul 11 19:39:03 UTC 2021


Hi Flavio


<Snip>

> > +    if (keys_size < cnt) {
> > +        miniflow_extract_func default_func = NULL;
> > +        atomic_uintptr_t *pmd_func = (void *)&pmd->miniflow_extract_opt;
> > +        atomic_store_relaxed(pmd_func, (uintptr_t) default_func);
> > +        VLOG_ERR("Invalid key size supplied, Key_size: %d less than"
> > +                 "batch_size:  %" PRIuSIZE"", keys_size, cnt);
> 
> Please mention that the autovalidator is disabled in this pmd too.
> 

Added a comment in v9.
> > +        return 0;
> > +    }
> > +
> > +    /* Run scalar miniflow_extract to get default result. */
> > +    DP_PACKET_BATCH_FOR_EACH (i, packet, packets) {
> > +        pkt_metadata_init(&packet->md, in_port);
> > +        miniflow_extract(packet, &keys[i].mf);
> > +
> > +        /* Store known good metadata to compare with optimized metadata. */
> > +        good_l2_5_ofs[i] = packet->l2_5_ofs;
> > +        good_l3_ofs[i] = packet->l3_ofs;
> > +        good_l4_ofs[i] = packet->l4_ofs;
> > +        good_l2_pad_size[i] = packet->l2_pad_size;
> > +    }
> > +
> > +    uint32_t batch_failed = 0;
> > +    /* Iterate through each version of miniflow implementations. */
> > +    for (int j = MFEX_IMPL_START_IDX; j < MFEX_IMPL_MAX; j++) {
> > +        if ((j < MFEX_IMPL_MAX) || (!mfex_impls[j].available)) {
> 
> With the fix for MFEX_IMPL_MAX in the previous patch and fixing the define for
> MFEX_IMPL_START_IDX in the future patch, there is no need to check if (j <
> MFEX_IMPL_MAX).
> 
> 
Make sense fixed in v9.
> 

Regards
Amber


More information about the dev mailing list