Merge branch 'netif_rx-part3'

Sebastian Andrzej Siewior says:

====================
net: Convert user to netif_rx(), part 3.

This is the third and last batch of converting netif_rx_ni() caller to
netif_rx(). The change making this possible is net-next and
netif_rx_ni() is a wrapper around netif_rx(). This is a clean up in
order to remove netif_rx_ni().

The micrel phy driver is patched twice within this series: the first is
is to replace netif_rx_ni() and second to move netif_rx() outside of the
IRQ-off section. It is probably simpler to keep it within this series.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2022-03-07 11:40:41 +00:00
commit e21af12622
13 changed files with 19 additions and 33 deletions

View file

@ -2034,8 +2034,6 @@ static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,
memset(shhwtstamps, 0, sizeof(*shhwtstamps)); memset(shhwtstamps, 0, sizeof(*shhwtstamps));
shhwtstamps->hwtstamp = ktime_set(rx_ts->seconds, shhwtstamps->hwtstamp = ktime_set(rx_ts->seconds,
rx_ts->nsec); rx_ts->nsec);
netif_rx_ni(skb);
list_del(&rx_ts->list); list_del(&rx_ts->list);
kfree(rx_ts); kfree(rx_ts);
@ -2044,6 +2042,8 @@ static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,
} }
spin_unlock_irqrestore(&ptp_priv->rx_ts_lock, flags); spin_unlock_irqrestore(&ptp_priv->rx_ts_lock, flags);
if (ret)
netif_rx(skb);
return ret; return ret;
} }
@ -2387,7 +2387,7 @@ static bool lan8814_match_skb(struct kszphy_ptp_priv *ptp_priv,
shhwtstamps = skb_hwtstamps(skb); shhwtstamps = skb_hwtstamps(skb);
memset(shhwtstamps, 0, sizeof(*shhwtstamps)); memset(shhwtstamps, 0, sizeof(*shhwtstamps));
shhwtstamps->hwtstamp = ktime_set(rx_ts->seconds, rx_ts->nsec); shhwtstamps->hwtstamp = ktime_set(rx_ts->seconds, rx_ts->nsec);
netif_rx_ni(skb); netif_rx(skb);
} }
return ret; return ret;

View file

@ -1984,7 +1984,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
} else if (!IS_ENABLED(CONFIG_4KSTACKS)) { } else if (!IS_ENABLED(CONFIG_4KSTACKS)) {
tun_rx_batched(tun, tfile, skb, more); tun_rx_batched(tun, tfile, skb, more);
} else { } else {
netif_rx_ni(skb); netif_rx(skb);
} }
rcu_read_unlock(); rcu_read_unlock();

View file

