DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 1/6] ether: enhancement for VMDQ support
Date: Tue,  4 Nov 2014 18:01:24 +0800
Message-ID: <1415095289-28961-2-git-send-email-jing.d.chen@intel.com> (raw)
In-Reply-To: <1415095289-28961-1-git-send-email-jing.d.chen@intel.com>

From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>

The change includes several parts:
1. Clear pool bitmap when trying to remove specific MAC.
2. Define RSS, DCB and VMDQ flags to combine rx_mq_mode.
3. Use 'struct' to replace 'union', which to expand the rx_adv_conf
   arguments to better support RSS, DCB and VMDQ.
4. Fix bug in rte_eth_dev_config_restore function, which will restore
   all MAC address to default pool.
5. Define additional 3 arguments for better VMDQ support.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
 lib/librte_ether/rte_ethdev.c |    6 +++++-
 lib/librte_ether/rte_ethdev.h |   41 ++++++++++++++++++++++++++++++-----------
 2 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ff1c769..5e9d576 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -813,7 +813,8 @@ rte_eth_dev_config_restore(uint8_t port_id)
 			continue;
 
 		/* add address to the hardware */
-		if  (*dev->dev_ops->mac_addr_add)
+		if  (*dev->dev_ops->mac_addr_add &&
+			dev->data->mac_pool_sel[i] & (1ULL << pool))
 			(*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool);
 		else {
 			PMD_DEBUG_TRACE("port %d: MAC address array not supported\n",
@@ -2220,6 +2221,9 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr)
 	/* Update address in NIC data structure */
 	ether_addr_copy(&null_mac_addr, &dev->data->mac_addrs[index]);
 
+	/* reset pool bitmap */
+	dev->data->mac_pool_sel[index] = 0;
+
 	return 0;
 }
 
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8bf274d..7e4c998 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -253,20 +253,36 @@ struct rte_eth_thresh {
 };
 
 /**
+ *  Simple flags are used for rte_eth_conf.rxmode.mq_mode.
+ */
+#define ETH_MQ_RX_RSS_FLAG  0x1
+#define ETH_MQ_RX_DCB_FLAG  0x2
+#define ETH_MQ_RX_VMDQ_FLAG 0x4
+
+/**
  *  A set of values to identify what method is to be used to route
  *  packets to multiple queues.
  */
 enum rte_eth_rx_mq_mode {
-	ETH_MQ_RX_NONE = 0,  /**< None of DCB,RSS or VMDQ mode */
-
-	ETH_MQ_RX_RSS,       /**< For RX side, only RSS is on */
-	ETH_MQ_RX_DCB,       /**< For RX side,only DCB is on. */
-	ETH_MQ_RX_DCB_RSS,   /**< Both DCB and RSS enable */
-
-	ETH_MQ_RX_VMDQ_ONLY, /**< Only VMDQ, no RSS nor DCB */
-	ETH_MQ_RX_VMDQ_RSS,  /**< RSS mode with VMDQ */
-	ETH_MQ_RX_VMDQ_DCB,  /**< Use VMDQ+DCB to route traffic to queues */
-	ETH_MQ_RX_VMDQ_DCB_RSS, /**< Enable both VMDQ and DCB in VMDq */
+	/** None of DCB,RSS or VMDQ mode */
+	ETH_MQ_RX_NONE = 0,
+
+	/** For RX side, only RSS is on */
+	ETH_MQ_RX_RSS = ETH_MQ_RX_RSS_FLAG,
+	/** For RX side,only DCB is on. */
+	ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
+	/** Both DCB and RSS enable */
+	ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
+
+	/** Only VMDQ, no RSS nor DCB */
+	ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
+	/** RSS mode with VMDQ */
+	ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
+	/** Use VMDQ+DCB to route traffic to queues */
+	ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
+	/** Enable both VMDQ and DCB in VMDq */
+	ETH_MQ_RX_VMDQ_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG |
+				 ETH_MQ_RX_VMDQ_FLAG,
 };
 
 /**
@@ -850,7 +866,7 @@ struct rte_eth_conf {
 				 Read the datasheet of given ethernet controller
 				 for details. The possible values of this field
 				 are defined in implementation of each driver. */
