MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_fc_lpbthresh_set

Function ngbe_fc_lpbthresh_set

dpdk/drivers/net/ngbe/ngbe_ethdev.c:2468–2486  ·  view source on GitHub ↗

* ngbe_fc_lpbthresh_set - calculate low water mark for flow control * * @dv_id: device interface delay */

Source from the content-addressed store, hash-verified

2466 * @dv_id: device interface delay
2467 */
2468static s32
2469ngbe_fc_lpbthresh_set(struct rte_eth_dev *dev)
2470{
2471 struct ngbe_hw *hw = ngbe_dev_hw(dev);
2472 u32 max_frame_size, tc, dv_id;
2473 s32 kb;
2474
2475 /* Calculate max LAN frame size */
2476 max_frame_size = rd32m(hw, NGBE_FRMSZ, NGBE_FRMSZ_MAX_MASK);
2477 tc = max_frame_size + NGBE_ETH_FRAMING;
2478
2479 /* Calculate delay value for device */
2480 dv_id = NGBE_LOW_DV(tc);
2481
2482 /* Delay value is calculated in bit times convert to KB */
2483 kb = NGBE_BT2KB(dv_id);
2484
2485 return kb;
2486}
2487
2488/*
2489 * ngbe_pbthresh_setup - calculate and setup high low water marks

Callers 1

ngbe_pbthresh_setFunction · 0.85

Calls 2

ngbe_dev_hwFunction · 0.85
rd32mFunction · 0.50

Tested by

no test coverage detected