From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Herbert Subject: [PATCH iproute 3/5] ila: support to configure checksum neutral-map-auto Date: Wed, 22 Nov 2017 12:05:35 -0800 Message-ID: <20171122200537.26703-4-tom@quantonium.net> References: <20171122200537.26703-1-tom@quantonium.net> Cc: netdev@vger.kernel.org, rohit@quantonium.net, Tom Herbert To: stephen@networkplumber.org Return-path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:39923 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbdKVUGY (ORCPT ); Wed, 22 Nov 2017 15:06:24 -0500 Received: by mail-pl0-f66.google.com with SMTP id l16so1348031pli.6 for ; Wed, 22 Nov 2017 12:06:24 -0800 (PST) In-Reply-To: <20171122200537.26703-1-tom@quantonium.net> Sender: netdev-owner@vger.kernel.org List-ID: Configuration support in both ip ila and ip LWT for checksum neutral-map-auto. This is a mode of ILA where checksum neutral mapping is assumed for packets (there is no C-bit in the identifier to indicate checksum neutral). Signed-off-by: Tom Herbert --- ip/ipila.c | 8 +++++--- ip/iproute_lwtunnel.c | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ip/ipila.c b/ip/ipila.c index d4935d18..0b706f0b 100644 --- a/ip/ipila.c +++ b/ip/ipila.c @@ -28,7 +28,7 @@ static void usage(void) fprintf(stderr, "Usage: ip ila add loc_match LOCATOR_MATCH " "loc LOCATOR [ dev DEV ] " "[ csum-mode { adj-transport | neutral-map | " - "no-action } ]\n"); + "neutral-map-auto | no-action } ]\n"); fprintf(stderr, " ip ila del loc_match LOCATOR_MATCH " "[ loc LOCATOR ] [ dev DEV ]\n"); fprintf(stderr, " ip ila list\n"); @@ -59,6 +59,8 @@ static char *ila_csum_mode2name(__u8 csum_mode) return "neutral-map"; case ILA_CSUM_NO_ACTION: return "no-action"; + case ILA_CSUM_NEUTRAL_MAP_AUTO: + return "neutral-map-auto"; default: return "unknown"; } @@ -70,8 +72,8 @@ static int ila_csum_name2mode(char *name) return ILA_CSUM_ADJUST_TRANSPORT; else if (strcmp(name, "neutral-map") == 0) return ILA_CSUM_NEUTRAL_MAP; - else if (strcmp(name, "no-action") == 0) - return ILA_CSUM_NO_ACTION; + else if (strcmp(name, "neutral-map-auto") == 0) + return ILA_CSUM_NEUTRAL_MAP_AUTO; else return -1; } diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c index 1c8adbe7..ebedd94a 100644 --- a/ip/iproute_lwtunnel.c +++ b/ip/iproute_lwtunnel.c @@ -288,6 +288,8 @@ static char *ila_csum_mode2name(__u8 csum_mode) return "neutral-map"; case ILA_CSUM_NO_ACTION: return "no-action"; + case ILA_CSUM_NEUTRAL_MAP_AUTO: + return "neutral-map-auto"; default: return "unknown"; } @@ -301,6 +303,8 @@ static int ila_csum_name2mode(char *name) return ILA_CSUM_NEUTRAL_MAP; else if (strcmp(name, "no-action") == 0) return ILA_CSUM_NO_ACTION; + else if (strcmp(name, "neutral-map-auto") == 0) + return ILA_CSUM_NEUTRAL_MAP_AUTO; else return -1; } -- 2.11.0