From mboxrd@z Thu Jan 1 00:00:00 1970 From: Le Scouarnec Nicolas Subject: Re: Issues with ixgbe and rte_flow Date: Wed, 8 Mar 2017 09:24:26 +0000 Message-ID: References: , <6A0DE07E22DDAD4C9103DF62FEBC09093B56D514@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: "Lu, Wenzhuo" , "dev@dpdk.org" , "Adrien Mazarguil (adrien.mazarguil@6wind.com)" Return-path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0139.outbound.protection.outlook.com [104.47.37.139]) by dpdk.org (Postfix) with ESMTP id 9AE5B108A for ; Wed, 8 Mar 2017 10:24:27 +0100 (CET) In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B56D514@shsmsx102.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" My response is inline bellow, and further comment on the code excerpt also From: Lu, Wenzhuo Sent: Wednesday, March 8, 2017 4:16 AM To: Le Scouarnec Nicolas; dev@dpdk.org; Adrien Mazarguil (adrien.mazarguil@= 6wind.com) Cc: Yigit, Ferruh Subject: RE: Issues with ixgbe and rte_flow =A0 =20 >> 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 unders= tand). I >> enclosed the setup code at the bottom of this email. >> For reference, here is the setup code I use >> >>=A0=A0=A0=A0=A0=A0 vlan_spec.tci =3D vlan_be; >>=A0=A0=A0=A0=A0=A0 vlan_spec.tpid =3D 0; >> >>=A0=A0=A0=A0=A0=A0 vlan_mask.tci =3D rte_cpu_to_be_16(0x0fff); >>=A0=A0=A0=A0=A0=A0 vlan_mask.tpid =3D=A0 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 contai= ns 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=