From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 7C7725934 for ; Fri, 11 Sep 2015 18:09:26 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so69828722wic.1 for ; Fri, 11 Sep 2015 09:09:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=q8EVPlg7UfTu0hTF23941TUmCyugDd8+SYzXZ3PAMoI=; b=QEgGlyrEnWBJbUI50XL0whfayo/jBzH8Q44JsoGCpAmCMO20c2rPcZKBFeQjT13nPM JghRJ9EiNYANSbDbVgbti7vonGuWLDkGTxlVbaCE4YooKfY8UaFWygRSuGYY4ErCMRXF WJwDr4kn7u3Dp6iunWB/5j21txD/7spJjbdwLUBF9ehkrt4oAkSQpMWXuQLsmxoKpk6w pMSiwv4QVHVgVz20sT2HKwGkjAlemksCY6jHihroOkPfR+LQXkWaiRUNYECIONBxgc3w 5cdUa1zssxgdav3fs2OwPqpEjB7J8q/kSuSaFBKAuuc4KIzaEn0wOUhAHf7xJpvZCBiZ R3SQ== X-Gm-Message-State: ALoCoQm1Sor/XEKaOXyQ7I04CFiT//DIUD60PjJVV1TalltkBe/sIA5HAo9WtpN5/5O9Fep7ubMx X-Received: by 10.194.238.202 with SMTP id vm10mr75973023wjc.96.1441987766358; Fri, 11 Sep 2015 09:09:26 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id bi6sm1067043wjc.25.2015.09.11.09.09.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Sep 2015 09:09:25 -0700 (PDT) From: Thomas Monjalon To: Avi Kivity , Vladislav Zolotarov , "didier.pallard" Date: Fri, 11 Sep 2015 18:08:17 +0200 Message-ID: <3734976.j9Azrvq6io@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <55F2F6A9.6080405@cloudius-systems.com> References: <1439489195-31553-1-git-send-email-vladz@cloudius-systems.com> <55F2F6A9.6080405@cloudius-systems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v1] ixgbe_pmd: forbid tx_rs_thresh above 1 for all NICs but 82598 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 16:09:26 -0000 2015-09-11 18:43, Avi Kivity: > On 09/11/2015 06:12 PM, Vladislav Zolotarov wrote: > > On Sep 11, 2015 5:55 PM, "Thomas Monjalon" > > wrote: > > > 2015-09-11 17:47, Avi Kivity: > > > > On 09/11/2015 05:25 PM, didier.pallard wrote: > > > > > Hi vlad, > > > > > > > > > > Documentation states that a packet (or multiple packets in transmit > > > > > segmentation) can span any number of > > > > > buffers (and their descriptors) up to a limit of 40 minus WTHRESH > > > > > minus 2. > > > > > > > > > > Shouldn't there be a test in transmit function that drops > > properly the > > > > > mbufs with a too large number of > > > > > segments, while incrementing a statistic; otherwise transmit > > function > > > > > may be locked by the faulty packet without > > > > > notification. > > > > > > > > > > > > > What we proposed is that the pmd expose to dpdk, and dpdk expose > > to the > > > > application, an mbuf check function. This way applications that can > > > > generate complex packets can verify that the device will be able to > > > > process them, and applications that only generate simple mbufs can > > avoid > > > > the overhead by not calling the function. > > > > > > More than a check, it should be exposed as a capability of the port. > > > Anyway, if the application sends too much segments, the driver must > > > drop it to avoid hang, and maintain a dedicated statistic counter to > > > allow easy debugging. > > > > I agree with Thomas - this should not be optional. Malformed packets > > should be dropped. In the icgbe case it's a very simple test - it's a > > single branch per packet so i doubt that it could impose any > > measurable performance degradation. > > A drop allows the application no chance to recover. The driver must > either provide the ability for the application to know that it cannot > accept the packet, or it must fix it up itself. I have the feeling that everybody agrees on the same thing: the application must be able to make a well formed packet by checking limitations of the port. What about a field rte_eth_dev_info.max_tx_segs? In case the application fails in its checks, the driver must drop it and notify the user via a stat counter. The driver can also remove the hardware limitation by gathering the segments but it may be hard to implement and would be a slow operation.