From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zoltan Kiss Subject: Re: ixgbe TX function selection Date: Fri, 18 Mar 2016 13:33:20 +0000 Message-ID: <56EC03A0.20500@linaro.org> References: <56D5EB07.9070706@linaro.org> <9BB6961774997848B5B42BEC655768F8DD26BC@SHSMSX104.ccr.corp.intel.com> <56EAE521.900@linaro.org> <6A0DE07E22DDAD4C9103DF62FEBC09090343C5C9@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: "Lu, Wenzhuo" , "Wu, Jingjing" , "dev@dpdk.org" Return-path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 560E05908 for ; Fri, 18 Mar 2016 14:33:22 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id l68so31518630wml.0 for ; Fri, 18 Mar 2016 06:33:22 -0700 (PDT) In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09090343C5C9@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 18/03/16 00:45, Lu, Wenzhuo wrote: > Hi Zoltan, > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zoltan Kiss >> Sent: Friday, March 18, 2016 1:11 AM >> To: Wu, Jingjing; dev@dpdk.org >> Subject: Re: [dpdk-dev] ixgbe TX function selection >> >> >> >> On 10/03/16 07:51, Wu, Jingjing 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 (dev->data->scattered_rx == 1). That seems a bit dangerous, >>>> as you can turn that on inadvertently when you don't set >>>> max_rx_pkt_len and buffer size 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 segmented packets. >>>> 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. >>>> >>> >>> If you look into the ixgbe_set_tx_function, you will find tx function >>> selection is decided by the tx_flags on queue configure, which is >>> passed by rte_eth_txconf. So even you set dev->data->scattered_rx to >>> 1, if the tx_flags is ETH_TXQ_FLAGS_NOMULTSEGS, ixgbe_xmit_pkts_simple >>> is still selected as tx function. So, you'd better to set tx_flags=0, and have a try. >> >> You mean getting default_txconf from rte_eth_dev_info_get() and explicitly turn >> ETH_TXQ_FLAGS_NOMULTSEGS to 0? (filling tx_flags with zeros doesn't work >> very well) That's a way to solve it for me, but I'm rather talking about using >> defaults which doesn't cause memory leak quite easily. > Yes, ETH_TXQ_FLAGS_NOMULTSEGS only can be set to 1 when you know all your packets will not be segmented. > I think that means normally we should use full function path for TX, for we have no knowledge about if the packets will be segmented or not. > You don't need to set tx_flags to 0, only the ETH_TXQ_FLAGS_NOMULTSEGS bit should be 0, the other bits can be 1 if needed. So can we agree that the default settings should set ETH_TXQ_FLAGS_NOMULTSEGS to 0? > >> >>> >>>> Regards, >>>> >>>> Zoltan