Hi Dave,
This patchset includes small fixes for the mlx4_en driver.
First patch by Eran fixes the value used to init the netdevice's
min_mtu field.
Please queue it to -stable >= v4.10.
Second patch by Saeed adds missing Kconfig build dependencies.
Series generated against net commit:
35b827b6d061 tun: forbid iface creation with rtnl ops
Thanks,
Tariq.
Eran Ben Elisha (1):
net/mlx4_en: Change min MTU size to ETH_MIN_MTU
Saeed Mahameed (1):
net/mlx4_en: Fix build break when CONFIG_INET is off
drivers/net/ethernet/mellanox/mlx4/Kconfig | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 -
3 files changed, 3 insertions(+), 4 deletions(-)
--
1.8.3.1
From: Saeed Mahameed <redacted>
MLX4_EN depends on NETDEVICES, ETHERNET and INET Kconfigs.
Make sure they are listed in MLX4_EN Kconfig dependencies.
This fixes the following build break:
drivers/net/ethernet/mellanox/mlx4/en_rx.c:582:18: warning: ‘struct iphdr’ declared inside parameter list [enabled by default]
struct iphdr *iph)
^
drivers/net/ethernet/mellanox/mlx4/en_rx.c:582:18: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
drivers/net/ethernet/mellanox/mlx4/en_rx.c: In function ‘get_fixed_ipv4_csum’:
drivers/net/ethernet/mellanox/mlx4/en_rx.c:586:20: error: dereferencing pointer to incomplete type
_u8 ipproto = iph->protocol;
Signed-off-by: Saeed Mahameed <redacted>
Signed-off-by: Tariq Toukan <redacted>
---
drivers/net/ethernet/mellanox/mlx4/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Eran Ben Elisha <redacted>
NIC driver minimal MTU size shall be set to ETH_MIN_MTU, as defined in
the RFC791 and in the network stack. Remove old mlx4_en only define for
it, which was set to wrong value.
Fixes: b80f71f5816f ("ethernet/mellanox: use core min/max MTU checking")
Signed-off-by: Eran Ben Elisha <redacted>
Signed-off-by: Tariq Toukan <redacted>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
@@ -3493,8 +3493,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,dev->gso_partial_features=NETIF_F_GSO_UDP_TUNNEL_CSUM;}-/* MTU range: 46 - hw-specific max */-dev->min_mtu=MLX4_EN_MIN_MTU;+/* MTU range: 68 - hw-specific max */+dev->min_mtu=ETH_MIN_MTU;dev->max_mtu=priv->max_mtu;mdev->pndev[port]=dev;
This patchset includes small fixes for the mlx4_en driver.
First patch by Eran fixes the value used to init the netdevice's
min_mtu field.
Please queue it to -stable >= v4.10.
Second patch by Saeed adds missing Kconfig build dependencies.
Series generated against net commit:
35b827b6d061 tun: forbid iface creation with rtnl ops
Series applied and patch #1 queued up for -stable, thanks.
From: David Laight <hidden> Date: 2018-12-04 16:59:11
From: Tariq Toukan
Sent: 02 December 2018 12:35
From: Eran Ben Elisha <redacted>
NIC driver minimal MTU size shall be set to ETH_MIN_MTU, as defined in
the RFC791 and in the network stack. Remove old mlx4_en only define for
it, which was set to wrong value.
...
- /* MTU range: 46 - hw-specific max */
- dev->min_mtu = MLX4_EN_MIN_MTU;
+ /* MTU range: 68 - hw-specific max */
+ dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = priv->max_mtu;
Where does 68 come from?
The minimum size of an ethernet packet including the mac addresses
and CRC is 64 bytes - but that would never be an 'mtu'.
Since 64 - 46 = 18, the 46 probably excludes both MAC addresses,
the ethertype/length and the CRC.
This is 'sort of' the minimum mtu for an ethernet frame.
I'm not sure which values are supposed to be in dev->min/max_mtu.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
From: Eric Dumazet <hidden> Date: 2018-12-04 17:04:20
On 12/04/2018 08:59 AM, David Laight wrote:
From: Tariq Toukan
quoted
Sent: 02 December 2018 12:35
From: Eran Ben Elisha <redacted>
NIC driver minimal MTU size shall be set to ETH_MIN_MTU, as defined in
the RFC791 and in the network stack. Remove old mlx4_en only define for
it, which was set to wrong value.
...
quoted
- /* MTU range: 46 - hw-specific max */
- dev->min_mtu = MLX4_EN_MIN_MTU;
+ /* MTU range: 68 - hw-specific max */
+ dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = priv->max_mtu;
Where does 68 come from?
Min IPv4 MTU per RFC791
The minimum size of an ethernet packet including the mac addresses
and CRC is 64 bytes - but that would never be an 'mtu'.
Since 64 - 46 = 18, the 46 probably excludes both MAC addresses,
the ethertype/length and the CRC.
This is 'sort of' the minimum mtu for an ethernet frame.
I'm not sure which values are supposed to be in dev->min/max_mtu.
I am not sure we really care, only syzkaller can possibly.
From: David Laight <hidden> Date: 2018-12-04 17:17:14
From: Eric Dumazet
Sent: 04 December 2018 17:04
On 12/04/2018 08:59 AM, David Laight wrote:
quoted
From: Tariq Toukan
quoted
Sent: 02 December 2018 12:35
From: Eran Ben Elisha <redacted>
NIC driver minimal MTU size shall be set to ETH_MIN_MTU, as defined in
the RFC791 and in the network stack. Remove old mlx4_en only define for
it, which was set to wrong value.
...
quoted
- /* MTU range: 46 - hw-specific max */
- dev->min_mtu = MLX4_EN_MIN_MTU;
+ /* MTU range: 68 - hw-specific max */
+ dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = priv->max_mtu;
Where does 68 come from?
Min IPv4 MTU per RFC791
Which has nothing to do with an ethernet driver.
Indeed, IIRC, it is the smallest maximum frame size that IPv4
can work over.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
From: David Laight <hidden> Date: 2018-12-04 17:21:07
From: Eric Dumazet
Sent: 04 December 2018 17:04
On 12/04/2018 08:59 AM, David Laight wrote:
quoted
From: Tariq Toukan
quoted
Sent: 02 December 2018 12:35
From: Eran Ben Elisha <redacted>
NIC driver minimal MTU size shall be set to ETH_MIN_MTU, as defined in
the RFC791 and in the network stack. Remove old mlx4_en only define for
it, which was set to wrong value.
...
quoted
- /* MTU range: 46 - hw-specific max */
- dev->min_mtu = MLX4_EN_MIN_MTU;
+ /* MTU range: 68 - hw-specific max */
+ dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = priv->max_mtu;
Where does 68 come from?
Min IPv4 MTU per RFC791
Maybe I'm just confused and these are the ranges that the 'maximum mtu'
can be set to.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
From: Cong Wang <hidden> Date: 2018-12-05 05:40:47
On Sun, Dec 2, 2018 at 4:37 AM Tariq Toukan [off-list ref] wrote:
From: Saeed Mahameed <redacted>
MLX4_EN depends on NETDEVICES, ETHERNET and INET Kconfigs.
Make sure they are listed in MLX4_EN Kconfig dependencies.
This fixes the following build break:
drivers/net/ethernet/mellanox/mlx4/en_rx.c:582:18: warning: ‘struct iphdr’ declared inside parameter list [enabled by default]
struct iphdr *iph)
^
drivers/net/ethernet/mellanox/mlx4/en_rx.c:582:18: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
drivers/net/ethernet/mellanox/mlx4/en_rx.c: In function ‘get_fixed_ipv4_csum’:
drivers/net/ethernet/mellanox/mlx4/en_rx.c:586:20: error: dereferencing pointer to incomplete type
_u8 ipproto = iph->protocol;
I am confused with this build error. It complains about the
compiler doesn't know struct iphdr, but struct iphdr is defined
merely in include/uapi/linux/ip.h, without any dependency with
CONFIG_INET.
How could changing Kconfig fix this?
BTW, the patch itself is probably correct as mlx4 does rely on
INET to function, only the build failure confuses me.
Thanks.