All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
To: dev@dpdk.org
Cc: shaopeng.he@intel.com
Subject: [PATCH 6/6] fm10k: Add default mac/vlan filter to SM
Date: Fri, 29 May 2015 16:10:44 +0800	[thread overview]
Message-ID: <1432887044-24777-7-git-send-email-jing.d.chen@intel.com> (raw)
In-Reply-To: <1432887044-24777-1-git-send-email-jing.d.chen@intel.com>

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

Since the communication between PF/Switch Manager, VF/PF is
asynchronous through mailbox, it's hard to determine when Switch
Manager/PF host will send the default vlan to PF/VF. So, it's
necessary to set default vlan until the device is started.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index b6e82e3..3a26480 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -667,6 +667,17 @@ fm10k_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) {
+		fm10k_mbx_lock(hw);
+		/* Update default vlan */
+		hw->mac.ops.update_vlan(hw, hw->mac.default_vid, 0, true);
+
+		/* Add default mac/vlan filter to PF/Switch manger */
+		hw->mac.ops.update_uc_addr(hw, hw->mac.dglort_map, hw->mac.addr,
+				hw->mac.default_vid, true, 0);
+		fm10k_mbx_unlock(hw);
+	}
+
 	return 0;
 }
 
@@ -1839,15 +1850,12 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	/* Enable port first */
 	hw->mac.ops.update_lport_state(hw, hw->mac.dglort_map, 1, 1);
 
-	/* Update default vlan */
-	hw->mac.ops.update_vlan(hw, hw->mac.default_vid, 0, true);
-
 	/*
-	 * Add default mac/vlan filter. glort is assigned by SM for PF, while is
+	 * Add default mac. glort is assigned by SM for PF, while is
 	 * unused for VF. PF will assign correct glort for VF.
 	 */
 	hw->mac.ops.update_uc_addr(hw, hw->mac.dglort_map, hw->mac.addr,
-			      hw->mac.default_vid, 1, 0);
+				0, 1, 0);
 
 	/* Set unicast mode by default. App can change to other mode in other
 	 * API func.
-- 
1.7.7.6

  parent reply	other threads:[~2015-05-29  8:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29  8:10 [PATCH 0/6] fm10k: A series of bug fixes Chen Jing D(Mark)
2015-05-29  8:10 ` [PATCH 1/6] fm10k: Fix improper RX buffer size assignment Chen Jing D(Mark)
2015-06-16 11:55   ` Qiu, Michael
2015-05-29  8:10 ` [PATCH 2/6] fm10k: Fix jumbo frame issue Chen Jing D(Mark)
2015-06-12  1:15   ` Qiu, Michael
2015-05-29  8:10 ` [PATCH 3/6] fm10k: Fix data integrity issue with multi-segment frame Chen Jing D(Mark)
2015-06-16 12:07   ` Qiu, Michael
2015-05-29  8:10 ` [PATCH 4/6] fm10k: Fix issue that MAC addr can't be set to silicon Chen Jing D(Mark)
2015-06-09 16:23   ` Qiu, Michael
2015-06-10  5:34     ` Chen, Jing D
2015-06-12  2:03   ` Qiu, Michael
2015-05-29  8:10 ` [PATCH 5/6] fm10k: Do sanity check on mac address Chen Jing D(Mark)
2015-06-16 12:08   ` Qiu, Michael
2015-05-29  8:10 ` Chen Jing D(Mark) [this message]
2015-06-08  2:39 ` [PATCH 0/6] fm10k: A series of bug fixes He, Shaopeng
2015-06-09 15:21 ` Qiu, Michael
2015-06-22 13:55   ` Thomas Monjalon

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=1432887044-24777-7-git-send-email-jing.d.chen@intel.com \
    --to=jing.d.chen@intel.com \
    --cc=dev@dpdk.org \
    --cc=shaopeng.he@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.