patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Wang Ying A <ying.a.wang@intel.com>
To: qabuild@intel.com
Cc: Wang Ying A <ying.a.wang@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [DPDK] net/ice: fix LLDP forward
Date: Fri, 26 Jul 2019 07:45:33 +0800	[thread overview]
Message-ID: <1564098333-277153-1-git-send-email-ying.a.wang@intel.com> (raw)

The patch fix the issue that lldp packet can't be forwarded to host.

Fixes: 59d151de6673 ("net/ice: stop LLDP by default")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 08fc9ec..9550aed 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1385,6 +1385,40 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
 	return ret;
 }
 
+/* Forward LLDP packets to default VSI by set switch rules*/
+static int
+ice_vsi_config_sw_lldp(struct ice_vsi *vsi,  bool on)
+{
+	struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+	struct ice_fltr_list_entry *s_list_itr = NULL;
+	struct LIST_HEAD_TYPE list_head;
+	int ret = 0;
+
+	INIT_LIST_HEAD(&list_head);
+
+	s_list_itr = (struct ice_fltr_list_entry *)
+			ice_malloc(hw, sizeof(*s_list_itr));
+	if (!s_list_itr) {
+		ret = -ENOMEM;
+		goto DONE;
+	}
+	s_list_itr->fltr_info.lkup_type = ICE_SW_LKUP_ETHERTYPE;
+	s_list_itr->fltr_info.vsi_handle = vsi->idx;
+	s_list_itr->fltr_info.l_data.ethertype_mac.ethertype =
+			RTE_ETHER_TYPE_LLDP;
+	s_list_itr->fltr_info.fltr_act = ICE_FWD_TO_VSI;
+	s_list_itr->fltr_info.flag = ICE_FLTR_RX;
+	s_list_itr->fltr_info.src_id = ICE_SRC_ID_LPORT;
+	LIST_ADD(&s_list_itr->list_entry, &list_head);
+	if (on)
+		ret = ice_add_eth_mac(hw, &list_head);
+	else
+		ret = ice_remove_eth_mac(hw, &list_head);
+DONE:
+	rte_free(s_list_itr);
+	return ret;
+}
+
 static int
 ice_dev_init(struct rte_eth_dev *dev)
 {
@@ -1492,7 +1526,13 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
 	ret = ice_aq_stop_lldp(hw, TRUE, FALSE, NULL);
 	if (ret != ICE_SUCCESS)
 		PMD_INIT_LOG(DEBUG, "lldp has already stopped\n");
-
+	ret = ice_init_dcb(hw, TRUE);
+	if (ret != ICE_SUCCESS)
+		PMD_INIT_LOG(DEBUG, "Failed to init DCB\n");
+	/* Forward LLDP packets to default VSI */
+	ret = ice_vsi_config_sw_lldp(vsi, TRUE);
+	if (ret != ICE_SUCCESS)
+		PMD_INIT_LOG(DEBUG, "Failed to cfg lldp\n");
 	/* register callback func to eal lib */
 	rte_intr_callback_register(intr_handle,
 				   ice_interrupt_handler, dev);
-- 
1.8.3.1


             reply	other threads:[~2019-07-26  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 23:45 Wang Ying A [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-07-28 16:39 Wang Ying A
2019-07-25 20:44 Wang Ying A

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=1564098333-277153-1-git-send-email-ying.a.wang@intel.com \
    --to=ying.a.wang@intel.com \
    --cc=qabuild@intel.com \
    --cc=stable@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).