Skip to contentSkip to conversation

ixgbe: cleanup whitespace and formatting issues

PATCH In review Stephen Hemminger 2 participants 4 messages Apr 4, 2016 – Apr 6, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: cleanup whitespace and formatting issues

This driver was one of the originals and has lots of little whitespace issues.

PS: I know Intel doesn't like whitespace changes, there is never a good time to do this, but no resuliting binary changes and it is unlikely that more changes to this driver will occur this late in release cycle.

---
 drivers/net/ixgbe/ixgbe_82599_bypass.c   |   4 +-
 drivers/net/ixgbe/ixgbe_bypass.c         |   6 +-
 drivers/net/ixgbe/ixgbe_bypass.h         |   8 +-
 drivers/net/ixgbe/ixgbe_bypass_defines.h |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c         | 156 +++++++++++++++----------------
 drivers/net/ixgbe/ixgbe_fdir.c           |  10 +-
 drivers/net/ixgbe/ixgbe_pf.c             |  29 +++---
 drivers/net/ixgbe/ixgbe_rxtx.c           |  80 ++++++++--------
 8 files changed, 145 insertions(+), 150 deletions(-)
drivers/net/ixgbe/ixgbe_82599_bypass.c +2 -2
index 21c42ea..db05d8e 100644
@@ -306,8 +306,8 @@ ixgbe_bypass_init_hw(struct ixgbe_hw *hw)
 		hw->mac.ops.get_media_type = &ixgbe_bypass_get_media_type;
 
 		hw->mac.ops.disable_tx_laser = NULL;
-                hw->mac.ops.enable_tx_laser = NULL;
-                hw->mac.ops.flap_tx_laser = NULL;
+		hw->mac.ops.enable_tx_laser = NULL;
+		hw->mac.ops.flap_tx_laser = NULL;
 	}
 
 	return rc;
drivers/net/ixgbe/ixgbe_bypass.c +3 -3
index 73f608b..7006928 100644
@@ -82,7 +82,7 @@ ixgbe_bypass_set_time(struct ixgbe_adapter *adapter)
 	       BYPASS_CTL1_VALID_M |
 	       BYPASS_CTL1_OFFTRST_M;
 	value = (sec & BYPASS_CTL1_TIME_M) |
-	        BYPASS_CTL1_VALID |
+		BYPASS_CTL1_VALID |
 		BYPASS_CTL1_OFFTRST;
 
 	FUNC_PTR_OR_RET(adapter->bps.ops.bypass_set);
@@ -275,8 +275,8 @@ s32
 ixgbe_bypass_wd_timeout_store(struct rte_eth_dev *dev, u32 timeout)
 {
 	struct ixgbe_hw *hw;
-        u32 status;
-        u32 mask;
+	u32 status;
+	u32 mask;
 	s32 ret_val;
 	struct ixgbe_adapter *adapter = IXGBE_DEV_TO_ADPATER(dev);
 
drivers/net/ixgbe/ixgbe_bypass.h +4 -4
index fcd9774..5f5c63e 100644
@@ -37,10 +37,10 @@
 #ifdef RTE_NIC_BYPASS
 
 struct ixgbe_bypass_mac_ops {
-	s32 (*bypass_rw) (struct ixgbe_hw *hw, u32 cmd, u32 *status);
-	bool (*bypass_valid_rd) (u32 in_reg, u32 out_reg);
-	s32 (*bypass_set) (struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action);
-	s32 (*bypass_rd_eep) (struct ixgbe_hw *hw, u32 addr, u8 *value);
+	s32 (*bypass_rw)(struct ixgbe_hw *hw, u32 cmd, u32 *status);
+	bool (*bypass_valid_rd)(u32 in_reg, u32 out_reg);
+	s32 (*bypass_set)(struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action);
+	s32 (*bypass_rd_eep)(struct ixgbe_hw *hw, u32 addr, u8 *value);
 };
 
 struct ixgbe_bypass_info {
drivers/net/ixgbe/ixgbe_bypass_defines.h +1 -1
index 22570ac..cafcb27 100644
@@ -136,7 +136,7 @@ enum ixgbe_state_t {
 #define BYPASS_LOG_EVENT_SHIFT	28
 #define BYPASS_LOG_CLEAR_SHIFT	24 /* bit offset */
 #define IXGBE_DEV_TO_ADPATER(dev) \
-	((struct ixgbe_adapter*)(dev->data->dev_private))
+	((struct ixgbe_adapter *)(dev->data->dev_private))
 
 /* extractions from ixgbe_phy.h */
 #define	IXGBE_I2C_EEPROM_DEV_ADDR2	0xA2
drivers/net/ixgbe/ixgbe_ethdev.c +76 -80

479 lines not on this page · raw message

drivers/net/ixgbe/ixgbe_fdir.c +5 -5
index 2e4c353..d040feb 100644
@@ -189,14 +189,13 @@ fdir_enable_82599(struct ixgbe_hw *hw, uint32_t fdirctrl)
 	IXGBE_WRITE_FLUSH(hw);
 	for (i = 0; i < IXGBE_FDIR_INIT_DONE_POLL; i++) {
 		if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) &
-		                   IXGBE_FDIRCTRL_INIT_DONE)
+				   IXGBE_FDIRCTRL_INIT_DONE)
 			break;
 		msec_delay(1);
 	}
 
 	if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
-		PMD_INIT_LOG(ERR, "Flow Director poll time exceeded "
-			"during enabling!");
+		PMD_INIT_LOG(ERR, "Flow Director poll time exceeded during enabling!");
 		return -ETIMEDOUT;
 	}
 	return 0;
@@ -282,6 +281,7 @@ static inline uint32_t
 reverse_fdir_bitmasks(uint16_t hi_dword, uint16_t lo_dword)
 {
 	uint32_t mask = hi_dword << 16;
+
 	mask |= lo_dword;
 	mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1);
 	mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2);
@@ -822,7 +822,7 @@ ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,
 
 
 	/* process the remaining 30 bits in the key 2 bits at a time */
-	for (i = 15; i; i-- ) {
+	for (i = 15; i; i--) {
 		if (key & (0x0001 << i)) hash_result ^= lo_hash_dword >> i;
 		if (key & (0x00010000 << i)) hash_result ^= hi_hash_dword >> i;
 	}
@@ -1016,7 +1016,7 @@ fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
 
 	/* configure FDIRCMD register */
 	fdircmd |= IXGBE_FDIRCMD_CMD_ADD_FLOW |
-	          IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN;
+		  IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN;
 	fdircmd |= input->formatted.flow_type << IXGBE_FDIRCMD_FLOW_TYPE_SHIFT;
 	fdircmd |= (uint32_t)queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT;
 
drivers/net/ixgbe/ixgbe_pf.c +15 -14
index a2787d9..ceb07f4 100644
@@ -97,9 +97,9 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
 	struct ixgbe_vf_info **vfinfo =
 		IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
 	struct ixgbe_mirror_info *mirror_info =
-        IXGBE_DEV_PRIVATE_TO_PFDATA(eth_dev->data->dev_private);
+	IXGBE_DEV_PRIVATE_TO_PFDATA(eth_dev->data->dev_private);
 	struct ixgbe_uta_info *uta_info =
-        IXGBE_DEV_PRIVATE_TO_UTA(eth_dev->data->dev_private);
+	IXGBE_DEV_PRIVATE_TO_UTA(eth_dev->data->dev_private);
 	struct ixgbe_hw *hw =
 		IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
 	uint16_t vf_num;
@@ -115,8 +115,8 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
 	if (*vfinfo == NULL)
 		rte_panic("Cannot allocate memory for private VF data\n");
 
-	memset(mirror_info,0,sizeof(struct ixgbe_mirror_info));
-	memset(uta_info,0,sizeof(struct ixgbe_uta_info));
+	memset(mirror_info, 0, sizeof(struct ixgbe_mirror_info));
+	memset(uta_info, 0, sizeof(struct ixgbe_uta_info));
 	hw->mac.mc_filter_type = 0;
 
 	if (vf_num >= ETH_32_POOLS) {
@@ -280,19 +280,19 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	}
 
 	IXGBE_WRITE_REG(hw, IXGBE_GCR_EXT, gcr_ext);
-        IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
+	IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
 
-        /*
+	/*
 	 * enable vlan filtering and allow all vlan tags through
 	 */
-        vlanctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
-        vlanctrl |= IXGBE_VLNCTRL_VFE; /* enable vlan filters */
-        IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlanctrl);
+	vlanctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
+	vlanctrl |= IXGBE_VLNCTRL_VFE; /* enable vlan filters */
+	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlanctrl);
 
