From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/3] examples/ip_reassembly: add parse-ptype option Date: Thu, 09 Feb 2017 22:27:03 +0100 Message-ID: <4997476.25NJoPJnWZ@xps13> References: <1485156509-4919-1-git-send-email-yong.liu@intel.com> <1486650334-34300-1-git-send-email-yong.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Marvin Liu , Jianfeng Tan Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id CC4F7FAE1 for ; Thu, 9 Feb 2017 22:27:05 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id c85so243672400wmi.1 for ; Thu, 09 Feb 2017 13:27:05 -0800 (PST) In-Reply-To: <1486650334-34300-1-git-send-email-yong.liu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-02-09 22:25, Marvin Liu: > Add new option parse-ptype in this sample in case of pmd driver > not provide packet type info. If this option enabled, packet type > will be analyzed in Rx callback function. [...] > + if (parse_ptype) { > + if (add_cb_parse_ptype(portid, queueid) < 0) > + rte_exit(EXIT_FAILURE, > + "Fail to add ptype cb\n"); > + } else if (!check_ptype(portid)) > + rte_exit(EXIT_FAILURE, > + "PMD can not provide needed ptypes\n"); Instead of adding a new option, why not adding the callback automatically if the packet type is not supported by the hardware?