Unverified Commit cafedb29 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 2439120b 21f178e2
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ struct net_dm_hw_entries {
};

struct per_cpu_dm_data {
	spinlock_t		lock;	/* Protects 'skb', 'hw_entries' and
	raw_spinlock_t		lock;	/* Protects 'skb', 'hw_entries' and
					 * 'send_timer'
					 */
	union {
@@ -168,9 +168,9 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data)
err:
	mod_timer(&data->send_timer, jiffies + HZ / 10);
out:
	spin_lock_irqsave(&data->lock, flags);
	raw_spin_lock_irqsave(&data->lock, flags);
	swap(data->skb, skb);
	spin_unlock_irqrestore(&data->lock, flags);
	raw_spin_unlock_irqrestore(&data->lock, flags);

	if (skb) {
		struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
@@ -225,7 +225,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)

	local_irq_save(flags);
	data = this_cpu_ptr(&dm_cpu_data);
	spin_lock(&data->lock);
	raw_spin_lock(&data->lock);
	dskb = data->skb;

	if (!dskb)
@@ -259,7 +259,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
	}

out:
	spin_unlock_irqrestore(&data->lock, flags);
	raw_spin_unlock_irqrestore(&data->lock, flags);
}

static void trace_kfree_skb_hit(void *ignore, struct sk_buff *skb, void *location)
@@ -318,9 +318,9 @@ net_dm_hw_reset_per_cpu_data(struct per_cpu_dm_data *hw_data)
		mod_timer(&hw_data->send_timer, jiffies + HZ / 10);
	}

	spin_lock_irqsave(&hw_data->lock, flags);
	raw_spin_lock_irqsave(&hw_data->lock, flags);
	swap(hw_data->hw_entries, hw_entries);
	spin_unlock_irqrestore(&hw_data->lock, flags);
	raw_spin_unlock_irqrestore(&hw_data->lock, flags);

	return hw_entries;
}
@@ -452,7 +452,7 @@ net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink,
		return;

	hw_data = this_cpu_ptr(&dm_hw_cpu_data);
	spin_lock_irqsave(&hw_data->lock, flags);
	raw_spin_lock_irqsave(&hw_data->lock, flags);
	hw_entries = hw_data->hw_entries;

	if (!hw_entries)
@@ -481,7 +481,7 @@ net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink,
	}

out:
	spin_unlock_irqrestore(&hw_data->lock, flags);
	raw_spin_unlock_irqrestore(&hw_data->lock, flags);
}

static const struct net_dm_alert_ops net_dm_alert_summary_ops = {
@@ -1669,7 +1669,7 @@ static struct notifier_block dropmon_net_notifier = {

static void __net_dm_cpu_data_init(struct per_cpu_dm_data *data)
{
	spin_lock_init(&data->lock);
	raw_spin_lock_init(&data->lock);
	skb_queue_head_init(&data->drop_queue);
	u64_stats_init(&data->stats.syncp);
}