diff mbox

[dpdk-dev,v3] net/i40e: fix compile error

Message ID 1487614316-2270-1-git-send-email-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Zhang, Qi Z Feb. 20, 2017, 6:11 p.m. UTC
This patch fix the compile error when RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
is disabled. fake_mbuf is also required to be initialized and assigned to
additional sw_ring entries for vector PMD.

Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 2 +-
 drivers/net/i40e/i40e_rxtx.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

De Lara Guarch, Pablo Feb. 21, 2017, 8:15 a.m. UTC | #1
Hi Qi,

> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Qi Zhang
> Sent: Monday, February 20, 2017 6:12 PM
> To: Wu, Jingjing; Zhang, Helin
> Cc: dev@dpdk.org; Zhang, Qi Z; stable@dpdk.org
> Subject: [dpdk-stable] [PATCH v3] net/i40e: fix compile error
> 
> This patch fix the compile error when
> RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
> is disabled. fake_mbuf is also required to be initialized and assigned to
> additional sw_ring entries for vector PMD.
> 
> Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---

Please, try to remember to include the changes you have made
in the different revisions, after the "---".

Thanks,
Pablo
Zhang, Qi Z Feb. 22, 2017, 1:04 a.m. UTC | #2
Thanks for reminder, will follow:)

> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Tuesday, February 21, 2017 4:15 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Zhang, Helin <helin.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-stable] [PATCH v3] net/i40e: fix compile error
> 
> Hi Qi,
> 
> > -----Original Message-----
> > From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Qi Zhang
> > Sent: Monday, February 20, 2017 6:12 PM
> > To: Wu, Jingjing; Zhang, Helin
> > Cc: dev@dpdk.org; Zhang, Qi Z; stable@dpdk.org
> > Subject: [dpdk-stable] [PATCH v3] net/i40e: fix compile error
> >
> > This patch fix the compile error when
> > RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
> > is disabled. fake_mbuf is also required to be initialized and assigned
> > to additional sw_ring entries for vector PMD.
> >
> > Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> 
> Please, try to remember to include the changes you have made in the different
> revisions, after the "---".
> 
> Thanks,
> Pablo
>
Ferruh Yigit Feb. 22, 2017, 5:51 p.m. UTC | #3
On 2/20/2017 6:11 PM, Qi Zhang wrote:
> This patch fix the compile error when RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
> is disabled. fake_mbuf is also required to be initialized and assigned to
> additional sw_ring entries for vector PMD.
> 
> Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

    Fixes: 4861cde46116 ("i40e: new poll mode driver")

Applied to dpdk-next-net/master, thanks.
diff mbox

Patch

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 48429cc..40f4a45 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2209,11 +2209,11 @@  i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
 	for (i = 0; i < len * sizeof(union i40e_rx_desc); i++)
 		((volatile char *)rxq->rx_ring)[i] = 0;
 
-#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
 	memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf));
 	for (i = 0; i < RTE_PMD_I40E_RX_MAX_BURST; ++i)
 		rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf;
 
+#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
 	rxq->rx_nb_avail = 0;
 	rxq->rx_next_avail = 0;
 	rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1);
diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h
index 9df8a56..4f7f319 100644
--- a/drivers/net/i40e/i40e_rxtx.h
+++ b/drivers/net/i40e/i40e_rxtx.h
@@ -119,11 +119,11 @@  struct i40e_rx_queue {
 	uint16_t nb_rx_hold; /**< number of held free RX desc */
 	struct rte_mbuf *pkt_first_seg; /**< first segment of current packet */
 	struct rte_mbuf *pkt_last_seg; /**< last segment of current packet */
+	struct rte_mbuf fake_mbuf; /**< dummy mbuf */
 #ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
 	uint16_t rx_nb_avail; /**< number of staged packets ready */
 	uint16_t rx_next_avail; /**< index of next staged packets */
 	uint16_t rx_free_trigger; /**< triggers rx buffer allocation */
-	struct rte_mbuf fake_mbuf; /**< dummy mbuf */
 	struct rte_mbuf *rx_stage[RTE_PMD_I40E_RX_MAX_BURST * 2];
 #endif