Skip to content

Commit

Permalink
net/ngbe: support jumbo frame
Browse files Browse the repository at this point in the history
Add to support Rx jumbo frames.

Signed-off-by: Jiawen Wu <[email protected]>
  • Loading branch information
Jiawen Wu authored and Ferruh Yigit committed Oct 29, 2021
1 parent 64b36e4 commit 586e602
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/guides/nics/ngbe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Features
- Packet type information
- Checksum offload
- TSO offload
- Jumbo frames
- Link state information
- Scattered and gather for TX and RX

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ngbe/ngbe_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

#define NGBE_QUEUE_ITR_INTERVAL_DEFAULT 500 /* 500us */

/* The overhead from MTU to max frame size. */
#define NGBE_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)

#define NGBE_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
#define NGBE_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET

Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ngbe/ngbe_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2364,8 +2364,11 @@ ngbe_dev_rx_init(struct rte_eth_dev *dev)
hlreg0 &= ~NGBE_SECRXCTL_XDSA;
wr32(hw, NGBE_SECRXCTL, hlreg0);

/*
* Configure jumbo frame support, if any.
*/
wr32m(hw, NGBE_FRMSZ, NGBE_FRMSZ_MAX_MASK,
NGBE_FRMSZ_MAX(NGBE_FRAME_SIZE_DFT));
NGBE_FRMSZ_MAX(dev->data->mtu + NGBE_ETH_OVERHEAD));

/* Setup Rx queues */
for (i = 0; i < dev->data->nb_rx_queues; i++) {
Expand Down

0 comments on commit 586e602

Please sign in to comment.