DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 2/7] ethdev: add autoneg parameter in flow ctrl accessors
Date: Tue, 17 Jun 2014 20:09:27 +0200	[thread overview]
Message-ID: <1403028572-24794-3-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <1403028572-24794-1-git-send-email-david.marchand@6wind.com>

Add autoneg field in flow control parameters.
This makes it easier to understand why changing some parameters does not always
have the expected result.

Changing autoneg is not supported at the moment.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 lib/librte_ether/rte_ethdev.h       |    1 +
 lib/librte_pmd_e1000/em_ethdev.c    |    3 +++
 lib/librte_pmd_e1000/igb_ethdev.c   |    3 +++
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c |    3 +++
 4 files changed, 10 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 1e0564d..a410afd 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -649,6 +649,7 @@ struct rte_eth_fc_conf {
 	uint16_t send_xon;    /**< Is XON frame need be sent */
 	enum rte_eth_fc_mode mode;  /**< Link flow control mode */
 	uint8_t mac_ctrl_frame_fwd; /**< Forward MAC control frames */
+	uint8_t autoneg;      /**< Use Pause autoneg */
 };
 
 /**
diff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_ethdev.c
index 58efcdf..7913ff0 100644
--- a/lib/librte_pmd_e1000/em_ethdev.c
+++ b/lib/librte_pmd_e1000/em_ethdev.c
@@ -1378,6 +1378,7 @@ eth_em_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	fc_conf->high_water = hw->fc.high_water;
 	fc_conf->low_water = hw->fc.low_water;
 	fc_conf->send_xon = hw->fc.send_xon;
+	fc_conf->autoneg = hw->mac.autoneg;
 
 	/*
 	 * Return rx_pause and tx_pause status according to actual setting of
@@ -1422,6 +1423,8 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	uint32_t rctl;
 
 	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (fc_conf->autoneg != hw->mac.autoneg)
+		return -ENOTSUP;
 	rx_buf_size = em_get_rx_buffer_size(hw);
 	PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size);
 
diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c
index 92ac4a8..c92b737 100644
--- a/lib/librte_pmd_e1000/igb_ethdev.c
+++ b/lib/librte_pmd_e1000/igb_ethdev.c
@@ -1871,6 +1871,7 @@ eth_igb_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	fc_conf->high_water = hw->fc.high_water;
 	fc_conf->low_water = hw->fc.low_water;
 	fc_conf->send_xon = hw->fc.send_xon;
+	fc_conf->autoneg = hw->mac.autoneg;
 
 	/*
 	 * Return rx_pause and tx_pause status according to actual setting of
@@ -1915,6 +1916,8 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	uint32_t rctl;
 
 	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (fc_conf->autoneg != hw->mac.autoneg)
+		return -ENOTSUP;
 	rx_buf_size = igb_get_rx_buffer_size(hw);
 	PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size);
 
diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index f130080..559d246 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -2309,6 +2309,7 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	fc_conf->high_water = hw->fc.high_water[0];
 	fc_conf->low_water = hw->fc.low_water[0];
 	fc_conf->send_xon = hw->fc.send_xon;
+	fc_conf->autoneg = !hw->fc.disable_fc_autoneg;
 
 	/*
 	 * Return rx_pause status according to actual setting of
@@ -2360,6 +2361,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	PMD_INIT_FUNC_TRACE();
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (fc_conf->autoneg != !hw->fc.disable_fc_autoneg)
+		return -ENOTSUP;
 	rx_buf_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0));
 	PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size);
 
-- 
1.7.10.4

  parent reply	other threads:[~2014-06-17 18:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 18:09 [dpdk-dev] [PATCH v3 0/7] add mtu and flow control handlers David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 1/7] ethdev: retrieve flow control configuration David Marchand
2014-06-17 18:09 ` David Marchand [this message]
2014-06-23  3:35   ` [dpdk-dev] [PATCH v3 2/7] ethdev: add autoneg parameter in flow ctrl accessors Liu, Jijiang
2014-06-23  9:26     ` David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 3/7] ethdev: store min rx buffer size David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 4/7] ethdev: introduce enable_scatter rx mode David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 5/7] ethdev: add mtu accessors David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 6/7] ixgbe: add set_mtu to ixgbevf David Marchand
2014-06-17 18:09 ` [dpdk-dev] [PATCH v3 7/7] app/testpmd: allow to configure mtu David Marchand
2014-06-17 22:30 ` [dpdk-dev] [PATCH v3 0/7] add mtu and flow control handlers Ananyev, Konstantin
2014-06-17 22:59   ` 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=1403028572-24794-3-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.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
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).