| 2301 | } |
| 2302 | |
| 2303 | int |
| 2304 | eth_igb_rx_init(struct rte_eth_dev *dev) |
| 2305 | { |
| 2306 | struct rte_eth_rxmode *rxmode; |
| 2307 | struct e1000_hw *hw; |
| 2308 | struct igb_rx_queue *rxq; |
| 2309 | uint32_t rctl; |
| 2310 | uint32_t rxcsum; |
| 2311 | uint32_t srrctl; |
| 2312 | uint16_t buf_size; |
| 2313 | uint16_t rctl_bsize; |
| 2314 | uint32_t max_len; |
| 2315 | uint16_t i; |
| 2316 | int ret; |
| 2317 | |
| 2318 | hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 2319 | srrctl = 0; |
| 2320 | |
| 2321 | /* |
| 2322 | * Make sure receives are disabled while setting |
| 2323 | * up the descriptor ring. |
| 2324 | */ |
| 2325 | rctl = E1000_READ_REG(hw, E1000_RCTL); |
| 2326 | E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); |
| 2327 | |
| 2328 | rxmode = &dev->data->dev_conf.rxmode; |
| 2329 | |
| 2330 | /* |
| 2331 | * Configure support of jumbo frames, if any. |
| 2332 | */ |
| 2333 | max_len = dev->data->mtu + E1000_ETH_OVERHEAD; |
| 2334 | if (dev->data->mtu > RTE_ETHER_MTU) { |
| 2335 | rctl |= E1000_RCTL_LPE; |
| 2336 | |
| 2337 | /* |
| 2338 | * Set maximum packet length by default, and might be updated |
| 2339 | * together with enabling/disabling dual VLAN. |
| 2340 | */ |
| 2341 | if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_EXTEND) |
| 2342 | max_len += VLAN_TAG_SIZE; |
| 2343 | |
| 2344 | E1000_WRITE_REG(hw, E1000_RLPML, max_len); |
| 2345 | } else |
| 2346 | rctl &= ~E1000_RCTL_LPE; |
| 2347 | |
| 2348 | /* Configure and enable each RX queue. */ |
| 2349 | rctl_bsize = 0; |
| 2350 | dev->rx_pkt_burst = eth_igb_recv_pkts; |
| 2351 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 2352 | uint64_t bus_addr; |
| 2353 | uint32_t rxdctl; |
| 2354 | |
| 2355 | rxq = dev->data->rx_queues[i]; |
| 2356 | |
| 2357 | rxq->flags = 0; |
| 2358 | /* |
| 2359 | * i350 and i354 vlan packets have vlan tags byte swapped. |
| 2360 | */ |
no test coverage detected