DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shweta Choudaha <shweta.choudaha@gmail.com>
To: dev@dpdk.org
Cc: shweta.choudaha@att.com
Subject: [dpdk-dev] [PATCH 1/1] net/ixgbe: Add API to update SBP bit
Date: Fri, 23 Feb 2018 11:59:13 +0000	[thread overview]
Message-ID: <20180223115913.19266-2-shweta.choudaha@gmail.com> (raw)
In-Reply-To: <20180223115913.19266-1-shweta.choudaha@gmail.com>

From: Shweta Choudaha <shweta.choudaha@att.com>

Add ixgbe API to enable SBP bit in FCTRL register
to allow receiving packets that may otherwise be
considered length errors by ixgbe and dropped

Signed-off-by: Shweta Choudaha <shweta.choudaha@att.com>
Reviewed-by: Chas Williams <chas3@att.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
---
 drivers/net/ixgbe/rte_pmd_ixgbe.c           | 28 ++++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 13 +++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  6 ++++++
 3 files changed, 47 insertions(+)

diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index d8ca8ca31..3b6f68f9e 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -880,6 +880,34 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port,
 	return 0;
 }
 
+int __rte_experimental
+rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable)
+{
+	struct ixgbe_hw *hw;
+	struct rte_eth_dev *dev;
+	uint32_t fctrl;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+	dev = &rte_eth_devices[port];
+	if (!is_ixgbe_supported(dev))
+		return -ENOTSUP;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (!hw)
+		return -ENOTSUP;
+
+	fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
+
+	/* If 'enable' set the SBP bit else clear it */
+	if (enable)
+		fctrl |= IXGBE_FCTRL_SBP;
+	else
+		fctrl &= ~(IXGBE_FCTRL_SBP);
+
+	IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
+	return 0;
+}
+
 #ifdef RTE_LIBRTE_IXGBE_BYPASS
 int
 rte_pmd_ixgbe_bypass_init(uint16_t port_id)
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 11a9f334b..a3026bd98 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -637,4 +637,17 @@ enum {
 	((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF &&  \
 	(x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM))
 
+/**
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param enable
+ *    0 to disable and nonzero to enable 'SBP' bit in FCTRL register
+ *    to receive all packets
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ */
+int __rte_experimental
+rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
 #endif /* _PMD_IXGBE_H_ */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index bf776742c..a360d383b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -52,3 +52,9 @@ DPDK_17.08 {
 	rte_pmd_ixgbe_bypass_wd_timeout_show;
 	rte_pmd_ixgbe_bypass_wd_timeout_store;
 } DPDK_17.05;
+
+EXPERIMENTAL {
+	global:
+
+	rte_pmd_ixgbe_upd_fctrl_sbp;
+} DPDK_17.08;
-- 
2.11.0

  reply	other threads:[~2018-02-23 11:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 11:59 [dpdk-dev] [PATCH 0/1] " Shweta Choudaha
2018-02-23 11:59 ` Shweta Choudaha [this message]
2018-04-04  2:25   ` [dpdk-dev] [PATCH 1/1] " Lu, Wenzhuo
2018-04-04 10:14     ` Ferruh Yigit
2018-04-04 10:40       ` Bruce Richardson
2018-04-10 15:58         ` Shweta Choudaha
2018-04-26 10:20           ` Shweta Choudaha
2018-04-26 10:56             ` Ferruh Yigit
2018-05-01 22:15               ` Shweta Choudaha
2018-04-10 15:42   ` [dpdk-dev] [PATCH v2] " Shweta Choudaha
2018-05-08  1:47     ` Zhang, Helin

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=20180223115913.19266-2-shweta.choudaha@gmail.com \
    --to=shweta.choudaha@gmail.com \
    --cc=dev@dpdk.org \
    --cc=shweta.choudaha@att.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 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).