>> -                     eth_hdr->ether_type == _htons(RTE_ETHER_TYPE_QINQ)) {
>> -                     vlan_hdr = (struct rte_vlan_hdr *)
>> -                             ((char *)eth_hdr + sizeof(*eth_hdr));
>> +             vlan_hdr = (struct rte_vlan_hdr *) RTE_PTR_ADD(eth_hdr,
>> +                              offsetof(struct rte_ether_hdr, ether_type));
>> +             while ((ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
>> +                     ethertype == _htons(RTE_ETHER_TYPE_QINQ))) {

>Two details:
>1. Lines continuing on the next line must be indented by two TABs.
>2. Please add the boundary check, as requested by Stephen. (I realize this mail may have crossed my response arguing why it is required.)

Sure, I’ve sent a V3 having these fixed thanks for your review and comments.


>> +                     vlan_hdr++;
>>                        ethertype = vlan_hdr->eth_proto;
>>                }
>>                return ethertype;
>> --
>> 2.39.5 (Apple Git-154)