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

Function ngbe_set_rx_mode

dpdk/drivers/net/ngbe/ngbe_pf.c:212–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212static void
213ngbe_set_rx_mode(struct rte_eth_dev *eth_dev)
214{
215 struct rte_eth_dev_data *dev_data = eth_dev->data;
216 struct ngbe_hw *hw = ngbe_dev_hw(eth_dev);
217 u32 fctrl, vmolr;
218 uint16_t vfn = dev_num_vf(eth_dev);
219
220 /* disable store-bad-packets */
221 wr32m(hw, NGBE_SECRXCTL, NGBE_SECRXCTL_SAVEBAD, 0);
222
223 /* Check for Promiscuous and All Multicast modes */
224 fctrl = rd32m(hw, NGBE_PSRCTL,
225 ~(NGBE_PSRCTL_UCP | NGBE_PSRCTL_MCP));
226 fctrl |= NGBE_PSRCTL_BCA |
227 NGBE_PSRCTL_MCHFENA;
228
229 vmolr = rd32m(hw, NGBE_POOLETHCTL(vfn),
230 ~(NGBE_POOLETHCTL_UCP |
231 NGBE_POOLETHCTL_MCP |
232 NGBE_POOLETHCTL_UCHA |
233 NGBE_POOLETHCTL_MCHA));
234 vmolr |= NGBE_POOLETHCTL_BCA |
235 NGBE_POOLETHCTL_UTA |
236 NGBE_POOLETHCTL_VLA;
237
238 if (dev_data->promiscuous) {
239 fctrl |= NGBE_PSRCTL_UCP |
240 NGBE_PSRCTL_MCP;
241 /* pf don't want packets routing to vf, so clear UPE */
242 vmolr |= NGBE_POOLETHCTL_MCP;
243 } else if (dev_data->all_multicast) {
244 fctrl |= NGBE_PSRCTL_MCP;
245 vmolr |= NGBE_POOLETHCTL_MCP;
246 } else {
247 vmolr |= NGBE_POOLETHCTL_UCHA;
248 vmolr |= NGBE_POOLETHCTL_MCHA;
249 }
250
251 wr32(hw, NGBE_POOLETHCTL(vfn), vmolr);
252
253 wr32(hw, NGBE_PSRCTL, fctrl);
254
255 ngbe_vlan_hw_strip_config(eth_dev);
256}
257
258static inline void
259ngbe_vf_reset_event(struct rte_eth_dev *eth_dev, uint16_t vf)

Callers 1

ngbe_vf_reset_eventFunction · 0.85

Calls 6

ngbe_dev_hwFunction · 0.85
dev_num_vfFunction · 0.70
wr32mFunction · 0.50
rd32mFunction · 0.50
wr32Function · 0.50

Tested by

no test coverage detected