From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by dpdk.org (Postfix) with ESMTP id B87CE5A6B for ; Mon, 11 Jan 2016 08:40:55 +0100 (CET) Received: by mail-ob0-f175.google.com with SMTP id wp13so264712521obc.1 for ; Sun, 10 Jan 2016 23:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9SeH3BTpi7f4xTrpsG81ExojO2VAjGAghnvpiy88ZSU=; b=SwNz1ub1wxPmEoCGgmra3+jO4ze/UffhJvh/2BTofWZkcNsgMQcEbv5aF5K5YDWtZv TZy8zAnhgZXpNpYHk+gpA1i51gDbiiYUZ4DstIwhR8LCL+2XZt+FnADPY0OTBxIr+zxl l5qI5n09sZzsdg5s4mpfjRrqnheG540ZbrDn+ifUGjVZO8HVZjdcPMNY9S4RlvjPRwgE 9eVNBZqsd0fmI89SaR308JiKon6w07+ucZtPjlJx/eLb//oDtRoj7CLTiwUHgwsiPCjz NQaSDa/668ClaZctSrgt3608Fw9ynFGFX3BwsvCA+2UDxKdRrUotODuuT/TriBLrI1De mbaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9SeH3BTpi7f4xTrpsG81ExojO2VAjGAghnvpiy88ZSU=; b=KGv/zcVFQ4CQsBLWyBG+6fIH6zw7un0FKwxx2KkSpMmz8tJpHLFGk9/xs3SQlYQ8b8 mcAsy4l7OMG9vxbc7NqCH9FiM4R7YWqPRdXVCe2nBbPkVOWgUR05xuAnPtTRKruY+1dG hGLF/nuI+i3xvXc2cDn+vE2H+8SJZ3miEc8WQXBtN2qQeGZ5FFmOZ5yRdl5ffjt9Bx/v ASUTZj8dYwdsD4iIB3jb6Oa9QcAGvE2JNBznQwzh6t0H0wMsHGj6FoJtayI8ioC8XubV zao09/NYrnvUg2Qg/qVLZEd6QawLfdilNK2ZmIml26ICzHuryl6w2gqvdhOdCPnkDeNU flCw== X-Gm-Message-State: ALoCoQnmRQjZ8dpBMiBzl3LIqtUwm207Y8e1QG5EvKhH36aLJDMhfhF+UIvmR4p2phRjXl5ucqYCNaiSbC1sgG+IE2SVJaG9oPjZ6hYTEjaU8F1BFLXVNnY= MIME-Version: 1.0 X-Received: by 10.182.241.3 with SMTP id we3mr89480990obc.82.1452498055180; Sun, 10 Jan 2016 23:40:55 -0800 (PST) Received: by 10.60.38.132 with HTTP; Sun, 10 Jan 2016 23:40:55 -0800 (PST) Received: by 10.60.38.132 with HTTP; Sun, 10 Jan 2016 23:40:55 -0800 (PST) In-Reply-To: <1452496044-17524-2-git-send-email-wenzhuo.lu@intel.com> References: <1452496044-17524-1-git-send-email-wenzhuo.lu@intel.com> <1452496044-17524-2-git-send-email-wenzhuo.lu@intel.com> Date: Mon, 11 Jan 2016 08:40:55 +0100 Message-ID: From: Vincent JARDIN To: Wenzhuo Lu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 1/4] ixgbe: support UDP tunnel add/del 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, 11 Jan 2016 07:40:56 -0000 see inline Le 11 janv. 2016 08:08, "Wenzhuo Lu" a =C3=A9crit : > > Add UDP tunnel add/del support on ixgbe. Now it only support > VxLAN port configuration. > Although the VxLAN port has a default value 4789, it can be > changed. We support VxLAN port configuration to meet the > change. > Note, the default value of VxLAN port in ixgbe NICs is 0. So > please set it when using VxLAN off-load. > > Signed-off-by: Wenzhuo Lu > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 93 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 93 insertions(+) > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c > index 4c4c6df..381cbad 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -337,6 +337,10 @@ static int ixgbe_timesync_read_time(struct rte_eth_dev *dev, > struct timespec *timestamp); > static int ixgbe_timesync_write_time(struct rte_eth_dev *dev, > const struct timespec *timestamp); > +static int ixgbe_dev_udp_tunnel_add(struct rte_eth_dev *dev, > + struct rte_eth_udp_tunnel *udp_tunnel); > +static int ixgbe_dev_udp_tunnel_del(struct rte_eth_dev *dev, > + struct rte_eth_udp_tunnel *udp_tunnel); > > /* > * Define VF Stats MACRO for Non "cleared on read" register > @@ -495,6 +499,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops =3D= { > .timesync_adjust_time =3D ixgbe_timesync_adjust_time, > .timesync_read_time =3D ixgbe_timesync_read_time, > .timesync_write_time =3D ixgbe_timesync_write_time, > + .udp_tunnel_add =3D ixgbe_dev_udp_tunnel_add, > + .udp_tunnel_del =3D ixgbe_dev_udp_tunnel_del, > }; > Your patch is not adding HW tunnel support but port management. > /* > @@ -6191,6 +6197,93 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev, > return 0; > } > > +#define DEFAULT_VXLAN_PORT 4789 > + > +/* on x550, there's only one register for VxLAN UDP port. > + * So, we cannot add or del the port. We only update it. > + */ > +static int > +ixgbe_update_vxlan_port(struct ixgbe_hw *hw, > + uint16_t port) > +{ > + IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, port); > + IXGBE_WRITE_FLUSH(hw); > + > + return 0; > +} > + > +/* Add UDP tunneling port */ > +static int > +ixgbe_dev_udp_tunnel_add(struct rte_eth_dev *dev, > + struct rte_eth_udp_tunnel *udp_tunnel) > +{ > + int ret =3D 0; > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + > + if (hw->mac.type !=3D ixgbe_mac_X550 && > + hw->mac.type !=3D ixgbe_mac_X550EM_x) { > + return -ENOTSUP; > + } > + > + if (udp_tunnel =3D=3D NULL) > + return -EINVAL; > + > + switch (udp_tunnel->prot_type) { > + case RTE_TUNNEL_TYPE_VXLAN: > + /* cannot add a port, update the port value */ > + ret =3D ixgbe_update_vxlan_port(hw, udp_tunnel->udp_port)= ; > + break; > + > + case RTE_TUNNEL_TYPE_GENEVE: > + case RTE_TUNNEL_TYPE_TEREDO: > + PMD_DRV_LOG(ERR, "Tunnel type is not supported now."); > + ret =3D -1; > + break; > + > + default: > + PMD_DRV_LOG(ERR, "Invalid tunnel type"); > + ret =3D -1; > + break; > + } > + > + return ret; > +} Is tunnel_add a proper naming? We need to keep flexibility for NICs that will support full HW tunneling support. Here it is about setting registers. > + > +/* Remove UDP tunneling port */ > +static int > +ixgbe_dev_udp_tunnel_del(struct rte_eth_dev *dev, > + struct rte_eth_udp_tunnel *udp_tunnel) > +{ > + int ret =3D 0; > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + > + if (hw->mac.type !=3D ixgbe_mac_X550 && > + hw->mac.type !=3D ixgbe_mac_X550EM_x) { > + return -ENOTSUP; > + } > + > + if (udp_tunnel =3D=3D NULL) > + return -EINVAL; > + > + switch (udp_tunnel->prot_type) { > + case RTE_TUNNEL_TYPE_VXLAN: > + /* cannot del the port, reset it to default */ > + ret =3D ixgbe_update_vxlan_port(hw, DEFAULT_VXLAN_PORT); > + break; > + case RTE_TUNNEL_TYPE_GENEVE: > + case RTE_TUNNEL_TYPE_TEREDO: > + PMD_DRV_LOG(ERR, "Tunnel type is not supported now."); > + ret =3D -1; > + break; > + default: > + PMD_DRV_LOG(ERR, "Invalid tunnel type"); > + ret =3D -1; > + break; > + } > + > + return ret; > +} > + > static struct rte_driver rte_ixgbe_driver =3D { > .type =3D PMD_PDEV, > .init =3D rte_ixgbe_pmd_init, > -- > 1.9.3 > I think the semantic of this serie should be revisited. It is about adding the support of inner/outer checksum for encapsulated packets but not the support of HW encap/decap (tunnel?). Thank you, Vincent