From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zoltan Kiss Subject: Re: ixgbe TX function selection Date: Fri, 4 Mar 2016 11:59:48 +0000 Message-ID: <56D978B4.4020300@linaro.org> References: <56D5EB07.9070706@linaro.org> <6A0DE07E22DDAD4C9103DF62FEBC0909034378C2@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable To: "Lu, Wenzhuo" , "dev@dpdk.org" Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id ED3602BA3 for ; Fri, 4 Mar 2016 13:00:01 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id l68so31566438wml.0 for ; Fri, 04 Mar 2016 04:00:01 -0800 (PST) In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC0909034378C2@shsmsx102.ccr.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 04/03/16 01:47, Lu, Wenzhuo wrote: > Hi Zoltan, > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zoltan Kiss >> Sent: Wednesday, March 2, 2016 3:19 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] ixgbe TX function selection >> >> Hi, >> >> I've noticed that ixgbe_set_tx_function() selects the non-SG function = even if > Thanks for let us know the problem. But I don't catch your point. Do yo= u really mean TX here? After a quick look at the code, I don=E2=80=99t fi= nd the SG/non-SG functions for TX. Do I miss something? The simple code path doesn't handle multisegmented packets.=20 ixgbe_txq_vec_setup() and ixgbe_xmit_pkts_simple() doesn't even check=20 the next pointer of the mbuf, just put the first one on the descriptor=20 ring, and when TX completion happens, the memory is leaked because it=20 just sets ->next to NULL, and calls rte_mempool_put[_bulk] ixgbe_xmit_pkts() puts all the segments on the descriptor ring,=20 therefore when the descriptors are released they are released as well. This is what these functions supposed to do, but my point is it's very=20 easy to send a multisegmented packet to the simple code path. > >> (dev->data->scattered_rx =3D=3D 1). That seems a bit dangerous, as you= can turn >> that on inadvertently when you don't set max_rx_pkt_len and buffer siz= e in >> certain ways. I've learnt it in the hard way, as my segmented packets = were >> leaking memory on the TX path, which doesn't cries if you send out seg= mented >> packets. > Which one will cause problem? SG or non-SG packets? And where does the = memory leak happen? > >> How should this case be treated? Assert on the non-SG TX side for the = 'next' >> pointer? Or turning on SG if RX has it? It doesn't seem to be a solid = way as other >> interfaces still can have SG turned on. >> >> Regards, >> >> Zoltan