Skip to content

Commit

Permalink
Merge branch 'hinic-BugFixes'
Browse files Browse the repository at this point in the history
Luo bin says:

====================
hinic: BugFixes

the bug fixed in patch #2 has been present since the first commit.
the bugs fixed in patch #1 and patch #3 have been present since the
following commits:
patch #1: 352f58b ("net-next/hinic: Set Rxq irq to specific cpu for NUMA")
patch #3: 421e952 ("hinic: add rss support")
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Feb 27, 2020
2 parents a2f2ef4 + 386d471 commit f4979b4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth,
}

hw_ioctxt.func_idx = HINIC_HWIF_FUNC_IDX(hwif);
hw_ioctxt.ppf_idx = HINIC_HWIF_PPF_IDX(hwif);

hw_ioctxt.set_cmdq_depth = HW_IOCTXT_SET_CMDQ_DEPTH_DEFAULT;
hw_ioctxt.cmdq_depth = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ struct hinic_cmd_hw_ioctxt {

u8 lro_en;
u8 rsvd3;
u8 ppf_idx;
u8 rsvd4;
u8 rsvd5;

u16 rq_depth;
u16 rx_buf_sz_idx;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
#define HINIC_HWIF_FUNC_IDX(hwif) ((hwif)->attr.func_idx)
#define HINIC_HWIF_PCI_INTF(hwif) ((hwif)->attr.pci_intf_idx)
#define HINIC_HWIF_PF_IDX(hwif) ((hwif)->attr.pf_idx)
#define HINIC_HWIF_PPF_IDX(hwif) ((hwif)->attr.ppf_idx)

#define HINIC_FUNC_TYPE(hwif) ((hwif)->attr.func_type)
#define HINIC_IS_PF(hwif) (HINIC_FUNC_TYPE(hwif) == HINIC_PF)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct hinic_rq {

struct hinic_wq *wq;

struct cpumask affinity_mask;
u32 irq;
u16 msix_entry;

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/huawei/hinic/hinic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ static void hinic_enable_rss(struct hinic_dev *nic_dev)
if (!num_cpus)
num_cpus = num_online_cpus();

nic_dev->num_qps = min_t(u16, nic_dev->max_qps, num_cpus);
nic_dev->num_qps = hinic_hwdev_num_qps(hwdev);
nic_dev->num_qps = min_t(u16, nic_dev->num_qps, num_cpus);

nic_dev->rss_limit = nic_dev->num_qps;
nic_dev->num_rss = nic_dev->num_qps;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/ethernet/huawei/hinic/hinic_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ static int rx_request_irq(struct hinic_rxq *rxq)
struct hinic_hwdev *hwdev = nic_dev->hwdev;
struct hinic_rq *rq = rxq->rq;
struct hinic_qp *qp;
struct cpumask mask;
int err;

rx_add_napi(rxq);
Expand All @@ -492,8 +491,8 @@ static int rx_request_irq(struct hinic_rxq *rxq)
}

qp = container_of(rq, struct hinic_qp, rq);
cpumask_set_cpu(qp->q_id % num_online_cpus(), &mask);
return irq_set_affinity_hint(rq->irq, &mask);
cpumask_set_cpu(qp->q_id % num_online_cpus(), &rq->affinity_mask);
return irq_set_affinity_hint(rq->irq, &rq->affinity_mask);
}

static void rx_free_irq(struct hinic_rxq *rxq)
Expand Down

0 comments on commit f4979b4

Please sign in to comment.