ANA_PORT_PORT_CFG_PORTID_VAL(cpu),
                         ANA_PORT_PORT_CFG, cpu);
  
 -      /* If the CPU port is a physical port, set up the port in Node
 -       * Processor Interface (NPI) mode. This is the mode through which
 -       * frames can be injected from and extracted to an external CPU.
 -       * Only one port can be an NPI at the same time.
 -       */
 -      if (cpu < ocelot->num_phys_ports) {
 +      if (npi >= 0 && npi < ocelot->num_phys_ports) {
-               int mtu = VLAN_ETH_FRAME_LEN + OCELOT_TAG_LEN;
+               int sdu = ETH_DATA_LEN + OCELOT_TAG_LEN;
  
                ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M |
 -                           QSYS_EXT_CPU_CFG_EXT_CPU_PORT(cpu),
 +                           QSYS_EXT_CPU_CFG_EXT_CPU_PORT(npi),
                             QSYS_EXT_CPU_CFG);
  
                if (injection == OCELOT_TAG_PREFIX_SHORT)
-                       mtu += OCELOT_SHORT_PREFIX_LEN;
+                       sdu += OCELOT_SHORT_PREFIX_LEN;
                else if (injection == OCELOT_TAG_PREFIX_LONG)
-                       mtu += OCELOT_LONG_PREFIX_LEN;
+                       sdu += OCELOT_LONG_PREFIX_LEN;
  
-               ocelot_port_set_mtu(ocelot, npi, mtu);
+               ocelot_port_set_maxlen(ocelot, cpu, sdu);
 +
 +              /* Enable NPI port */
 +              ocelot_write_rix(ocelot,
 +                               QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE |
 +                               QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG(1) |
 +                               QSYS_SWITCH_PORT_MODE_PORT_ENA,
 +                               QSYS_SWITCH_PORT_MODE, npi);
 +              /* NPI port Injection/Extraction configuration */
 +              ocelot_write_rix(ocelot,
 +                               SYS_PORT_MODE_INCL_XTR_HDR(extraction) |
 +                               SYS_PORT_MODE_INCL_INJ_HDR(injection),
 +                               SYS_PORT_MODE, npi);
        }
  
 -      /* CPU port Injection/Extraction configuration */
 +      /* Enable CPU port module */
        ocelot_write_rix(ocelot, QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE |
                         QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG(1) |
                         QSYS_SWITCH_PORT_MODE_PORT_ENA,
 
                        goto errout;
        }
  
-       if (ext & (1 << (INET_DIAG_CLASS_ID - 1)) ||
-           ext & (1 << (INET_DIAG_TCLASS - 1))) {
-               u32 classid = 0;
- 
- #ifdef CONFIG_SOCK_CGROUP_DATA
-               classid = sock_cgroup_classid(&sk->sk_cgrp_data);
- #endif
-               /* Fallback to socket priority if class id isn't set.
-                * Classful qdiscs use it as direct reference to class.
-                * For cgroup2 classid is always zero.
-                */
-               if (!classid)
-                       classid = sk->sk_priority;
- 
-               if (nla_put_u32(skb, INET_DIAG_CLASS_ID, classid))
-                       goto errout;
-       }
- 
 +      /* Keep it at the end for potential retry with a larger skb,
 +       * or else do best-effort fitting, which is only done for the
 +       * first_nlmsg.
 +       */
 +      if (cb_data->bpf_stg_diag) {
 +              bool first_nlmsg = ((unsigned char *)nlh == skb->data);
 +              unsigned int prev_min_dump_alloc;
 +              unsigned int total_nla_size = 0;
 +              unsigned int msg_len;
 +              int err;
 +
 +              msg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
 +              err = bpf_sk_storage_diag_put(cb_data->bpf_stg_diag, sk, skb,
 +                                            INET_DIAG_SK_BPF_STORAGES,
 +                                            &total_nla_size);
 +
 +              if (!err)
 +                      goto out;
 +
 +              total_nla_size += msg_len;
 +              prev_min_dump_alloc = cb->min_dump_alloc;
 +              if (total_nla_size > prev_min_dump_alloc)
 +                      cb->min_dump_alloc = min_t(u32, total_nla_size,
 +                                                 MAX_DUMP_ALLOC_SIZE);
 +
 +              if (!first_nlmsg)
 +                      goto errout;
 +
 +              if (cb->min_dump_alloc > prev_min_dump_alloc)
 +                      /* Retry with pskb_expand_head() with
 +                       * __GFP_DIRECT_RECLAIM
 +                       */
 +                      goto errout;
 +
 +              WARN_ON_ONCE(total_nla_size <= prev_min_dump_alloc);
 +
 +              /* Send what we have for this sk
 +               * and move on to the next sk in the following
 +               * dump()
 +               */
 +      }
 +
  out:
        nlmsg_end(skb, nlh);
        return 0;