@ -1877,7 +1877,7 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb, __be32 vni)
reply->ip_summed = CHECKSUM_UNNECESSARY; reply->ip_summed = CHECKSUM_UNNECESSARY;
reply->pkt_type = PACKET_HOST; reply->pkt_type = PACKET_HOST;
if (netif_rx_ni(reply) == NET_RX_DROP) { if (netif_rx(reply) == NET_RX_DROP) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
vxlan_vnifilter_count(vxlan, vni, NULL, vxlan_vnifilter_count(vxlan, vni, NULL,
VXLAN_VNI_STATS_RX_DROPS, 0); VXLAN_VNI_STATS_RX_DROPS, 0);
@ -2036,7 +2036,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb, __be32 vni)
if (reply == NULL) if (reply == NULL)
goto out; goto out;
if (netif_rx_ni(reply) == NET_RX_DROP) { if (netif_rx(reply) == NET_RX_DROP) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
vxlan_vnifilter_count(vxlan, vni, NULL, vxlan_vnifilter_count(vxlan, vni, NULL,
VXLAN_VNI_STATS_RX_DROPS, 0); VXLAN_VNI_STATS_RX_DROPS, 0);

View file

@ -166,7 +166,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
ch->logflags = 0; ch->logflags = 0;
priv->stats.rx_packets++; priv->stats.rx_packets++;
priv->stats.rx_bytes += skblen; priv->stats.rx_bytes += skblen;
netif_rx_ni(skb); netif_rx(skb);
if (len > 0) { if (len > 0) {
skb_pull(pskb, header->length); skb_pull(pskb, header->length);
if (skb_tailroom(pskb) < LL_HEADER_LENGTH) { if (skb_tailroom(pskb) < LL_HEADER_LENGTH) {

View file

@ -620,11 +620,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
pskb->ip_summed = CHECKSUM_UNNECESSARY; pskb->ip_summed = CHECKSUM_UNNECESSARY;
privptr->stats.rx_packets++; privptr->stats.rx_packets++;
privptr->stats.rx_bytes += skb->len; privptr->stats.rx_bytes += skb->len;
/* netif_rx(skb);
* Since receiving is always initiated from a tasklet (in iucv.c),
* we must use netif_rx_ni() instead of netif_rx()
*/
netif_rx_ni(skb);
skb_pull(pskb, header->next); skb_pull(pskb, header->next);
skb_put(pskb, NETIUCV_HDRLEN); skb_put(pskb, NETIUCV_HDRLEN);
} }

View file

@ -78,7 +78,7 @@ static int gdm_lte_rx(struct sk_buff *skb, struct nic *nic, int nic_type)
{ {
int ret; int ret;
ret = netif_rx_ni(skb); ret = netif_rx(skb);
if (ret == NET_RX_DROP) { if (ret == NET_RX_DROP) {
nic->stats.rx_dropped++; nic->stats.rx_dropped++;
} else { } else {

View file

@ -255,7 +255,7 @@ static int p80211_convert_to_ether(struct wlandevice *wlandev,
if (skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0) { if (skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0) {
wlandev->netdev->stats.rx_packets++; wlandev->netdev->stats.rx_packets++;
wlandev->netdev->stats.rx_bytes += skb->len; wlandev->netdev->stats.rx_bytes += skb->len;
netif_rx_ni(skb); netif_rx(skb);
return 0; return 0;
} }
@ -290,7 +290,7 @@ static void p80211netdev_rx_bh(struct tasklet_struct *t)
dev->stats.rx_packets++; dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
netif_rx_ni(skb); netif_rx(skb);
continue; continue;
} else { } else {
if (!p80211_convert_to_ether(wlandev, skb)) if (!p80211_convert_to_ether(wlandev, skb))

View file

@ -3718,16 +3718,6 @@ int do_xdp_generic(struct bpf_prog *xdp_prog, struct sk_buff *skb);
int netif_rx(struct sk_buff *skb); int netif_rx(struct sk_buff *skb);
int __netif_rx(struct sk_buff *skb); int __netif_rx(struct sk_buff *skb);
static inline int netif_rx_ni(struct sk_buff *skb)
{
return netif_rx(skb);
}
static inline int netif_rx_any_context(struct sk_buff *skb)
{
return netif_rx(skb);
}
int netif_receive_skb(struct sk_buff *skb); int netif_receive_skb(struct sk_buff *skb);
int netif_receive_skb_core(struct sk_buff *skb); int netif_receive_skb_core(struct sk_buff *skb);
void netif_receive_skb_list_internal(struct list_head *head); void netif_receive_skb_list_internal(struct list_head *head);

View file

@ -444,7 +444,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, const u8 *mac,
batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,
skb->len + ETH_HLEN); skb->len + ETH_HLEN);
netif_rx_any_context(skb); netif_rx(skb);
out: out:
batadv_hardif_put(primary_if); batadv_hardif_put(primary_if);
} }

View file

@ -240,7 +240,7 @@ static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
if (!skb_cp) if (!skb_cp)
return NET_RX_DROP; return NET_RX_DROP;
return netif_rx_ni(skb_cp); return netif_rx(skb_cp);
} }
static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev, static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev,

View file

@ -400,7 +400,7 @@ static int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
dev->stats.rx_packets++; dev->stats.rx_packets++;
nskb->ip_summed = CHECKSUM_NONE; nskb->ip_summed = CHECKSUM_NONE;
nskb->protocol = eth_type_trans(nskb, dev); nskb->protocol = eth_type_trans(nskb, dev);
netif_rx_ni(nskb); netif_rx(nskb);
return 0; return 0;
badframe: badframe:

View file

@ -146,7 +146,7 @@ EXPORT_SYMBOL(phonet_header_ops);
* Prepends an ISI header and sends a datagram. * Prepends an ISI header and sends a datagram.
*/ */
static int pn_send(struct sk_buff *skb, struct net_device *dev, static int pn_send(struct sk_buff *skb, struct net_device *dev,
u16 dst, u16 src, u8 res, u8 irq) u16 dst, u16 src, u8 res)
{ {
struct phonethdr *ph; struct phonethdr *ph;
int err; int err;
@ -182,7 +182,7 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
if (skb->pkt_type == PACKET_LOOPBACK) { if (skb->pkt_type == PACKET_LOOPBACK) {
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_orphan(skb); skb_orphan(skb);
err = (irq ? netif_rx(skb) : netif_rx_ni(skb)) ? -ENOBUFS : 0; err = netif_rx(skb) ? -ENOBUFS : 0;
} else { } else {
err = dev_hard_header(skb, dev, ntohs(skb->protocol), err = dev_hard_header(skb, dev, ntohs(skb->protocol),
NULL, NULL, skb->len); NULL, NULL, skb->len);
@ -214,7 +214,7 @@ static int pn_raw_send(const void *data, int len, struct net_device *dev,
skb_reserve(skb, MAX_PHONET_HEADER); skb_reserve(skb, MAX_PHONET_HEADER);
__skb_put(skb, len); __skb_put(skb, len);
skb_copy_to_linear_data(skb, data, len); skb_copy_to_linear_data(skb, data, len);
return pn_send(skb, dev, dst, src, res, 1); return pn_send(skb, dev, dst, src, res);
} }
/* /*
@ -269,7 +269,7 @@ int pn_skb_send(struct sock *sk, struct sk_buff *skb,
if (!pn_addr(src)) if (!pn_addr(src))
src = pn_object(saddr, pn_obj(src)); src = pn_object(saddr, pn_obj(src));
err = pn_send(skb, dev, dst, src, res, 0); err = pn_send(skb, dev, dst, src, res);
dev_put(dev); dev_put(dev);
return err; return err;

View file

@ -768,7 +768,7 @@ void tipc_clone_to_loopback(struct net *net, struct sk_buff_head *pkts)
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx_ni(skb); netif_rx(skb);
} }
} }