From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by dpdk.org (Postfix) with ESMTP id D23255A35 for ; Tue, 14 Apr 2015 16:24:05 +0200 (CEST) Received: by wizk4 with SMTP id k4so115826380wiz.1 for ; Tue, 14 Apr 2015 07:24:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=E7aCuI3k3c4DtKFwtQGyU6UAPbi2DPZxK2BK5CaWGsI=; b=Zzb4z8SknJPmRFIybR0fnVyyoLocb3D3hszQA3zKxvZCfncjY83robfTcoH06MtXms iyEiPIlAsW2IQ3ysXzxRmkmawshwfT8YXp5Y0MKncP/d9gYzAFAkaG2/vNCE0XAcrGvP sNnMKYDRJfo0g7miiQrVziG0p3xzKMREm0r0Av5DxZjuFrU7LyuBhONSc5j4/hAnabyA Sg28A/PJeeqkvcoZXIKI+TZ0bSNu1SVNcq15Yh8cP20z2KpbpAStCjdgABGDVXP9MUGy FH+0QfiM3XoQuneR+KlVvycZiRlxQBrw6HTKSxxzxD8fq+auWF5nL54HI4WU0gMyzFcK lNNw== X-Gm-Message-State: ALoCoQnnWwuK+HoQZCl24ISgFmNN5CIUQTHJkjNVA0Ika/UGPBow8t2VLKPjUEAowgkUGWXnuNF+ X-Received: by 10.194.78.231 with SMTP id e7mr39001604wjx.33.1429021445707; Tue, 14 Apr 2015 07:24:05 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id l10sm1805084wje.15.2015.04.14.07.24.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 Apr 2015 07:24:04 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 14 Apr 2015 16:23:55 +0200 Message-Id: <1429021435-28414-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 Subject: [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: Tue, 14 Apr 2015 14:24:06 -0000 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; + 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) ENICPMD_FUNC_TRACE(); + enic->port_id = eth_dev->data->port_id; enic->rte_dev = eth_dev; eth_dev->dev_ops = &enicpmd_eth_dev_ops; eth_dev->rx_pkt_burst = &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 = RTE_PKTMBUF_HEADROOM; hdr_mbuf->nb_segs = 2; - hdr_mbuf->port = rq->index; + hdr_mbuf->port = enic->port_id; hdr_mbuf->next = mbuf; dma_addr = (dma_addr_t) @@ -359,7 +359,7 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) type = RQ_ENET_TYPE_NOT_SOP; } else { mbuf->nb_segs = 1; - mbuf->port = rq->index; + mbuf->port = enic->port_id; } mbuf->data_off = RTE_PKTMBUF_HEADROOM; -- 2.1.0