From patchwork Fri Apr 10 10:02:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1269297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OrbxWBSX; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48zqsp2cvcz9sSt for ; Sat, 11 Apr 2020 19:51:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4D78B85F93; Sat, 11 Apr 2020 09:51:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VEGul4HQTGVd; Sat, 11 Apr 2020 09:51:55 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id EC4D585F5F; Sat, 11 Apr 2020 09:51:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D087FC1D74; Sat, 11 Apr 2020 09:51:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id CBA85C0177 for ; Sat, 11 Apr 2020 09:51:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B5C5D875B9 for ; Sat, 11 Apr 2020 09:51:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lfoidz+rxi6V for ; Sat, 11 Apr 2020 09:51:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 446D087553 for ; Sat, 11 Apr 2020 09:51:53 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id q16so2191710pje.1 for ; Sat, 11 Apr 2020 02:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wB9pUWQVW9ydbIpMTdNklKNjBeYMYt1beO4axmFBu60=; b=OrbxWBSXZ2F0BOY7NvnQ8Gv4mlR79uYNeRxdW5aAPdYJ1mOrzIfh8fmR4kwrqtQxa2 Ht1zY8f1NmmGIFEczyNMErJT/wLBD0KFge9BX4GFa0B2X9OjlyG69nkNHmqezxbaQ2Lj fxbHnsyW4huCxEpVYQca9yT0+0+0Qz70YNDXs/Bkns+arOU5NF1xQQuYnFFlGZ7kh4OX v2As8VEL7H1NKrfetUUjl7bceCXTUswBy08KKFVumTnXRzhq83639RWbampNk7vx0+qf +5q20K8Ib5dlU8C7La+r1cqk6f3m37oI0GwrcJF7siN8A/z8AHp7m/00OQS/Qpl4Jafz Khxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wB9pUWQVW9ydbIpMTdNklKNjBeYMYt1beO4axmFBu60=; b=Sluk6Tm2b3TmW0kEkrYeGQz8d46XBzhQ34iHNPluFFnitQluFRGGjnr7TDLp/eyXcb WjPhqaqjivH5OpyhKI4+8k3DOreHAHLqXlGyepdlDhNczMWx6Nep78mRhH8Z3/8pSnfv yaR5EVvFSBLd7sRto3YAzKAZTmYHicxzouOpJjfHRvKVWca3FpbAa4x8Ly+aBDK0/CHr AijNJqJZqrGhAHO88HXqKWnFqJczWQwEx3CVBMa4NHZJ+Oh8zBbQaV+QVGgOMX5NUamg VF5z6O1PzyTikqo1DUchjlc7ZaeLlDLaqZyGeVcejhznTYbqcl59EtabqDSsAG3qoNTc /G4Q== X-Gm-Message-State: AGi0Pua1h5AH/2ToZ0IkT/rrzdmkIthGPAxd0rbq6w1i0P0CTBQkIlDW JChDDnVoS5yzevLLyHbm+w0= X-Google-Smtp-Source: APiQypIWf7azCqqE1HZ0QMbOH5oW+UmvVfOujS//6NyxFHSHzVJo3y0A/SytvMxSFHdwlHFkLvT3wQ== X-Received: by 2002:a17:90a:276a:: with SMTP id o97mr10282321pje.194.1586598712806; Sat, 11 Apr 2020 02:51:52 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([115.171.63.184]) by smtp.gmail.com with ESMTPSA id hg20sm3714094pjb.3.2020.04.11.02.51.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2020 02:51:52 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: roid@mellanox.com, paulb@mellanox.com, blp@ovn.org Date: Fri, 10 Apr 2020 18:02:47 +0800 Message-Id: <1586512967-18878-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 Cc: dev@openvswitch.org Subject: [ovs-dev] [PATCH ovs] netdev-offload-tc: Use accurately function to check dl_type. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang When offloading the flows which matching the vlan feild, there is an error[1]. Then we can't offload them, though TC flower supports this. To fix it, we should use the *dl_type_is_ip_any* instead of *is_ip_any*. Use ovs-appctl command to reproduce it. $ ovs-appctl dpctl/add-flow "recirc_id(0),in_port(5),eth(dst=00:11:22:33:44:66), eth_type(0x8100),vlan(vid=100,pcp=0),encap(eth_type(0x0800),ipv4(dst=1.1.1.2))" "pop_vlan,3" [1] - "offloading isn't supported, unknown attribute" Cc: Roi Dayan Cc: Paul Blakey Cc: Ben Pfaff Signed-off-by: Tonghao Zhang --- lib/netdev-offload-tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c index 875ebef71941..3c52db3e90cd 100644 --- a/lib/netdev-offload-tc.c +++ b/lib/netdev-offload-tc.c @@ -1500,7 +1500,7 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match, mask->dl_type = 0; mask->in_port.odp_port = 0; - if (is_ip_any(key)) { + if (dl_type_is_ip_any(key->dl_type)) { flower.key.ip_proto = key->nw_proto; flower.mask.ip_proto = mask->nw_proto; mask->nw_proto = 0;