From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 583C98E8D for ; Mon, 4 Jan 2016 12:11:33 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id f206so208032227wmf.0 for ; Mon, 04 Jan 2016 03:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to; bh=XjBStlI6dsOqUQ1ALQoHyjXlfEF223Ag0mtIIN3z6b8=; b=klzZHTgoAF8ltj+o6qS80UOaGxj3ql/mZlWFBl6Ncz+n9af79xtME/u8WWKI/4aWWD N4nc169j0LA1DAVA8VBkuR5y0Px/DD6b/moJ0XJJVVeUsdk2uDz9Fp8RlLVDDteiaM+y lXlFfyarZKfyBuNewMXPPHRC+UukcdSYt5obkBD3rsVUesl2HxOI0njbkObLjynw6SO9 dvYon5q6Jto8xr9BC74eIM0R6X+M58wITCMTdiVkAVQhnYE7G3w7LOypvbUzvmDS5c2r OXKpRSrXdrilMuAYB5WdcLBZu9YQybcXDCKUBGC6l1HHukktqcfUKjAuS+T6WfhjFXEr aRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to; bh=XjBStlI6dsOqUQ1ALQoHyjXlfEF223Ag0mtIIN3z6b8=; b=LjUlpoUK9lxD9sBovRx2f4Ty0s/G3L8T8q4m63OAKfd9w9d8eQsu7wBX5Fd+mJdSUe DCjkiG2NKG8B0CwIVQ0KThZztlNb+BYg0HB5r2+trlIAlzyYQyThyOh3PHhl2N0Vfaxw WFzG+vk+rS7Q92qDK3dG+wRj+P+w/pF5aByHdrx87cjx4SgzFbYdKL1SfU2Gn+uFhXyv OWjYJu6B4jkZcfUET9TkKfWtMYkmAk2k8frqau2+H11NVy9uRhu+WOYED78vqyLFINuJ p5THbVVgTX2dqg8An8GjAFHITW6klnnBNYZh4Tm0kEFCFi3h/CEeVJEDRMdZRqc5ChYs Lq2Q== X-Gm-Message-State: ALoCoQnqBHVh4j4eE3BfXuaPoqmq4MpKo3S5l8nYIOI07pegg46rVku43MkfLpmiAdArHNAqAe3GC0h9mseE1fjUH/KAYVl/eg== X-Received: by 10.28.127.87 with SMTP id a84mr78697212wmd.83.1451905893136; Mon, 04 Jan 2016 03:11:33 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id u69sm44025121wmu.20.2016.01.04.03.11.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jan 2016 03:11:32 -0800 (PST) Date: Mon, 4 Jan 2016 12:11:14 +0100 From: Adrien Mazarguil To: Jianfeng Tan Message-ID: <20160104111114.GS3806@6wind.com> Mail-Followup-To: Jianfeng Tan , dev@dpdk.org References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1451544799-70776-9-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1451544799-70776-9-git-send-email-jianfeng.tan@intel.com> Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 08/12] pmd/mlx4: add dev_ptype_info_get implementation 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: Mon, 04 Jan 2016 11:11:33 -0000 Hi Jianfeng, I'm only commenting the mlx4/mlx5 bits in this message, see below. On Thu, Dec 31, 2015 at 02:53:15PM +0800, Jianfeng Tan wrote: > Signed-off-by: Jianfeng Tan > --- > drivers/net/mlx4/mlx4.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c > index 207bfe2..85afa32 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -2836,6 +2836,8 @@ rxq_cleanup(struct rxq *rxq) > * @param flags > * RX completion flags returned by poll_length_flags(). > * > + * @note: fix mlx4_dev_ptype_info_get() if any change here. > + * > * @return > * Packet type for struct rte_mbuf. > */ > @@ -4268,6 +4270,30 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) > priv_unlock(priv); > } > > +static int > +mlx4_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptype_mask, > + uint32_t ptypes[]) > +{ > + int num = 0; > + > + if ((dev->rx_pkt_burst == mlx4_rx_burst) > + || (dev->rx_pkt_burst == mlx4_rx_burst_sp)) { > + /* refers to rxq_cq_to_pkt_type() */ > + if ((ptype_mask & RTE_PTYPE_L3_MASK) == RTE_PTYPE_L3_MASK) { > + ptypes[num++] = RTE_PTYPE_L3_IPV4; > + ptypes[num++] = RTE_PTYPE_L3_IPV6; > + } > + > + if ((ptype_mask & RTE_PTYPE_INNER_L3_MASK) == RTE_PTYPE_INNER_L3_MASK) { > + ptypes[num++] = RTE_PTYPE_INNER_L3_IPV4; > + ptypes[num++] = RTE_PTYPE_INNER_L3_IPV6; > + } > + } else > + num = -ENOTSUP; > + > + return num; > +} I think checking for mlx4_rx_burst and mlx4_rx_burst_sp is unnecessary at the moment, all RX burst functions do update the packet_type field, no need for extra complexity. Same comment for mlx5. > + > /** > * DPDK callback to get device statistics. > * > @@ -4989,6 +5015,7 @@ static const struct eth_dev_ops mlx4_dev_ops = { > .stats_reset = mlx4_stats_reset, > .queue_stats_mapping_set = NULL, > .dev_infos_get = mlx4_dev_infos_get, > + .dev_ptypes_info_get = mlx4_dev_ptype_info_get, > .vlan_filter_set = mlx4_vlan_filter_set, > .vlan_tpid_set = NULL, > .vlan_strip_queue_set = NULL, > -- > 2.1.4 > -- Adrien Mazarguil 6WIND