[dpdk-dev] Issues with ixgbe and rte_flow

Le Scouarnec Nicolas Nicolas.LeScouarnec at technicolor.com
Wed Mar 8 10:24:26 CET 2017


My response is inline bellow, and further comment on the code excerpt also


From: Lu, Wenzhuo <wenzhuo.lu at intel.com>
Sent: Wednesday, March 8, 2017 4:16 AM
To: Le Scouarnec Nicolas; dev at dpdk.org; Adrien Mazarguil (adrien.mazarguil at 6wind.com)
Cc: Yigit, Ferruh
Subject: RE: Issues with ixgbe and rte_flow
    
>> I have been using the new API rte_flow to program filtering on an X540 (ixgbe)
>> NIC. My goal is to send packets from different VLANs to different queues
>> (filtering which should be supported by flow director as far as I understand). I
>> enclosed the setup code at the bottom of this email.
>> For reference, here is the setup code I use
>>
>>       vlan_spec.tci = vlan_be;
>>       vlan_spec.tpid = 0;
>>
>>       vlan_mask.tci = rte_cpu_to_be_16(0x0fff);
>>       vlan_mask.tpid =  0;

>To my opinion, this setting is not right. As we know, vlan tag is inserted between MAC source address and Ether type.
>So if we have a MAC+VLAN+IPv4 packet, the vlan_spec.tpid should be 0x8100, the eth_spec.type should be 0x0800.
>+ Adrien, the author. He can correct me if I'm wrong.

Ok, I apologize, you're right. Being more used to the software-side than to the hardware-side, I misunderstood struct rte_flow_item_vlan and though it was the "equivalent" of struct vlan_hdr, in which case the vlan_hdr contains the type of the encapsulated frame.

(  /**
 * Ethernet VLAN Header.
 * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type
 * of the encapsulated frame.
 */
struct vlan_hdr {
	uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */
	uint16_t eth_proto;/**< Ethernet type of encapsulated frame. */
} __attribute__((__packed__));        )


Best regards,
Nicolas Le Scouarnec


More information about the dev mailing list