On 2007/08/03 15:27, Hugo van Niekerk wrote:
[...]

pcn(4) can be persuaded to send frames large enough to hold vlan tags
and a 1500-byte packet with the diff below, but on the vmware I just
tried, I can't get it to receive frames that size. Then again, neither
does em(4) with Ethernet0.virtualDev = "e1000", or vic(4) with
Ethernet0.virtualDev = "vmxnet", so it's likely to be a problem
with the NIC on the vmware I just tried it on (nfe on a junk
windows box).

If anyone wants to try their luck with a real pcn (rare beast that
it is ..) or a better vmware installation here's the diff (against
-current) to test.

A test is only successful if you can send *and receive* large
packets over a vlan interface over the wire (e.g. ping -s1472
some.other.host.on.the.vlan).

Features table for the AMD chip says 'software vlan support' and there's
nothing specific to enable large frame reception mentioned in the data
sheet that I could find, but there could be some reason (other than
"they didn't think of it") why it seems not to be done in other OS.

Index: if_pcn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_pcn.c,v
retrieving revision 1.15
diff -u -p -r1.15 if_pcn.c
--- if_pcn.c    9 Nov 2006 14:25:23 -0000       1.15
+++ if_pcn.c    3 Aug 2007 10:40:49 -0000
@@ -805,6 +805,8 @@ pcn_attach(struct device *parent, struct
        IFQ_SET_MAXLEN(&ifp->if_snd, PCN_NTXDESC -1);
        IFQ_SET_READY(&ifp->if_snd);
 
+       ifp->if_capabilities = IFCAP_VLAN_MTU;
+
        /* Attach the interface. */
        if_attach(ifp);
        ether_ifattach(ifp);
@@ -1128,7 +1130,8 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd,
                break;
 
        case SIOCSIFMTU:
-               if (ifr->ifr_mtu > ETHERMTU || ifr->ifr_mtu < ETHERMIN)
+               if (ifr->ifr_mtu > ETHERMTU + ETHER_VLAN_ENCAP_LEN || 
+                   ifr->ifr_mtu < ETHERMIN)
                        error = EINVAL;
                else if (ifp->if_mtu != ifr->ifr_mtu)
                        ifp->if_mtu = ifr->ifr_mtu;

Reply via email to