[dpdk-dev] ixgbe: fix compilation issue when IXGBE_RX_ALLOW_BULK_ALLOC is disabled

Message ID 1437558611-11952-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

De Lara Guarch, Pablo July 22, 2015, 9:50 a.m. UTC
  ixgbe_recv_pkts_lro uses field rx_free_trigger
in structure ixgbe_rx_queue, but that field is only defined
if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
that field is not used when it is disabled,
compiler complains about it.
Therefore, the lines of code that use that field
have been ifdef.

Fixes: 8eecb329 ("ixgbe: add LRO support")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 22, 2015, 9:56 a.m. UTC | #1
2015-07-22 10:50, Pablo de Lara:
> ixgbe_recv_pkts_lro uses field rx_free_trigger
> in structure ixgbe_rx_queue, but that field is only defined
> if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
> that field is not used when it is disabled,
> compiler complains about it.

Why this option is still needed?
  
Thomas Monjalon July 22, 2015, 9:58 a.m. UTC | #2
2015-07-22 10:50, Pablo de Lara:
> ixgbe_recv_pkts_lro uses field rx_free_trigger
> in structure ixgbe_rx_queue, but that field is only defined
> if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
> that field is not used when it is disabled,
> compiler complains about it.
> Therefore, the lines of code that use that field
> have been ifdef.
> 
> Fixes: 8eecb329 ("ixgbe: add LRO support")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9b2d637..af7e222 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1707,7 +1707,9 @@  next_desc:
 							rx_mbuf_alloc_failed++;
 				break;
 			}
-		} else if (nb_hold > rxq->rx_free_thresh) {
+		}
+#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
+		else if (nb_hold > rxq->rx_free_thresh) {
 			uint16_t next_rdt = rxq->rx_free_trigger;
 
 			if (!ixgbe_rx_alloc_bufs(rxq, false)) {
@@ -1725,6 +1727,7 @@  next_desc:
 				break;
 			}
 		}
+#endif
 
 		nb_hold++;
 		rxe = &sw_ring[rx_id];