-        /* VFTA - enable all vlan filters */
-        for (i = 0; i < IXGBE_MAX_VFTA; i++) {
-                IXGBE_WRITE_REG(hw, IXGBE_VFTA(i), 0xFFFFFFFF);
-        }
+	/* VFTA - enable all vlan filters */
+	for (i = 0; i < IXGBE_MAX_VFTA; i++) {
+		IXGBE_WRITE_REG(hw, IXGBE_VFTA(i), 0xFFFFFFFF);
+	}
 
 	/* Enable MAC Anti-Spoofing */
 	hw->mac.ops.set_mac_anti_spoofing(hw, FALSE, vf_num);
@@ -481,7 +481,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 	int rar_entry = hw->mac.num_rar_entries - (vf + 1);
 	uint8_t *new_mac = (uint8_t *)(&msgbuf[1]);
 
-	if (is_valid_assigned_ether_addr((struct ether_addr*)new_mac)) {
+	if (is_valid_assigned_ether_addr((struct ether_addr *)new_mac)) {
 		rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
 		return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV);
 	}
@@ -678,6 +678,7 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
 	/* perform VF reset */
 	if (msgbuf[0] == IXGBE_VF_RESET) {
 		int ret = ixgbe_vf_reset(dev, vf, msgbuf);
+
 		vfinfo[vf].clear_to_send = true;
 		return ret;
 	}
drivers/net/ixgbe/ixgbe_rxtx.c +39 -41

256 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw

Hi Stephen,

Quoted 7 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, April 5, 2016 12:14 AM
To: Zhang, Helin; Ananyev, Konstantin
Cc: [email protected]; Stephen Hemminger
Subject: [dpdk-dev] [PATCH] ixgbe: cleanup whitespace and formatting issues

Quoted 7 lines

This driver was one of the originals and has lots of little whitespace issues.

PS: I know Intel doesn't like whitespace changes, there is never a good time to do this, but no resuliting binary changes and it is unlikely that more changes to this driver will occur this late in release cycle.

Thanks for this patch. I think it's good to make the format better :) But there's some checkpatch error and warnings, like this,
ERROR: "foo* bar" should be "foo *bar"
#508: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:4256:
+ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct ether_addr* mac_addr,

#2 lore raw
Quoted 15 lines · Wenzhuo

Hi Stephen,

Quoted 13 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, April 5, 2016 12:14 AM
To: Zhang, Helin; Ananyev, Konstantin
Cc: [email protected]; Stephen Hemminger
Subject: [dpdk-dev] [PATCH] ixgbe: cleanup whitespace and formatting issues

This driver was one of the originals and has lots of little whitespace issues.

PS: I know Intel doesn't like whitespace changes, there is never a good time to do this, but no resuliting binary changes and it is unlikely that more changes to this driver will occur this late in release cycle.

Quoted 7 lines
Quoted 1 line

Thanks for this patch. I think it's good to make the format better :) But there's some checkpatch error and warnings, like this,
ERROR: "foo* bar" should be "foo *bar"
#508: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:4256:
+ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct ether_addr* mac_addr,

I didn't fix all the checkpatch errors, just the easy ones.

#3 lore raw

Hi Stephen,

Quoted 29 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Tuesday, April 5, 2016 9:56 AM
To: Lu, Wenzhuo
Cc: Zhang, Helin; Ananyev, Konstantin; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ixgbe: cleanup whitespace and formatting issues

Quoted 18 lines · Wenzhuo

Hi Stephen,

Quoted 16 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, April 5, 2016 12:14 AM
To: Zhang, Helin; Ananyev, Konstantin
Cc: [email protected]; Stephen Hemminger
Subject: [dpdk-dev] [PATCH] ixgbe: cleanup whitespace and formatting issues

This driver was one of the originals and has lots of little whitespace issues.

PS: I know Intel doesn't like whitespace changes, there is never a good time to do this, but no resuliting binary changes and it is unlikely that more changes to this driver will occur this late in release cycle.

Quoted 9 lines

Review

Quoted 7 lines

Thanks for this patch. I think it's good to make the format better :) But there's some checkpatch error and warnings, like this,
ERROR: "foo* bar" should be "foo *bar"
#508: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:4256:

(quoted diff) +2 -0
+ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct ether_addr*
+mac_addr,

I didn't fix all the checkpatch errors, just the easy ones.

So, If you don't object, I can try to make a new version with the checkpatch error/warning fixed.