Skip to content

Commit

Permalink
Merge branch 'alx-msix'
Browse files Browse the repository at this point in the history
Tobias Regnery says:

====================
alx: add msi-x support

This patchset adds msi-x support to the alx driver. It is a preparatory
series for multi queue support, which I am currently working on. As there
is no advantage over msi interrupts without multi queue support, msi-x
interrupts are disabled by default. In order to test for regressions, a
new module parameter is added to enable msi-x interrupts.

Based on information of the downstream driver at github.com/qca/alx
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 10, 2016
2 parents ba56947 + 0c58ee0 commit 171a6c5
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 29 deletions.
10 changes: 9 additions & 1 deletion drivers/net/ethernet/atheros/alx/alx.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,19 @@ enum alx_device_quirks {
ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG = BIT(0),
};

#define ALX_FLAG_USING_MSIX BIT(0)
#define ALX_FLAG_USING_MSI BIT(1)

struct alx_priv {
struct net_device *dev;

struct alx_hw hw;

/* msi-x vectors */
int num_vec;
struct msix_entry *msix_entries;
char irq_lbl[IFNAMSIZ + 8];

/* all descriptor memory */
struct {
dma_addr_t dma;
Expand All @@ -105,7 +113,7 @@ struct alx_priv {

u16 msg_enable;

bool msi;
int flags;

/* protects hw.stats */
spinlock_t stats_lock;
Expand Down
14 changes: 14 additions & 0 deletions drivers/net/ethernet/atheros/alx/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,20 @@ void alx_configure_basic(struct alx_hw *hw)
alx_write_mem32(hw, ALX_WRR, val);
}

void alx_mask_msix(struct alx_hw *hw, int index, bool mask)
{
u32 reg, val;

reg = ALX_MSIX_ENTRY_BASE + index * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_VECTOR_CTRL;

val = mask ? PCI_MSIX_ENTRY_CTRL_MASKBIT : 0;

alx_write_mem32(hw, reg, val);
alx_post_write(hw);
}


bool alx_get_phy_info(struct alx_hw *hw)
{
u16 devs1, devs2;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/atheros/alx/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ int alx_reset_mac(struct alx_hw *hw);
void alx_set_macaddr(struct alx_hw *hw, const u8 *addr);
bool alx_phy_configured(struct alx_hw *hw);
void alx_configure_basic(struct alx_hw *hw);
void alx_mask_msix(struct alx_hw *hw, int index, bool mask);
void alx_disable_rss(struct alx_hw *hw);
bool alx_get_phy_info(struct alx_hw *hw);
void alx_update_hw_stats(struct alx_hw *hw);
Expand Down
Loading

0 comments on commit 171a6c5

Please sign in to comment.