Message ID | 20230309130252.356289-4-simon.horman@corigine.com |
---|---|
State | Changes Requested |
Headers | show |
Series | Add support for DPDK meter HW offload | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | warning | apply and check: warning |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
References: <20230309130252.356289-4-simon.horman@corigine.com> Bleep bloop. Greetings Simon Horman, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Jin Liu <jin.liu@corigine.com>, Simon Horman <simon.horman@corigine.com> Lines checked: 69, Warnings: 1, Errors: 0 Please check this out. If you feel there has been an error, please email aconole@redhat.com Thanks, 0-day Robot
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 2c08a71c8db2..e8d0ca6606de 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -7277,6 +7277,11 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, ovs_mutex_unlock(&dp->meters_lock); + if (netdev_is_flow_api_enabled()) { + dpdk_meter_offload_set(dpif_normalize_type(dpif_type(dpif)), + meter_id, config); + } + return 0; } @@ -7313,8 +7318,18 @@ dpif_netdev_meter_get(const struct dpif *dpif, ovs_mutex_unlock(&meter->lock); stats->n_bands = i; - } + if (netdev_is_flow_api_enabled()) { + dpdk_meter_offload_get(dpif_normalize_type(dpif_type(dpif)), + meter_id_, stats); + + /* nit: Meter offload currently only supports one band */ + if (meter->n_bands) { + stats->bands[0].packet_count = stats->packet_in_count; + stats->bands[0].byte_count = stats->byte_in_count; + } + } + } return 0; } @@ -7330,6 +7345,11 @@ dpif_netdev_meter_del(struct dpif *dpif, if (!error) { uint32_t meter_id = meter_id_.uint32; + if (netdev_is_flow_api_enabled()) { + dpdk_meter_offload_del(dpif_normalize_type(dpif_type(dpif)), + meter_id_, stats); + } + ovs_mutex_lock(&dp->meters_lock); dp_meter_detach_free(&dp->meters, meter_id); ovs_mutex_unlock(&dp->meters_lock);