“74bc2ecfb5ca14d22eec1b6b8d476735067fa8db”上不存在“...classes/sun/java2d/jules/JulesRenderingEngine.java”
提交 cd004f5d 编写于 作者: A Ariel Levkovich 提交者: Xibo.Wang

net: bonding: Inherit MPLS features from slave devices

mainline inclusion
from mianline-v5.3-rc1
commit 		2e770b50
category: task
bugzilla: https://gitee.com/openeuler/kernel/issues/I5Z32F
CVE: NA

--------------------------------

When setting the bonding interface net device features,
the kernel code doesn't address the slaves' MPLS features
and doesn't inherit them.

Therefore, HW offloads that enhance performance such as
checksumming and TSO are disabled for MPLS tagged traffic
flowing via the bonding interface.

The patch add the inheritance of the MPLS features from the
slave devices with a similar logic to setting the bonding device's
VLAN and encapsulation features.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSun Shouxin <sunshouxin@chinatelecom.cn>
Signed-off-by: NXibo.Wang <wangxb12@chinatelecom.cn>
上级 98b3569a
...@@ -1071,12 +1071,16 @@ static netdev_features_t bond_fix_features(struct net_device *dev, ...@@ -1071,12 +1071,16 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ #define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_RXCSUM | NETIF_F_ALL_TSO) NETIF_F_RXCSUM | NETIF_F_ALL_TSO)
#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_ALL_TSO)
static void bond_compute_features(struct bonding *bond) static void bond_compute_features(struct bonding *bond)
{ {
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
IFF_XMIT_DST_RELEASE_PERM; IFF_XMIT_DST_RELEASE_PERM;
netdev_features_t vlan_features = BOND_VLAN_FEATURES; netdev_features_t vlan_features = BOND_VLAN_FEATURES;
netdev_features_t enc_features = BOND_ENC_FEATURES; netdev_features_t enc_features = BOND_ENC_FEATURES;
netdev_features_t mpls_features = BOND_MPLS_FEATURES;
struct net_device *bond_dev = bond->dev; struct net_device *bond_dev = bond->dev;
struct list_head *iter; struct list_head *iter;
struct slave *slave; struct slave *slave;
...@@ -1087,6 +1091,7 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1087,6 +1091,7 @@ static void bond_compute_features(struct bonding *bond)
if (!bond_has_slaves(bond)) if (!bond_has_slaves(bond))
goto done; goto done;
vlan_features &= NETIF_F_ALL_FOR_ALL; vlan_features &= NETIF_F_ALL_FOR_ALL;
mpls_features &= NETIF_F_ALL_FOR_ALL;
bond_for_each_slave(bond, slave, iter) { bond_for_each_slave(bond, slave, iter) {
vlan_features = netdev_increment_features(vlan_features, vlan_features = netdev_increment_features(vlan_features,
...@@ -1095,6 +1100,11 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1095,6 +1100,11 @@ static void bond_compute_features(struct bonding *bond)
enc_features = netdev_increment_features(enc_features, enc_features = netdev_increment_features(enc_features,
slave->dev->hw_enc_features, slave->dev->hw_enc_features,
BOND_ENC_FEATURES); BOND_ENC_FEATURES);
mpls_features = netdev_increment_features(mpls_features,
slave->dev->mpls_features,
BOND_MPLS_FEATURES);
dst_release_flag &= slave->dev->priv_flags; dst_release_flag &= slave->dev->priv_flags;
if (slave->dev->hard_header_len > max_hard_header_len) if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len; max_hard_header_len = slave->dev->hard_header_len;
...@@ -1110,6 +1120,7 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1110,6 +1120,7 @@ static void bond_compute_features(struct bonding *bond)
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX | NETIF_F_HW_VLAN_STAG_TX |
NETIF_F_GSO_UDP_L4; NETIF_F_GSO_UDP_L4;
bond_dev->mpls_features = mpls_features;
bond_dev->gso_max_segs = gso_max_segs; bond_dev->gso_max_segs = gso_max_segs;
netif_set_gso_max_size(bond_dev, gso_max_size); netif_set_gso_max_size(bond_dev, gso_max_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册