search for: netif_running

Displaying 20 results from an estimated 237 matches for "netif_running".

2018 Feb 28
3
[PATCH net] virtio-net: disable NAPI only when enabled during XDP set
We try to disable NAPI to prevent a single XDP TX queue being used by multiple cpus. But we don't check if device is up (NAPI is enabled), this could result stall because of infinite wait in napi_disable(). Fixing this by checking device state through netif_running() before. Fixes: 4941d472bf95b ("virtio-net: do not reset during XDP set") Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net....
2018 Feb 28
3
[PATCH net] virtio-net: disable NAPI only when enabled during XDP set
We try to disable NAPI to prevent a single XDP TX queue being used by multiple cpus. But we don't check if device is up (NAPI is enabled), this could result stall because of infinite wait in napi_disable(). Fixing this by checking device state through netif_running() before. Fixes: 4941d472bf95b ("virtio-net: do not reset during XDP set") Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net....
2013 Aug 26
0
[PATCH] bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones
...t) || br_multicast_is_router(br)) skb2 = skb; diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 0daae3e..6053b96 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -414,16 +414,20 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) if (!netif_running(br->dev) || br->multicast_disabled) return -EINVAL; - if (timer_pending(&br->multicast_querier_timer)) - return -EBUSY; - ip.proto = entry->addr.proto; - if (ip.proto == htons(ETH_P_IP)) + if (ip.proto == htons(ETH_P_IP)) { + if (timer_pending(&br->ip4_multicast_quer...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
...t_info *vi = + container_of(work, struct virtnet_info, reset_task); + struct net_device *dev = vi->dev; + struct virtio_device *vdev = vi->vdev; + int err, i; + + flush_work(&vi->config_work); + + netif_device_detach(vi->dev); + cancel_delayed_work_sync(&vi->refill); + + if (netif_running(vi->dev)) { + for (i = 0; i < vi->max_queue_pairs; i++) { + napi_disable(&vi->rq[i].napi); + napi_hash_del(&vi->rq[i].napi); + netif_napi_del(&vi->rq[i].napi); + } + } + + remove_vq_common(vi); + + dev->stats.tx_errors++; + + err = init_vqs(vi); + if (err) {...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
...t_info *vi = + container_of(work, struct virtnet_info, reset_task); + struct net_device *dev = vi->dev; + struct virtio_device *vdev = vi->vdev; + int err, i; + + flush_work(&vi->config_work); + + netif_device_detach(vi->dev); + cancel_delayed_work_sync(&vi->refill); + + if (netif_running(vi->dev)) { + for (i = 0; i < vi->max_queue_pairs; i++) { + napi_disable(&vi->rq[i].napi); + napi_hash_del(&vi->rq[i].napi); + netif_napi_del(&vi->rq[i].napi); + } + } + + remove_vq_common(vi); + + dev->stats.tx_errors++; + + err = init_vqs(vi); + if (err) {...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...gt; + struct virtio_device *vdev = vi->vdev; > > + int err, i; > > + > > + flush_work(&vi->config_work); > > + > > + netif_device_detach(vi->dev); > > + cancel_delayed_work_sync(&vi->refill); > > + > > + if (netif_running(vi->dev)) { > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > + napi_disable(&vi->rq[i].napi); > > + napi_hash_del(&vi->rq[i].napi); > > + netif_napi_del(&vi->rq[i].napi...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...gt; + struct virtio_device *vdev = vi->vdev; > > + int err, i; > > + > > + flush_work(&vi->config_work); > > + > > + netif_device_detach(vi->dev); > > + cancel_delayed_work_sync(&vi->refill); > > + > > + if (netif_running(vi->dev)) { > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > + napi_disable(&vi->rq[i].napi); > > + napi_hash_del(&vi->rq[i].napi); > > + netif_napi_del(&vi->rq[i].napi...
2018 Oct 12
0
[PATCH] virtio_net: enable tx after resuming from suspend
...If I am to do more >>> investigation, what areas should I look into? >> As you've figured out, you can start with why netif_tx_wake_all_queues() >> were not executed? >> >> (Btw, does the issue disappear if you move netif_tx_disable() under the >> check of netif_running() in virtnet_freeze_down()?) > The issue disappears if I move netif_tx_disable() under the check of > netif_running() in virtnet_freeze_down(). Moving netif_tx_disable() > is probably better as its logic is consistent with > netif_device_attach() implementation. If you are OK with this...
2018 Jan 23
2
[RFC PATCH net-next v2 2/2] virtio_net: Extend virtio to use VF datapath when available
...(dev, qnum); > bool kick = !skb->xmit_more; > bool use_napi = sq->napi.weight; > > + /* If VF is present and up then redirect packets > + * called with rcu_read_lock_bh > + */ > + vf_netdev = rcu_dereference_bh(vi->vf_netdev); > + if (vf_netdev && netif_running(vf_netdev) && > + !netpoll_tx_running(dev) && > + is_unicast_ether_addr(eth_hdr(skb)->h_dest)) > + return virtnet_vf_xmit(dev, vf_netdev, skb); > + A question here. If I read the code correctly, all features were validated against virtio instead VF before...
2018 Jan 23
2
[RFC PATCH net-next v2 2/2] virtio_net: Extend virtio to use VF datapath when available
...(dev, qnum); > bool kick = !skb->xmit_more; > bool use_napi = sq->napi.weight; > > + /* If VF is present and up then redirect packets > + * called with rcu_read_lock_bh > + */ > + vf_netdev = rcu_dereference_bh(vi->vf_netdev); > + if (vf_netdev && netif_running(vf_netdev) && > + !netpoll_tx_running(dev) && > + is_unicast_ether_addr(eth_hdr(skb)->h_dest)) > + return virtnet_vf_xmit(dev, vf_netdev, skb); > + A question here. If I read the code correctly, all features were validated against virtio instead VF before...
2014 Aug 27
2
[PATCH 1/1] add selftest for virtio-net
...+ memcpy(buf, &virtnet_gstrings_test, + sizeof(virtnet_gstrings_test)); + break; + default: + break; + } +} + +static void virtnet_self_test(struct net_device *netdev, + struct ethtool_test *eth_test, u64 *data) +{ + struct virtnet_info *vi = netdev_priv(netdev); + bool if_running = netif_running(netdev); + + set_bit(__VIRTNET_TESTING, &vi->flags); + memset(data, 0, sizeof(u64) * VIRTNET_NUM_TEST); + + if (eth_test->flags == ETH_TEST_FL_OFFLINE) { + if (!if_running) { + dev_warn(&vi->dev->dev, "Failed to execute self test.\n"); + eth_test->flags |= ETH_...
2014 Aug 27
2
[PATCH 1/1] add selftest for virtio-net
...+ memcpy(buf, &virtnet_gstrings_test, + sizeof(virtnet_gstrings_test)); + break; + default: + break; + } +} + +static void virtnet_self_test(struct net_device *netdev, + struct ethtool_test *eth_test, u64 *data) +{ + struct virtnet_info *vi = netdev_priv(netdev); + bool if_running = netif_running(netdev); + + set_bit(__VIRTNET_TESTING, &vi->flags); + memset(data, 0, sizeof(u64) * VIRTNET_NUM_TEST); + + if (eth_test->flags == ETH_TEST_FL_OFFLINE) { + if (!if_running) { + dev_warn(&vi->dev->dev, "Failed to execute self test.\n"); + eth_test->flags |= ETH_...
2018 Oct 09
2
[PATCH net-next V3] virtio_net: ethtool tx napi configuration
...turn 0; } +static int virtnet_set_coalesce(struct net_device *dev, + struct ethtool_coalesce *ec) +{ + struct ethtool_coalesce ec_default = { + .cmd = ETHTOOL_SCOALESCE, + .rx_max_coalesced_frames = 1, + }; + struct virtnet_info *vi = netdev_priv(dev); + int i, napi_weight; + bool running = netif_running(dev); + + if (ec->tx_max_coalesced_frames > 1) + return -EINVAL; + + ec_default.tx_max_coalesced_frames = ec->tx_max_coalesced_frames; + napi_weight = ec->tx_max_coalesced_frames ? NAPI_POLL_WEIGHT : 0; + + /* disallow changes to fields not explicitly tested above */ + if (memcmp(ec, &...
2018 Oct 09
2
[PATCH net-next V3] virtio_net: ethtool tx napi configuration
...turn 0; } +static int virtnet_set_coalesce(struct net_device *dev, + struct ethtool_coalesce *ec) +{ + struct ethtool_coalesce ec_default = { + .cmd = ETHTOOL_SCOALESCE, + .rx_max_coalesced_frames = 1, + }; + struct virtnet_info *vi = netdev_priv(dev); + int i, napi_weight; + bool running = netif_running(dev); + + if (ec->tx_max_coalesced_frames > 1) + return -EINVAL; + + ec_default.tx_max_coalesced_frames = ec->tx_max_coalesced_frames; + napi_weight = ec->tx_max_coalesced_frames ? NAPI_POLL_WEIGHT : 0; + + /* disallow changes to fields not explicitly tested above */ + if (memcmp(ec, &...
2012 Jun 29
5
[patch net-next v2 0/4] net: introduce and use IFF_LIFE_ADDR_CHANGE
three drivers updated, but this can be used in many others. v1->v2: %s/LIFE/LIVE Jiri Pirko (4): net: introduce new priv_flag indicating iface capable of change mac when running virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag team: use IFF_LIVE_ADDR_CHANGE priv_flag dummy: use IFF_LIVE_ADDR_CHANGE priv_flag drivers/net/dummy.c | 15 ++------------- drivers/net/team/team.c
2012 Jun 29
5
[patch net-next v2 0/4] net: introduce and use IFF_LIFE_ADDR_CHANGE
three drivers updated, but this can be used in many others. v1->v2: %s/LIFE/LIVE Jiri Pirko (4): net: introduce new priv_flag indicating iface capable of change mac when running virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag team: use IFF_LIVE_ADDR_CHANGE priv_flag dummy: use IFF_LIVE_ADDR_CHANGE priv_flag drivers/net/dummy.c | 15 ++------------- drivers/net/team/team.c
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
...*dev) for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } return 0; @@ -1803,7 +1809,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } } } -- 2.13.0.rc0.306.g87b477812d-goog
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
...*dev) for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } return 0; @@ -1803,7 +1809,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev) if (netif_running(vi->dev)) { for (i = 0; i < vi->max_queue_pairs; i++) { napi_disable(&vi->rq[i].napi); - napi_disable(&vi->sq[i].napi); + virtnet_napi_tx_disable(&vi->sq[i].napi); } } } -- 2.13.0.rc0.306.g87b477812d-goog
2015 Jul 02
1
[RFC] virtio_net: Adding tx_timeout function.
...t err, i; > > > > + > > > > + flush_work(&vi->config_work); > > > > + > > > > + netif_device_detach(vi->dev); > > > > + cancel_delayed_work_sync(&vi->refill); > > > > + > > > > + if (netif_running(vi->dev)) { > > > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > > > + napi_disable(&vi->rq[i].napi); > > > > + napi_hash_del(&vi->rq[i].napi); > > > > +...
2015 Jul 02
1
[RFC] virtio_net: Adding tx_timeout function.
...t err, i; > > > > + > > > > + flush_work(&vi->config_work); > > > > + > > > > + netif_device_detach(vi->dev); > > > > + cancel_delayed_work_sync(&vi->refill); > > > > + > > > > + if (netif_running(vi->dev)) { > > > > + for (i = 0; i < vi->max_queue_pairs; i++) { > > > > + napi_disable(&vi->rq[i].napi); > > > > + napi_hash_del(&vi->rq[i].napi); > > > > +...