DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: David Marchand <david.marchand@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 3/5] ethdev: add mtu accessors
Date: Tue, 10 Jun 2014 17:23:48 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772580EFB5EEE@IRSMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <1401103892-17225-4-git-send-email-david.marchand@6wind.com>

Hi David,

>This patch adds two new functions in ethdev api to retrieve current MTU and
>change MTU of a port.
>These operations have been implemented for rte_em_pmd, rte_igb_pmd and
>rte_ixgbe_pmd.

>+
>+void ixgbe_dev_set_rx_scatter_mode(struct rte_eth_dev *dev)
>+{
>+	if (dev->rx_pkt_burst != ixgbe_recv_scattered_pkts) {
>+		dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
>+		/* we must ensure that this is done when we leave the
>+		   function */
>+		rte_wmb();
>+	}
>+}

I don't think it is safe to change RX function on the fly (without calling dev_stop first).
If before that ixgbe_recv_pkts_bulk_alloc() was used, then up to 32 mbufs could be stored internally in the stage[],
and ixgbe_recv_scattered_pkts() doesn't have a clue about them.
Also with ixgbe_recv_pkts_bulk_alloc(), it could be up to rx_free_thresh RX descriptors not armed yet with proper buffer addresses,
while ixgbe_recv_scattered_pkts()  doesn't expect that - it re-arms RXD straight after it receives a packet from it.

I wonder is the ability to change mtu on the fly (without dev_stop) is really needed?
If so, then we probably can allow ixgbe_dev_set_mtu() to increase MTU only if
new frame size is less than RX buffer size OR that device already using  ixgbe_recv_scattered_pkts().
Something like:
frame_size <= rx_buf_size || dev->rx_pkt_burst == ixgbe_recv_scattered_pkts


> +static int
>+ixgbe_dev_set_mtu(struct rte_eth_dev *dev, uint16_t *mtu)
>+{
>....
>+
>+	/* switch to jumbo mode if needed */
>+	if (frame_size  > ETHER_MAX_LEN) {

Why ETHER_MAX_LEN?
If we have rx_buffer big enough, we don't need to split packets even for jumbo frames. 
Shouldn't it be something like inside ixgbe_dev_rx_init():
If (mtu + 2 * IXGBE_VLAN_TAG_SIZE) > rx_buf_size) {...

Same thing for igb.

Konstantin
 

  reply	other threads:[~2014-06-10 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 11:31 [dpdk-dev] [PATCH 0/5] add mtu and flow control handlers David Marchand
2014-05-26 11:31 ` [dpdk-dev] [PATCH 1/5] ethdev: retrieve flow control configuration David Marchand
2014-05-26 11:31 ` [dpdk-dev] [PATCH 2/5] ethdev: add autoneg parameter in flow ctrl accessors David Marchand
2014-05-26 11:31 ` [dpdk-dev] [PATCH 3/5] ethdev: add mtu accessors David Marchand
2014-06-10 17:23   ` Ananyev, Konstantin [this message]
2014-06-12 14:20     ` David Marchand
2014-05-26 11:31 ` [dpdk-dev] [PATCH 4/5] ixgbe: add get/set_mtu to ixgbevf David Marchand
2014-05-26 11:31 ` [dpdk-dev] [PATCH 5/5] app/testpmd: allow to configure mtu David Marchand

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=2601191342CEEE43887BDE71AB9772580EFB5EEE@IRSMSX105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=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).