Skip to contentSkip to conversation

net/ixgbe: shrink size of context index

PATCH In review Bruce Richardson 2 participants 3 messages Apr 8 – Apr 9 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe: shrink size of context index

The ixgbe driver only supports two contexts, so using uint32_t for the context index is excessive. Reducing this to uint8_t shrinks the ixgbe part of the union from 32 bytes to 24. Although it does not in itself shrink the space for the whole struct, it is worth doing as ixgbe is the second-largest block in the union, so may become relevant if other rework shrinks the idpf-specific block.

---
 drivers/net/intel/common/tx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/common/tx.h +1 -1
index f2123f069c..8cb281aa20 100644
@@ -200,7 +200,7 @@ struct ci_tx_queue {
 		struct { /* ixgbe specific values */
 			const struct ixgbe_txq_ops *ops;
 			struct ixgbe_advctx_info *ctx_cache;
-			uint32_t ctx_curr;
+			uint8_t ctx_curr;
 			uint8_t pthresh;   /**< Prefetch threshold register. */
 			uint8_t hthresh;   /**< Host threshold register. */
 			uint8_t wthresh;   /**< Write-back threshold reg. */
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Bruce Richardson

The ixgbe driver only supports two contexts, so using uint32_t for the context index is excessive. Reducing this to uint8_t shrinks the ixgbe part of the union from 32 bytes to 24. Although it does not in itself shrink the space for the whole struct, it is worth doing as ixgbe is the second-largest block in the union, so may become relevant if other rework shrinks the idpf-specific block.

---

Signature · 2 lines
Thanks,
Anatoly
author Applied
#2 lore raw
Quoted 8 lines · Anatoly
Quoted 7 lines · Bruce Richardson

The ixgbe driver only supports two contexts, so using uint32_t for the context index is excessive. Reducing this to uint8_t shrinks the ixgbe part of the union from 32 bytes to 24. Although it does not in itself shrink the space for the whole struct, it is worth doing as ixgbe is the second-largest block in the union, so may become relevant if other rework shrinks the idpf-specific block.

Quoted 5 lines
Quoted 2 lines

---

Applied to dpdk-next-net-intel

Thanks,
/Bruce