Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / mellanox / mlx4 / port.c
index 719ead15e49181f1fc419b0c18310db521280eff..4b6aad39e72cd97d09d8deff9f35390684a700bf 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <linux/errno.h>
 #include <linux/if_ether.h>
+#include <linux/if_vlan.h>
 #include <linux/export.h>
 
 #include <linux/mlx4/cmd.h>
@@ -175,7 +176,7 @@ EXPORT_SYMBOL_GPL(__mlx4_register_mac);
 
 int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac)
 {
-       u64 out_param;
+       u64 out_param = 0;
        int err;
 
        if (mlx4_is_mfunc(dev)) {
@@ -222,7 +223,7 @@ EXPORT_SYMBOL_GPL(__mlx4_unregister_mac);
 
 void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
 {
-       u64 out_param;
+       u64 out_param = 0;
 
        if (mlx4_is_mfunc(dev)) {
                set_param_l(&out_param, port);
@@ -361,7 +362,7 @@ out:
 
 int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
 {
-       u64 out_param;
+       u64 out_param = 0;
        int err;
 
        if (mlx4_is_mfunc(dev)) {
@@ -406,7 +407,7 @@ out:
 
 void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index)
 {
-       u64 in_param;
+       u64 in_param = 0;
        int err;
 
        if (mlx4_is_mfunc(dev)) {
@@ -517,7 +518,8 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
                        /* Mtu is configured as the max MTU among all the
                         * the functions on the port. */
                        mtu = be16_to_cpu(gen_context->mtu);
-                       mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port]);
+                       mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port] +
+                                   ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
                        prev_mtu = slave_st->mtu[port];
                        slave_st->mtu[port] = mtu;
                        if (mtu > master->max_mtu[port])