Skip to content

Commit

Permalink
ON-16207: Don't print filter information for dummy hw filters
Browse files Browse the repository at this point in the history
The debugfs output for efct prints information for the currently
installed filters. Now that we are using a dummy filter to specify the
ownership of rxq 0, we shouldn't output this alongside the real hw
filters. A dummy driv_id for the filter is used to determine if the
filter is real or not. A value of -1 is chosen for this dummy id value
since the X3 net driver uses this value to index in to a table, so it
should give negative/extremely large numbers.
  • Loading branch information
tcrawley-xilinx committed Jan 24, 2025
1 parent f2dcb46 commit af6bead
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/ci/efhw/efct_filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ struct efct_filter_insert_out {
};
struct efct_filter_state;

#define EFCT_HW_FILTER_DRV_ID_DUMMY ((uint64_t)~0)

typedef int (*drv_filter_insert)(const struct efct_filter_insert_in *in,
struct efct_filter_insert_out *out);

Expand Down
3 changes: 3 additions & 0 deletions src/lib/efhw/debugfs_efct.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <ci/efhw/nic.h>
#include <ci/efhw/efct.h>
#include <ci/efhw/ef10ct.h>
#include <ci/efhw/efct_filters.h>

#include "linux_resource_internal.h"
#include "debugfs.h"
Expand All @@ -30,6 +31,8 @@ static int efct_debugfs_read_hw_filters(struct seq_file *file,
for( i = 0; i < fs->hw_filters_n; i++ ) {
filter = &fs->hw_filters[i];
if( filter->refcount > 0 ) {
if( filter->drv_id == EFCT_HW_FILTER_DRV_ID_DUMMY)
continue;
if( filter->remote_ip )
snprintf(remote_ip_buf, sizeof(remote_ip_buf), "%pI4:%d ",
&filter->remote_ip, ntohs(filter->remote_port));
Expand Down
1 change: 1 addition & 0 deletions src/lib/efhw/efct_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void efct_filter_state_reserve_rxq(struct efct_filter_state *state, int rxq)
EFHW_ASSERT(state->hw_filters_n > rxq);
state->hw_filters[rxq].rxq = 0;
state->hw_filters[rxq].refcount = 1;
state->hw_filters[rxq].drv_id = EFCT_HW_FILTER_DRV_ID_DUMMY;
}


Expand Down

0 comments on commit af6bead

Please sign in to comment.