summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hns_enet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_enet.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 672b64606321..fca37e2c7f01 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -305,8 +305,8 @@ int hns_nic_net_xmit_hw(struct net_device *ndev,
struct hns_nic_ring_data *ring_data)
{
struct hns_nic_priv *priv = netdev_priv(ndev);
- struct device *dev = priv->dev;
struct hnae_ring *ring = ring_data->ring;
+ struct device *dev = ring_to_dev(ring);
struct netdev_queue *dev_queue;
struct skb_frag_struct *frag;
int buf_num;
@@ -797,7 +797,6 @@ static void hns_nic_rx_up_pro(struct hns_nic_ring_data *ring_data,
skb->protocol = eth_type_trans(skb, ndev);
(void)napi_gro_receive(&ring_data->napi, skb);
- ndev->last_rx = jiffies;
}
static int hns_desc_unused(struct hnae_ring *ring)
@@ -1203,43 +1202,48 @@ static void hns_set_irq_affinity(struct hns_nic_priv *priv)
struct hns_nic_ring_data *rd;
int i;
int cpu;
- cpumask_t mask;
+ cpumask_var_t mask;
+
+ if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+ return;
/*diffrent irq banlance for 16core and 32core*/
if (h->q_num == num_possible_cpus()) {
for (i = 0; i < h->q_num * 2; i++) {
rd = &priv->ring_data[i];
if (cpu_online(rd->queue_index)) {
- cpumask_clear(&mask);
+ cpumask_clear(mask);
cpu = rd->queue_index;
- cpumask_set_cpu(cpu, &mask);
+ cpumask_set_cpu(cpu, mask);
(void)irq_set_affinity_hint(rd->ring->irq,
- &mask);
+ mask);
}
}
} else {
for (i = 0; i < h->q_num; i++) {
rd = &priv->ring_data[i];
if (cpu_online(rd->queue_index * 2)) {
- cpumask_clear(&mask);
+ cpumask_clear(mask);
cpu = rd->queue_index * 2;
- cpumask_set_cpu(cpu, &mask);
+ cpumask_set_cpu(cpu, mask);
(void)irq_set_affinity_hint(rd->ring->irq,
- &mask);
+ mask);
}
}
for (i = h->q_num; i < h->q_num * 2; i++) {
rd = &priv->ring_data[i];
if (cpu_online(rd->queue_index * 2 + 1)) {
- cpumask_clear(&mask);
+ cpumask_clear(mask);
cpu = rd->queue_index * 2 + 1;
- cpumask_set_cpu(cpu, &mask);
+ cpumask_set_cpu(cpu, mask);
(void)irq_set_affinity_hint(rd->ring->irq,
- &mask);
+ mask);
}
}
}
+
+ free_cpumask_var(mask);
}
static int hns_nic_init_irq(struct hns_nic_priv *priv)
@@ -1625,8 +1629,8 @@ void hns_nic_set_rx_mode(struct net_device *ndev)
netdev_err(ndev, "sync uc address fail\n");
}
-struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
- struct rtnl_link_stats64 *stats)
+static void hns_nic_get_stats64(struct net_device *ndev,
+ struct rtnl_link_stats64 *stats)
{
int idx = 0;
u64 tx_bytes = 0;
@@ -1668,8 +1672,6 @@ struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
stats->tx_window_errors = ndev->stats.tx_window_errors;
stats->rx_compressed = ndev->stats.rx_compressed;
stats->tx_compressed = ndev->stats.tx_compressed;
-
- return stats;
}
static u16