From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 96B4E4CE4 for ; Mon, 9 Jul 2018 17:00:42 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id r16-v6so11345241wrt.11 for ; Mon, 09 Jul 2018 08:00:42 -0700 (PDT) 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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to:openpgp :user-agent; bh=Rq6qxqjEO/7vH9afzDD1GnfE/SeUOqmBIE7fIRwo7kk=; b=SI2edoJLZj5pOGM5W4QNlL9oBxy8HKNx/QqsP+/m6XdtjtsijkJEpHaGVwOh5CsYk5 K18m7ollZmox5DegjRQTDOV6/EaJOcQ1ymUynyy7bVejeyX0LImsIbyqJeOFckV9Irlp 8/4QU9DPRtYl2e66xUMIKAmWQOgSpHlJ0P8IIC7HvYfM7BUZpDwUK3sb11l+Bq118Bn3 gkCPzczhmgea47JeI0AIJAt6vSASKgkWZgikNf5uSkvrAntCUfZcOJtlCMeoDT/ItEWq 43qUsrbVrOBJ94th2Dv0ppBJ4PZH4QuZuVg3aW4imK5QQ2tUm8hsPKDqqkyI7jlcpqdh Cs/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:openpgp:user-agent; bh=Rq6qxqjEO/7vH9afzDD1GnfE/SeUOqmBIE7fIRwo7kk=; b=mGbqXhCGGpc26W93ifNj2IWVL5r27muJ74K6C9oPq+kS6Ue68fxO5k/zGcXZXdqzsu MEHChXE4jU1KyKVHUxzldzMU2sNPhixVcrPEGvbsQoktjDnLXiU4OPUF90UYsMhhgYVw I75o4OAyh/T9966kUIVhhNjUB/WAnCdma8TSJu6kEJH+CWjFhODS6Xsdz1BZN75fGAS2 0OC+3c4oKb+FLAWMDxRNO2G/mf2czRPtiC/Nt9VWxOZLba+tTnbzjtvHJp1U/zwgBUAg yNHEmty6dgfKnduRAsJMbCrPk71eLICCxPmgJNzqgZBytDTwblvVLyh5HkMkJGmm41ab F1FQ== X-Gm-Message-State: APt69E3hkqk5QUZR2GjeAzFU7z+Bgr9KUSW30jtnvEwpzd1g/LyL1Sna W0fWaB0pzYy2lDJjySza3go0 X-Google-Smtp-Source: AAOMgpdWXAkGnluHpLSIZRa/XnF6w4rZqp78jx8LBqejDxo3Sjhr2+R+NsW9cMipRWl4/YcYExwfRw== X-Received: by 2002:adf:f410:: with SMTP id g16-v6mr14606483wro.256.1531148442440; Mon, 09 Jul 2018 08:00:42 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id t53-v6sm21128570wrc.13.2018.07.09.08.00.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 08:00:41 -0700 (PDT) Date: Mon, 9 Jul 2018 17:00:26 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: dev@dpdk.org, Adrien Mazarguil Message-ID: <20180709150026.tsaeadpwngeo3v3t@laranjeiro-vm.dev.6wind.com> References: <20180707001131.GD53779@yongseok-MBP.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180707001131.GD53779@yongseok-MBP.local> OpenPGP: id=A0075DA8F66A5949 preference=signencrypt User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 19/20] net/mlx5: add flow MPLS item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 15:00:42 -0000 On Fri, Jul 06, 2018 at 05:11:31PM -0700, Yongseok Koh wrote: > On Wed, Jun 27, 2018 at 05:07:51PM +0200, Nelio Laranjeiro wrote: > > Signed-off-by: Nelio Laranjeiro > > --- >[...] > > + if (spec) { > > + memcpy(&mpls.val.label, spec, sizeof(mpls.val.label)); > > + memcpy(&mpls.mask.label, mask, sizeof(mpls.mask.label)); > > + /* Remove unwanted bits from values. */ > > + mpls.val.label &= mpls.mask.label; > > + } > > + if (size <= flow_size) > > Is it guaranteed flow->cur_verbs isn't null if size fits? Could be obvious but > just want to make sure. Yes it is. > > + mlx5_flow_spec_verbs_add(flow, &mpls, size); > > + mlx5_flow_layers_update(flow, MLX5_FLOW_LAYER_MPLS); > > + if (layers & MLX5_FLOW_LAYER_OUTER_L4_UDP) > > + flow->ptype = RTE_PTYPE_TUNNEL_MPLS_IN_GRE | RTE_PTYPE_L4_UDP; > > + else > > + flow->ptype = RTE_PTYPE_TUNNEL_MPLS_IN_GRE; > > + return size; > > +#endif /* !HAVE_IBV_DEVICE_MPLS_SUPPORT */ > > + return rte_flow_error_set(error, ENOTSUP, > > + RTE_FLOW_ERROR_TYPE_ITEM, > > + item, > > + "MPLS is not supported by Verbs, please" > > + " update."); > > +} > > + > > /** > > * Validate items provided by the user. > > * > > @@ -1650,6 +1722,9 @@ mlx5_flow_items(struct rte_eth_dev *dev, > > case RTE_FLOW_ITEM_TYPE_GRE: > > ret = mlx5_flow_item_gre(items, flow, remain, error); > > break; > > #ifdef HAVE_IBV_DEVICE_MPLS_SUPPORT > > > + case RTE_FLOW_ITEM_TYPE_MPLS: > > + ret = mlx5_flow_item_mpls(items, flow, remain, error); > > + break; > > #endif /* !HAVE_IBV_DEVICE_MPLS_SUPPORT */ > > How about this? >[...] It adds another couple of #ifdef #endif and the final output won't help much the user, having an error "MPLS is not updated by Verbs, please update" will help more than "item not supported". Regards, -- Nélio Laranjeiro 6WIND