DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jens Freimann <jfreimann@redhat.com>
To: Ilya Maximets <i.maximets@samsung.com>
Cc: dev@dpdk.org, tiwei.bie@intel.com, maxime.coquelin@redhat.com
Subject: Re: [dpdk-dev] [v4] net/virtio: set offload flag for jumbo frames
Date: Fri, 1 Feb 2019 16:13:12 +0100	[thread overview]
Message-ID: <20190201151312.432t55b4relhqv3d@jenstp.localdomain> (raw)
In-Reply-To: <d120a32b-a83b-b5ca-c956-0413c5af65f6@samsung.com>

On Fri, Feb 01, 2019 at 05:27:37PM +0300, Ilya Maximets wrote:
>On 01.02.2019 13:03, Jens Freimann wrote:
>> +	if (host_features & (1ULL << VIRTIO_NET_F_MTU)) {
>> +		uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +
>> +			hw->vtnet_hdr_size;
>> +		if (dev->data->dev_conf.rxmode.max_rx_pkt_len <=
>> +				hw->max_mtu + ether_hdr_len)
>> +			dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;
>> +	} else {
>> +		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;
>> +	}
>> +
>
>As I wrote for v3, hw->max_mtu already calculated taking VIRTIO_NET_F_MTU
>into account. If VIRTIO_NET_F_MTU is not set, hw->max_mtu is equal to
>"VIRTIO_MAX_RX_PKTLEN - ETHER_HDR_LEN - VLAN_TAG_LEN - hw->vtnet_hdr_size".
>i.e. "hw->max_mtu + ether_hdr_len" equal to VIRTIO_MAX_RX_PKTLEN which is
>larger or equal to rxmode.max_rx_pkt_len.
>So, there is no need to check for VIRTIO_NET_F_MTU here. You may just perform
>same check for both cases.

I should read more carefully :). I think I get what you mean now.
hw->max_mtu already includes ether_hdr_len, so it doesn't need
re-calculation here. And in case of VIRTIO_NET_F_MTU the mtu is
checked during feature negotiation.  

So it basically boils down to 
        if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= w->max_mtu)
                dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;

>This doesn't give any performance or so, but will simplify the code.

Thanks for the review!

regards,
Jens 

  reply	other threads:[~2019-02-01 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01 10:03 [dpdk-dev] [PATCH v4] " Jens Freimann
     [not found] ` <CGME20190201142739eucas1p1eff46b874ee985b7aa2d32b185e837c1@eucas1p1.samsung.com>
2019-02-01 14:27   ` [dpdk-dev] [v4] " Ilya Maximets
2019-02-01 15:13     ` Jens Freimann [this message]
2019-02-01 15:21       ` Ilya Maximets

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=20190201151312.432t55b4relhqv3d@jenstp.localdomain \
    --to=jfreimann@redhat.com \
    --cc=dev@dpdk.org \
    --cc=i.maximets@samsung.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@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).