* [PATCH] enic: set correct port ID in received mbufs
@ 2015-04-14 14:23 Adrien Mazarguil
[not found] ` <1429021435-28414-1-git-send-email-adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2015-04-14 14:23 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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 <adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1429021435-28414-1-git-send-email-adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] enic: set correct port ID in received mbufs [not found] ` <1429021435-28414-1-git-send-email-adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> @ 2015-04-18 17:49 ` Sujith Sankar (ssujith) [not found] ` <D15896D1.3628E%ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Sujith Sankar (ssujith) @ 2015-04-18 17:49 UTC (permalink / raw) To: Adrien Mazarguil, dev-VfR2kkLFssw@public.gmane.org On 14/04/15 7:53 pm, "Adrien Mazarguil" <adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> 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 <adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> >--- > 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 Acked-by: Sujith Sankar <ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> Thanks, -Sujith > ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <D15896D1.3628E%ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] enic: set correct port ID in received mbufs [not found] ` <D15896D1.3628E%ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> @ 2015-04-20 13:23 ` Thomas Monjalon 0 siblings, 0 replies; 3+ messages in thread From: Thomas Monjalon @ 2015-04-20 13:23 UTC (permalink / raw) To: Adrien Mazarguil; +Cc: dev-VfR2kkLFssw > >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 <adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> > > Acked-by: Sujith Sankar <ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> Applied, thanks ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-20 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 14:23 [PATCH] enic: set correct port ID in received mbufs Adrien Mazarguil
[not found] ` <1429021435-28414-1-git-send-email-adrien.mazarguil-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2015-04-18 17:49 ` Sujith Sankar (ssujith)
[not found] ` <D15896D1.3628E%ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-04-20 13:23 ` Thomas Monjalon
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.