re: MACFG50 requires defragmentation in software, but no padding for runt.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 9 Jun 2018 11:45:55 +0000 (19:45 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 9 Jun 2018 11:45:55 +0000 (19:45 +0800)
Reported-by: YONETANI Tomokazu
Tested-by: YONETANI Tomokazu
sys/dev/netif/re/if_re.c
sys/dev/netif/re/if_revar.h
sys/dev/netif/re/re.c

index 901544a..7a72dbb 100644 (file)
@@ -699,9 +699,10 @@ re_attach(device_t dev)
                sc->re_if_flags |= RL_FLAG_PCIE;
        else
                sc->re_if_flags &= ~RL_FLAG_PCIE;
-       device_printf(dev, "MAC version 0x%08x, MACFG %u%s%s\n",
+       device_printf(dev, "MAC version 0x%08x, MACFG %u%s%s%s\n",
            (CSR_READ_4(sc, RE_TXCFG) & 0xFCF00000), sc->re_type,
            sc->re_coalesce_tx_pkt ? ", software TX defrag" : "",
+           sc->re_pad_runt ? ", pad runt" : "",
            sc->re_hw_enable_msi_msix ? ", support MSI" : "");
 
        /*
@@ -1527,7 +1528,7 @@ re_encap(struct re_softc *sc, struct mbuf **m_head, int *idx0)
        else
                ctl_csum = 0;
 
-       if (sc->re_coalesce_tx_pkt) {
+       if (sc->re_pad_runt) {
                /*
                 * With some of the RealTek chips, using the checksum offload
                 * support in conjunction with the autopadding feature results
index 4d53630..e3a7741 100644 (file)
@@ -173,6 +173,7 @@ struct re_softc {
        u_int8_t                RequireAdjustUpsTxLinkPulseTiming;
        u_int8_t                re_hw_enable_msi_msix;
        u_int8_t                re_coalesce_tx_pkt;
+       u_int8_t                re_pad_runt;
        u_int8_t                re_8169_MacVersion;
        u_int8_t                re_8169_PhyVersion;
        int                     re_tx_cstag;
index 16958e8..6df43a5 100644 (file)
@@ -4078,9 +4078,16 @@ static void re_init_software_variable(struct re_softc *sc)
         case MACFG_41:
         case MACFG_42:
         case MACFG_43:
+#ifdef __DragonFly__
+       case MACFG_50:
+#endif
         case MACFG_54:
         case MACFG_55:
                 sc->re_coalesce_tx_pkt = TRUE;
+#ifdef __DragonFly__
+               if (sc->re_type != MACFG_50)
+                       sc->re_pad_runt = TRUE;
+#endif
                 break;
         }