net/af_packet: fix setting MTU decrements sockaddr twice
net/af_packet: fix setting MTU decrements sockaddr twice

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 increments sizeof(struct
sockaddr_ll) internally, meaning the useuful area of data above will
have sizeof(struct sockaddr_ll) decremented twice.

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: cc68ac4847bc ("net/af_packet: support MTU change")
Cc: stable@dpdk.org

Signed-off-by: Tiago Lam <a5d814a3ba3c87e37a920688311be806714cc755@intel.com>
Reviewed-by: Ferruh Yigit <ba8734c3c506d2e3557bd4ac8fdaccd25bdb9aa7@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk