Skip to content

Commit 82bc89f

Browse files
Mingming Caogregkh
authored andcommitted
ibmveth: Disable GSO for packets with small MSS
commit cc427d2 upstream. Some physical adapters on Power systems do not support segmentation offload when the MSS is less than 224 bytes. Attempting to send such packets causes the adapter to freeze, stopping all traffic until manually reset. Implement ndo_features_check to disable GSO for packets with small MSS values. The network stack will perform software segmentation instead. The 224-byte minimum matches ibmvnic commit <f10b09ef687f> ("ibmvnic: Enforce stronger sanity checks on GSO packets") which uses the same physical adapters in SEA configurations. The issue occurs specifically when the hardware attempts to perform segmentation (gso_segs > 1) with a small MSS. Single-segment GSO packets (gso_segs == 1) do not trigger the problematic LSO code path and are transmitted normally without segmentation. Add an ndo_features_check callback to disable GSO when MSS < 224 bytes. Also call vlan_features_check() to ensure proper handling of VLAN packets, particularly QinQ (802.1ad) configurations where the hardware parser may not support certain offload features. Validated using iptables to force small MSS values. Without the fix, the adapter freezes. With the fix, packets are segmented in software and transmission succeeds. Comprehensive regression testing completedd (MSS tests, performance, stability). Fixes: 8641dd8 ("ibmveth: Add support for TSO") Cc: stable@vger.kernel.org Reviewed-by: Brian King <bjking1@linux.ibm.com> Tested-by: Shaik Abdulla <shaik.abdulla1@ibm.com> Tested-by: Naveed Ahmed <naveedaus@in.ibm.com> Signed-off-by: Mingming Cao <mmc@linux.ibm.com> Link: https://patch.msgid.link/20260424162917.65725-1-mmc@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9415a3f commit 82bc89f

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,27 @@ static int ibmveth_set_mac_addr(struct net_device *dev, void *p)
16301630
return 0;
16311631
}
16321632

1633+
static netdev_features_t ibmveth_features_check(struct sk_buff *skb,
1634+
struct net_device *dev,
1635+
netdev_features_t features)
1636+
{
1637+
/* Some physical adapters do not support segmentation offload with
1638+
* MSS < 224. Disable GSO for such packets to avoid adapter freeze.
1639+
* Note: Single-segment packets (gso_segs == 1) don't need this check
1640+
* as they bypass the LSO path and are transmitted without segmentation.
1641+
*/
1642+
if (skb_is_gso(skb)) {
1643+
if (skb_shinfo(skb)->gso_size < IBMVETH_MIN_LSO_MSS) {
1644+
netdev_warn_once(dev,
1645+
"MSS %u too small for LSO, disabling GSO\n",
1646+
skb_shinfo(skb)->gso_size);
1647+
features &= ~NETIF_F_GSO_MASK;
1648+
}
1649+
}
1650+
1651+
return vlan_features_check(skb, features);
1652+
}
1653+
16331654
static const struct net_device_ops ibmveth_netdev_ops = {
16341655
.ndo_open = ibmveth_open,
16351656
.ndo_stop = ibmveth_close,
@@ -1641,6 +1662,7 @@ static const struct net_device_ops ibmveth_netdev_ops = {
16411662
.ndo_set_features = ibmveth_set_features,
16421663
.ndo_validate_addr = eth_validate_addr,
16431664
.ndo_set_mac_address = ibmveth_set_mac_addr,
1665+
.ndo_features_check = ibmveth_features_check,
16441666
#ifdef CONFIG_NET_POLL_CONTROLLER
16451667
.ndo_poll_controller = ibmveth_poll_controller,
16461668
#endif

drivers/net/ethernet/ibm/ibmveth.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define IBMVETH_ILLAN_IPV4_TCP_CSUM 0x0000000000000002UL
3737
#define IBMVETH_ILLAN_ACTIVE_TRUNK 0x0000000000000001UL
3838

39+
#define IBMVETH_MIN_LSO_MSS 224 /* Minimum MSS for LSO */
3940
/* hcall macros */
4041
#define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
4142
plpar_hcall_norets(H_REGISTER_LOGICAL_LAN, ua, buflst, rxq, fltlst, mac)

0 commit comments

Comments
 (0)