From patchwork Fri Apr 13 05:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 37986 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 892031BB67; Fri, 13 Apr 2018 07:56:59 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 613291B7D7 for ; Fri, 13 Apr 2018 07:56:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 22:56:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,444,1517904000"; d="scan'208";a="220088389" Received: from unknown (HELO localhost.localdomain) ([10.224.122.203]) by fmsmga006.fm.intel.com with ESMTP; 12 Apr 2018 22:56:53 -0700 From: Vipin Varghese To: dev@dpdk.org, ophirmu@mellanox.com Cc: pascal.mazon@6wind.com, ferruh.yigit@intel.com, Vipin Varghese Date: Fri, 13 Apr 2018 11:28:47 +0530 Message-Id: <1523599127-19424-1-git-send-email-vipin.varghese@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] net/tap: fix the protocol field for non ip X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When non IP packets are sent on TUN interface, the logic put Ipv6 as protocol field in header. With the current patch, the check is modified for ipv4, ipv6 and non ip. Fixes: 5a3efcfffd06 ("net/tap: add tun support") Cc: vipin.varghese@intel.com Suggested-by: Ophir Munk Signed-off-by: Vipin Varghese Reviewed-by: Ferruh Yigit --- drivers/net/tap/rte_eth_tap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 915d937..66e026f 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -526,8 +526,8 @@ enum ioctl_mode { */ char *buff_data = rte_pktmbuf_mtod(seg, void *); j = (*buff_data & 0xf0); - if (j & (0x40 | 0x60)) - pi.proto = (j == 0x40) ? 0x0008 : 0xdd86; + pi.proto = (j == 0x40) ? 0x0008 : + (j == 0x60) ? 0xdd86 : 0x00; iovecs[0].iov_base = π iovecs[0].iov_len = sizeof(pi);