DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jakub Grajciar <jgrajcia@cisco.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	Huisong Li <lihuisong@huawei.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
	dev@dpdk.org, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	David Christensen <drc@linux.vnet.ibm.com>
Subject: [dpdk-dev] [PATCH v2 2/2] net/memif: fix driver init with default MTU
Date: Wed, 27 Oct 2021 10:14:29 +0100	[thread overview]
Message-ID: <20211027091429.2996153-2-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20211027091429.2996153-1-ferruh.yigit@intel.com>

Driver is using 'ETH_FRAME_LEN' Linux defined value as max frame length,
which doesn't include FCS (4 bytes CRC). But ethdev by default uses
frame size with FCS when application doesn't define any explicit value.

As a result device configuration fails because device is tried to be
configured with a frame size length that is bigger than what device
reported as supported. Device reports as max supported frame size is
1514 but configured value is 1518.

Instead use DPDK macro, 'RTE_ETHER_MAX_LEN', that includes FCS in the
driver to report the max supported frame size, this matches to the
initial intention.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
---
v2:
* Remove unnecessary cast
---
 drivers/net/memif/rte_eth_memif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 8cec493ffdb9..e4ebabec6ad6 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -195,7 +195,7 @@ static int
 memif_dev_info(struct rte_eth_dev *dev __rte_unused, struct rte_eth_dev_info *dev_info)
 {
 	dev_info->max_mac_addrs = 1;
-	dev_info->max_rx_pktlen = (uint32_t)ETH_FRAME_LEN;
+	dev_info->max_rx_pktlen = RTE_ETHER_MAX_LEN;
 	dev_info->max_rx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS;
 	dev_info->max_tx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS;
 	dev_info->min_rx_bufsize = 0;
-- 
2.31.1


  reply	other threads:[~2021-10-27  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 15:38 [dpdk-dev] [PATCH 1/2] net/af_packet: " Ferruh Yigit
2021-10-26 15:38 ` [dpdk-dev] [PATCH 2/2] net/memif: " Ferruh Yigit
2021-10-26 15:45   ` David Christensen
2021-10-26 20:47   ` Stephen Hemminger
2021-10-27  8:27     ` Ferruh Yigit
2021-10-27  9:14 ` [dpdk-dev] [PATCH v2 1/2] net/af_packet: " Ferruh Yigit
2021-10-27  9:14   ` Ferruh Yigit [this message]
2021-10-27 15:13     ` [dpdk-dev] [PATCH v2 2/2] net/memif: " Andrew Rybchenko
2021-10-27 15:12   ` [dpdk-dev] [PATCH v2 1/2] net/af_packet: " Andrew Rybchenko
2021-10-27 15:51     ` 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=20211027091429.2996153-2-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=jgrajcia@cisco.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=lihuisong@huawei.com \
    --cc=somnath.kotur@broadcom.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).