Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when test snull driver, ping remote1 sometimes return 100% packet loss #68

Open
lzq420241 opened this issue Sep 20, 2021 · 4 comments
Open

Comments

@lzq420241
Copy link

lzq420241 commented Sep 20, 2021

This issue occurs in ubuntu 18.04 and 20.04

@lzq420241
Copy link
Author

lzq420241 commented Sep 20, 2021

It turns out that it may not be driver issue.

I used journalctl -f to monitor the snull_load process.
After add printk in snull_rx_ints and snull_hw_tx, I found that
right after sn1 send pkt to remote1, snull_napi_interrupt set sn0's rx_int_enabled to 0, but before the sn0's snull_poll begin to excute, the below log appeared.

NetworkManager[574]: [1632110381.7007] device (sn0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')

NetworkManager[574]: [1632110381.7197] device (sn0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')

NetworkManager seems drop napi_schedule from the execution flow.

Thus sn0's rx_int_enabled has no chance to get update to 1, and sn0's rx is disabled totally.

@lzq420241
Copy link
Author

lzq420241 commented Sep 20, 2021

To verify the above issue, I made sn0, sn1 unmanaged by networkmanager:

append to /etc/NetworkManager/NetworkManager.conf with

[keyfile]
unmanaged-devices=interface-name:sn0,interface-name:sn1

and use service network-manager restart to reload the change.
check with nmcli dev status.

@lzq420241 lzq420241 changed the title when test snull driver, ping remote0 sometimes return 100% packet loss when test snull driver, ping remote1 sometimes return 100% packet loss Sep 20, 2021
@lzq420241
Copy link
Author

lzq420241 commented Sep 22, 2021

Can someone help check below changes:
before:

if (statusword & SNULL_RX_INTR) {
    snull_rx_ints(dev, 0);  /* Disable further interrupts */
    napi_schedule(&priv->napi);
}

after:

if (statusword & SNULL_RX_INTR && napi_schedule_prep(&priv->napi)) {
    snull_rx_ints(dev, 0);  /* Disable further interrupts */
    __napi_schedule(&priv->napi); 
}

seems works with Netmanager enabled.

before you start ping remote1, do ifconfig sn0 local0; ifconfig sn1 local1 again, as netmanager will remove them.

@dwalkes
Copy link
Collaborator

dwalkes commented Nov 7, 2021

Thanks @lzq420241 sorry for the delay. Do you want to submit a pull request for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants