From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 554A693C0 for ; Tue, 2 Feb 2016 04:07:23 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 01 Feb 2016 19:07:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,383,1449561600"; d="scan'208";a="40663245" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 01 Feb 2016 19:07:21 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Feb 2016 19:07:21 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Feb 2016 19:07:21 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.215]) by shsmsx102.ccr.corp.intel.com ([169.254.2.172]) with mapi id 14.03.0248.002; Tue, 2 Feb 2016 11:07:19 +0800 From: "Qiu, Michael" To: "Wang, Xiao W" , "Chen, Jing D" Thread-Topic: [dpdk-dev] [PATCH 1/3] fm10k: enable FTAG based forwarding Thread-Index: AQHRV0eIGSJVzh1JKEKyvTz9XMu+gA== Date: Tue, 2 Feb 2016 03:07:19 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F28C2D@SHSMSX101.ccr.corp.intel.com> References: <1453709251-32309-1-git-send-email-xiao.w.wang@intel.com> <1453709251-32309-2-git-send-email-xiao.w.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/3] fm10k: enable FTAG based forwarding X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2016 03:07:24 -0000 On 1/25/2016 4:08 PM, Wang Xiao W wrote:=0A= > This patch enables reading sglort info into mbuf for RX and inserting=0A= > an FTAG at the beginning of the packet for TX. The vlan_tci_outer field= =0A= > selected from rte_mbuf structure for sglort is not used in fm10k now.=0A= > In FTAG based forwarding mode, the switch will forward packets according= =0A= > to glort info in FTAG rather than mac and vlan table.=0A= >=0A= > To activate this feature, user needs to turn ``CONFIG_RTE_LIBRTE_FM10K_FT= AG_FWD``=0A= > to y in common_linuxapp or common_bsdapp. Currently this feature is suppo= rted=0A= > only on PF, because FM10K_PFVTCTL register is read-only for VF.=0A= >=0A= > Signed-off-by: Wang Xiao W =0A= > ---=0A= > config/common_bsdapp | 1 +=0A= > config/common_linuxapp | 1 +=0A= > drivers/net/fm10k/fm10k_ethdev.c | 8 ++++++++=0A= > drivers/net/fm10k/fm10k_rxtx.c | 17 +++++++++++++++++=0A= > drivers/net/fm10k/fm10k_rxtx_vec.c | 9 +++++++++=0A= > 5 files changed, 36 insertions(+)=0A= >=0A= > diff --git a/config/common_bsdapp b/config/common_bsdapp=0A= > index ed7c31c..451f81a 100644=0A= > --- a/config/common_bsdapp=0A= > +++ b/config/common_bsdapp=0A= > @@ -208,6 +208,7 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX=3Dn=0A= > CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=3Dn=0A= > CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=3Dn=0A= > CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=3Dy=0A= > +CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=3Dn=0A= > =0A= > #=0A= > # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD=0A= > diff --git a/config/common_linuxapp b/config/common_linuxapp=0A= > index 74bc515..c928bce 100644=0A= > --- a/config/common_linuxapp=0A= > +++ b/config/common_linuxapp=0A= > @@ -207,6 +207,7 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=3Dn=0A= > CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=3Dn=0A= > CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=3Dy=0A= > CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=3Dy=0A= > +CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=3Dn=0A= > =0A= > #=0A= > # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD=0A= > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_e= thdev.c=0A= > index e4aed94..cc8317f 100644=0A= > --- a/drivers/net/fm10k/fm10k_ethdev.c=0A= > +++ b/drivers/net/fm10k/fm10k_ethdev.c=0A= > @@ -668,6 +668,14 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)=0A= > PMD_INIT_LOG(ERR, "failed to disable queue %d", i);=0A= > return -1;=0A= > }=0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + /* Enable use of FTAG bit in TX descriptor, PFVTCTL=0A= > + * register is read-only for VF.=0A= > + */=0A= > + if (hw->mac.type =3D=3D fm10k_mac_pf)=0A= > + FM10K_WRITE_REG(hw, FM10K_PFVTCTL(i),=0A= > + FM10K_PFVTCTL_FTAG_DESC_ENABLE);=0A= =0A= So here if somebody enable FTAG, when compile, but he use VF, what will=0A= happen? We'd better to give a error message when he try to use VF with FTAG= .=0A= =0A= Thanks,=0A= Michael=0A= > +#endif=0A= > =0A= > /* set location and size for descriptor ring */=0A= > FM10K_WRITE_REG(hw, FM10K_TDBAL(i),=0A= > diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxt= x.c=0A= > index e958865..f87987d 100644=0A= > --- a/drivers/net/fm10k/fm10k_rxtx.c=0A= > +++ b/drivers/net/fm10k/fm10k_rxtx.c=0A= > @@ -152,6 +152,13 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx= _pkts,=0A= > */=0A= > mbuf->ol_flags |=3D PKT_RX_VLAN_PKT;=0A= > mbuf->vlan_tci =3D desc.w.vlan;=0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + /**=0A= > + * mbuf->vlan_tci_outer is an idle field in fm10k driver,=0A= > + * so it can be selected to store sglort value.=0A= > + */=0A= > + mbuf->vlan_tci_outer =3D rte_le_to_cpu_16(desc.w.sglort);=0A= > +#endif=0A= > =0A= > rx_pkts[count] =3D mbuf;=0A= > if (++next_dd =3D=3D q->nb_desc) {=0A= > @@ -307,6 +314,13 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte= _mbuf **rx_pkts,=0A= > */=0A= > mbuf->ol_flags |=3D PKT_RX_VLAN_PKT;=0A= > first_seg->vlan_tci =3D desc.w.vlan;=0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + /**=0A= > + * mbuf->vlan_tci_outer is an idle field in fm10k driver,=0A= > + * so it can be selected to store sglort value.=0A= > + */=0A= > + first_seg->vlan_tci_outer =3D rte_le_to_cpu_16(desc.w.sglort);=0A= > +#endif=0A= > =0A= > /* Prefetch data of first segment, if configured to do so. */=0A= > rte_packet_prefetch((char *)first_seg->buf_addr +=0A= > @@ -432,6 +446,9 @@ static inline void tx_xmit_pkt(struct fm10k_tx_queue = *q, struct rte_mbuf *mb)=0A= > q->nb_free -=3D mb->nb_segs;=0A= > =0A= > q->hw_ring[q->next_free].flags =3D 0;=0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + q->hw_ring[q->next_free].flags |=3D FM10K_TXD_FLAG_FTAG;=0A= > +#endif=0A= > /* set checksum flags on first descriptor of packet. SCTP checksum=0A= > * offload is not supported, but we do not explicitly check for this=0A= > * case in favor of greatly simplified processing. */=0A= > diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k= _rxtx_vec.c=0A= > index 2a57eef..0b0f2e3 100644=0A= > --- a/drivers/net/fm10k/fm10k_rxtx_vec.c=0A= > +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c=0A= > @@ -198,7 +198,12 @@ fm10k_rx_vec_condition_check(struct rte_eth_dev *dev= )=0A= > rxmode->header_split =3D=3D 1)=0A= > return -1;=0A= > =0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + return -1;=0A= > +#else=0A= > return 0;=0A= > +#endif=0A= > +=0A= > #else=0A= > RTE_SET_USED(dev);=0A= > return -1;=0A= > @@ -648,7 +653,11 @@ fm10k_tx_vec_condition_check(struct fm10k_tx_queue *= txq)=0A= > if ((txq->txq_flags & FM10K_SIMPLE_TX_FLAG) !=3D FM10K_SIMPLE_TX_FLAG)= =0A= > return -1;=0A= > =0A= > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD=0A= > + return -1;=0A= > +#else=0A= > return 0;=0A= > +#endif=0A= > }=0A= > =0A= > static inline void=0A= =0A=