On Tue, Mar 13, 2018 at 02:54:44PM -0700, Yongseok Koh wrote: > On Mon, Mar 12, 2018 at 02:43:18PM +0100, Nelio Laranjeiro wrote: > > This behavior is mixed between what should be handled by the application > > and what is under PMD responsibility. > > > > According to DPDK API: > > - link_update() should only query the link status [1] > > - link_set_{up,down}() should only set the link to the according status [1] > > - dev_{start,stop}() should enable/disable traffic reception/emission [2] > > The description of rte_eth_dev_set_link_up() is [1] : > The device rx/tx functionality will be disabled if success, and it can > be re-enabled with a call to rte_eth_dev_set_link_up() > > This means, if user runs "set link-down port 0" on testpmd, traffic should > stop > by disabling Rx/Tx on device. But unfortunately, mlx5 doesn't have a way to > stop > device but it rather relies on kernel implementation - e.g. SIOCSIFFLAGS. So, > even if the command is run, traffic goes on. I guess the original > implementation might be needed to workaround this situation.
As you mention the traffic is not disabled on the hardware, which also means that replacing the burst functions does not solve anything, it just moves the issue. The fact is, the queues can still send/receive traffic even if the link is down. Not polling them won't solve the fact that Rx queues will still receive traffic addressed to the application. Considering an application should not try to send nor poll traffic once it has set the link down and this, until it sets the link up, the behavior is identical to the "original" code i.e. at the first poll, the application will receive enqueued packets in the Rx queues while the link was down. > Shall we talk to HW and driver people regarding how to access dev (or PHY) > from > user-level? We can. > [1] > http://dpdk.org/doc/api/rte__ethdev_8h.html#a51d7a0d2bb4202f9ebf9f174ba1f6e5c Regards, -- Nélio Laranjeiro 6WIND