All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	netdev@vger.kernel.org, sassmann@redhat.com,
	anthony.l.nguyen@intel.com
Subject: [PATCH net-next 09/11] igbvf: convert to strongly typed descriptors
Date: Wed, 26 May 2021 10:23:44 -0700	[thread overview]
Message-ID: <20210526172346.3515587-10-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210526172346.3515587-1-anthony.l.nguyen@intel.com>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

The igbvf driver for some reason never strongly typed it's descriptor
formats. Make this driver like the rest of the Intel drivers and use
__le* for our little endian descriptors.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
Warning Detail
.../igbvf/netdev.c:203:48: warning: incorrect type in assignment (different base types)
.../igbvf/netdev.c:203:48:    expected unsigned long long [usertype] pkt_addr
.../igbvf/netdev.c:203:48:    got restricted __le64 [usertype]
.../igbvf/netdev.c:205:48: warning: incorrect type in assignment (different base types)
.../igbvf/netdev.c:205:48:    expected unsigned long long [usertype] hdr_addr
.../igbvf/netdev.c:205:48:    got restricted __le64 [usertype]
.../igbvf/netdev.c:207:48: warning: incorrect type in assignment (different base types)
.../igbvf/netdev.c:207:48:    expected unsigned long long [usertype] pkt_addr
.../igbvf/netdev.c:207:48:    got restricted __le64 [usertype]
.../igbvf/netdev.c:261:19: warning: cast to restricted __le32
.../igbvf/netdev.c:276:25: warning: cast to restricted __le16
.../igbvf/netdev.c:282:26: warning: cast to restricted __le16
.../igbvf/netdev.c:356:52: warning: incorrect type in argument 5 (different base types)
.../igbvf/netdev.c:356:52:    expected restricted __le16 [usertype] vlan
.../igbvf/netdev.c:356:52:    got unsigned short [usertype] vlan
.../igbvf/netdev.c:371:27: warning: cast to restricted __le32
.../igbvf/netdev.c:797:45: warning: restricted __le32 degrades to integer
---
 drivers/net/ethernet/intel/igbvf/vf.h | 42 +++++++++++++--------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h
index c71b0d7dbcee..ba9bb3132d5d 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.h
+++ b/drivers/net/ethernet/intel/igbvf/vf.h
@@ -35,31 +35,31 @@ struct e1000_hw;
 /* Receive Descriptor - Advanced */
 union e1000_adv_rx_desc {
 	struct {
-		u64 pkt_addr; /* Packet buffer address */
-		u64 hdr_addr; /* Header buffer address */
+		__le64 pkt_addr; /* Packet buffer address */
+		__le64 hdr_addr; /* Header buffer address */
 	} read;
 	struct {
 		struct {
 			union {
-				u32 data;
+				__le32 data;
 				struct {
-					u16 pkt_info; /* RSS/Packet type */
+					__le16 pkt_info; /* RSS/Packet type */
 					/* Split Header, hdr buffer length */
-					u16 hdr_info;
+					__le16 hdr_info;
 				} hs_rss;
 			} lo_dword;
 			union {
-				u32 rss; /* RSS Hash */
+				__le32 rss; /* RSS Hash */
 				struct {
-					u16 ip_id; /* IP id */
-					u16 csum;  /* Packet Checksum */
+					__le16 ip_id; /* IP id */
+					__le16 csum;  /* Packet Checksum */
 				} csum_ip;
 			} hi_dword;
 		} lower;
 		struct {
-			u32 status_error; /* ext status/error */
-			u16 length; /* Packet length */
-			u16 vlan;   /* VLAN tag */
+			__le32 status_error; /* ext status/error */
+			__le16 length; /* Packet length */
+			__le16 vlan; /* VLAN tag */
 		} upper;
 	} wb;  /* writeback */
 };
@@ -70,14 +70,14 @@ union e1000_adv_rx_desc {
 /* Transmit Descriptor - Advanced */
 union e1000_adv_tx_desc {
 	struct {
-		u64 buffer_addr; /* Address of descriptor's data buf */
-		u32 cmd_type_len;
-		u32 olinfo_status;
+		__le64 buffer_addr; /* Address of descriptor's data buf */
+		__le32 cmd_type_len;
+		__le32 olinfo_status;
 	} read;
 	struct {
-		u64 rsvd; /* Reserved */
-		u32 nxtseq_seed;
-		u32 status;
+		__le64 rsvd; /* Reserved */
+		__le32 nxtseq_seed;
+		__le32 status;
 	} wb;
 };
 
@@ -94,10 +94,10 @@ union e1000_adv_tx_desc {
 
 /* Context descriptors */
 struct e1000_adv_tx_context_desc {
-	u32 vlan_macip_lens;
-	u32 seqnum_seed;
-	u32 type_tucmd_mlhl;
-	u32 mss_l4len_idx;
+	__le32 vlan_macip_lens;
+	__le32 seqnum_seed;
+	__le32 type_tucmd_mlhl;
+	__le32 mss_l4len_idx;
 };
 
 #define E1000_ADVTXD_MACLEN_SHIFT	9  /* Adv ctxt desc mac len shift */
-- 
2.26.2


  parent reply	other threads:[~2021-05-26 17:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 17:23 [PATCH net-next 00/11][pull request] 1GbE Intel Wired LAN Driver Updates 2021-05-26 Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 01/11] e100: handle eeprom as little endian Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 02/11] intel: remove checker warning Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 03/11] fm10k: move error check Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 04/11] igb/igc: use strongly typed pointer Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 05/11] igb: handle vlan types with checker enabled Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 06/11] igb: fix assignment on big endian machines Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 07/11] igb: override two checker warnings Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 08/11] intel: call csum functions with well formatted arguments Tony Nguyen
2021-05-26 17:23 ` Tony Nguyen [this message]
2021-05-26 17:23 ` [PATCH net-next 10/11] ixgbe: use checker safe conversions Tony Nguyen
2021-05-26 17:23 ` [PATCH net-next 11/11] ixgbe: reduce checker warnings Tony Nguyen
2021-05-26 17:42   ` Shannon Nelson
2021-05-27  1:40 ` [PATCH net-next 00/11][pull request] 1GbE Intel Wired LAN Driver Updates 2021-05-26 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526172346.3515587-10-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.