Skip to content

Commit 97700bc

Browse files
Andre GuedesJeff Kirsher
authored andcommitted
igc: Align terms used in NFC support code
The Network Flow Classification (NFC) support code from IGC driver uses terms such as 'rule', 'filter', 'entry', 'input' interchangeably when referring to NFC rules, making it harder to follow the code. This patch renames IGC's internal APIs, structs, and variables so we stick with the term 'rule' since this is the term used in ethtool APIs. It also removes some not applicable comments along the way. No functionality is changed by this patch. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 7df76bd commit 97700bc

File tree

3 files changed

+114
-117
lines changed

3 files changed

+114
-117
lines changed

drivers/net/ethernet/intel/igc/igc.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ struct igc_adapter {
187187
u32 rss_queues;
188188
u32 rss_indir_tbl_init;
189189

190-
/* RX network flow classification support */
191-
struct hlist_head nfc_filter_list;
192-
unsigned int nfc_filter_count;
193-
194-
/* lock for RX network flow classification filter */
195-
spinlock_t nfc_lock;
190+
/* Any access to elements in nfc_rule_list is protected by the
191+
* nfc_rule_lock.
192+
*/
193+
spinlock_t nfc_rule_lock;
194+
struct hlist_head nfc_rule_list;
195+
unsigned int nfc_rule_count;
196196

197197
u8 rss_indir_tbl[IGC_RETA_SIZE];
198198

@@ -453,7 +453,7 @@ enum igc_filter_match_flags {
453453
};
454454

455455
/* RX network flow classification data structure */
456-
struct igc_nfc_input {
456+
struct igc_nfc_filter {
457457
/* Byte layout in order, all values with MSB first:
458458
* match_flags - 1 byte
459459
* etype - 2 bytes
@@ -466,14 +466,14 @@ struct igc_nfc_input {
466466
u8 dst_addr[ETH_ALEN];
467467
};
468468

469-
struct igc_nfc_filter {
469+
struct igc_nfc_rule {
470470
struct hlist_node nfc_node;
471-
struct igc_nfc_input filter;
471+
struct igc_nfc_filter filter;
472472
u16 sw_idx;
473473
u16 action;
474474
};
475475

476-
#define IGC_MAX_RXNFC_FILTERS 16
476+
#define IGC_MAX_RXNFC_RULES 16
477477

478478
/* igc_desc_unused - calculate if we have unused descriptors */
479479
static inline u16 igc_desc_unused(const struct igc_ring *ring)
@@ -549,12 +549,11 @@ static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data)
549549
return 0;
550550
}
551551

552-
/* forward declaration */
553552
void igc_reinit_locked(struct igc_adapter *);
554-
int igc_add_filter(struct igc_adapter *adapter,
555-
struct igc_nfc_filter *input);
556-
int igc_erase_filter(struct igc_adapter *adapter,
557-
struct igc_nfc_filter *input);
553+
int igc_enable_nfc_rule(struct igc_adapter *adapter,
554+
const struct igc_nfc_rule *rule);
555+
int igc_disable_nfc_rule(struct igc_adapter *adapter,
556+
const struct igc_nfc_rule *rule);
558557

559558
void igc_ptp_init(struct igc_adapter *adapter);
560559
void igc_ptp_reset(struct igc_adapter *adapter);

0 commit comments

Comments
 (0)