From: Ferruh Yigit Subject: Re: [PATCH v2 1/3] net/af_packet: set_mtu() decrements sockaddr twice Date: Tue, 27 Nov 2018 17:42:44 +0000 Message-ID: <8cc744eb-011d-5b98-97ed-a45a0dbea6c5@intel.com> References: <1542707697-175836-1-git-send-email-tiago.lam@intel.com> <1542709592-215007-1-git-send-email-tiago.lam@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linville@tuxdriver.com To: Tiago Lam , dev@dpdk.org Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id C55701B430 for ; Tue, 27 Nov 2018 18:42:47 +0100 (CET) In-Reply-To: <1542709592-215007-1-git-send-email-tiago.lam@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Also can you please fix ./devtools/check-git-log.sh warnings on patches?