From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 051851B665 for ; Fri, 3 Nov 2017 06:07:17 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 02 Nov 2017 22:07:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,336,1505804400"; d="scan'208";a="1032982014" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by orsmga003.jf.intel.com with ESMTP; 02 Nov 2017 22:07:15 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.207]) by KMSMSX156.gar.corp.intel.com ([169.254.1.25]) with mapi id 14.03.0248.002; Fri, 3 Nov 2017 13:07:14 +0800 From: "Dai, Wei" To: "Peng, Yuan" , "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v2] net/ixgbe: fix filter parser error in L2 tunnel Thread-Index: AdNUYZpQNzPXSEG6Slun7mEXFXkU3Q== Date: Fri, 3 Nov 2017 05:07:13 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D651555276@PGSMSX111.gar.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjc5YTMxYzctZDg5MS00YjY4LWJlNjAtMjFmYWNlYThmYmVkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikh6RDFkVVhESTBwUXJIb3BsSmRUYzRza2JobDhOUUhHTE5vM3Awajh3M1k9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix filter parser error in L2 tunnel X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2017 05:07:18 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Peng, Yuan > Sent: Friday, November 3, 2017 11:39 AM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Zhao1, Wei > Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix filter parser error in = L2 > tunnel >=20 > Tested-by: Peng Yuan >=20 > - Tested Branch: dpdk-master > - Tested Commit: 8ced1542f7a356097c0b24bd1e08db670ff31b92 > - OS: 4.8.6-300.fc25.x86_64 > - GCC: gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) > - CPU: Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz > - NIC: Intel Corporation Ethernet Connection X552/X557-AT 10GBASE-T > [8086:15ad] > - Default x86_64-native-linuxapp-gcc configuration > - Prerequisites: > - Total 1 cases, 1 passed, 0 failed >=20 > Hardware: > dut: 10.240.176.192 > tester: 10.240.176.191 > X552/X557-AT 10g*2 >=20 > Test steps: >=20 > Bind pf to igb_uio: > ./usertools/dpdk-devbind.py -b igb_uio 03:00.0 >=20 > add two vfs on dpdk pf, then bind the vfs to vfio-pci: > echo 2 >/sys/bus/pci/devices/0000:03:00.0/max_vfs > ./usertools/dpdk-devbind.py -b vfio-pci 03:10.0 03:10.2 >=20 > Start testpmd: > ./x86_64-native-linuxapp-gcc/app/testpmd -c 1f -n 4 -m 1024 -w 03:00.0 > --file-prefix=3Dpf - -i --rxq=3D4 --txq=3D4 testpmd> set fwd rxonly tes= tpmd> set > verbose 1 testpmd> start ./x86_64-native-linuxapp-gcc/app/testpmd -c > 0xf0 -n 4 -w 03:10.0 --file-prefix=3Dvf0 -m 1024 - -i --rxq=3D4 --txq=3D4= --disable-rss > testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> > start ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf00 -n 4 -w 03:10.2 > --file-prefix=3Dvf1 -m 1024 - -i --rxq=3D4 --txq=3D4 --disable-rss testp= md> set fwd > rxonly testpmd> set verbose 1 testpmd> start >=20 > 1. create filter rules, > testpmd> flow create 0 ingress pattern e_tag grp_ecid_b is 0x1309 / end > actions vf id 0 / end Flow rule #0 created testpmd> flow create 0 ingre= ss > pattern e_tag grp_ecid_b is 0x1308 / end actions vf id 1 / end Flow rule= #1 > created >=20 > 2. send packets: > pkt1 =3D Ether(dst=3D"00:11:22:33:44:55")/Dot1BR(GRP=3D0x1, > ECIDbase=3D0x309)/Raw('x' * 20) > pkt2 =3D Ether(dst=3D"00:11:22:33:44:55")/Dot1BR(GRP=3D0x1, > ECIDbase=3D0x308)/Raw('x' * 20) > pkt3 =3D Ether(dst=3D"00:11:22:33:44:55")/Dot1BR(GRP=3D0x1, > ECIDbase=3D0x307)/Raw('x' * 20) > pkt4 =3D Ether(dst=3D"00:11:22:33:44:55")/Dot1BR(GRP=3D0x2, > ECIDbase=3D0x309)/Raw('x' * 20) >=20 > verify pkt1 to vf0 queue0, pkt2 to vf1 queue0, pkt3 and pkt4 can't receiv= ed > by pf and vfs. >=20 >=20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao > Sent: Wednesday, November 1, 2017 4:25 PM > To: dev@dpdk.org > Cc: Zhao1, Wei > Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix filter parser error in L2 t= unnel >=20 > The action for L2 tunnel should be VF, not QUEUE. >=20 > Fixes: 99e7003831c ("net/ixgbe: parse L2 tunnel filter") >=20 > Signed-off-by: Wei Zhao Acked-by: Wei Dai > --- > drivers/net/ixgbe/ixgbe_flow.c | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flo= w.c > index 82fc705..1c5e103 100644 > --- a/drivers/net/ixgbe/ixgbe_flow.c > +++ b/drivers/net/ixgbe/ixgbe_flow.c > @@ -1095,7 +1095,7 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev, > * The first not void item can be E_TAG. > * The next not void item must be END. > * action: > - * The first not void action should be QUEUE. > + * The first not void action should be VF. > * The next not void action should be END. > * pattern example: > * ITEM Spec Mask > @@ -1116,7 +1116,7 @@ cons_parse_l2_tn_filter(const struct > rte_flow_attr *attr, > const struct rte_flow_item_e_tag *e_tag_spec; > const struct rte_flow_item_e_tag *e_tag_mask; > const struct rte_flow_action *act; > - const struct rte_flow_action_queue *act_q; > + const struct rte_flow_action_vf *act_vf; >=20 > if (!pattern) { > rte_flow_error_set(error, EINVAL, > @@ -1224,9 +1224,9 @@ cons_parse_l2_tn_filter(const struct > rte_flow_attr *attr, > return -rte_errno; > } >=20 > - /* check if the first not void action is QUEUE. */ > + /* check if the first not void action is VF. */ > act =3D next_no_void_action(actions, NULL); > - if (act->type !=3D RTE_FLOW_ACTION_TYPE_QUEUE) { > + if (act->type !=3D RTE_FLOW_ACTION_TYPE_VF) { > memset(filter, 0, sizeof(struct rte_eth_l2_tunnel_conf)); > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, > @@ -1234,8 +1234,8 @@ cons_parse_l2_tn_filter(const struct > rte_flow_attr *attr, > return -rte_errno; > } >=20 > - act_q =3D (const struct rte_flow_action_queue *)act->conf; > - filter->pool =3D act_q->index; > + act_vf =3D (const struct rte_flow_action_vf *)act->conf; > + filter->pool =3D act_vf->id; >=20 > /* check if the next not void item is END */ > act =3D next_no_void_action(actions, act); @@ -1260,6 +1260,8 @@ > ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev, { > int ret =3D 0; > struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + uint16_t vf_num; >=20 > ret =3D cons_parse_l2_tn_filter(attr, pattern, > actions, l2_tn_filter, error); > @@ -1274,7 +1276,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev, > return -rte_errno; > } >=20 > - if (l2_tn_filter->pool >=3D dev->data->nb_rx_queues) > + vf_num =3D pci_dev->max_vfs; > + > + if (l2_tn_filter->pool >=3D vf_num) > return -rte_errno; >=20 > return ret; > -- > 2.7.4