[dpdk-dev] net/virtio: init MTU in case no control channel

Message ID 1508987346-68173-1-git-send-email-wangzhike@jd.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

王志克 Oct. 26, 2017, 3:09 a.m. UTC
  The max_mtu is kept as zero in case no CRTL channel, which leads
to failure when calling virtio_mtu_set().

Signed-off-by: wangzhike <wangzhike@jd.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Yuanhan Liu Nov. 7, 2017, 3:44 a.m. UTC | #1
On Wed, Oct 25, 2017 at 08:09:06PM -0700, wangzhike wrote:
> The max_mtu is kept as zero in case no CRTL channel, which leads
> to failure when calling virtio_mtu_set().
> 
> Signed-off-by: wangzhike <wangzhike@jd.com>

Acked-by: Yuanhan Liu <yliu@fridaylinux.org>

Thanks.

	--yliu
> ---
>  drivers/net/virtio/virtio_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index bfbd737..823b3fd 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1474,6 +1474,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
>  	} else {
>  		PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=1");
>  		hw->max_queue_pairs = 1;
> +		hw->max_mtu = VIRTIO_MAX_RX_PKTLEN - ETHER_HDR_LEN -
> +			VLAN_TAG_LEN - hw->vtnet_hdr_size;
>  	}
>  
>  	ret = virtio_alloc_queues(eth_dev);
> -- 
> 1.8.3.1
  
Thomas Monjalon Nov. 12, 2017, 6:45 p.m. UTC | #2
07/11/2017 04:44, Yuanhan Liu:
> On Wed, Oct 25, 2017 at 08:09:06PM -0700, wangzhike wrote:
> > The max_mtu is kept as zero in case no CRTL channel, which leads
> > to failure when calling virtio_mtu_set().
> > 
> > Signed-off-by: wangzhike <wangzhike@jd.com>
> 
> Acked-by: Yuanhan Liu <yliu@fridaylinux.org>

Sorry, it cannot be applied without the real name of the author.
  
Maxime Coquelin Jan. 4, 2018, 3:16 p.m. UTC | #3
Hi,

On 11/12/2017 07:45 PM, Thomas Monjalon wrote:
> 07/11/2017 04:44, Yuanhan Liu:
>> On Wed, Oct 25, 2017 at 08:09:06PM -0700, wangzhike wrote:
>>> The max_mtu is kept as zero in case no CRTL channel, which leads
>>> to failure when calling virtio_mtu_set().
>>>
>>> Signed-off-by: wangzhike <wangzhike@jd.com>
>>
>> Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
> 
> Sorry, it cannot be applied without the real name of the author.
> 

Could you please repost with your real name?

Thanks,
Maxime
  
王志克 Jan. 5, 2018, 1 a.m. UTC | #4
Thanks.

I just changed the signed-off from wangzhike to "zhike wang".  Zhike is given name, while wang is family name.

Br,
Zhike

-----Original Message-----
From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com] 

Sent: Thursday, January 04, 2018 11:16 PM
To: Thomas Monjalon; Yuanhan Liu; 王志克
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/virtio: init MTU in case no control channel

Hi,

On 11/12/2017 07:45 PM, Thomas Monjalon wrote:
> 07/11/2017 04:44, Yuanhan Liu:

>> On Wed, Oct 25, 2017 at 08:09:06PM -0700, wangzhike wrote:

>>> The max_mtu is kept as zero in case no CRTL channel, which leads

>>> to failure when calling virtio_mtu_set().

>>>

>>> Signed-off-by: wangzhike <wangzhike@jd.com>

>>

>> Acked-by: Yuanhan Liu <yliu@fridaylinux.org>

> 

> Sorry, it cannot be applied without the real name of the author.

> 


Could you please repost with your real name?

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index bfbd737..823b3fd 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1474,6 +1474,8 @@  static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 	} else {
 		PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=1");
 		hw->max_queue_pairs = 1;
+		hw->max_mtu = VIRTIO_MAX_RX_PKTLEN - ETHER_HDR_LEN -
+			VLAN_TAG_LEN - hw->vtnet_hdr_size;
 	}
 
 	ret = virtio_alloc_queues(eth_dev);