DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/af_xdp: enforce an MTU of 1500
@ 2019-11-07 13:27 Ciara Loftus
  2019-11-07 14:05 ` Eelco Chaudron
  0 siblings, 1 reply; 2+ messages in thread
From: Ciara Loftus @ 2019-11-07 13:27 UTC (permalink / raw)
  To: dev; +Cc: xiaolong.ye, Ciara Loftus

Packets larger than this will fail to be transmitted by AF_XDP,
so limit the MTU to 1500.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 2b1245ee4..62c801500 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -595,7 +595,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_tx_queues = internals->queue_cnt;
 
 	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
-	dev_info->max_mtu = ETH_AF_XDP_FRAME_SIZE - ETH_AF_XDP_DATA_HEADROOM;
+	dev_info->max_mtu = 1500;
 
 	dev_info->default_rxportconf.nb_queues = 1;
 	dev_info->default_txportconf.nb_queues = 1;
@@ -1328,6 +1328,8 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
 		return -1;
 	}
 
+	eth_dev_mtu_set(eth_dev, 1500);
+
 	rte_eth_dev_probing_finish(eth_dev);
 
 	return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/af_xdp: enforce an MTU of 1500
  2019-11-07 13:27 [dpdk-dev] [PATCH] net/af_xdp: enforce an MTU of 1500 Ciara Loftus
@ 2019-11-07 14:05 ` Eelco Chaudron
  0 siblings, 0 replies; 2+ messages in thread
From: Eelco Chaudron @ 2019-11-07 14:05 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: dev, xiaolong.ye



On 7 Nov 2019, at 14:27, Ciara Loftus wrote:

> Packets larger than this will fail to be transmitted by AF_XDP,
> so limit the MTU to 1500.
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c 
> b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 2b1245ee4..62c801500 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -595,7 +595,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct 
> rte_eth_dev_info *dev_info)
>  	dev_info->max_tx_queues = internals->queue_cnt;
>
>  	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
> -	dev_info->max_mtu = ETH_AF_XDP_FRAME_SIZE - 
> ETH_AF_XDP_DATA_HEADROOM;
> +	dev_info->max_mtu = 1500;

Why is this limited to 1500 in the AF_XDP PMD? For native AF_XDP in OVS 
the limit is mainly by the driver/XDP page limit:
	min(PAGE_SIZE, ETH_AF_XDP_FRAME_SIZE ) - ETH_XDP_DATA_HEADROOM - 
XDP_PACKET_HEADROOM

>
>  	dev_info->default_rxportconf.nb_queues = 1;
>  	dev_info->default_txportconf.nb_queues = 1;
> @@ -1328,6 +1328,8 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device 
> *dev)
>  		return -1;
>  	}
>
> +	eth_dev_mtu_set(eth_dev, 1500);
> +
>  	rte_eth_dev_probing_finish(eth_dev);
>
>  	return 0;
> -- 
> 2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-07 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 13:27 [dpdk-dev] [PATCH] net/af_xdp: enforce an MTU of 1500 Ciara Loftus
2019-11-07 14:05 ` Eelco Chaudron

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).