@@ -1756,6 +1756,27 @@ static int ibmveth_set_mac_addr(struct net_device *dev, void *p)
17561756 return 0 ;
17571757}
17581758
1759+ static netdev_features_t ibmveth_features_check (struct sk_buff * skb ,
1760+ struct net_device * dev ,
1761+ netdev_features_t features )
1762+ {
1763+ /* Some physical adapters do not support segmentation offload with
1764+ * MSS < 224. Disable GSO for such packets to avoid adapter freeze.
1765+ * Note: Single-segment packets (gso_segs == 1) don't need this check
1766+ * as they bypass the LSO path and are transmitted without segmentation.
1767+ */
1768+ if (skb_is_gso (skb )) {
1769+ if (skb_shinfo (skb )-> gso_size < IBMVETH_MIN_LSO_MSS ) {
1770+ netdev_warn_once (dev ,
1771+ "MSS %u too small for LSO, disabling GSO\n" ,
1772+ skb_shinfo (skb )-> gso_size );
1773+ features &= ~NETIF_F_GSO_MASK ;
1774+ }
1775+ }
1776+
1777+ return vlan_features_check (skb , features );
1778+ }
1779+
17591780static const struct net_device_ops ibmveth_netdev_ops = {
17601781 .ndo_open = ibmveth_open ,
17611782 .ndo_stop = ibmveth_close ,
@@ -1767,6 +1788,7 @@ static const struct net_device_ops ibmveth_netdev_ops = {
17671788 .ndo_set_features = ibmveth_set_features ,
17681789 .ndo_validate_addr = eth_validate_addr ,
17691790 .ndo_set_mac_address = ibmveth_set_mac_addr ,
1791+ .ndo_features_check = ibmveth_features_check ,
17701792#ifdef CONFIG_NET_POLL_CONTROLLER
17711793 .ndo_poll_controller = ibmveth_poll_controller ,
17721794#endif
0 commit comments