From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by dpdk.org (Postfix) with ESMTP id 2F90EADA7 for ; Sat, 18 Apr 2015 19:49:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2224; q=dns/txt; s=iport; t=1429379372; x=1430588972; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=45lxJtA29hvWRj9so9dQlqiB2zDzJdwjfKXB2mFLWQ8=; b=CunhhwejPZiOwf5UWHy7DGeSW8YSy3laeSdgSydo9kcxnYdZ7h7+JGyn b/wUBW1WWoTnYtg7Rm9nSKoh8pFKWfBELUSrv19F+wTmemMpE99xzski0 k+ylpfEnoMqG4U8Vgtnu2BlXOmLV8TI2wpmo6AhrdlijY2+9kpSHh+UsQ k=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BnBQDslzJV/4QNJK1dgwyBLgXOCQKBLkwBAQEBAQF+hCEBAQQnE08CAQg2EDIlAgQBEogryHgBAQEBAQEBAwEBAQEBAQEbiymFA4QtAQSRK4ohlSIig3NvgUSBAAEBAQ X-IronPort-AV: E=Sophos;i="5.11,599,1422921600"; d="scan'208";a="412927074" Received: from alln-core-10.cisco.com ([173.36.13.132]) by rcdn-iport-6.cisco.com with ESMTP; 18 Apr 2015 17:49:31 +0000 Received: from xhc-rcd-x12.cisco.com (xhc-rcd-x12.cisco.com [173.37.183.86]) by alln-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id t3IHnU61013394 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sat, 18 Apr 2015 17:49:30 GMT Received: from xmb-aln-x07.cisco.com ([169.254.2.108]) by xhc-rcd-x12.cisco.com ([173.37.183.86]) with mapi id 14.03.0195.001; Sat, 18 Apr 2015 12:49:30 -0500 From: "Sujith Sankar (ssujith)" To: Adrien Mazarguil , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] enic: set correct port ID in received mbufs Thread-Index: AQHQdr6v4zIMzvqb70CgQbMRJaKH1p1TwpQA Date: Sat, 18 Apr 2015 17:49:30 +0000 Message-ID: References: <1429021435-28414-1-git-send-email-adrien.mazarguil@6wind.com> In-Reply-To: <1429021435-28414-1-git-send-email-adrien.mazarguil@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [10.65.48.239] Content-Type: text/plain; charset="us-ascii" Content-ID: <0D2AEB077993AD49B93FCF520A55B238@emea.cisco.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] enic: set correct port ID in received mbufs 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: Sat, 18 Apr 2015 17:49:32 -0000 On 14/04/15 7:53 pm, "Adrien Mazarguil" wrote: >This field is not supposed to contain the RX queue index. Applications can >rely on it to determine the port a given mbuf comes from. > >Signed-off-by: Adrien Mazarguil >--- > lib/librte_pmd_enic/enic.h | 1 + > lib/librte_pmd_enic/enic_ethdev.c | 1 + > lib/librte_pmd_enic/enic_main.c | 4 ++-- > 3 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h >index a50bff1..0eba334 100644 >--- a/lib/librte_pmd_enic/enic.h >+++ b/lib/librte_pmd_enic/enic.h >@@ -99,6 +99,7 @@ struct enic { > struct vnic_dev_bar bar0; > struct vnic_dev *vdev; >=20 >+ unsigned int port_id; > struct rte_eth_dev *rte_dev; > struct enic_fdir fdir; > char bdf_name[ENICPMD_BDF_LENGTH]; >diff --git a/lib/librte_pmd_enic/enic_ethdev.c >b/lib/librte_pmd_enic/enic_ethdev.c >index 3e53f86..a319e1e 100644 >--- a/lib/librte_pmd_enic/enic_ethdev.c >+++ b/lib/librte_pmd_enic/enic_ethdev.c >@@ -567,6 +567,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev >*eth_dev) >=20 > ENICPMD_FUNC_TRACE(); >=20 >+ enic->port_id =3D eth_dev->data->port_id; > enic->rte_dev =3D eth_dev; > eth_dev->dev_ops =3D &enicpmd_eth_dev_ops; > eth_dev->rx_pkt_burst =3D &enicpmd_recv_pkts; >diff --git a/lib/librte_pmd_enic/enic_main.c >b/lib/librte_pmd_enic/enic_main.c >index 0e40d46..15313c2 100644 >--- a/lib/librte_pmd_enic/enic_main.c >+++ b/lib/librte_pmd_enic/enic_main.c >@@ -344,7 +344,7 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) > hdr_mbuf->data_off =3D RTE_PKTMBUF_HEADROOM; >=20 > hdr_mbuf->nb_segs =3D 2; >- hdr_mbuf->port =3D rq->index; >+ hdr_mbuf->port =3D enic->port_id; > hdr_mbuf->next =3D mbuf; >=20 > dma_addr =3D (dma_addr_t) >@@ -359,7 +359,7 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) > type =3D RQ_ENET_TYPE_NOT_SOP; > } else { > mbuf->nb_segs =3D 1; >- mbuf->port =3D rq->index; >+ mbuf->port =3D enic->port_id; > } >=20 > mbuf->data_off =3D RTE_PKTMBUF_HEADROOM; >--=20 >2.1.0 Acked-by: Sujith Sankar Thanks, -Sujith >