Skip to content

Commit 23a4e38

Browse files
Jakub Kicinskidavem330
authored andcommitted
nfp: create separate define for max number of vectors
We are currently using define for max TX rings to allocate IRQ vectors. It's OK since the max number of rings for TX and RX are currently the same, but lets make the code nicer by taking max of the two. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1a1d74d commit 23a4e38

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
/* Queue/Ring definitions */
8888
#define NFP_NET_MAX_TX_RINGS 64 /* Max. # of Tx rings per device */
8989
#define NFP_NET_MAX_RX_RINGS 64 /* Max. # of Rx rings per device */
90+
#define NFP_NET_MAX_R_VECS (NFP_NET_MAX_TX_RINGS > NFP_NET_MAX_RX_RINGS ? \
91+
NFP_NET_MAX_TX_RINGS : NFP_NET_MAX_RX_RINGS)
92+
#define NFP_NET_MAX_IRQS (NFP_NET_NON_Q_VECTORS + NFP_NET_MAX_R_VECS)
9093

9194
#define NFP_NET_MIN_TX_DESCS 256 /* Min. # of Tx descs per ring */
9295
#define NFP_NET_MIN_RX_DESCS 256 /* Min. # of Rx descs per ring */
@@ -539,9 +542,8 @@ struct nfp_net {
539542

540543
u8 num_irqs;
541544
u8 num_r_vecs;
542-
struct nfp_net_r_vector r_vecs[NFP_NET_MAX_TX_RINGS];
543-
struct msix_entry irq_entries[NFP_NET_NON_Q_VECTORS +
544-
NFP_NET_MAX_TX_RINGS];
545+
struct nfp_net_r_vector r_vecs[NFP_NET_MAX_R_VECS];
546+
struct msix_entry irq_entries[NFP_NET_MAX_IRQS];
545547

546548
irq_handler_t lsc_handler;
547549
char lsc_name[IFNAMSIZ + 8];

0 commit comments

Comments
 (0)