Commit 047f7ae2 authored by Vikram Narayanan's avatar Vikram Narayanan
Browse files

test_mods/nullnet: Avoid kthread_should_stop for user threads

async_message_send_start() had a check for kthread_should_stop() while
spinning. This check is meaningless and possibly result in null pointer
exception if invoked on user threads. Replace it with a version that
does not do this check for user threads.
parent ad138aae
...@@ -630,7 +630,7 @@ int ndo_init_user(struct net_device *dev, struct trampoline_hidden_args *hidden_ ...@@ -630,7 +630,7 @@ int ndo_init_user(struct net_device *dev, struct trampoline_hidden_args *hidden_
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -722,7 +722,7 @@ void ndo_uninit_user(struct net_device *dev, struct trampoline_hidden_args *hidd ...@@ -722,7 +722,7 @@ void ndo_uninit_user(struct net_device *dev, struct trampoline_hidden_args *hidd
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -848,7 +848,7 @@ int ndo_validate_addr_user(struct net_device *dev, struct trampoline_hidden_args ...@@ -848,7 +848,7 @@ int ndo_validate_addr_user(struct net_device *dev, struct trampoline_hidden_args
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -939,7 +939,7 @@ void ndo_set_rx_mode_user(struct net_device *dev, struct trampoline_hidden_args ...@@ -939,7 +939,7 @@ void ndo_set_rx_mode_user(struct net_device *dev, struct trampoline_hidden_args
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -1043,7 +1043,7 @@ int ndo_set_mac_address_user(struct net_device *dev, void *addr, struct trampoli ...@@ -1043,7 +1043,7 @@ int ndo_set_mac_address_user(struct net_device *dev, void *addr, struct trampoli
lcd_enter(); lcd_enter();
ret = grant_sync_ep(&sync_end, hidden_args->sync_ep); ret = grant_sync_ep(&sync_end, hidden_args->sync_ep);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -1195,7 +1195,7 @@ struct rtnl_link_stats64 *ndo_get_stats64_user(struct net_device *dev, ...@@ -1195,7 +1195,7 @@ struct rtnl_link_stats64 *ndo_get_stats64_user(struct net_device *dev,
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_MSG("failed to get a send slot"); LIBLCD_MSG("failed to get a send slot");
goto fail_async; goto fail_async;
...@@ -1355,7 +1355,7 @@ int ndo_change_carrier_user(struct net_device *dev, bool new_carrier, struct tra ...@@ -1355,7 +1355,7 @@ int ndo_change_carrier_user(struct net_device *dev, bool new_carrier, struct tra
net_dev_container = container_of(dev, struct net_device_container, net_device); net_dev_container = container_of(dev, struct net_device_container, net_device);
ret = async_msg_blocking_send_start(hidden_args->async_chnl, &request); ret = fipc_test_blocking_send_start(hidden_args->async_chnl, &request);
if (ret) { if (ret) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
goto fail_async; goto fail_async;
......
...@@ -145,7 +145,7 @@ int __ndo_start_xmit_inner_async(struct sk_buff *skb, struct net_device *dev, st ...@@ -145,7 +145,7 @@ int __ndo_start_xmit_inner_async(struct sk_buff *skb, struct net_device *dev, st
net_dev_container = container_of(dev, net_dev_container = container_of(dev,
struct net_device_container, net_device); struct net_device_container, net_device);
ret = async_msg_blocking_send_start( ret = fipc_test_blocking_send_start(
async_chnl, &_request); async_chnl, &_request);
if (unlikely(ret)) { if (unlikely(ret)) {
...@@ -286,7 +286,7 @@ int __ndo_start_xmit_bare_fipc_nomarshal(struct sk_buff *skb, struct net_device ...@@ -286,7 +286,7 @@ int __ndo_start_xmit_bare_fipc_nomarshal(struct sk_buff *skb, struct net_device
_TS_START(xmit); _TS_START(xmit);
for (i = 0; i < NUM_TRANSACTIONS; i++) { for (i = 0; i < NUM_TRANSACTIONS; i++) {
#endif #endif
async_msg_blocking_send_start( fipc_test_blocking_send_start(
async_chnl, &_request); async_chnl, &_request);
async_msg_set_fn_type(_request, NDO_START_XMIT); async_msg_set_fn_type(_request, NDO_START_XMIT);
...@@ -376,7 +376,7 @@ int ndo_start_xmit_noasync(struct sk_buff *skb, struct net_device *dev, struct t ...@@ -376,7 +376,7 @@ int ndo_start_xmit_noasync(struct sk_buff *skb, struct net_device *dev, struct t
async_chnl = PTS()->thc_chnl; async_chnl = PTS()->thc_chnl;
async_msg_blocking_send_start( fipc_test_blocking_send_start(
async_chnl, &_request); async_chnl, &_request);
async_msg_set_fn_type(_request, NDO_START_XMIT); async_msg_set_fn_type(_request, NDO_START_XMIT);
...@@ -475,7 +475,7 @@ int ndo_start_xmit_async(struct sk_buff *skb, struct net_device *dev, struct tra ...@@ -475,7 +475,7 @@ int ndo_start_xmit_async(struct sk_buff *skb, struct net_device *dev, struct tra
skb_c->skb = skb; skb_c->skb = skb;
ret = async_msg_blocking_send_start( ret = fipc_test_blocking_send_start(
async_chnl, &_request); async_chnl, &_request);
if (unlikely(ret)) { if (unlikely(ret)) {
LIBLCD_ERR("failed to get a send slot"); LIBLCD_ERR("failed to get a send slot");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment