Commit 61ed713b authored by David S. Miller's avatar David S. Miller

Merge branch 'drivers_iff_no_queue'

Phil Sutter says:

====================
net: Convert drivers to IFF_NO_QUEUE and cleanup afterwards

This series converts in-tree users away from the old and deprecated
'tx_queue_len = 0' idiom, adds a warning to notify out-of-tree driver
maintainers that there is need for action on their behalf and finally drops any
workarounds in scheduling algorithm implementations.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0b233dc7 348e3435
...@@ -4120,9 +4120,8 @@ void bond_setup(struct net_device *bond_dev) ...@@ -4120,9 +4120,8 @@ void bond_setup(struct net_device *bond_dev)
SET_NETDEV_DEVTYPE(bond_dev, &bond_type); SET_NETDEV_DEVTYPE(bond_dev, &bond_type);
/* Initialize the device options */ /* Initialize the device options */
bond_dev->tx_queue_len = 0;
bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT; bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_NO_QUEUE;
bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
/* don't acquire bond device's netif_tx_lock when transmitting */ /* don't acquire bond device's netif_tx_lock when transmitting */
......
...@@ -1120,7 +1120,7 @@ static void cfhsi_setup(struct net_device *dev) ...@@ -1120,7 +1120,7 @@ static void cfhsi_setup(struct net_device *dev)
dev->type = ARPHRD_CAIF; dev->type = ARPHRD_CAIF;
dev->flags = IFF_POINTOPOINT | IFF_NOARP; dev->flags = IFF_POINTOPOINT | IFF_NOARP;
dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ; dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->destructor = free_netdev; dev->destructor = free_netdev;
dev->netdev_ops = &cfhsi_netdevops; dev->netdev_ops = &cfhsi_netdevops;
for (i = 0; i < CFHSI_PRIO_LAST; ++i) for (i = 0; i < CFHSI_PRIO_LAST; ++i)
......
...@@ -427,7 +427,7 @@ static void caifdev_setup(struct net_device *dev) ...@@ -427,7 +427,7 @@ static void caifdev_setup(struct net_device *dev)
dev->type = ARPHRD_CAIF; dev->type = ARPHRD_CAIF;
dev->flags = IFF_POINTOPOINT | IFF_NOARP; dev->flags = IFF_POINTOPOINT | IFF_NOARP;
dev->mtu = CAIF_MAX_MTU; dev->mtu = CAIF_MAX_MTU;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->destructor = free_netdev; dev->destructor = free_netdev;
skb_queue_head_init(&serdev->head); skb_queue_head_init(&serdev->head);
serdev->common.link_select = CAIF_LINK_LOW_LATENCY; serdev->common.link_select = CAIF_LINK_LOW_LATENCY;
......
...@@ -710,7 +710,7 @@ static void cfspi_setup(struct net_device *dev) ...@@ -710,7 +710,7 @@ static void cfspi_setup(struct net_device *dev)
dev->netdev_ops = &cfspi_ops; dev->netdev_ops = &cfspi_ops;
dev->type = ARPHRD_CAIF; dev->type = ARPHRD_CAIF;
dev->flags = IFF_NOARP | IFF_POINTOPOINT; dev->flags = IFF_NOARP | IFF_POINTOPOINT;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->mtu = SPI_MAX_PAYLOAD_SIZE; dev->mtu = SPI_MAX_PAYLOAD_SIZE;
dev->destructor = free_netdev; dev->destructor = free_netdev;
skb_queue_head_init(&cfspi->qhead); skb_queue_head_init(&cfspi->qhead);
......
...@@ -144,10 +144,9 @@ static void dummy_setup(struct net_device *dev) ...@@ -144,10 +144,9 @@ static void dummy_setup(struct net_device *dev)
dev->destructor = free_netdev; dev->destructor = free_netdev;
/* Fill in device structure with ethernet-generic values. */ /* Fill in device structure with ethernet-generic values. */
dev->tx_queue_len = 0;
dev->flags |= IFF_NOARP; dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST; dev->flags &= ~IFF_MULTICAST;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO; dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO;
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
eth_hw_addr_random(dev); eth_hw_addr_random(dev);
......
...@@ -283,7 +283,6 @@ static void geneve_setup(struct net_device *dev) ...@@ -283,7 +283,6 @@ static void geneve_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &geneve_type); SET_NETDEV_DEVTYPE(dev, &geneve_type);
dev->tx_queue_len = 0;
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->features |= NETIF_F_RXCSUM; dev->features |= NETIF_F_RXCSUM;
...@@ -297,7 +296,7 @@ static void geneve_setup(struct net_device *dev) ...@@ -297,7 +296,7 @@ static void geneve_setup(struct net_device *dev)
dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
netif_keep_dst(dev); netif_keep_dst(dev);
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
} }
static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = { static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = {
......
...@@ -520,12 +520,11 @@ static void ipvlan_link_setup(struct net_device *dev) ...@@ -520,12 +520,11 @@ static void ipvlan_link_setup(struct net_device *dev)
ether_setup(dev); ether_setup(dev);
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
dev->priv_flags |= IFF_UNICAST_FLT; dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
dev->netdev_ops = &ipvlan_netdev_ops; dev->netdev_ops = &ipvlan_netdev_ops;
dev->destructor = free_netdev; dev->destructor = free_netdev;
dev->header_ops = &ipvlan_header_ops; dev->header_ops = &ipvlan_header_ops;
dev->ethtool_ops = &ipvlan_ethtool_ops; dev->ethtool_ops = &ipvlan_ethtool_ops;
dev->tx_queue_len = 0;
} }
static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] = static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] =
......
...@@ -165,10 +165,9 @@ static void loopback_setup(struct net_device *dev) ...@@ -165,10 +165,9 @@ static void loopback_setup(struct net_device *dev)
dev->mtu = 64 * 1024; dev->mtu = 64 * 1024;
dev->hard_header_len = ETH_HLEN; /* 14 */ dev->hard_header_len = ETH_HLEN; /* 14 */
dev->addr_len = ETH_ALEN; /* 6 */ dev->addr_len = ETH_ALEN; /* 6 */
dev->tx_queue_len = 0;
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK; dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
netif_keep_dst(dev); netif_keep_dst(dev);
dev->hw_features = NETIF_F_ALL_TSO | NETIF_F_UFO; dev->hw_features = NETIF_F_ALL_TSO | NETIF_F_UFO;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
......
...@@ -130,7 +130,7 @@ static const struct net_device_ops nlmon_ops = { ...@@ -130,7 +130,7 @@ static const struct net_device_ops nlmon_ops = {
static void nlmon_setup(struct net_device *dev) static void nlmon_setup(struct net_device *dev)
{ {
dev->type = ARPHRD_NETLINK; dev->type = ARPHRD_NETLINK;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->netdev_ops = &nlmon_ops; dev->netdev_ops = &nlmon_ops;
dev->ethtool_ops = &nlmon_ethtool_ops; dev->ethtool_ops = &nlmon_ethtool_ops;
......
...@@ -2051,9 +2051,9 @@ static void team_setup(struct net_device *dev) ...@@ -2051,9 +2051,9 @@ static void team_setup(struct net_device *dev)
dev->netdev_ops = &team_netdev_ops; dev->netdev_ops = &team_netdev_ops;
dev->ethtool_ops = &team_ethtool_ops; dev->ethtool_ops = &team_ethtool_ops;
dev->destructor = team_destructor; dev->destructor = team_destructor;
dev->tx_queue_len = 0;
dev->flags |= IFF_MULTICAST; dev->flags |= IFF_MULTICAST;
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
dev->priv_flags |= IFF_NO_QUEUE;
/* /*
* Indicate we support unicast address filtering. That way core won't * Indicate we support unicast address filtering. That way core won't
......
...@@ -306,6 +306,7 @@ static void veth_setup(struct net_device *dev) ...@@ -306,6 +306,7 @@ static void veth_setup(struct net_device *dev)
dev->priv_flags &= ~IFF_TX_SKB_SHARING; dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_NO_QUEUE;
dev->netdev_ops = &veth_netdev_ops; dev->netdev_ops = &veth_netdev_ops;
dev->ethtool_ops = &veth_ethtool_ops; dev->ethtool_ops = &veth_ethtool_ops;
......
...@@ -2416,7 +2416,6 @@ static void vxlan_setup(struct net_device *dev) ...@@ -2416,7 +2416,6 @@ static void vxlan_setup(struct net_device *dev)
dev->destructor = free_netdev; dev->destructor = free_netdev;
SET_NETDEV_DEVTYPE(dev, &vxlan_type); SET_NETDEV_DEVTYPE(dev, &vxlan_type);
dev->tx_queue_len = 0;
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->features |= NETIF_F_RXCSUM; dev->features |= NETIF_F_RXCSUM;
...@@ -2428,7 +2427,7 @@ static void vxlan_setup(struct net_device *dev) ...@@ -2428,7 +2427,7 @@ static void vxlan_setup(struct net_device *dev)
dev->hw_features |= NETIF_F_GSO_SOFTWARE; dev->hw_features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
netif_keep_dst(dev); netif_keep_dst(dev);
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
INIT_LIST_HEAD(&vxlan->next); INIT_LIST_HEAD(&vxlan->next);
spin_lock_init(&vxlan->hash_lock); spin_lock_init(&vxlan->hash_lock);
......
...@@ -1096,7 +1096,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) ...@@ -1096,7 +1096,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
} }
dev->netdev_ops = &pvc_ops; dev->netdev_ops = &pvc_ops;
dev->mtu = HDLC_MAX_MTU; dev->mtu = HDLC_MAX_MTU;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->ml_priv = pvc; dev->ml_priv = pvc;
if (register_netdevice(dev) != 0) { if (register_netdevice(dev) != 0) {
......
...@@ -865,7 +865,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local, ...@@ -865,7 +865,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
switch(type) { switch(type) {
case HOSTAP_INTERFACE_AP: case HOSTAP_INTERFACE_AP:
dev->tx_queue_len = 0; /* use main radio device queue */ dev->priv_flags |= IFF_NO_QUEUE; /* use main radio device queue */
dev->netdev_ops = &hostap_mgmt_netdev_ops; dev->netdev_ops = &hostap_mgmt_netdev_ops;
dev->type = ARPHRD_IEEE80211; dev->type = ARPHRD_IEEE80211;
dev->header_ops = &hostap_80211_ops; dev->header_ops = &hostap_80211_ops;
...@@ -874,7 +874,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local, ...@@ -874,7 +874,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
dev->netdev_ops = &hostap_master_ops; dev->netdev_ops = &hostap_master_ops;
break; break;
default: default:
dev->tx_queue_len = 0; /* use main radio device queue */ dev->priv_flags |= IFF_NO_QUEUE; /* use main radio device queue */
dev->netdev_ops = &hostap_netdev_ops; dev->netdev_ops = &hostap_netdev_ops;
} }
......
...@@ -2677,7 +2677,7 @@ static void hwsim_mon_setup(struct net_device *dev) ...@@ -2677,7 +2677,7 @@ static void hwsim_mon_setup(struct net_device *dev)
dev->netdev_ops = &hwsim_netdev_ops; dev->netdev_ops = &hwsim_netdev_ops;
dev->destructor = free_netdev; dev->destructor = free_netdev;
ether_setup(dev); ether_setup(dev);
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->type = ARPHRD_IEEE80211_RADIOTAP; dev->type = ARPHRD_IEEE80211_RADIOTAP;
eth_zero_addr(dev->dev_addr); eth_zero_addr(dev->dev_addr);
dev->dev_addr[0] = 0x12; dev->dev_addr[0] = 0x12;
......
...@@ -493,7 +493,7 @@ static void WILC_WFI_mon_setup(struct net_device *dev) ...@@ -493,7 +493,7 @@ static void WILC_WFI_mon_setup(struct net_device *dev)
/* dev->destructor = free_netdev; */ /* dev->destructor = free_netdev; */
PRINT_INFO(CORECONFIG_DBG, "In Ethernet setup function\n"); PRINT_INFO(CORECONFIG_DBG, "In Ethernet setup function\n");
ether_setup(dev); ether_setup(dev);
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->type = ARPHRD_IEEE80211_RADIOTAP; dev->type = ARPHRD_IEEE80211_RADIOTAP;
memset(dev->dev_addr, 0, ETH_ALEN); memset(dev->dev_addr, 0, ETH_ALEN);
......
...@@ -791,10 +791,9 @@ void vlan_setup(struct net_device *dev) ...@@ -791,10 +791,9 @@ void vlan_setup(struct net_device *dev)
{ {
ether_setup(dev); ether_setup(dev);
dev->priv_flags |= IFF_802_1Q_VLAN; dev->priv_flags |= IFF_802_1Q_VLAN | IFF_NO_QUEUE;
dev->priv_flags &= ~IFF_TX_SKB_SHARING; dev->priv_flags &= ~IFF_TX_SKB_SHARING;
netif_keep_dst(dev); netif_keep_dst(dev);
dev->tx_queue_len = 0;
dev->netdev_ops = &vlan_netdev_ops; dev->netdev_ops = &vlan_netdev_ops;
dev->destructor = vlan_dev_free; dev->destructor = vlan_dev_free;
......
...@@ -941,7 +941,7 @@ static void batadv_softif_init_early(struct net_device *dev) ...@@ -941,7 +941,7 @@ static void batadv_softif_init_early(struct net_device *dev)
dev->netdev_ops = &batadv_netdev_ops; dev->netdev_ops = &batadv_netdev_ops;
dev->destructor = batadv_softif_free; dev->destructor = batadv_softif_free;
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
/* can't call min_mtu, because the needed variables /* can't call min_mtu, because the needed variables
* have not been initialized yet * have not been initialized yet
......
...@@ -365,8 +365,7 @@ void br_dev_setup(struct net_device *dev) ...@@ -365,8 +365,7 @@ void br_dev_setup(struct net_device *dev)
dev->destructor = br_dev_free; dev->destructor = br_dev_free;
dev->ethtool_ops = &br_ethtool_ops; dev->ethtool_ops = &br_ethtool_ops;
SET_NETDEV_DEVTYPE(dev, &br_type); SET_NETDEV_DEVTYPE(dev, &br_type);
dev->tx_queue_len = 0; dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE;
dev->priv_flags = IFF_EBRIDGE;
dev->features = COMMON_FEATURES | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL | dev->features = COMMON_FEATURES | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
......
...@@ -177,7 +177,7 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt) ...@@ -177,7 +177,7 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt)
skb->protocol = htons(ETH_P_CAIF); skb->protocol = htons(ETH_P_CAIF);
/* Check if we need to handle xoff */ /* Check if we need to handle xoff */
if (likely(caifd->netdev->tx_queue_len == 0)) if (likely(caifd->netdev->priv_flags & IFF_NO_QUEUE))
goto noxoff; goto noxoff;
if (unlikely(caifd->xoff)) if (unlikely(caifd->xoff))
......
...@@ -6997,6 +6997,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, ...@@ -6997,6 +6997,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM;
setup(dev); setup(dev);
if (!dev->tx_queue_len)
printk(KERN_WARNING "%s uses DEPRECATED zero tx_queue_len - convert driver to use IFF_NO_QUEUE instead.\n", name);
dev->num_tx_queues = txqs; dev->num_tx_queues = txqs;
dev->real_num_tx_queues = txqs; dev->real_num_tx_queues = txqs;
if (netif_alloc_netdev_queues(dev)) if (netif_alloc_netdev_queues(dev))
......
...@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, ...@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
slave_dev->features = master->vlan_features; slave_dev->features = master->vlan_features;
slave_dev->ethtool_ops = &dsa_slave_ethtool_ops; slave_dev->ethtool_ops = &dsa_slave_ethtool_ops;
eth_hw_addr_inherit(slave_dev, master); eth_hw_addr_inherit(slave_dev, master);
slave_dev->tx_queue_len = 0; slave_dev->priv_flags |= IFF_NO_QUEUE;
slave_dev->netdev_ops = &dsa_slave_netdev_ops; slave_dev->netdev_ops = &dsa_slave_netdev_ops;
slave_dev->switchdev_ops = &dsa_slave_switchdev_ops; slave_dev->switchdev_ops = &dsa_slave_switchdev_ops;
......
...@@ -392,7 +392,7 @@ void hsr_dev_setup(struct net_device *dev) ...@@ -392,7 +392,7 @@ void hsr_dev_setup(struct net_device *dev)
dev->header_ops = &hsr_header_ops; dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops; dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type); SET_NETDEV_DEVTYPE(dev, &hsr_type);
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->destructor = hsr_dev_destroy; dev->destructor = hsr_dev_destroy;
......
...@@ -90,7 +90,7 @@ static void lowpan_setup(struct net_device *dev) ...@@ -90,7 +90,7 @@ static void lowpan_setup(struct net_device *dev)
dev->hard_header_len = 2 + 1 + 20 + 14; dev->hard_header_len = 2 + 1 + 20 + 14;
dev->needed_tailroom = 2; /* FCS */ dev->needed_tailroom = 2; /* FCS */
dev->mtu = IPV6_MIN_MTU; dev->mtu = IPV6_MIN_MTU;
dev->tx_queue_len = 0; dev->priv_flags |= IFF_NO_QUEUE;
dev->flags = IFF_BROADCAST | IFF_MULTICAST; dev->flags = IFF_BROADCAST | IFF_MULTICAST;
dev->watchdog_timeo = 0; dev->watchdog_timeo = 0;
......
...@@ -54,7 +54,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -54,7 +54,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
bool is_bfifo = sch->ops == &bfifo_qdisc_ops; bool is_bfifo = sch->ops == &bfifo_qdisc_ops;
if (opt == NULL) { if (opt == NULL) {
u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1; u32 limit = qdisc_dev(sch)->tx_queue_len;
if (is_bfifo) if (is_bfifo)
limit *= psched_mtu(qdisc_dev(sch)); limit *= psched_mtu(qdisc_dev(sch));
......
...@@ -512,11 +512,9 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -512,11 +512,9 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_GRED_LIMIT]) if (tb[TCA_GRED_LIMIT])
sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]); sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]);
else { else
u32 qlen = qdisc_dev(sch)->tx_queue_len ? : 1; sch->limit = qdisc_dev(sch)->tx_queue_len
* psched_mtu(qdisc_dev(sch));
sch->limit = qlen * psched_mtu(qdisc_dev(sch));
}
return gred_change_table_def(sch, tb[TCA_GRED_DPS]); return gred_change_table_def(sch, tb[TCA_GRED_DPS]);
} }
......
...@@ -1048,11 +1048,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -1048,11 +1048,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_HTB_DIRECT_QLEN]) if (tb[TCA_HTB_DIRECT_QLEN])
q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]); q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
else { else
q->direct_qlen = qdisc_dev(sch)->tx_queue_len; q->direct_qlen = qdisc_dev(sch)->tx_queue_len;
if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */
q->direct_qlen = 2;
}
if ((q->rate2quantum = gopt->rate2quantum) < 1) if ((q->rate2quantum = gopt->rate2quantum) < 1)
q->rate2quantum = 1; q->rate2quantum = 1;
q->defcls = gopt->defcls; q->defcls = gopt->defcls;
......
...@@ -130,12 +130,8 @@ static int plug_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -130,12 +130,8 @@ static int plug_init(struct Qdisc *sch, struct nlattr *opt)
q->unplug_indefinite = false; q->unplug_indefinite = false;
if (opt == NULL) { if (opt == NULL) {
/* We will set a default limit of 100 pkts (~150kB) q->limit = qdisc_dev(sch)->tx_queue_len
* in case tx_queue_len is not available. The * psched_mtu(qdisc_dev(sch));
* default value is completely arbitrary.
*/
u32 pkt_limit = qdisc_dev(sch)->tx_queue_len ? : 100;
q->limit = pkt_limit * psched_mtu(qdisc_dev(sch));
} else { } else {
struct tc_plug_qopt *ctl = nla_data(opt); struct tc_plug_qopt *ctl = nla_data(opt);
......
...@@ -502,7 +502,7 @@ static int sfb_change(struct Qdisc *sch, struct nlattr *opt) ...@@ -502,7 +502,7 @@ static int sfb_change(struct Qdisc *sch, struct nlattr *opt)
limit = ctl->limit; limit = ctl->limit;
if (limit == 0) if (limit == 0)
limit = max_t(u32, qdisc_dev(sch)->tx_queue_len, 1); limit = qdisc_dev(sch)->tx_queue_len;
child = fifo_create_dflt(sch, &pfifo_qdisc_ops, limit); child = fifo_create_dflt(sch, &pfifo_qdisc_ops, limit);
if (IS_ERR(child)) if (IS_ERR(child))
......
Markdown is supported
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