@@ -1117,7 +1117,6 @@ netdev_afxdp_batch_send(struct netdev *netdev, int qid,
if (concurrent_txq) {
dev = netdev_linux_cast(netdev);
- qid = qid % netdev_n_txq(netdev);
ovs_spin_lock(&dev->tx_locks[qid].lock);
ret = __netdev_afxdp_batch_send(netdev, qid, batch);
@@ -2598,7 +2598,7 @@ __netdev_dpdk_vhost_send(struct netdev *netdev, int qid,
int max_retries = VHOST_ENQ_RETRY_MIN;
int vid = netdev_dpdk_get_vid(dev);
- qid = dev->tx_q[qid % netdev->n_txq].map;
+ qid = dev->tx_q[qid].map;
if (OVS_UNLIKELY(vid < 0 || !dev->vhost_reconfigured || qid < 0
|| !(dev->flags & NETDEV_UP))) {
@@ -2872,7 +2872,6 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid,
}
if (OVS_UNLIKELY(concurrent_txq)) {
- qid = qid % dev->up.n_txq;
rte_spinlock_lock(&dev->tx_q[qid].tx_lock);
}
After 324c8374852a ("dpif-netdev: XPS (Transmit Packet Steering) implementation."), it is impossible that qid is greater than or equal to n_txq of netdev. so remove this modulo operation which is in hot path Signed-off-by: Li RongQing <lirongqing@baidu.com> --- lib/netdev-afxdp.c | 1 - lib/netdev-dpdk.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)