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

Function set_rx_mode

dpdk/drivers/net/ixgbe/ixgbe_pf.c:309–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309static void
310set_rx_mode(struct rte_eth_dev *dev)
311{
312 struct rte_eth_dev_data *dev_data = dev->data;
313 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
314 u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE;
315 uint16_t vfn = dev_num_vf(dev);
316
317 /* Check for Promiscuous and All Multicast modes */
318 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
319
320 /* set all bits that we expect to always be set */
321 fctrl &= ~IXGBE_FCTRL_SBP; /* disable store-bad-packets */
322 fctrl |= IXGBE_FCTRL_BAM;
323
324 /* clear the bits we are changing the status of */
325 fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
326
327 if (dev_data->promiscuous) {
328 fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
329 vmolr |= (IXGBE_VMOLR_ROPE | IXGBE_VMOLR_MPE);
330 } else {
331 if (dev_data->all_multicast) {
332 fctrl |= IXGBE_FCTRL_MPE;
333 vmolr |= IXGBE_VMOLR_MPE;
334 } else {
335 vmolr |= IXGBE_VMOLR_ROMPE;
336 }
337 }
338
339 if (hw->mac.type != ixgbe_mac_82598EB) {
340 vmolr |= IXGBE_READ_REG(hw, IXGBE_VMOLR(vfn)) &
341 ~(IXGBE_VMOLR_MPE | IXGBE_VMOLR_ROMPE |
342 IXGBE_VMOLR_ROPE);
343 IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vfn), vmolr);
344 }
345
346 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
347
348 ixgbe_vlan_hw_strip_config(dev);
349}
350
351static inline void
352ixgbe_vf_reset_event(struct rte_eth_dev *dev, uint16_t vf)

Callers 1

ixgbe_vf_reset_eventFunction · 0.70

Calls 2

dev_num_vfFunction · 0.70

Tested by

no test coverage detected