Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Nov 2017 12:32:10 +0000 (UTC)
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325585 - head/sys/dev/ena
Message-ID:  <201711091232.vA9CWAer066938@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mw
Date: Thu Nov  9 12:32:10 2017
New Revision: 325585
URL: https://svnweb.freebsd.org/changeset/base/325585

Log:
  Fix checking if the DF flag was set in ENA driver
  
  The previous way of checking for DF was not valid.
  When DF is enabled, the DF bit should be 1.
  
  The original way of checking it was wrong in 2 ways: first of all, it
  was not checking for single bit, secondly, it was checking for 0.
  
  Submitted by: Michal Krawczyk <mk@semihalf.com>
  Reviewed by: byenduri_gmail.com
  Obtained from: Semihalf
  Sponsored by: Amazon, Inc.
  Differential Revision: https://reviews.freebsd.org/D12865

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c	Thu Nov  9 12:07:02 2017	(r325584)
+++ head/sys/dev/ena/ena.c	Thu Nov  9 12:32:10 2017	(r325585)
@@ -2640,7 +2640,7 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct 
 	switch (etype) {
 	case ETHERTYPE_IP:
 		ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV4;
-		if (ip->ip_off == 0)
+		if ((ip->ip_off & htons(IP_DF)) != 0)
 			ena_tx_ctx->df = 1;
 		break;
 	case ETHERTYPE_IPV6:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711091232.vA9CWAer066938>