-	union {
+	struct {
 		struct rte_eth_rss_conf rss_conf; /**< Port RSS configuration */
 		struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;
 		/**< Port vmdq+dcb configuration. */
@@ -918,6 +934,9 @@ struct rte_eth_dev_info {
 	uint32_t tx_offload_capa; /**< Device TX offload capabilities. */
 	struct rte_eth_rxconf default_rxconf; /**< Default RX configuration */
 	struct rte_eth_txconf default_txconf; /**< Default TX configuration */
+	uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
+	uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
+	uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
 };
 
 /** Maximum name length for extended statistics counters */
-- 
1.7.7.6

  reply	other threads:[~2014-11-04  9:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 13:14 [dpdk-dev] [PATCH 0/6] i40e " Chen Jing D(Mark)
2014-09-23 13:14 ` [dpdk-dev] [PATCH 1/6] ether: enhancement for " Chen Jing D(Mark)
2014-10-14 14:09   ` Thomas Monjalon
2014-10-15  6:59     ` Chen, Jing D
2014-10-15  8:10       ` Thomas Monjalon
2014-10-15  9:47         ` Chen, Jing D
2014-10-15  9:59           ` Thomas Monjalon
2014-10-16 10:07   ` [dpdk-dev] [PATCH v2 0/6] i40e " Chen Jing D(Mark)
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 1/6] ether: enhancement for " Chen Jing D(Mark)
2014-11-03 22:17       ` Thomas Monjalon
2014-11-04  5:50         ` Chen, Jing D
2014-11-04  8:53           ` Thomas Monjalon
2014-11-04  8:59             ` Chen, Jing D
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 2/6] igb: change for VMDQ arguments expansion Chen Jing D(Mark)
2014-11-03 18:37       ` Thomas Monjalon
2014-11-04  5:26         ` Chen, Jing D
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 3/6] ixgbe: " Chen Jing D(Mark)
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 4/6] i40e: add VMDQ support Chen Jing D(Mark)
2014-11-03 18:33       ` Thomas Monjalon
2014-11-04  5:22         ` Chen, Jing D
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 5/6] i40e: macaddr add/del enhancement Chen Jing D(Mark)
2014-10-16 10:07     ` [dpdk-dev] [PATCH v2 6/6] i40e: Add full VMDQ pools support Chen Jing D(Mark)
2014-10-21  3:30     ` [dpdk-dev] [PATCH v2 0/6] i40e VMDQ support Cao, Min
2014-11-03  7:54     ` Chen, Jing D
2014-11-04 10:01   ` [dpdk-dev] [PATCH v3 " Chen Jing D(Mark)
2014-11-04 10:01     ` Chen Jing D(Mark) [this message]
2014-11-04 10:01     ` [dpdk-dev] [PATCH v3 2/6] igb: change for VMDQ arguments expansion Chen Jing D(Mark)
2014-11-04 10:01     ` [dpdk-dev] [PATCH v3 3/6] ixgbe: " Chen Jing D(Mark)
2014-11-04 10:01     ` [dpdk-dev] [PATCH v3 4/6] i40e: add VMDQ support Chen Jing D(Mark)
2014-11-04 10:01     ` [dpdk-dev] [PATCH v3 5/6] i40e: macaddr add/del enhancement Chen Jing D(Mark)
2014-11-04 10:01     ` [dpdk-dev] [PATCH v3 6/6] i40e: Add full VMDQ pools support Chen Jing D(Mark)
2014-11-04 11:19     ` [dpdk-dev] [PATCH v3 0/6] i40e VMDQ support Ananyev, Konstantin
2014-11-04 23:17       ` Thomas Monjalon
2014-12-11  6:09     ` Cao, Min
2014-09-23 13:14 ` [dpdk-dev] [PATCH 2/6] igb: change for VMDQ arguments expansion Chen Jing D(Mark)
2014-09-23 13:14 ` [dpdk-dev] [PATCH 3/6] ixgbe: " Chen Jing D(Mark)
2014-09-23 13:14 ` [dpdk-dev] [PATCH 4/6] i40e: add VMDQ support Chen Jing D(Mark)
2014-10-13 16:14   ` De Lara Guarch, Pablo
2014-09-23 13:14 ` [dpdk-dev] [PATCH 5/6] i40e: macaddr add/del enhancement Chen Jing D(Mark)
2014-10-14 14:25   ` Thomas Monjalon
2014-10-15  7:01     ` Chen, Jing D
2014-09-23 13:14 ` [dpdk-dev] [PATCH 6/6] i40e: Add full VMDQ pools support Chen Jing D(Mark)
2014-10-10 10:45 ` [dpdk-dev] [PATCH 0/6] i40e VMDQ support Ananyev, Konstantin
2014-10-14  8:27 ` Chen, Jing D
2014-10-21  3:30 ` Cao, Min

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415095289-28961-2-git-send-email-jing.d.chen@intel.com \
    --to=jing.d.chen@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git