dpdk: fix overflow in mtu arithmetic 31/36131/2
authorMohammed Hawari <mohammed@hawari.fr>
Fri, 13 May 2022 07:45:12 +0000 (09:45 +0200)
committerMohammed HAWARI <momohawari@gmail.com>
Fri, 13 May 2022 09:35:13 +0000 (09:35 +0000)
When the driver's max_rx_pktlen is >= 65536, max_supported_frame_size
overflows and queue creation fails.

Change-Id: If78707cb698adf8619ec44a852dd05d570917577
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix

src/plugins/dpdk/device/common.c
src/plugins/dpdk/device/dpdk.h

index a376595..b8c6edd 100644 (file)
@@ -65,7 +65,7 @@ dpdk_device_setup (dpdk_device_t * xd)
   struct rte_eth_dev_info dev_info;
   struct rte_eth_conf conf = {};
   u64 rxo, txo;
-  u16 max_frame_size;
+  u32 max_frame_size;
   int rv;
   int j;
 
index 008c82d..02cf681 100644 (file)
@@ -202,7 +202,7 @@ typedef struct
   u8 *default_mac_address;
 
   /* maximum supported max frame size */
-  u16 max_supported_frame_size;
+  u32 max_supported_frame_size;
 
   /* due to lack of API to get ethernet max_frame_size we store information
    * deducted from device info */