On Fri, May 04, 2007 at 03:27:53AM -0700, Clint Pachl wrote:
> I'm curious if the flag bits, shown for each interface with ifconfig(8), 
> can be decoded in order to reveal the characteristics of NICs, such as 
> hardware RX/TX checksums and VLAN.
> 
> So far I have searched:
> 
> netintro(4)
> ifmedia(4)
> inet(4)
> sys/net/if.c
> sys/dev/pci/if_em.c
> 
> But haven't found anything definitive. Can someone explain or point out 
> some source or man page?

ifconfig shows if_flags, it sounds like you are talking about
if_capabilities however.

In the case of em(4) grep tells us

if_em.c:        ifp->if_capabilities = IFCAP_VLAN_MTU;
if_em.c:                ifp->if_capabilities |= 
IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;

from net/if.h

/* Capabilities that interfaces can advertise. */
#define IFCAP_CSUM_IPv4         0x00000001      /* can do IPv4 header csum */
#define IFCAP_CSUM_TCPv4        0x00000002      /* can do IPv4/TCP csum */
#define IFCAP_CSUM_UDPv4        0x00000004      /* can do IPv4/UDP csum */
#define IFCAP_IPSEC             0x00000008      /* can do IPsec */
#define IFCAP_VLAN_MTU          0x00000010      /* VLAN-compatible MTU */
#define IFCAP_VLAN_HWTAGGING    0x00000020      /* hardware VLAN tag support */ 
 
#define IFCAP_IPCOMP            0x00000040      /* can do IPcomp */
#define IFCAP_CSUM_TCPv6        0x00000080      /* can do IPv6/TCP checksums */
#define IFCAP_CSUM_UDPv6        0x00000100      /* can do IPv6/UDP checksums */
#define IFCAP_CSUM_TCPv4_Rx     0x00000200      /* can do IPv4/TCP (Rx only) */
#define IFCAP_CSUM_UDPv4_Rx     0x00000400      /* can do IPv4/UDP (Rx only) */

I don't think this is exported to userland, it is the kind of thing that
should be transparent to the user and perhaps mentioned in a man page
if appropriate.

Reply via email to