Skip to content

Commit 6af4905

Browse files
Dimon-Zhaoshemminger
authored andcommitted
net/nbl: change default Rx extension header size to 12 bytes
The default Rx extension header size is reduced from 16 bytes to 12 bytes. This reduction saves PCIe bandwidth by decreasing packet overhead. Signed-off-by: Dimon Zhao <[email protected]>
1 parent cb699a0 commit 6af4905

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

drivers/net/nbl/nbl_dev/nbl_dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int nbl_dev_txrx_start(struct rte_eth_dev *eth_dev)
8787
param.local_queue_id = i + ring_mgt->queue_offset;
8888
param.intr_en = 0;
8989
param.intr_mask = 0;
90-
param.half_offload_en = 1;
90+
param.half_offload_en = ring_mgt->rx_hash_en;
9191
param.extend_header = 1;
9292
param.split = 0;
9393
param.rxcsum = 1;
@@ -266,6 +266,7 @@ int nbl_rx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
266266
param.conf = conf;
267267
param.mempool = mempool;
268268
param.product = adapter->caps.product_type;
269+
param.rx_hash_en = ring_mgt->rx_hash_en;
269270
ret = disp_ops->start_rx_ring(NBL_DEV_MGT_TO_DISP_PRIV(dev_mgt), &param, &rx_ring->dma);
270271
if (ret) {
271272
NBL_LOG(ERR, "start_rx_ring failed %d", ret);
@@ -993,6 +994,7 @@ int nbl_dev_init(void *p, struct rte_eth_dev *eth_dev)
993994
eth_dev->data->mac_addrs[0].addr_bytes);
994995

995996
adapter->state = NBL_ETHDEV_INITIALIZED;
997+
(*dev_mgt)->net_dev->ring_mgt.rx_hash_en = 0;
996998
eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
997999
disp_ops->get_resource_pt_ops(NBL_DEV_MGT_TO_DISP_PRIV(*dev_mgt),
9981000
&(*dev_mgt)->pt_ops, 0);

drivers/net/nbl/nbl_dev/nbl_dev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct nbl_dev_ring_mgt {
3535
u8 tx_ring_num;
3636
u8 rx_ring_num;
3737
u8 active_ring_num;
38+
bool rx_hash_en;
3839
};
3940

4041
struct nbl_dev_net_mgt {

drivers/net/nbl/nbl_hw/nbl_resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ struct nbl_res_rx_ring {
197197

198198
u16 avail_used_flags;
199199
bool used_wrap_counter;
200+
bool rx_hash_en;
200201
u16 notify_qid;
201202
u16 exthdr_len;
202203

drivers/net/nbl/nbl_hw/nbl_txrx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,14 @@ static int nbl_res_txrx_start_rx_ring(void *priv,
284284
rx_ring->dma_limit_msb = common->dma_limit_msb;
285285
rx_ring->common = common;
286286
rx_ring->notify = hw_ops->get_tail_ptr(NBL_RES_MGT_TO_HW_PRIV(res_mgt));
287+
rx_ring->rx_hash_en = param->rx_hash_en;
287288

288289
switch (param->product) {
289290
case NBL_LEONIS_TYPE:
290-
rx_ring->exthdr_len = sizeof(struct nbl_rx_ehdr_leonis);
291+
if (param->rx_hash_en)
292+
rx_ring->exthdr_len = sizeof(struct nbl_rx_ehdr_leonis);
293+
else
294+
rx_ring->exthdr_len = sizeof(struct nbl_rx_ehdr_leonis) - 4;
291295
break;
292296
default:
293297
rx_ring->exthdr_len = sizeof(union nbl_rx_extend_head);

drivers/net/nbl/nbl_include/nbl_include.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ struct nbl_start_rx_ring_param {
8282
u16 queue_idx;
8383
u16 nb_desc;
8484
u32 socket_id;
85-
enum nbl_product_type product;
8685
const struct rte_eth_rxconf *conf;
8786
struct rte_mempool *mempool;
87+
enum nbl_product_type product;
88+
bool rx_hash_en;
8889
};
8990

9091
struct nbl_start_tx_ring_param {

0 commit comments

Comments
 (0)