* ngbe_fc_lpbthresh_set - calculate low water mark for flow control * * @dv_id: device interface delay */
| 2466 | * @dv_id: device interface delay |
| 2467 | */ |
| 2468 | static s32 |
| 2469 | ngbe_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 |
no test coverage detected