Re: ixl(4): Fix hardmtu

Jan Klemkow <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
ping?

On Thu, Jul 30, 2026 at 06:16:40PM +0200, Jan Klemkow wrote:
> Using ixl(4) with it's hardmtu is broken, because packets with hardmtu
> were dropped cause they are bigger then rxmax is configured.
> 
> The Intel Ethernet Controller X710/XXV710/XL710 Datasheet said:
> 
> Table 1-3. Link layer Ethernet port features
> 
> 	Maximum Transmit Unit Size (MTU) is 9728 - Ethernet header/CRC =
> 	9728 - 18 = 9710 bytes (jumbo frames)
> 	MTU can be further reduced by additional header fields such as
> 	Virtual Local Area Network (VLAN) tag(s), etc.
> 
> Table 8-12. LAN Rx Queue Context in the Private Host Memory
> 
> 	The "rxmax" parameter defines the whole packet size starting at
> 	the L2 header up to including the Ethernet CRC.
> 
> The following diff sending and receiving sizes in the ixl(4) code.  The
> result is a working hardmtu of 9706 and its also working with vlan(4).
> 
> ok?
> 
> Index: dev/pci/if_ixl.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_ixl.c,v
> diff -u -p -r1.117 if_ixl.c
> --- dev/pci/if_ixl.c	23 Jun 2026 14:40:40 -0000	1.117
> +++ dev/pci/if_ixl.c	30 Jul 2026 15:15:53 -0000
> @@ -901,7 +901,8 @@ struct ixl_rx_wb_desc_32 {
>  #define IXL_TX_QUEUE_ALIGN		128
>  #define IXL_RX_QUEUE_ALIGN		128
>  
> -#define IXL_HARDMTU			9712 /* 9726 - ETHER_HDR_LEN */
> +#define IXL_HARDMTU			(9728 - ETHER_HDR_LEN - EVL_ENCAPLEN \
> +					    - ETHER_CRC_LEN)
>  #define IXL_TSO_SIZE			((255 * 1024) - 1)
>  #define IXL_MAX_DMA_SEG_SIZE		((16 * 1024) - 1)
>  
> @@ -3171,7 +3172,8 @@ ixl_rxr_config(struct ixl_softc *sc, str
>  	rxq.crcstrip = 1;
>  	rxq.l2tsel = IXL_HMC_RXQ_L2TSEL_1ST_TAG_TO_L2TAG1;
>  	rxq.showiv = 0;
> -	rxq.rxmax = htole16(IXL_HARDMTU);
> +	rxq.rxmax = htole16(IXL_HARDMTU + ETHER_HDR_LEN + EVL_ENCAPLEN +
> +	    ETHER_CRC_LEN);
>  	rxq.tphrdesc_ena = 0;
>  	rxq.tphwdesc_ena = 0;
>  	rxq.tphdata_ena = 0;
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.