mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 16:25:17 +00:00
dpif-netdev: Use DP_PACKET_BATCH_FOR_EACH in fast_path_processing.
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Signed-off-by: Darrell Ball <dlu998@gmail.com>
This commit is contained in:
committed by
Darrell Ball
parent
79c81260c2
commit
31c82130fc
@@ -5025,14 +5025,14 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,
|
|||||||
odp_port_t in_port,
|
odp_port_t in_port,
|
||||||
long long now)
|
long long now)
|
||||||
{
|
{
|
||||||
int cnt = packets_->count;
|
const size_t cnt = dp_packet_batch_size(packets_);
|
||||||
#if !defined(__CHECKER__) && !defined(_WIN32)
|
#if !defined(__CHECKER__) && !defined(_WIN32)
|
||||||
const size_t PKT_ARRAY_SIZE = cnt;
|
const size_t PKT_ARRAY_SIZE = cnt;
|
||||||
#else
|
#else
|
||||||
/* Sparse or MSVC doesn't like variable length array. */
|
/* Sparse or MSVC doesn't like variable length array. */
|
||||||
enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST };
|
enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST };
|
||||||
#endif
|
#endif
|
||||||
struct dp_packet **packets = packets_->packets;
|
struct dp_packet *packet;
|
||||||
struct dpcls *cls;
|
struct dpcls *cls;
|
||||||
struct dpcls_rule *rules[PKT_ARRAY_SIZE];
|
struct dpcls_rule *rules[PKT_ARRAY_SIZE];
|
||||||
struct dp_netdev *dp = pmd->dp;
|
struct dp_netdev *dp = pmd->dp;
|
||||||
@@ -5060,7 +5060,7 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,
|
|||||||
ofpbuf_use_stub(&actions, actions_stub, sizeof actions_stub);
|
ofpbuf_use_stub(&actions, actions_stub, sizeof actions_stub);
|
||||||
ofpbuf_use_stub(&put_actions, slow_stub, sizeof slow_stub);
|
ofpbuf_use_stub(&put_actions, slow_stub, sizeof slow_stub);
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++) {
|
DP_PACKET_BATCH_FOR_EACH (packet, packets_) {
|
||||||
struct dp_netdev_flow *netdev_flow;
|
struct dp_netdev_flow *netdev_flow;
|
||||||
|
|
||||||
if (OVS_LIKELY(rules[i])) {
|
if (OVS_LIKELY(rules[i])) {
|
||||||
@@ -5079,7 +5079,7 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
miss_cnt++;
|
miss_cnt++;
|
||||||
handle_packet_upcall(pmd, packets[i], &keys[i], &actions,
|
handle_packet_upcall(pmd, packet, &keys[i], &actions,
|
||||||
&put_actions, &lost_cnt, now);
|
&put_actions, &lost_cnt, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5087,17 +5087,16 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,
|
|||||||
ofpbuf_uninit(&put_actions);
|
ofpbuf_uninit(&put_actions);
|
||||||
fat_rwlock_unlock(&dp->upcall_rwlock);
|
fat_rwlock_unlock(&dp->upcall_rwlock);
|
||||||
} else if (OVS_UNLIKELY(any_miss)) {
|
} else if (OVS_UNLIKELY(any_miss)) {
|
||||||
for (i = 0; i < cnt; i++) {
|
DP_PACKET_BATCH_FOR_EACH (packet, packets_) {
|
||||||
if (OVS_UNLIKELY(!rules[i])) {
|
if (OVS_UNLIKELY(!rules[i])) {
|
||||||
dp_packet_delete(packets[i]);
|
dp_packet_delete(packet);
|
||||||
lost_cnt++;
|
lost_cnt++;
|
||||||
miss_cnt++;
|
miss_cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++) {
|
DP_PACKET_BATCH_FOR_EACH (packet, packets_) {
|
||||||
struct dp_packet *packet = packets[i];
|
|
||||||
struct dp_netdev_flow *flow;
|
struct dp_netdev_flow *flow;
|
||||||
|
|
||||||
if (OVS_UNLIKELY(!rules[i])) {
|
if (OVS_UNLIKELY(!rules[i])) {
|
||||||
|
Reference in New Issue
Block a user