[dpdk-dev] [PATCH v2 1/3] net/af_packet: set_mtu() decrements sockaddr twice

Ferruh Yigit ferruh.yigit at intel.com
Tue Nov 27 18:42:44 CET 2018


On 11/20/2018 10:26 AM, Tiago Lam wrote:
> When setting the MTU, eth_dev_mtu_set() is called to validate the
> provided MTU. As part of that, it calculates the useful area to store
> data and compares it against the MTU, to guarantee that there's enough
> space to store the data. It calculates that as:
>     "tp_frame_size - TPACKET2_HDRLEN - sizeof(struct sockaddr_ll)"
> 
> However, the TPACKET2_HDRLEN macro already increaments sizeof(struct
> sockaddr_ll) internally, meaning the useuful area of data above will
> have sizeof(struct sockaddr_ll) decremented twice.

There are a few typos above.

> 
> Instead, the useful area of data should be calculated as:
>     "tp_frame_size - TPACKET2_HDRLEN"
> 
> This makes sure that there's enough useful area to fit the provided MTU
> after excluding tpacket2_hdr and sockaddr_ll.
> 
> Fixes: cc68ac4 ("net/af_packet: support MTU change")

The syntax is slightly different, can you please try following git alias:
alias.fixline=log -1 --abbrev=12 --format='Fixes: %h ("%s")%nCc: %ae'

> 
> Signed-off-by: Tiago Lam <tiago.lam at intel.com>

Also can you please fix ./devtools/check-git-log.sh warnings on patches?


More information about the dev mailing list