From patchwork Thu Jan 18 22:04:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 863186 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MytRIfkc"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMygW0jvMz9t63 for ; Fri, 19 Jan 2018 09:05:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbeARWFI (ORCPT ); Thu, 18 Jan 2018 17:05:08 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:46847 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752689AbeARWFF (ORCPT ); Thu, 18 Jan 2018 17:05:05 -0500 Received: by mail-oi0-f68.google.com with SMTP id d124so16793985oib.13 for ; Thu, 18 Jan 2018 14:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OYB79WPZW2RcYW5URvzGu32ePjCamG5x3Bh1f6LDhvc=; b=MytRIfkc8KW5M89Jg/lRpelum+lvKJFkk3taqBkBAdDh+TJcG25EraTDgu/2NUFZ6w GER2SkNYwj4R1y+ggbGp17A10hmGOWiUAtTnXQdySprz86t9l+ooDiJkjTGXv+qHbvVk SfQSiWYXgsZDZ0koAaCougG0N/A2CnIHfHwFy6Lt9i3TwOAWr91Oce+vjnmfaumzjV6C qgZph7jWw5ErxxVEok1aYCVTGEjJHiNrbW6u+umnoRuvDsZJcvx8tX87UbpmG82iqnZZ XpL1UJjDBvxgS0ONShVy+4uIbMkPvb77g4iYDynunEFrPfMS0ryr/R/SfcJcPxsT8D81 c9dA== 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=OYB79WPZW2RcYW5URvzGu32ePjCamG5x3Bh1f6LDhvc=; b=RN9nsNtbshf705bKnuo0bixWIY3IIaahuVacOK5YUUOIcwtMt0wLHVnkcW/u/LYJxG cshL62yBRQoB7cJ/SXI+C+ekO1l9ZqTOiSEZBeAAj58ByoczRaY3l20QF1E9LlgsN7J4 w1U3yyuHtnUkjETxMSyrfT5CGygv1sMbLCVIc5yK3S0FslMFgRGXcCrlMBCKHwBktS6J E0JqoHELO3E00YHo94m2cqE4zuBmHdOnnhvaq5wmvjL43uV4ZQE+LGWjsUThrDMxsfyE 09F5you9Fgn91d9JxcaqpTIxPo4sT/8GAoqq1IjPteesIhLfJP5npe9Doqb9hGPVf7hJ c9BQ== X-Gm-Message-State: AKwxytdurmsJjW/PziLkN4AcFB80q9JYFph8NneZCyYbIErvuYCgvxV4 5WR1xOoQjUj6dah6eBG83PEdGL5D X-Google-Smtp-Source: ACJfBoufrbZfWi1hcHTAMClcaWI96ctcmCgY4x38n88WLPFvPeNE1P0NuHWrG9AM8/fkLsE2h49n9A== X-Received: by 10.202.223.8 with SMTP id w8mr3556319oig.132.1516313104798; Thu, 18 Jan 2018 14:05:04 -0800 (PST) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id 66sm1979549ots.17.2018.01.18.14.05.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Jan 2018 14:05:04 -0800 (PST) From: William Tu To: netdev@vger.kernel.org Cc: pshelar@ovn.org, jbenc@redhat.com Subject: [PATCHv4 net-next 0/2] net: erspan: add support for openvswitch Date: Thu, 18 Jan 2018 14:04:54 -0800 Message-Id: <1516313096-3971-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The first patch refactors the erspan header definitions. Originally, the erspan fields are defined as a group into a __be16 field, and use mask and offset to access each field. This is more costly due to calling ntohs/htons and error-prone. The first patch changes it to use bitfields. The second patch introduces the new OVS tunnel key attribute to program both v1 and v2 erspan tunnel for openvswitch. William Tu (2): net: erspan: use bitfield instead of mask and offset openvswitch: add erspan version I and II support include/net/erspan.h | 127 +++++++++++++++++++++++--------- include/uapi/linux/openvswitch.h | 11 +++ net/ipv4/ip_gre.c | 38 ++++------ net/ipv6/ip6_gre.c | 36 ++++----- net/openvswitch/flow_netlink.c | 154 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 285 insertions(+), 81 deletions(-) --- v3->v4 change from be32 to u32 for OVS_ERSPAN_OPT_IDX, suggested by Jiri Benc. v2->v3 revert the "openvswitch: Add erspan tunnel support." commit ceaa001a170e. redesign the OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS as nested attribute v1->v2 Fix compatibility issue suggested by Pravin.