Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1456676 > unrolled thread

[RFC V2 PATCH 23/25] net/netpolicy: optimize for queue pair

Started bykan.liang@intel.com
First post2016-08-04 21:40 +0200
Last post2016-08-04 21:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC V2 PATCH 23/25] net/netpolicy: optimize for queue pair kan.liang@intel.com - 2016-08-04 21:40 +0200

#1456676 — [RFC V2 PATCH 23/25] net/netpolicy: optimize for queue pair

Fromkan.liang@intel.com
Date2016-08-04 21:40 +0200
Subject[RFC V2 PATCH 23/25] net/netpolicy: optimize for queue pair
Message-ID<s2wEN-5rB-5@gated-at.bofh.it>
From: Kan Liang <kan.liang@intel.com>

Some drivers like i40e driver does not support separate Tx and Rx queues
as channels. Using Rx queue to stand for the channels, if queue_pair is
set by driver.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 include/linux/netpolicy.h | 1 +
 net/core/netpolicy.c      | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/netpolicy.h b/include/linux/netpolicy.h
index 00600f8..0eba512 100644
--- a/include/linux/netpolicy.h
+++ b/include/linux/netpolicy.h
@@ -76,6 +76,7 @@ struct netpolicy_info {
 	enum netpolicy_name	cur_policy;
 	unsigned long avail_policy[BITS_TO_LONGS(NET_POLICY_MAX)];
 	bool	has_mix_policy;
+	bool	queue_pair;
 	/* cpu and queue mapping information */
 	struct netpolicy_sys_info	sys_info;
 	/* List of policy objects 0 rx 1 tx */
diff --git a/net/core/netpolicy.c b/net/core/netpolicy.c
index dc1edfc..735405c 100644
--- a/net/core/netpolicy.c
+++ b/net/core/netpolicy.c
@@ -495,6 +495,9 @@ int netpolicy_pick_queue(struct netpolicy_instance *instance, bool is_rx)
 	if (!policy_validate(instance))
 		return -EINVAL;
 
+	if (dev->netpolicy->queue_pair)
+		is_rx = true;
+
 	/* fast path */
 	rcu_read_lock();
 	version = (int *)rcu_dereference(netpolicy_sys_map_version);
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web