bonding: add QinQ packet xmit hash support
Checks
Commit Message
For QinQ packet with ether type 0x88a8, dpdk bond's xmit hash policy is
not worked to get the ip or port field.
Signed-off-by: Lilijun <jerry.lilijun@huawei.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
I think this change already went in dpdk-next-net:
commit 61e99d7e944885e8d625ded41b5877653e0b637e
Author: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue Aug 7 16:10:46 2018 +0800
net/bonding: add support to match on 0x88A8 ethertype
We assume VLAN ethtertype is 0x8100 in get_vlan_offset() function,
but it could be 0x88A8 if QinQ is supported.
Fixes: 06fe78b98ccd ("bond: add mode 6")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Chas Williams <chas3@att.com>
On Fri, Sep 14, 2018 at 9:52 PM Lilijun <jerry.lilijun@huawei.com> wrote:
>
> For QinQ packet with ether type 0x88a8, dpdk bond's xmit hash policy is
> not worked to get the ip or port field.
>
> Signed-off-by: Lilijun <jerry.lilijun@huawei.com>
> ---
> drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 58f7377..4417422 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -37,7 +37,8 @@
> {
> size_t vlan_offset = 0;
>
> - if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
> + if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto ||
> + rte_cpu_to_be_16(ETHER_TYPE_QINQ) == *proto) {
> struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
>
> vlan_offset = sizeof(struct vlan_hdr);
> --
> 1.8.4.msysgit.0
>
>
> -----Original Message-----
> From: chasmosaurus@gmail.com [mailto:chasmosaurus@gmail.com] On
> Behalf Of Chas Williams
> Sent: Monday, September 17, 2018 12:02 AM
> To: Lilijun (Jerry, Cloud Networking) <jerry.lilijun@huawei.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] bonding: add QinQ packet xmit hash
> support
>
> I think this change already went in dpdk-next-net:
>
> commit 61e99d7e944885e8d625ded41b5877653e0b637e
> Author: Yunjian Wang <wangyunjian@huawei.com>
> Date: Tue Aug 7 16:10:46 2018 +0800
>
> net/bonding: add support to match on 0x88A8 ethertype
>
> We assume VLAN ethtertype is 0x8100 in get_vlan_offset() function,
> but it could be 0x88A8 if QinQ is supported.
>
OK, thanks. I will update it.
> Fixes: 06fe78b98ccd ("bond: add mode 6")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> Acked-by: Chas Williams <chas3@att.com> On Fri, Sep 14, 2018 at 9:52 PM
> Lilijun <jerry.lilijun@huawei.com> wrote:
> >
> > For QinQ packet with ether type 0x88a8, dpdk bond's xmit hash policy
> > is not worked to get the ip or port field.
> >
> > Signed-off-by: Lilijun <jerry.lilijun@huawei.com>
> > ---
> > drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> > b/drivers/net/bonding/rte_eth_bond_pmd.c
> > index 58f7377..4417422 100644
> > --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> > @@ -37,7 +37,8 @@
> > {
> > size_t vlan_offset = 0;
> >
> > - if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
> > + if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto ||
> > + rte_cpu_to_be_16(ETHER_TYPE_QINQ) == *proto) {
> > struct vlan_hdr *vlan_hdr = (struct vlan_hdr
> > *)(eth_hdr + 1);
> >
> > vlan_offset = sizeof(struct vlan_hdr);
> > --
> > 1.8.4.msysgit.0
> >
> >
@@ -37,7 +37,8 @@
{
size_t vlan_offset = 0;
- if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
+ if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto ||
+ rte_cpu_to_be_16(ETHER_TYPE_QINQ) == *proto) {
struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
vlan_offset = sizeof(struct vlan_hdr);