DPDK patches and discussions
 help / color / mirror / Atom feed
From: Beilei Xing <beilei.xing@intel.com>
To: wenzhuo.lu@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3] net/ixgbe: remove MTU setting limitation when port's stopped
Date: Thu,  6 Jul 2017 11:36:00 +0800	[thread overview]
Message-ID: <1499312160-122381-1-git-send-email-beilei.xing@intel.com> (raw)
In-Reply-To: <1499222024-64581-1-git-send-email-beilei.xing@intel.com>

Currently, setting MTU will fail if MTU requires the support
of scattered packets before scattered_rx is enabled.
This patch allows setting this special MTU when device is
stopped, cause scattered_rx will be re-configured during
starting port.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v3 changes:
 -Check dev_data->scattered_rx instead of rx_conf->enable_scatter
v2 changes:
 -Change commit log
 drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fb5574e..4814aeb 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4811,7 +4811,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	struct ixgbe_hw *hw;
 	struct rte_eth_dev_info dev_info;
 	uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-	struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
+	struct rte_eth_dev_data *dev_data = dev->data;
 
 	ixgbe_dev_info_get(dev, &dev_info);
 
@@ -4819,13 +4819,15 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen))
 		return -EINVAL;
 
-	/* refuse mtu that requires the support of scattered packets when this
-	 * feature has not been enabled before.
+	/* If device is started, refuse mtu that requires the support of
+	 * scattered packets when this feature has not been enabled before.
 	 */
-	if (!rx_conf->enable_scatter &&
+	if (dev_data->dev_started && !dev_data->scattered_rx &&
 	    (frame_size + 2 * IXGBE_VLAN_TAG_SIZE >
-	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
+	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
+		PMD_INIT_LOG(ERR, "Stop port first.");
 		return -EINVAL;
+	}
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
-- 
2.5.5

  parent reply	other threads:[~2017-07-06  3:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04  8:22 [dpdk-dev] [PATCH] net/ixgbe: align setting MTU behavior with i40e Beilei Xing
2017-07-05  2:33 ` [dpdk-dev] [PATCH v2] net/ixgbe: remove MTU setting limitation when port's stopped Beilei Xing
2017-07-05  3:19   ` Lu, Wenzhuo
2017-07-05 13:59   ` Ferruh Yigit
2017-07-06  3:23     ` Xing, Beilei
2017-07-06  3:36   ` Beilei Xing [this message]
2017-07-06  9:49     ` [dpdk-dev] [PATCH v3] " Ferruh Yigit

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=1499312160-122381-1-git-send-email-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@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 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).